]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
AC_PROG_CC: define via AC_DEFUN_ONCE
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 16 Oct 2012 20:20:58 +0000 (13:20 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 16 Oct 2012 20:41:34 +0000 (13:41 -0700)
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.

NEWS
doc/autoconf.texi
lib/autoconf/c.m4

diff --git a/NEWS b/NEWS
index 8b35cb8ec2d11b97b35f8ac98c06a961c6f85945..d3ff4b9c6433b610f3a0521eb64fa9bc507bf2ba 100644 (file)
--- 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.
 
index e0666d4b71e1cd5f86b4a787c3916e75178dadc1..a0c19d1d98e34704b982d9824f39447897b752b5 100644 (file)
@@ -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}
index ad40527021fe62f2580407417dcfc5876e1fd20d..cf382dad4415ea9207bd18487ec17a53f565bfbb 100644 (file)
@@ -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