2020-12-08  Zack Weinberg  <zackw@panix.com>

	Release 2.70.

	Remove obsolete instructions from HACKING.
	configure CC=g++ is no longer supported, so don’t tell maintainers to
	test that.

2020-12-08  Zack Weinberg  <zackw@panix.com>

	testsuite: log version of M4 and Perl
	Jannick reported problems on OSX for which the most plausible
	explanation is that the system-provided M4 is emitting error messages
	with different line numbers than we expect, perhaps because Apple
	froze their copy of GNU M4 to the last GPLv2 release.  To test this
	hypothesis, add $PERL and $M4 to AT_TESTED in our testsuite.

	* tests/atlocal.in: Also set $M4 from configure.
	* tests/local.at: Add AT_TESTED([$PERL $M4]).

2020-12-08  Zack Weinberg  <zackw@panix.com>

	lib/autotest/general.m4: typo fix
	The absolute-path case in AT_TESTED had a typo in it, causing bizarre
	error messages and preventing programs identified by absolute path
	from being logged properly.

	* lib/autotest/general.m4 (AT_TESTED): Fix typoed shell syntax in
	  handling of programs identified by absolute path.

2020-12-08  Zack Weinberg  <zackw@panix.com>

	Three minor testsuite fixes.
	1. To insulate the test suite from a system-provided config.site file,
	set the CONFIG_SITE environment variable to a file that is known not
	to exist.  Problem reported by Jannick.

	2. AC_PROG_CC, AC_PROG_CXX, AC_PROG_CPP, and AC_PROG_CXXCPP may set
	cache variables named ‘ac_cv_prog_$tool’ or ‘ac_cv_prog_ac_ct_$tool’,
	depending on system conditions; _AT_CONFIG_CMP_PRUNE needs to handle
	both possibilities.  Found by testing on FreeBSD 12; I have no idea
	why it didn’t show up on _any_ of my other test platforms.

	3. The ‘AC_PROG_LEX with yywrap’ test needs to be skipped on systems
	that don’t provide libl.a nor libfl.a.  This change needed yet another
	hook for AT_CHECK_MACRO.  Found by testing on Alpine Linux.

	(Ideally, instead of skipping this test, we would test that this
	configure script *errors out* on these systems, but that would involve
	much more invasive changes to AT_CHECK_MACRO, which I don’t want to
	hold the release for.)

	* tests/local.at (AT_PREPARE_TESTS): Set CONFIG_SITE to refer to
	  a file that is known not to exist, and export it.
	  (_AT_CONFIG_CMP_PRUNE): Prune all variables matching the
	  ERE ‘ac_cv_prog_(ac_ct_)?(CC|CXX|CPP|CXXCPP)’.
	  (AT_CHECK_MACRO): Add PRETEST-CMDS argument which takes commands to
	  execute immediately after AT_SETUP.
	* tests/semantics.at (AC_PROG_LEX with yywrap): Using PRETEST-CMDS,
	  skip this test on OSes where neither -ll nor -lfl provides a
	  definition of yywrap.

2020-12-08  Zack Weinberg  <zackw@panix.com>

	autoreconf --install --force: replace install-sh with no timestamp
	Old versions of install-sh did not have a timestamp line.  Therefore,
	treat the absence of a timestamp line as indicating a very old file
	(that --install --force should replace), not as an error.

	Problem reported by Pascal Terjan.

	* bin/autoreconf.in (extract_time_stamp): Return 1970-01-01 when
	  no timestamp line is found.
	* tests/torture.at (Missing auxiliary files (--force)):
	  Test replacement of old install-sh with no timestamp line.

2020-12-07  Zack Weinberg  <zackw@panix.com>

	make fetch

2020-12-07  Zack Weinberg  <zackw@panix.com>

	Update documentation of AC_USE_SYSTEM_EXTENSIONS.
	The list of macros documented as being defined by
	AC_USE_SYSTEM_EXTENSIONS had gotten out of sync with the actual list.
	Update it thoroughly.

	Also, I introduced an error into the commentary when I merged Julien
	ÉLIE’s patch to define _NETBSD_SOURCE and _OPENBSD_SOURCE in
	AC_USE_SYSTEM_EXTENSIONS.  _OPENBSD_SOURCE does something on NetBSD
	and *doesn’t* do anything on OpenBSD.  This is corrected.

	Clean up the code in AC_USE_SYSTEM_EXTENSIONS a bit while I’m in
	there; we now had a redundant definition of _NETBSD_SOURCE (one
	unconditional and one conditional on minix/config.h existing).
	Reorganize the macro to make it easier to catch problems like this in
	the future.

	* lib/autoconf/specific.m4 (AC_USE_SYSTEM_EXTENSIONS): Reorganize;
	  remove redundant AC_DEFINE of _NETBSD_SOURCE; add some missing
	  AC_BEFOREs; use _AC_CHECK_HEADER_ONCE for header checks;
	  revise all commentary.
	* doc/autoconf.texi (AC_USE_SYSTEM_EXTENSIONS): Update.

2020-12-07  Zack Weinberg  <zackw@panix.com>

	Revise documentation of AT_CHECK.
	Patch originally by Jannick but then about 10x more words added by me.

2020-12-07  Zack Weinberg  <zackw@panix.com>

	Revise documentation of AC_PROG_CC and comments on conformance checks.
	Makes the documentation of AC_PROG_CC consistent with the
	documentation of AC_PROG_CXX.  Also removes a bunch of redundant text
	from c.m4 and adds lists of the headers that *can* be used in the
	conformance tests, so future hackers don’t have to look them up.

	* doc/autoconf.texi (AC_PROG_CC): Make description consistent with
	  description of AC_PROG_CXX.
	* lib/autoconf/c.m4: Clean up some outdated or repetitive commentary
	  and add lists of the freestanding headers above the code that needs
	  to avoid using non-freestanding headers.

