]> git.ipfire.org Git - thirdparty/autoconf.git/commit
Only probe C++ language features, not library, for speed (#110285)
authorZack Weinberg <zackw@panix.com>
Tue, 28 Jul 2020 20:29:55 +0000 (16:29 -0400)
committerZack Weinberg <zackw@panix.com>
Tue, 4 Aug 2020 17:08:31 +0000 (13:08 -0400)
commitc16be7152d883483e1b8af0bd76c8d5800cbc3d0
tree98ef3266f64f72330a8f8b6d7c2825a24489bb54
parent2cb0ab81b975f0f69ca90c57e5a3b7ea5de26e5f
Only probe C++ language features, not library, for speed (#110285)

The test programs used by _AC_PROG_CXX_CXX98 and _AC_PROG_CXX_CXX11
can take several seconds to compile, even on current-generation CPUs.
Each of them may be test-compiled up to six times as the configure
script searches for appropriate command-line switches.  This is
reported to cancel out all of the other performance gains made since
2.69.

Replace these programs with simpler ones that do not exercise the C++
standard *library* and can be compiled in less than a second each.
On my computer, which is quite new, the minimal configure script

    AC_INIT
    AC_PROG_CXX

executes in 4.5 seconds (wall-clock) before this change and 0.5
seconds after.

* lib/autoconf/c.m4 (_AC_CXX_CXX98_TEST_HEADER, _AC_CXX_CXX98_TEST_BODY):
  Rewrite to test only C++ 1998 language features, not library features.
  (_AC_CXX_CXX11_TEST_HEADER, _AC_CXX_CXX11_TEST_BODY):
  Similarly for C++ 2011.
* doc/autoconf.texi (AC_PROG_CXX): Document this change.
doc/autoconf.texi
lib/autoconf/c.m4