RFR: JDK-8146995 Introduce named arguments in configure
erik.joelsson at oracle.com
Wed Jan 13 19:18:35 UTC 2016
The implementation of the m4 black magic macro certainly looks scary. I
was able to understand the first conditional block. I did apply and try
the patch and verified that -stack-protector was added to cflags when
setting slowdebug. The readability of the macro calls are definitely
much more understandable. I like it. Looks good.
On 2016-01-13 15:43, Magnus Ihse Bursie wrote:
> Similar to how we use named argument in makefiles, we should support
> named arguments in the configure scripts. This is possible using some
> m4 black magic.
> My long-term goal with this is to provide readable functions for
> handling common patterns, like parsing --with arguments and doing
> proper action depending on the value of the flag.
> Since the m4 logic is hairy, to say the least, I chose to pick a more
> simple function to use as test bench for getting the actual m4
> underpinning to work.
> The essence of this change can be seen here:
> - FLAGS_COMPILER_CHECK_ARGUMENTS([$STACK_PROTECTOR_CFLAG], ,
> + FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG],
> IF_FALSE: [STACK_PROTECTOR_CFLAG=""])
> Just like in our Setup* macros in make, now it is possible to use
> named arguments in autoconf macros. Named arguments can come in any
> order. The framework will verify that only known arguments is allowed
> in. It is also possible to mark an argument as compulsory (by
> prefixing it with *). The framework will verify that all required
> arguments are present.
> Don't ask me to explain the finer points of BASIC_DEFUN_NAMED. :)
> m4/autoconf is non-trivial to get correct, with few debugging
> possibilities and sparse documentation. There's a lot of trial and
> error behind this final version. :-&
> Bug: https://bugs.openjdk.java.net/browse/JDK-8146995
More information about the build-dev