On 07/11/2011 01:31 PM, Mike Frysinger wrote: > with this little bit of code: > $ cat common.m4 > AC_DEFUN([SIM_AC_COMMON],[ > AC_PROG_CC
Change this to AC_REQUIRE([AC_PROG_CC]), and that should also avoid the warning. > AC_CHECK_HEADERS(stdlib.h string.h strings.h unistd.h time.h) > ]) > > $ cat configure.ac > sinclude(common.m4) > AC_INIT(Makefile.in) I suggest using proper m4 quoting: m4_sinclude([common.m4]) AC_INIT([Makefile.in]) > SIM_AC_COMMON > > running autoconf (2.64 and 2.68) results in the warnings: 2.64 doesn't produce the warnings; but silently produced a broken configure instead. 2.68 outputs a fixed configure, at the expense of outputting the code for AC_PROG_CC twice; the warning exists to tell you that you can shrink the size of your configure by fixing things to avoid the warning. > > this seems odd to me ... why would autoconf care if a macro is expanded > before > something requires it ? Because without the warning, you have a silently broken configure. The warning is trying to tell you that the AC_CHECK_HEADERS in SIM_AC_COMMON depends on already knowing what $CC was set to, but that it does so by doing an AC_REQUIRE([AC_PROG_CC]). In Autoconf 2.64, you end up with this layout: # prereqs to SIM_AC_COMMON # prereqs to AC_CHECK_HEADERS, including code that uses $CC # body of SIM_AC_COMMON # body of AC_PROG_CC - now $CC is finally set # body of AC_CHECK_HEADERS In Autoconf 2.68, you end up with this layout: # prereqs to SIM_AC_COMMON # body of AC_PROG_CC - $CC is set before use # prereqs to AC_CHECK_HEADERS, including code that uses $CC # body of SIM_AC_COMMON # body of AC_PROG_CC - redundant, hence the warning # body of AC_CHECK_HEADERS > guessing it's a bug because when i pull just > AC_PROG_CC out of "SIM_AC_COMMON" and inline it before the call, autoconf > doesnt warn: > $ cat configure.ac > sinclude(common.m4) > AC_INIT(Makefile.in) > AC_PROG_CC > SIM_AC_COMMON The bug is in the configure.ac file that is using SIM_AC_COMMON, for using a pattern that triggered a silent bug in autoconf 2.64, but which has since been fixed in 2.68. http://www.gnu.org/software/autoconf/manual/autoconf.html#Expanded-Before-Required -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature