On 10/16/2012 12:44 PM, Eric Blake wrote: > Known issue, and waiting for copyright papers to clear: > https://lists.gnu.org/archive/html/bug-autoconf/2012-10/msg00010.html
I rewrote the core part of the fix myself, using just the idea to avoid copyright issues, and pushed it. Here's what I pushed: >From d5c68de6790c7ea50fc13f32b9f4e86737c99286 Mon Sep 17 00:00:00 2001 From: Paul Eggert <egg...@cs.ucla.edu> Date: Tue, 16 Oct 2012 13:20:58 -0700 Subject: [PATCH 1/2] 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. --- NEWS | 2 ++ doc/autoconf.texi | 7 ++----- lib/autoconf/c.m4 | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 8b35cb8..d3ff4b9 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 e0666d4..a0c19d1 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 ad40527..cf382da 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.11.7 >From 6642f16e9aa69b380f7c137dee650ff8b365e4ad Mon Sep 17 00:00:00 2001 From: Paul Eggert <egg...@cs.ucla.edu> Date: Tue, 16 Oct 2012 13:32:31 -0700 Subject: [PATCH 2/2] AC_PROG_CC_C89, AC_PROG_CC_C99, AC_PROG_CC_STDC: Use AU_ALIAS. Based on a suggestion by Adrian Bunk in http://lists.gnu.org/archive/html/autoconf-patches/2012-09/msg00040.html * lib/autoconf/c.m4 (AC_PROG_CC_C89, AC_PROG_CC_C99, AC_PROG_CC_STDC): Use AU_ALIAS, now that AC_PROG_CC is defined via AC_DEFUN_ONCE. --- lib/autoconf/c.m4 | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index cf382da..4a84489 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -1448,24 +1448,15 @@ dnl preferably extc11. # AC_PROG_CC_C89 # -------------- -AC_DEFUN([AC_PROG_CC_C89], -[ AC_REQUIRE([AC_PROG_CC])dnl - m4_warn([obsolete], [$0 is obsolete; use AC_PROG_CC]) -]) +AU_ALIAS([AC_PROG_CC_C89], [AC_PROG_CC]) # AC_PROG_CC_C99 # -------------- -AC_DEFUN([AC_PROG_CC_C99], -[ AC_REQUIRE([AC_PROG_CC])dnl - m4_warn([obsolete], [$0 is obsolete; use AC_PROG_CC]) -]) +AU_ALIAS([AC_PROG_CC_C99], [AC_PROG_CC]) # AC_PROG_CC_STDC # --------------- -AC_DEFUN([AC_PROG_CC_STDC], -[ AC_REQUIRE([AC_PROG_CC])dnl - m4_warn([obsolete], [$0 is obsolete; use AC_PROG_CC]) -]) +AU_ALIAS([AC_PROG_CC_STDC], [AC_PROG_CC]) # AC_C_BACKSLASH_A -- 1.7.11.7