From: Paul Eggert Date: Tue, 16 Oct 2012 20:20:58 +0000 (-0700) Subject: AC_PROG_CC: define via AC_DEFUN_ONCE X-Git-Tag: v2.69b~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18c140b5;p=thirdparty%2Fautoconf.git AC_PROG_CC: define via AC_DEFUN_ONCE Suggested by Adrian Bunk in http://lists.gnu.org/archive/html/autoconf-patches/2012-09/msg00034.html * NEWS: * doc/autoconf.texi (C Compiler): Document it * lib/autoconf/c.m4 (AC_PROG_CC): Implement it. --- diff --git a/NEWS b/NEWS index 8b35cb8e..d3ff4b9c 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,8 @@ GNU Autoconf NEWS - User visible changes. - AC_PROG_CC now prefers C11 if available, falling back on C99 and then on C89 as before. +- AC_PROG_CC is now defined via AC_DEFUN_ONCE, to avoid bloat in 'configure'. + - AC_PROG_CC_STDC, AC_PROG_CC_C89, AC_PROG_CC_C99 have been marked as obsolete. Applications should use AC_PROG_CC. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index e0666d4b..a0c19d1d 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -7280,11 +7280,8 @@ and before @code{AC_PROG_CC} to select an empty default instead. Many Autoconf macros use a compiler, and thus call @samp{AC_REQUIRE([AC_PROG_CC])} to ensure that the compiler has been determined before the body of the outermost @code{AC_DEFUN} macro. -Although @code{AC_PROG_CC} is safe to directly expand multiple times, it -performs certain checks (such as the proper value of @env{EXEEXT}) only -on the first invocation. Therefore, care must be used when invoking -this macro from within another macro rather than at the top level -(@pxref{Expanded Before Required}). +@code{AC_PROG_CC} is therefore defined via @code{AC_DEFUN_ONCE} to avoid +needless reexpansion (@pxref{One-Shot Macros}). @end defmac @anchor{AC_PROG_CC_C_O} diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index ad405270..cf382dad 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -432,7 +432,7 @@ AU_DEFUN([ac_cv_prog_gcc], AN_MAKEVAR([CC], [AC_PROG_CC]) AN_PROGRAM([cc], [AC_PROG_CC]) AN_PROGRAM([gcc], [AC_PROG_CC]) -AC_DEFUN([AC_PROG_CC], +AC_DEFUN_ONCE([AC_PROG_CC], [AC_LANG_PUSH(C)dnl AC_ARG_VAR([CC], [C compiler command])dnl AC_ARG_VAR([CFLAGS], [C compiler flags])dnl