Re: Bug in AX_APPEND_LINK_FLAGS
Peter Johansson <[email protected]>
| Newsgroups | gmane.comp.sysutils.autoconf.archive-maintainers |
|---|---|
| Message-ID | <[email protected]> |
Hi Mike, On 01/03/2014 04:48 AM, Mike Frysinger wrote: > On Wednesday 01 January 2014 18:55:44 Peter Johansson wrote: >> I haven't tested though. > this seems to work. what do you think of this patch ? Ooh, I didn't expect a new macro, but why not. Looks good to me. > > i tried to implement multiple macro support, but i couldn't get m4_foreach to > play nicely with quoting (m4 quoting rules make my head hurt). > > it also kind of sucks in that we're adding a dependency on another ax file, but > maybe that's not a big deal ? it'll get found automatically for people who > are running against the whole archive ... That is true, but if you run against the whole archive the AC_REQUIRE wasn't needed in the first place. You've moved the error from having an unexpanded AX_FOO to have an unexpanded AX_REQUIRE_DEFINED. But on the good side is that once the ax_require_defined has been copied into 'm4/' one should be fine, in contrast to before when one got a new file to miss out on for every macro one added to one's project. > -mike > > diff --git a/m4/ax_append_compile_flags.m4 b/m4/ax_append_compile_flags.m4 > index 1f8e708..dc7b866 100644 > --- a/m4/ax_append_compile_flags.m4 > +++ b/m4/ax_append_compile_flags.m4 > @@ -54,11 +54,11 @@ > # modified version of the Autoconf Macro, you may extend this special > # exception to the GPL to apply to your modified version as well. > > -#serial 3 > +#serial 4 > > SNIP 8< > +AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) > case ".$VAR" in > .ok|.ok,*) m4_ifvaln($3,$3) ;; > .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;; > diff --git a/m4/ax_require_defined.m4 b/m4/ax_require_defined.m4 > new file mode 100644 > index 0000000..e6a167d > --- /dev/null > +++ b/m4/ax_require_defined.m4 > @@ -0,0 +1,35 @@ > +# > =========================================================================== > +# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html > +# > =========================================================================== > +# > +# SYNOPSIS > +# > +# AX_REQUIRE_DEFINED(MACRO) > +# > +# DESCRIPTION > +# > +# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have been > +# defined and thus are available for use. This avoids random issues where a > +# macro isn't expanded. Instead the configure script emits a non-fatal: At first read I was confused whether the configure script emits a non-fatal message with AX_REQUIRED or without. Perhaps this is clearer: +# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have been +# defined and thus are available for use. This avoids random issues where a +# macro isn't expanded and the configure script emits a non-fatal: Cheers, Peter