2020-12-07  Zack Weinberg  <zackw@panix.com>

	Add checks of __STDC__ and __STDC_VERSION__ to C conformance tests.
	This makes the C conformance tests more consistent with the C++
	conformance tests, and should also speed up cycling through the
	possible options to turn on C99/C11.

	Tested with gcc, clang, SunPRO C, and AIX xlc.

	* lib/autoconf/c.m4 (_AC_C_C89_TEST_GLOBALS): Add preprocessor test
	  for __STDC__ being defined (to any value).
	  (_AC_C_C99_TEST_GLOBALS, _AC_C_C11_TEST_GLOBALS): Add preprocessor
	  test of the value of __STDC_VERSION__.

2020-12-07  Zack Weinberg  <zackw@panix.com>

	autom4te: don’t crash when warnings have no stacktrace
	In testing on Darwin (OSX), sometimes warnings reported from M4 code
	reach autom4te with no stack trace at all, causing the perl script to
	crash with a “use of uninitialized value” error.  The root cause of
	the problem is not clear to me, but the script certainly shouldn’t
	crash.

	Problem found by Jannick <thirdedition@gmx.net>.

	* bin/autom4te.in: When processing warnings, make sure $stacktrace is
	  defined.

2020-12-07  Jannick  <thirdedition@gmx.net>

	Small bug fixes for the test suite.
	* tests/atlocal.in: Also set AWK to value detected by configure.
	  Alphabetize list of shell variables set by config.status.
	* tests/local.mk: Add a rule to recreate tests/atconfig when
	  config.status changes.

2020-12-06  Zack Weinberg  <zackw@panix.com>

	Don’t use hosted headers when testing for C(++) standard level (#110393)
	The tests for the level of the C and C++ standard supported by their
	respective compilers should also avoid using any headers that are not
	guaranteed to be available in the respective freestanding environment.

	Unlike the previous change, the only user-visible consequence of this
	one should be that C11/C99/C89/C++11/C++98 *compiler* support is now
	correctly detected when the compilation target is a freestanding
	environment.

	This patch also refactors how we “emit [the text of the C/C++
	standard-conformance test programs] only once per [configure script],
	into shell variables which can then be referenced repeatedly,” from
	c3853873, because editing them just a little made the M4 quotation
	break.  Clearly too fragile.

	I believe this completes the fix for bug #110393.

	* lib/autoconf/c.m4 (_AC_PROG_CC_C89, _AC_PROG_CC_C99, _AC_PROG_CC_C11)
	  _AC_C_C99_TEST_HEADER, _AC_C_C99_TEST_BODY): Move all test program
	  fragments into new macros that can be AC_REQUIREd individually:
	  _AC_C_C89_TEST_GLOBALS, _AC_C_C89_TEST_MAIN, _AC_C_C89_TEST_PROGRAM,
	  _AC_C_C99_TEST_GLOBALS, _AC_C_C99_TEST_MAIN, _AC_C_C99_TEST_PROGRAM,
	  _AC_C_C11_TEST_GLOBALS, _AC_C_C11_TEST_MAIN, _AC_C_C11_TEST_PROGRAM.
	  Each emits test code at most once, into a shell variable in the
	  INIT_PREPARE diversion.
	  Revise each test program to use only library features of the
	  respective standard’s freestanding environment.
	  (_AC_C_STD_TRY): Take the *name* of the shell variable holding the
	  complete test program as an argument, not the code itself.  All
	  callers adjusted to match.

	  (_AC_PROG_CXX_CXX98, _AC_PROG_CXX_CXX11, _AC_CXX_STD_TRY)
	  (_AC_CXX_CXX98_TEST_HEADER, _AC_CXX_CXX98_TEST_BODY)
	  (_AC_CXX_CXX11_TEST_HEADER, _AC_CXX_CXX11_TEST_BODY): Similarly.
	  New macros are:
	  _AC_CXX_CXX98_TEST_GLOBALS, _AC_CXX_CXX98_TEST_MAIN,
	  _AC_CXX_CXX98_TEST_PROGRAM,
	  _AC_CXX_CXX11_TEST_GLOBALS, _AC_CXX_CXX11_TEST_MAIN,
	  _AC_CXX_CXX11_TEST_PROGRAM.

