bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

warnings expanding macros before they're required


From: Mike Frysinger
Subject: warnings expanding macros before they're required
Date: Mon, 11 Jul 2011 15:31:04 -0400
User-agent: KMail/1.13.7 (Linux/2.6.39; KDE/4.6.3; x86_64; ; )

with this little bit of code:
$ cat common.m4
AC_DEFUN([SIM_AC_COMMON],[
AC_PROG_CC
AC_CHECK_HEADERS(stdlib.h string.h strings.h unistd.h time.h)
])

$ cat configure.ac
sinclude(common.m4)
AC_INIT(Makefile.in)
SIM_AC_COMMON

running autoconf (2.64 and 2.68) results in the warnings:
$ autoconf
configure.ac:3: warning: AC_REQUIRE: `AC_PROG_CC' was expanded before it was 
required
../../lib/autoconf/c.m4:433: AC_LANG_COMPILER(C) is expanded from...
../../lib/autoconf/lang.m4:315: AC_LANG_COMPILER_REQUIRE is expanded from...
../../lib/autoconf/general.m4:2593: AC_COMPILE_IFELSE is expanded from...
../../lib/m4sugar/m4sh.m4:620: AS_IF is expanded from...
../../lib/m4sugar/m4sh.m4:368: AS_REQUIRE is expanded from...
../../lib/autoconf/general.m4:204: AC_REQUIRE_SHELL_FN is expanded from...
../../lib/autoconf/headers.m4:151: _AC_CHECK_HEADER_MONGREL is expanded 
from...
../../lib/autoconf/headers.m4:89: AC_CHECK_HEADER is expanded from...
../../lib/m4sugar/m4sh.m4:588: AS_FOR is expanded from...
../../lib/autoconf/headers.m4:265: AC_CHECK_HEADERS is expanded from...
common.m4:1: SIM_AC_COMMON is expanded from...
configure.ac:3: the top level

this seems odd to me ... why would autoconf care if a macro is expanded before 
something requires it ?  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
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]