autoconf-patches
[Top][All Lists]
Advanced

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

[PATCH] make AC_PROG_CC a one-shot macro


From: Adrian Bunk
Subject: [PATCH] make AC_PROG_CC a one-shot macro
Date: Tue, 25 Sep 2012 15:25:12 +0300

The test results are anyway cached, so executing it multiple times
doesn't make sense.

* lib/autoconf/c.m4: change AC_PROG_CC from AC_DEFUN to AC_DEFUN_ONCE
* doc/autoconf.texi: update the documentation accordingly
---
 doc/autoconf.texi |    7 ++-----
 lib/autoconf/c.m4 |    2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index b2b0b13..6ad40bd 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -7284,11 +7284,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}).
address@hidden used to be expanded multiple times in a safe way,
+but now it is declared with @code{AC_DEFUN_ONCE} (@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 4b49ae5..5f02647 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
-- 
1.7.10.4




reply via email to

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