2020-12-06  Zack Weinberg  <zackw@panix.com>

	AC_INCLUDES_DEFAULT: Check for presence of C90 hosted headers (#110393)
	Since 1993, Autoconf has been assuming that it is safe to include any
	of the headers defined by ISO C90 without checking for them; this is
	inaccurate, since only a subset are necessarily available in a
	C90 *freestanding* environment.

	It is OK to assume the presence of a header in a macro that checks
	specifically for something declared by that header (if the header is
	not present, we will think the specific declaration is unavailable,
	which is probably accurate for modern embedded environments).  It is
	also OK to continue recommending that user code use these headers
	unconditionally—anyone working with a freestanding environment knows
	it.  But it is not OK for very generic code within Autoconf itself,
	such as AC_INCLUDES_DEFAULT, to make this assumption.

	Note that the set of headers that are not always available includes
	stdio.h, which we have been assuming can be included unconditionally
	for even longer.

	In AC_INCLUDES_DEFAULT, revert to checking for string.h and stdlib.h
	before including them.  Also revert to defining STDC_HEADERS only when
	string.h and stdlib.h are available (but do not check for float.h and
	stdarg.h, as these are part of the freestanding set).  Add a new check
	for stdio.h.  Sort the inclusion list by standard (C90 freestanding;
	C90 hosted; C99; POSIX) and alphabetically within each group.  Revise
	all the documentation and update the testsuite.

	This partially reverts commit 86c213d0e355296f026a36e3203c0813041aae89
	and is a partial fix for bug #110393.

	* lib/autoconf/headers.m4 (AC_CHECK_INCLUDES_DEFAULT): Check for
	  stdio.h, stdlib.h, and string.h before including them.  Define
	  STDC_HEADERS only when string.h and stdlib.h are both available.
	  Organize includes list by standard, then alphabetically.

	* doc/autoconf.texi, NEWS: Update to match.

	* tests/local.at (AT_CHECK_DEFINES): Make regexes more specific.
	  Also expect a definition of HAVE_STDIO_H.
	* tests/c.at, tests/semantics.at, tests/tools.at: Use <float.h>,
	  not <stdio.h>, as a header that we expect always to exist.
	  Add HAVE_STDIO_H to various lists of macros that are expected to
	  appear in config.h.

2020-12-06  Julien ÉLIE  <julien@trigofacile.com>

	Define _NETBSD_SOURCE and _OPENBSD_SOURCE in AC_USE_SYSTEM_EXTENSIONS (#110392)
	These expose additional extensions specific to those operating
	systems, similar to _DARWIN_C_SOURCE, _GNU_SOURCE, etc.

	(DragonflyBSD and FreeBSD currently do not have any equivalent
	macros.)

	Fixes bug #110392.  See also
	https://git.savannah.gnu.org/cgit/gnulib.git/tree/m4/extensions.m4
	https://git.eyrie.org/?p=devel/rra-c-util.git;a=commitdiff;h=f8a922cf31804dcc25ac176dcc22fdcdffcb5fdf

	* lib/autoconf/specific.m4 (AC_USE_SYSTEM_EXTENSIONS): Also define
	  _NETBSD_SOURCE and _OPENBSD_SOURCE.  Add comment explaining that
	  there are (currently) no equivalent macros on DragonflyBSD and
	  FreeBSD.  Put macro list in alphabetical order.

2020-12-04  Zack Weinberg  <zackw@panix.com>

	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.

2020-12-02  Zack Weinberg  <zackw@panix.com>

	Autotest: add official way to execute code before all/each test.
	Currently, there isn’t any documented way for an Autotest testsuite to
	add custom code to be run either right before the main driver loop, or
	at the point of each AT_SETUP.  For instance, there’s no good place to
	put environment variable sanitization that should apply to the entire
	testsuite (but isn’t universally relevant), or shell function
	definitions to be used by custom test macros.

	Autoconf’s test suite is poking shell functions directly into the
	PREPARE_TESTS diversion, and doing environment variable sanitization
	in each individual test.  Both of these are obviously undesirable.

	This patch adds three new AT_* macros that can be used to do these
	things in an officially-supported way: AT_PREPARE_TESTS adds code to
	be run right before the main driver loop, AT_PREPARE_EACH_TEST adds
	code to be run at the beginning of each test, and AT_TEST_HELPER_FN
	defines a shell function that will be available to each test.  In
	Autoconf’s test suite, I use AT_PREPARE_TESTS to factor out
	environment variable sanitization that *ought* to apply across the
	board, and AT_TEST_HELPER_FN for the helper function used by
	AT_CHECK_ENV.

	(This fixes the testsuite bug reported by Jannick at
	https://lists.gnu.org/archive/html/autoconf/2020-10/msg00052.html :
	CONFIG_SITE in the parent environment will no longer be visible to tests.)

	It would be nice to give an example of when AT_PREPARE_EACH_TEST is
	useful, in the documentation, but I didn’t find one in the autoconf
	test suite.

	* lib/autotest/general.m4 (AT_PREPARE_TESTS, AT_PREPARE_EACH_TEST)
	  (AT_TEST_HELPER_FN): New macros.
	  (AT_INIT, AT_TESTED): Emit the code to report tested programs only
	  if it’s needed, and make sure it’s after any code added by
	  AT_PREPARE_TESTS.

	* tests/local.at: Add AT_PREPARE_TESTS block that ensures
	  $MAKE is set sensibly and $MAKEFLAGS and $CONFIG_SITE are unset.
	  Use AT_TEST_HELPER_FN for the helper function needed by AT_CHECK_ENV.
	  (AT_CHECK_MAKE): No need to sanitize $MAKE or $MAKEFLAGS here.
	* tests/base.at, tests/compile.at, tests/m4sh.at, tests/torture.at:
	  No need to unset or neutralize $CONFIG_SITE in individual tests.
	* tests/autotest.at: Add tests for new macros.

	* doc/autoconf.texi, NEWS: Document new macros.

2020-12-01  Bruno Haible  <bruno@clisp.org>

	Document better where to put -m32 or -m64 compiler options.
	* doc/autoconf.texi (Preset Output Variables): Clarify that options -m32 or -m64
	must go into CC, not CFLAGS and not CPPFLAGS either. This is needed because on
	bi-arch platforms, config.guess runs $CC without $CFLAGS nor $CPPFLAGS.

2020-12-01  Zack Weinberg  <zackw@panix.com>

	Add a note to NEWS about ac_cv_header_stdlib_h not being set...
	... even though HAVE_STDLIB_H is.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	Make autoreconf --force --install overwrite existing files (#110371)
	The new feature of autoreconf --install installing config.guess,
	config.sub, and install-sh itself didn’t implement --force mode
	correctly; existing files would not be overwritten.

	The fix has two parts.  If --force is in effect, we try to install
	everything that we can from the needed-auxfiles list *before* checking
	which of them already exist.  But also, we don’t overwrite existing
	files unconditionally, even with --force; we only do so if the file we
	can install has a newer “timestamp” line than the copy at the
	destination.  This is because Automake can also install all of the
	files we can install.  Suppose someone is using autoconf 2.70 with a
	newly released automake 1.17; automake 1.17 will presumably ship with
	a newer config.guess than autoconf 2.70 did; that version should win.

	Fixes bug #110371.

	* bin/autoreconf.in (extract_time_stamp, our_aux_file_is_newer): New functions.
	  (install_aux_file): If the destination exists, and our copy is not
	  newer, do not overwrite it.
	  (autoreconf_current_directory): When $force is true, attempt to
	  install all needed aux files *before* scanning for missing aux files.
	  (throughout): Remove extra \n from various error messages.

	* tests/torture.at (Missing auxiliary files (--force)): New test.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	Add more release notes about compatibility problems.
	See https://savannah.gnu.org/support/?110382 and
	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97998 for background.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	AT_CHECK_MACRO: test C++ as well as C, cross as well as native
	Many of the reported regressions in Autoconf 2.70 betas went unnoticed
	for years because Autoconf’s bundled test suite didn’t test most of
	the macros with a C++ compiler and/or in cross compilation mode.
	There’s a special makefile target ‘maintainer-check-c++’ that runs all
	the tests with CC=g++, but that doesn’t catch the regressions either,
	because it doesn’t compare the configure results with what you’d have
	gotten with a C compiler.  Also, C and C++ have diverged to the point
	where setting CC to a C++ compiler doesn’t work reliably anymore.

	This patch overhauls AT_CHECK_MACRO to test each macro four times:
	(C compiler, C++ compiler) x (native mode, cross-compilation mode).
	All four tests are expected to produce the same config.cache and
	config.h, except for certain predictable differences due to running
	AC_PROG_CXX instead of AC_PROG_CC, and a short list of known,
	acceptable differences, maintained in mktests.pl.

	There are two classes of known, acceptable differences.  Macros that
	use AC_RUN_IFELSE aren’t tested in cross-compilation mode at all,
	because they may crash the script (this is temporary and will be
	revisited after 2.70).  Macros that correctly detect a difference
	between C and C++ (e.g. AC_HEADER_STDBOOL will notice that C++ doesn’t
	have the _Bool type) are annotated with the specific cache variable
	and #define that varies.

	mktests.pl now also has the capability to provide values for the
	MACRO-USE, ADDITIONAL-COMMANDS, and AUTOCONF-FLAGS arguments to
	AT_CHECK_(AU_)MACRO, on a per-macro basis, but that’s not used in this
	patch.

	Some of the manual uses of AT_CHECK_MACRO do not need to test C++
	and/or cross compilation; for them, there is a new test helper,
	AT_CHECK_CONFIGURE_AC.  Another new helper, AT_PRESERVE_CONFIG_STATUS,
	is used extensively in AT_CHECK_(AU_)MACRO but may be also useful in
	manual tests that need to do multiple configure runs.

	This change supersedes AT_CHECK_MACRO_CROSS and
	‘make maintainer-check-c++’, which are removed.

	In my testing, setting CC to a C++ compiler no longer works at all,
	for reasons that are impractical to fix (e.g. C++ compilers choke on
	the test for C2011 features) so I have added a note to NEWS saying
	that this is not supported anymore.

	 * tests/local.at (AT_CHECK_MACRO): Default behavior is now to test
	   the macro in both native and cross-compilation mode, and expect the
	   results to be identical.  If the macro transitively required
	   AC_PROG_CC, and a C++ compiler is available, then test it twice
	   more with AC_LANG([C++]) in effect, and again expect the results to
	   be identical.  New fifth argument TEST-PARAMETERS can modify this
	   behavior.
	   (_AT_FILTER_CXX_CV_VARIES, _AT_FILTER_CXX_DEFINE_VARIES): New,
	   subroutines of AT_CHECK_MACRO.

	   (AT_CHECK_MACRO_CROSS): Remove, subsumed by new AT_CHECK_MACRO
	   behavior.
	   (AT_CHECK_AU_MACRO): Forward to AT_CHECK_MACRO for the basic test;
	   then do the same autoupdate test as before, as a separate test group.

	   (at_check_env): Also ignore OPENMP_CXXFLAGS.
	   (AT_CONFIG_CMP): Add third argument EXTRA-VARIANCE that specifies
	   additional variables that are expected to vary in a particular test.
	   (_AT_CONFIG_CMP_PRUNE): New, subroutine of AT_CONFIG_CMP.
	   (AT_DEFINES_CMP): New helper macro that compares config.h headers,
	   with the ability to ignore variation in specific defines.
	   (_AT_DEFINES_CMP_PRUNE): New, subroutine of AT_DEFINES_CMP.

	   (AT_PRESERVE_CONFIG_STATUS): New helper that makes copies of
	   config.h, config.log, config.status, and state-env.after under
	   names that won’t be clobbered by a subsequent run of configure.

	   (AT_CHECK_CONFIGURE_AC): New helper that defines a complete test
	   group consisting of a single invocation of _AT_CHECK_AC_MACRO;
	   effectively what AT_CHECK_MACRO used to be.
	   (_AT_CHECK_AC_MACRO): Correct documentation comment; the PRE-TESTS
	   argument has always been optional.

	 * tests/mktests.pl (test_parameters): New global data object giving
	   extra arguments to pass to AT_CHECK_MACRO/AT_CHECK_AU_MACRO on a
	   per-macro basis.
	   (emit_test): New function that handles emitting calls to
	   AT_CHECK_(AU_)MACRO with the desired arguments.
	   (scan_m4_files): Use emit_test.

	   (au_exclude_list): Add AC_HAVE_LIBRARY, AC_COMPILE_CHECK,
	   AC_TRY_CPP, AC_TRY_COMPILE, AC_TRY_LINK, and AC_TRY_RUN.

	 * tests/semantics.at (AC_CHECK_LIB, AC_SEARCH_LIBS): Rewrite test
	   using symbols from zlib instead of libm, to get consistent behavior
	   from C and C++.
	   (AC_SEARCH_LIBS (none needed)): Revise to clarify what is being tested.
	   (AC_CHECK_DECLS): Use _AC_LANG_ABBREV when inspecting cache variables.
	   (AC_CHECK_ALIGNOF, AC_CHECK_ALIGNOF struct)
	   (AC_CHECK_SIZEOF, AC_CHECK_SIZEOF struct)
	   No need for AT_CHECK_MACRO_CROSS.
	   (AC_CHECK_FILES): Switch to AT_CHECK_CONFIGURE_AC.
	   (AC_SYS_RESTARTABLE_SYSCALLS, AC_FUNC_WAIT3): Do not test in cross
	   compilation mode.
	   (AC_TRY_CPP, AC_TRY_COMPILE, AC_TRY_LINK, AC_TRY_RUN)
	   (AC_COMPILE_CHECK, AC_HAVE_LIBRARY): New manual AT_CHECK_AU_MACRO tests.

	 * tests/c.at (Extensions, C keywords, AC_PROG_CPP requires AC_PROG_CC)
	   (AC_NO_EXECUTABLES (working linker), AC_NO_EXECUTABLES (broken linker)):
	   Switch to AT_CHECK_CONFIGURE_AC. Also convert case statements to AS_CASE.
	   (Broken/missing compilers): Pass CC=no-such-compiler on the command
	   line instead of hardwiring it in the configure script.

	 * tests/local.mk (maintainer-check-c++): Remove target.
	   (maintainer-check): Run the ordinary ‘make check’ as well as
	   ‘make maintainer-check-posix’.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	Rewrite mktests.sh in Perl.
	This is probably marginally faster since it doesn’t have to read the
	.m4 files twice or muck around with temporary files and subprocesses,
	but the actual point of this rewrite is that it will make it easier to
	provide additional arguments to AT_CHECK_MACRO and AT_CHECK_AU_MACRO
	on a per-macro basis; this capability will be added and used in the
	next patch.

	In *this* patch, the ac*.at files are not functionally changed at all.
	(The comments come out slightly differently, though.)

	* tests/mktests.sh: Delete and...
	* tests/mktests.pl: ...rewrite in Perl.
	* tests/local.mk: Update to match.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	Overhaul Erlang support.
	Erlang is similar to Java in that it doesn’t compile to standalone
	machine code; the output of ‘erlc’ is byte-code files that are then
	interpreted by ‘erl’.  We handle this poorly in a whole bunch of ways,
	particularly when cross-compiling.  This patch fixes up the more
	serious problems:

	 - AC_COMPILE_IFELSE now actually works when AC_LANG([Erlang]) is in
	   effect.
	 - ‘conftest.beam’ is now deleted in several more places where it
	   could be created.
	 - The various AC_ERLANG_* macros that interrogate the runtime
	   environment do so by invoking ‘$ERL’ directly, rather than using
	   AC_RUN_IFELSE, and thus do not crash the configure script when
	   we think we’re cross-compiling.  (It is not clear to me whether
	   they get the correct answer when cross-compiling, but this should
	   still be strictly an improvement.)
	 - The Erlang-related tests have been streamlined.

	Further improvements are definitely possible, but we’d have to teach
	the infrastructure to make $ac_objext language-specific first, which
	seems like too big of a change for 2.70.

	(This patch is all fallout from a logically unrelated testsuite change
	which is coming up next.  Gotta love the fundamental interconnectedness
	of things.)

	* lib/autoconf/general.m4 (_AC_COMPILE_IFELSE_BODY)
	  (_AC_LINK_IFELSE_BODY): Delete conftest.beam as well as conftest.$ac_objext.

	* lib/autoconf/erlang.m4 (AC_ERLANG_PATH_ERLC, AC_ERLANG_PATH_ERL):
	  Don’t repeat work done by AC_PATH_TOOL.
	  (Erlang $ac_compile): Fake an .o file so AC_TRY_COMPILE will be happy.
	  (AC_LANG_COMPILER(Erlang)): AC_REQUIRE AC_ERLANG_NEED_ERLC, not
	  AC_ERLANG_PATH_ERLC.  Also AC_REQUIRE AC_ERLANG_NEED_ERL so
	  AC_RUN_IFELSE works reliably.
	  (AC_ERLANG_CHECK_LIB, AC_ERLANG_SUBST_ROOT_DIR)
	  (AC_ERLANG_SUBST_LIB_DIR, AC_ERLANG_SUBST_ERTS_VER):
	  Use $ERL -eval, not AC_RUN_IFELSE.
	  No need to AC_REQUIRE AC_ERLANG_NEED_ERLC.

	* tests/erlang.at: Don’t test anything here that’s tested adequately
	  by acerlang.at; document which macros those are expected to be.
	  Remove unnecessary AC_ERLANG_PATH_ERL/ERLC invocations throughout.
	  (AT_CHECK_MACRO([Erlang])): Rename test to ‘Erlang basic compilation’;
	  expect both AC_COMPILE_IFELSE and AC_RUN_IFELSE to work;
	  handle cross compilation mode properly.
	* tests/mktests.sh: Exclude from acerlang.at all macros completely
	  covered by erlang.at.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	Make “redefining AS_ECHO internals” test more robust.
	M4-redefining ‘printf’ as ‘echo’ brings back all the variations in
	‘echo’ behavior that we were trying to get away from by switching to
	‘printf’ in the first place.  This caused a spurious failure on AIX.

	* tests/m4sh.at (Redefining AS_ECHO internals): Redefine ‘printf’ as
	  a shell function with fully predictable output, not as ‘echo’.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	torture.at: Insulate more tests from buggy third-party m4 files.
	All tests that run autoreconf need to defend against the possibility
	of aclocal not existing and/or barfing on bugs in third-party m4 files
	installed on the build system.  Two of the “Missing auxiliary files”
	tests were missing this defensive code.

	 * tests/torture.at (Missing auxiliary files (install-sh))
	   (Missing auxiliary files (foreign)): Prevent autoreconf from
	   running aclocal.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	Avoid ‘new File::Temp’ in Perl scripts.
	Despite what the documentation says, ‘new File::Temp’ does not work
	reliably in perl 5.6.x.  Rather than figure out exactly what is wrong
	with it, let’s just stick to ‘tempfile’.

	 * bin/autom4te.in (handle_output): Use tempfile function instead of
	   object-oriented File::Temp interface.
	 * bin/autoreconf.in (install_aux_file): Likewise.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	Disentangle HAVE__BOOL from ac_cv_header_stdbool_h.
	AC_CHECK_HEADER_STDBOOL is documented to make two checks: whether the
	C99 header <stdbool.h> is available and fulfills its
	specification (i.e. including it makes the type ‘bool’ and the
	constants ‘true’ and ‘false’ available), and, independently, whether
	the type ‘_Bool’ is available.

	In C++, the type ‘_Bool’ is usually _not_ available, but <stdbool.h>
	is still supposed to be include-able and the type ‘bool’ and the
	constants ‘true’ and ‘false’ are still supposed to be available
	(unconditionally).  However, the test for <stdbool.h> fulfilling its
	specification freely used _Bool, and would therefore fail spuriously.
	Correct this by checking for _Bool first, and then refactoring the
	test program for <stdbool.h> so that it does all its tests using bool,
	then repeats them with _Bool only when available.

	* lib/autoconf/headers.m4 (AC_CHECK_HEADER_STDBOOL): Do the test for
	  _Bool before the test for stdbool.h.  Test semantics of bool
	  unconditionally; test _Bool only when HAVE__BOOL is defined.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	AC_FUNC_SETPGRP: Don’t depend on the return type of setpgrp.
	AC_FUNC_SETPGRP determines whether you have the historic BSD setpgrp,
	which takes two arguments and returns int, or the historic POSIX
	setpgrp, which takes no arguments and returns int.  Solaris has yet a
	third variant, which takes no arguments and returns a pid_t (the new
	process group ID).  This difference causes AC_FUNC_SETPGRP’s test
	program to fail to compile under AC_LANG([C++]), which in turn causes
	the macro to report that setpgrp does take arguments, which is wrong.

	It is not worth adding a new result #define for this variant,
	since *all* forms of setpgrp are deprecated in favor of setpgid, which
	is old enough that it can be used unconditionally.  However, it is
	worth documenting that this variant exists, and fixing AC_FUNC_SETPGRP
	to produce the right value for its existing result #define on Solaris
	with C++.

	* lib/autoconf/functions.m4 (AC_FUNC_SETPGRP): Redesign test program to
	  not depend on the return type of setpgrp.
	* doc/autoconf.texi (AC_FUNC_SETPGRP): Mention that the macro does not
	  check for the Solaris variant of setpgrp that returns pid_t.  Change
	  programming advice to recommend use of setpgid.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	AC_C_CHAR_UNSIGNED: Remove check of $GCC.
	On systems where plain ‘char’ is unsigned (e.g. AIX) we would define
	__CHAR_UNSIGNED__ only when $GCC was not true at configure time.
	If AC_LANG([C++]) has been in effect since the beginning of the
	script (so AC_PROG_CC was never invoked), $GCC will be false
	regardless; this causes an inconsistency between the C and C++
	behaviors, even when both compilers are GNU.

	The point of checking $GCC here is that GCC has command line options
	to override the signedness of plain ‘char’, and it predefines
	__CHAR_UNSIGNED__ to indicate what the signedness actually is.
	We don’t want config.h to override that.  However, there is already
	a special autoheader template for __CHAR_UNSIGNED__ that prevents it
	being redefined if it’s defined already, so checking $GCC at
	configure time is redundant and can safely be removed.

	* lib/autoconf/c.m4 (AC_C_CHAR_UNSIGNED): Do not make result depend on
	  value of $GCC.  Adjust commentary.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	sc_error_message_uppercase: allow fully uppercased words
	If an error message starts with an entire fully uppercased word,
	that’s probably a proper noun and it should stay that way.  For
	instance, autoreconf has an error message that starts with
	"AM_GNU_GETTEXT is used, but ..."; AM_GNU_GETTEXT is the name of an
	Automake macro, it needs to stay uppercased.

	This subsumes the existing exception for the words FATAL and WARNING.
	While I was in there I generalized the exception for PRIuMAX to cover
	all of the inttypes.h PRI* and SCN* macros.

	This patch has been submitted to Gnulib; until it is merged there,
	anyone running ‘make fetch’ should take care not to drop this change.

	* maint.mk (sc_error_message_uppercase): Allow error messages that
	  begin with any fully uppercased word, or with any of the inttypes.h
	  PRI[dioux]\w+ or SCN[dioux]\w+ macros.

2020-11-30  Zack Weinberg  <zackw@panix.com>

	make fetch and update savannah gitweb urls to cgit.
	Several of the files updated by make fetch have made this change, so
	we follow suit for consistency:

	* README-hacking
	* build-aux/fetch.pl
	* doc/autoconf.texi: Replace all git.savannah.gnu.org/gitweb URLs with
	  equivalent /cgit URLs.

2020-11-16  Zack Weinberg  <zackw@panix.com>

	AC_INIT: better handling of unusual arguments (#110349)
	Fix some subtle quotation bugs in _AC_INIT_PACKAGE that made it
	impossible to put ‘,’ or an unbalanced close parenthesis in some of
	the arguments to AC_INIT.  Document that arguments to AC_INIT
	containing parentheses, square brackets, ‘,’ or ‘#’ may need to be
	double-quoted.  Provide more detailed examples and exposition re
	computing the arguments to AC_INIT when autoconf is run (e.g. with
	git-version-gen).  Add a whole bunch more tests for unusual arguments
	to AC_INIT, and a test that the backward-compatibility behavior of
	AC_INIT with only one argument is still correct.

	This may still break some of the existing configure scripts described
	in the threads at
	https://lists.gnu.org/r/autoconf/2020-10/msg00013.html and
	https://lists.gnu.org/r/bug-autoconf/2020-10/msg00012.html
	but, I hope, only in ways covered by the existing warning in NEWS
	about pickier M4 quotation.

	* lib/autoconf/general.m4 (_AC_INIT_PACKAGE): Redo argument
	  normalization and default value selection in a simpler, less
	  error-prone fashion.
	  (_AC_INIT_PACKAGE_N): New helper subroutine.
	  (AC_INIT): Always call _AC_INIT_PACKAGE, but supply no arguments if
	  we were called with only one argument.

	* tests/base.at (AC_INIT (obsolete invocation)): New test.
	  (AC_INIT with unusual version strings): Expand test.

	* doc/autoconf.texi (AC_INIT): Revise.

2020-11-16  Zack Weinberg  <zackw@panix.com>

	AS_ECHO(_N): Do not expand macros named ‘s’ or ‘n’ (#110377)
	AS_ECHO expands to ‘printf "%s\n" $1’.  If a configure script defines
	an M4 macro named ‘s’ or ‘n’ it will be expanded in the first argument
	to printf, which is almost certainly not what was intended.
	The configure script for ruby 2.7.2 uses ‘AS_VAR_PUSHDEF([s], ...)’
	and breaks with 2.69d because of this.

	Add some extra quoting so that the ‘%s\n’ is treated as literal;
	similarly for AS_ECHO_N and the legacy shell variables $as_echo
	and $as_echo_n.

	For now, anyway, don’t quote the word ‘printf’; if someone does
	define that as a M4 macro they might well mean to affect AS_ECHO.
	(Whether this is something we *want* to allow, we can worry about
	when it comes up.)

	Fixes bug #110377.

	* lib/m4sugar/m4sh.m4 (_AS_ECHO_N_PREPARE, AS_ECHO, AS_ECHO_N):
	  Add another layer of quoting around the first argument to printf.
	* tests/m4sh.at (Redefining AS_ECHO internals): New test.

2020-11-15  Zack Weinberg  <zackw@panix.com>

	Don’t issue obsoletion warnings for AC_LANG_SAVE/RESTORE (#110375)
	The most recently released version of libtool.m4 is five years old as
	of this commit, and no new release is likely to appear anytime soon.
	It uses AC_LANG_SAVE and AC_LANG_RESTORE, in a way that doesn’t
	obviously translate to AC_LANG_PUSH and AC_LANG_POP.  This will need
	to be fixed by libtool upstream.  Until that actually happens, disable
	the -Wobsolete warnings for AC_LANG_SAVE and AC_LANG_RESTORE.  (They
	are still documented as obsolete in the manual, as they have been for
	many years.)

	Fixes bug #110375.

	* lib/autoconf/lang.m4 (AC_LANG_SAVE, AC_LANG_RESTORE): Define with
	  AC_DEFUN, not AU_DEFUN; remove manual -Wobsolete warnings.

2020-11-15  Zack Weinberg  <zackw@panix.com>

	AS_IF: Handle else clause being empty after macro expansion (#110369)
	AS_IF can emit a syntactically invalid shell if-then-else,

	  if CONDITION
	  then :
	    # ...
	  else
	  fi

	when its IF-FALSE argument consists of macros that don’t produce any
	shell code.  This was a documented limitation in AS_IF, but it’s a bad
	limitation to have, because macros that *used* to expand to shell
	commands might start expanding to nothing in future releases.  For
	instance, this broke the libzmq configure script, which did

	  AC_PROG_CC
	  AX_CHECK_COMPILE_FLAG([-std=gnu11],
	    [CFLAGS+=" -std=gnu11"],
	    [AC_PROG_CC_C99])

	Perfectly valid in 2.69, but in 2.70 AC_PROG_CC_C99 doesn’t produce
	any shell code and the script crashes.

	We had that limitation for good reason: we can’t just put ‘:’ at the
	beginning of the else-clause, like we do for the then-clause, because
	that would clobber $? and the IF-FALSE commands might want to inspect
	it.  (This doesn’t matter for the then-clause, because $? is always
	zero at the beginning of a then-clause anyway.)  The simplest and
	least inefficient shell construct I can find that works in this
	context is a shell function that does ‘return $?’.  Due to awkward
	M4sh initialization ordering constraints (AS_IF gets used before we
	can safely use shell functions) an indirection through a shell
	variable is necessary.  The structure of a m4sh script is now

	  #! /bin/sh
	  ## M4sh Initialization
	  as_nop=:

	  ...
	  ## M4sh Shell Functions

	  as_fn_nop () { return $?; }
	  as_nop=as_fn_nop
	  ...

	and AS_IF emits

	  if CONDITION
	  then :
	    # ...
	  else $as_nop
	    # ...
	  fi

	The uses of AS_IF that appear before the beginning of the M4sh Shell
	Functions section are all under our control and they don’t need to
	look at $?.

	If anyone has a better idea for how to make this work I will be glad
	to hear it.

	Fixes bug #110369.

	* lib/m4sugar/m4sh.m4
	  (_AS_IF_ELSE): When $1 is nonempty, invoke _AS_EMPTY_ELSE_PREPARE.
	  Emit $as_nop at beginning of else clause.
	  (_AS_BOURNE_COMPATIBLE): Initialize as_nop to ‘:’.
	  (_AS_EMPTY_ELSE_PREPARE): New macro which emits a definition of
	  as_fn_nop and resets as_nop to as_fn_nop.
	  (AS_PREPARE, _AS_PREPARE): Invoke _AS_EMPTY_ELSE_PREPARE.
	  (_AS_UNSET_PREPARE): Tweak white space.

	* tests/m4sh.at (AS_IF and AS_CASE): Test AS_IF’s IF-FALSE argument
	  being empty after macro expansion.

	* doc/autoconf.texi (AS_IF): Remove warning about use with
	  ‘run-if-false’ argument empty after macro expansion.

2020-11-11  Ross Burton  <ross.burton@arm.com>

	Support CONFIG_SITE being a list of entries.
	Instead of treating CONFIG_SITE as a single path, treat it as a
	space-separated list of paths and load them in order.

	Also remove the special-casing of entries starting with a dash, this is
	redundant as they'll be caught by the wildcard case.

	Finally add a test case to verify that multiple files are loaded
	correctly.

	* lib/autoconf/general.m4 (AC_SITE_LOAD): Treat CONFIG_SITE as a
	  space-separated list of scripts to be sourced.  Simplify handling
	  of default config.site locations using this capability.
	* tests/base.at (AC_CACHE_CHECK): Test loading of multiple site files.
	* doc/autoconf.texi (Site Defaults): Update documentation of CONFIG_SITE.

2020-11-11  Zack Weinberg  <zackw@panix.com>

	tests/compile.at (AC_RUN_IFELSE): typo fix

2020-11-10  Ben Pfaff  <pfaffben@debian.org>

	autom4te: replace output file atomically (#110305)
	In 2003, Joey Hess reported the following bug against Debian's
	autoconf package (see http://bugs.debian.org/221483):

	    I noticed that if I ctrl-c autoconf, it can leave a partially
	    written, executable configure script. I was lucky enough to
	    get a configure script that exited with a shell parse error,
	    but if I had been unlucky, it might have exited 0 without
	    doing all the tests I expected it to do.  That would have
	    sucked to ship to users.

	    There are many ways to update a file in a way that is not
	    prone to these problems, and I suggest that autoconf adopt
	    one of them.

	Ben Pfaff wrote a patch to make autom4te replace the output file
	atomically; Debian has carried it since 2006.  He submitted it
	to autoconf upstream in 2008 but it never went anywhere.

	I (Zack) have dusted off the patch and made some minor improvements:
	using File::Temp (with DIR set to the directory of the output file)
	instead of a predictable temporary file name, and using
	Autom4te::FileUtils::update_file instead of File::Copy::move.

	I do not attempt to test the fix (the test would be inherently racey)
	nor do I have autom4te delete the temp file if it crashes while the
	file is being written (there is no way to do this with 100%
	reliability and it strikes me as likely to cause more problems than it
	solves).

	Fixes our bug #110305.

	* bin/autom4te.in (handle_output): When $output is to a regular or
	  nonexistent file, write to a temporary file in the same directory
	  and then rename it over $output after completion.

2020-11-09  Zack Weinberg  <zackw@panix.com>

	make fetch

2020-11-09  Zack Weinberg  <zackw@panix.com>

	m4sh: Require shell to support $(...) command substitution.
	As of the 2020-11-07 update, config.sub and config.guess
	unconditionally use $(...) command substitution; see
	<https://lists.gnu.org/archive/html/config-patches/2020-11/msg00011.html>.

	Therefore, add this to the set of required shell features, searched
	for by _AS_DETECT_BETTER_SHELL.  On a system where /bin/sh doesn’t
	support $(...), $CONFIG_SHELL will be set to one that does (and the
	primary configure script will be re-executed using that shell).
	AC_CANONICAL_* use $CONFIG_SHELL to execute config.guess/sub, so they
	will keep working.  This also means that configure scripts and
	third-party macros that use $(...) will quietly start working
	correctly on such ancient systems.

	The test code is simple, but sufficient to weed out Solaris 10’s
	/bin/sh, which doesn’t support $(...) but *does* support shell
	functions.

	I’m not going to touch any of the existing uses of `...` command
	substitution in Autoconf proper for now, but it might make sense to
	bulk upgrade them early in the 2.71 release cycle; if nothing else,
	it would remove a major obstacle to running shellcheck over our
	scripts.

	* lib/m4sugar/m4sh.m4 (_AS_MODERN_CMDSUBST_WORKS): New macro.
	  (AS_INIT, AS_SHELL_SANITIZE): Call _AS_DETECT_REQUIRED for
	  _AS_MODERN_CMDSUBST_WORKS.
	* NEWS: Mention the requirement for $(...).

2020-11-09  Zack Weinberg  <zackw@panix.com>

	Check in install-sh as synced from automake (#110368)
	As pointed out in sr #110368, since install-sh is now being installed
	as part of autoconf, we should make sure to ship the latest version
	rather than the version shipped by the automake that was used to
	bootstrap the autoconf release tarball.

	The build-aux/fetch.pl script is already supposed to fetch the latest
	version, but install-sh is listed in .gitignore so any updates are
	discarded when starting from a clean tree.  Correct this.

	At the same time, since mdate-sh is *not* installed by autoconf nor is
	it directly referenced in any code maintained in the autoconf
	repository, remove it from the list of files to fetch and keep it in
	.gitignore.

	This change exposed a bug in fetch.pl where it would crash when
	there was no old copy of a file being updated.

	 * .gitignore: Remove /build-aux/install-sh.
	 * build-aux/fetch.pl (%to_fetch): Remove build-aux/mdate-sh.
	   (slurp): Don’t die on ENOENT, return undef.
	   (replace_if_change): Handle $oldcontents being undef.
	 * build-aux/install-sh: Is now checked in.

2020-11-09  Zack Weinberg  <zackw@panix.com>

	Mention AM_GNU_GETTEXT_REQUIRE_VERSION support in NEWS.

2020-11-09  Michał Górny  <mgorny@gentoo.org>

	autoreconf: Support AM_GNU_GETTEXT_REQUIRE_VERSION
	As reported in https://github.com/gentoo/gentoo/pull/163, gettext 0.19.6
	supports using AM_GNU_GETTEXT_REQUIRE_VERSION (specifying a *minimum*
	required version of gettext) instead of AM_GNU_GETTEXT_VERSION
	(which specifies a *fixed* required version of gettext).
	Update autoreconf to support both.

	 * bin/autoreconf.in (autoreconf_current_directory): Check for
	   AM_GNU_GETTEXT_REQUIRE_VERSION as well as AM_GNU_GETTEXT_VERSION.
	   Update diagnostics about using AM_GNU_GETTEXT_VERSION but not
	   AM_GNU_GETTEXT, or vice versa, to match.
	 * doc/autoconf.texi (autoreconf Invocation): Update to match.
