[Re-adding bug-autoconf] Hi Bruno,
On 30 Sep 2011, at 16:56, Bruno Haible wrote: > Gary V. Vaughan wrote: >> But why emit a warning when >> we can just fix-up the definition on the fly? ... >> This changeset fixes AC_PROG_CC_C99 >> (and effectively AC_PROG_CC_STDC) whether it is called before or >> after gl_EARLY, directly or by AC_PROG_CC_STDC, or even not at all! >> ... >> +[AC_PROVIDE_IFELSE([AC_PROG_CC_C99], >> + [AC_DEFUN([AC_PROG_CC_C99])], >> + [AC_DEFUN([AC_PROG_CC_C99], >> + m4_defn([AC_PROG_CC_C99])[AC_DEFUN([AC_PROG_CC_C99])])])]) > > We can't use this. AC_PROVIDE_IFELSE is undocumented. Oh yuck. Good point. Libtool is a bad citizen... oopsie. >> By putting the fix in gl_EARLY rather than autoconf itself, there's >> still the possibility of getting multiple expansions with something >> like: >> >> AC_PROG_CC >> AC_PROG_CC_C99 >> AC_PROG_CC_STDC >> gl_EARLY >> >> But that seems pathological to me in any case, so I haven't tried to >> address that. > > That's why I think it should be addressed in Autoconf. And I think it is as easy as adding AC_DEFUN([AC_PROG_CC_C99]) to the end of the existing AC_PROG_CC_C99 macro to make sure subsequent invocations expand to nothing. And maybe the same thing in AC_PROG_CC_C89 if it has the same bug. Autoconf folks, please ask me if you'd like a patch to that effect. >> * m4/gnulib-common (gl_PROG_CC_C99_ONCE): New macro to automatically >> neuter AC_PROG_CC_C99 after first invocation. > > We didn't say that we want to enable C99 for all programs. See > <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html> Ah yes, I got a bit too excited there. > I'm applying this for now. Maybe you have a more acceptable workaround against > the "$CC gets augmented twice" problem? Your patch is perfectly acceptable to me already. Thank you! > 2011-09-30 Bruno Haible <br...@clisp.org> > > Centralize C99 requirement. > * m4/gnulib-common.m4 (gl_PROG_CC_C99): New macro. > * modules/stdarg (configure.ac-early): Invoke it instead of > AC_PROG_CC_STDC. > Reported by Gary V. Vaughan and Paul Eggert. Cheers, -- Gary V. Vaughan (gary AT gnu DOT org)