]> git.ipfire.org Git - thirdparty/autoconf.git/commit
Revert "AC_PROG_CC: define via AC_DEFUN_ONCE". (#110350)
authorZack Weinberg <zackw@panix.com>
Fri, 4 Dec 2020 21:32:35 +0000 (16:32 -0500)
committerZack Weinberg <zackw@panix.com>
Fri, 4 Dec 2020 21:41:43 +0000 (16:41 -0500)
commitc38538737c6d221674b9bc746b6b1430f64d4aaa
treeca11e11215d9f37ded68a746ec18ef9a12dbcf4b
parent2a7a441b437d9a87271078877c2fc425137f9a3b
Revert "AC_PROG_CC: define via AC_DEFUN_ONCE". (#110350)

Revert commit 18c140b50b0619454d4da50d58a318cc257d580a, restoring
AC_PROG_CC to being defined as an ordinary AC_DEFUN.  This broke
third-party macros (e.g. the Autoconf Macro Archive’s
AX_PROG_CC_FOR_BUILD) that intentionally invoked AC_PROG_CC a second
time with its guts redefined via a whole bunch of ‘pushdef’s.  I don’t
think we want to support this long-term, but needing access to a
build-native compiler in cross-compilation is common enough that we
should have *some* supported way to do it, and it may as well be
AX_PROG_CC_FOR_BUILD until we come up with something better.

If we go back to AC_DEFUN_ONCE for AC_PROG_CC in the future, we should
do it consistently for all the “find me a compiler” macros -- it
was *only* done for AC_PROG_CC in 18c140b5.

The rationale for AC_DEFUN_ONCE seems to have been to reduce the size
of the generated configure script.  The bulk of the size accountable to
AC_PROG_CC is the test programs for figuring out which version of the
C standard is available, so I tweaked _AC_C_STD_TRY (and _AC_CXX_STD_TRY)
to emit that text only once per program, into shell variables which
can then be referenced repeatedly.

Fixes bug #110350.

* NEWS, doc/autoconf.texi: Revert documentation changes associated
  with AC_PROG_CC being a one-shot macro.
* lib/autoconf/c.m4 (AC_PROG_CC): Revert to defining with AC_DEFUN.
  (_AC_C_STD_TRY, _AC_CXX_STD_TRY): Emit the test program only once,
  even if invoked multiple times with the same arguments.

* tests/foreign.at (AX_PROG_CC_FOR_BUILD, AX_PROG_CXX_FOR_BUILD):
  New tests.
NEWS
doc/autoconf.texi
lib/autoconf/c.m4
tests/foreign.at