[Top][All Lists]

[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 
 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
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],
 AC_ARG_VAR([CC],     [C compiler command])dnl
 AC_ARG_VAR([CFLAGS], [C compiler flags])dnl

reply via email to

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