Zack Weinberg [Wed, 18 Mar 2026 18:34:15 +0000 (14:34 -0400)]
Allow --enable/disable-year2038 to be set in environment.
In both AC_SYS_YEAR2038 and AC_SYS_YEAR2038_RECOMMENDED, only set
the shell variable ‘enable_year2038’ if it doesn’t already have a
value, thus allowing it to be passed down from the environment.
Fixes <https://savannah.gnu.org/support/?111394>.
* lib/autoconf/specific.m4 (_AC_SYS_YEAR2038_ENABLE): When setting
the default value of enable_year2038, do not override a value that
was set in the environment.
* tests/semantics.at: Add tests for setting enable_year2038 in the
environment and in config.site.
Bruno Haible [Tue, 17 Mar 2026 21:48:47 +0000 (22:48 +0100)]
autoreconf: Fix recognition of autopoint versions 0.26 or newer.
* bin/autoreconf.in (autoreconf_current_directory): In the regex that
extracts the version number components from `autopoint --version`, mark
the third component as optional.
Zack Weinberg [Wed, 25 Feb 2026 18:04:14 +0000 (13:04 -0500)]
autoreconf: add --exclude option
‘autoreconf --exclude COMMAND’ will not run COMMAND even if it appears
to be necessary. The option can be given several times, or passed a
comma-separated list, to disable several such commands. This may be
useful when autoreconf’s heuristics are incorrect (e.g. various
reported problems with gtkdocize and autopoint in the past few
years), or when a tool is unavailable or undesirable.
(For future consideration: also add the inverse option, run a command
even if it doesn’t seem to be necessary.)
* bin/autoreconf.in (may_run_command): New function.
(%C, %cmd_excluded): New globals.
($autoconf, $autoheader, $autom4te, $automake, $aclocal, $libtoolize)
($intltoolize, $gtkdocize, $autopoint, $make): Fold into %C.
($run_make): Now local to parse_args.
(parse_args): Recognize -x, --exclude option. Merge all of the
options and environment variable settings that can cause us not to
run various commands into %cmd_excluded.
(autoreconf_current_directory): Call may_run_command before running
each command. Revise autopoint version detection for clarity.
* doc/autoconf.texi: Document new -x, --exclude option to autoreconf.
Clarify that the COMMANDNAME environment variables can have the same
effect.
* tests/statesave.m4 (AC_STATE_SAVE): Split into its component tasks:
AC_STATE_SAVE_DIR and AC_STATE_SAVE_ENV. AC_STATE_SAVE by itself
still does both tasks.
* tests/local.at: Log availability and version numbers for libtoolize,
gtkdocize, intltoolize, and autopoint. Detect whether autopoint
supports AM_GNU_GETTEXT without AM_GNU_GETTEXT_(REQUIRE_)VERSION.
(AT_REQUIRE_LIBTOOL, AT_REQUIRE_AUTOPOINT, AT_REQUIRE_INTLTOOLIZE)
(AT_REQUIRE_GTKDOCIZE): New macros.
(AT_STATE_SAVE, AT_STATE_SAVE_DIR, AT_STATE_SAVE_ENV): Import from
statesave.m4.
* tests/torture.at: Add several new tests of autoreconf invoking
third-party tools, and of the new --exclude option.
Zack Weinberg [Mon, 9 Mar 2026 19:22:33 +0000 (15:22 -0400)]
autoconf: error out if AC_OUTPUT receives more than three arguments
Modified versions of Autoconf exist that expect more than three
arguments to AC_OUTPUT; attempting to regenerate a configure
script that uses the extra arguments, with the unmodified
Autoconf, is likely to produce a broken script.
The feature enabled by a fourth argument, in the case I know about
(<https://invisible-island.net/autoconf/autoconf.html> - look for
“simplify the way we generate the config.h file”) is potentially
worth folding into our version of Autoconf, but we would need to
do it with a new AC_CONFIG_something macro, instead of reverting
to having AC_OUTPUT take arguments.
* lib/autoconf/status.m4 (AC_OUTPUT): Error out if more than three
arguments are supplied.
* tests/torture.at: Add tests of AC_OUTPUT with one, three, and four
arguments. Two arguments is treated as a special case of three
arguments, so it doesn’t need its own test.
Paul Eggert [Thu, 5 Mar 2026 22:37:15 +0000 (14:37 -0800)]
Pacify Emacs 30 in Elisp sources
* lib/emacs/autoconf-mode.el:
* lib/emacs/autotest-mode.el:
Mark these as using lexical binding as they work just fine with that,
and if you compile them without the mark, Emacs 30 complains
“Warning: file has no `lexical-binding' directive on its first line”.
Zack Weinberg [Tue, 24 Feb 2026 21:00:03 +0000 (16:00 -0500)]
autoheader: preserve hand-written template files
Consistent with the existing behavior of autoreconf regarding
hand-maintained aclocal.m4, make both autoheader and autoreconf
check for the /* Generated from configure.ac by autoheader */
line that autoheader emits at the beginning of its generated
configuration header templates. If the file exists but the
marker line is not there, they will now leave the file alone
unless given the new command line option --replace-handwritten.
I’m looking for feedback regarding whether the new option should
also cause autoreconf to clobber a hand-written aclocal.m4, or any
other files that _could_ be generated but aren’t always. (aclocal.m4
in particular may need coordination with Automake, since the ‘aclocal’
tool belongs to them.)
* bin/autoheader.in: Add option --replace-handwritten. If the
primary template file already exists and doesn’t begin with a
marker comment indicating it was generated by autoheader, don’t
modify it unless --replace-handwritten was given.
* bin/autoreconf.in: Similarly.
* doc/autoconf.texi: Document new option for autoheader and
autoreconf.
* tests/tools.at: Test new behavior.
Zack Weinberg [Wed, 18 Feb 2026 18:18:37 +0000 (13:18 -0500)]
Update documentation for building Autoconf from a Git checkout.
* Clarify that you need a full Git clone, not a shallow clone, because
the build scripts inspect the Git history.
* Remove all references to CVS and the CVS mirror of the Git repo.
pserver.git.sv.gnu.org doesn’t exist anymore, and I suspect building
from a CVS-based working copy wouldn’t work anyway, for the same
reason a shallow clone doesn’t work.
* Add a note to the paragraph about copyright assignments for patches,
explaining that that Signed-off-by: is useless to us.
Zack Weinberg [Mon, 9 Feb 2026 14:25:15 +0000 (09:25 -0500)]
Go: do not clobber GOFLAGS in AC_PROG_GO (sr #111383)
The AC_PROG_GO macro should honor the GOFLAGS set by the user at
configure time.
Fixes <https://savannah.gnu.org/support/?111382>.
* lib/autoconf/go.m4: Do not clobber GOFLAGS in AC_PROG_GO.
Simplify sequence of AC_CHECK_TOOL/AC_CHECK_PROGS operations;
this macro does not have the backward compatibility constraints
that AC_PROG_CC does.
Algol68: do not clobber A68FLAGS in AC_PROG_A68 (sr #111382)
The AC_PROG_A68 macro should honor the A68FLAGS set by the user at
configure time.
Fixes <https://savannah.gnu.org/support/?111382>.
* lib/autoconf/a68.m4: Do not clobber A68FLAGS in AC_PROG_A68.
Simplify sequence of AC_CHECK_TOOL/AC_CHECK_PROGS operations;
this macro does not have the backward compatibility constraints
that AC_PROG_CC does.
Zack Weinberg [Wed, 4 Feb 2026 18:36:06 +0000 (13:36 -0500)]
AC_PROG_LEX: Be compatible with Solaris 10 lex’s handling of C++.
Solaris 10 lex (Software Generation Utilities (SGU) Solaris-ELF (4.0))
provides its own declaration of yywrap. When the generated scanner is
compiled as C++, that declaration will *not* be tagged with `extern "C"`
unless the preprocessor macro __EXTERN_C__ is defined using -D.
The %{ %} block of the .l file is too late.
Our test .l file also declares yywrap, and it unconditionally tags it
with `extern "C"` when compiling as C++. Thus, we need to define
__EXTERN_C__ or we’ll get a spurious compile error with this
implementation of lex. This macro should be harmless with other
implementations.
sr #111381
* lib/autoconf/programs.m4 (_AC_PROG_LEX_YYTEXT_DECL): Add -D__EXTERN_C__=1
to CPPFLAGS while compiling test programs, for improved compatibility
with Solaris 10 lex.
Zack Weinberg [Wed, 4 Feb 2026 17:10:41 +0000 (12:10 -0500)]
tests: AC_C_FLEXIBLE_ARRAY_MEMBER result can vary between C and C++.
For example, the native C compiler for Solaris 10 (Sun C in, at least,
the version 5.9 .. 5.15 range) supports C99 flexible array members,
but the matching C++ compiler doesn’t.
Zack Weinberg [Tue, 3 Feb 2026 20:29:08 +0000 (15:29 -0500)]
maint.mk: remove overquotation in ‘announcement’ rule
If $(bootstrap-tools) *doesn’t* include “gnulib”, a nested shell
command is supposed to expand to nothing, but instead it expands to
an empty argument, causing announce-gen to barf.
Zack Weinberg [Tue, 3 Feb 2026 19:31:36 +0000 (14:31 -0500)]
NEWS: Briefly mention a few more improvements.
Specifically, this is meant to cover these commits:
2b56e8c2 autoreconf: don’t fail if gtkdocize is unavailable (#110503) 912567e9 autoreconf: require word boundaries when grepping for macros (#111271) 4774e6bb autoreconf: Adapt to the on-disk situation after autopoint has run. f0d97fb5 autoreconf: Invoke autopoint in more situations.
and
9a6c58cf Rename version.m4 to autoconf_version.m4.
Zack Weinberg [Tue, 3 Feb 2026 17:31:55 +0000 (12:31 -0500)]
fetch.pl: get GNU standards documents from gnulib
Pulling these files from gnulib, instead of getting them directly
from their official home, means that all the files fetched by fetch.pl
come from Savannah Git repositories, which is particularly important
right now as Savannah CVS repositories are currently inaccessible via
the web, see
https://lists.gnu.org/archive/html/savannah-hackers/2026-02/msg00024.html
et seq.
* fetch.pl (to_fetch): Get all gnustandards files from gnulib instead.
(savannah_url): Remove special case for gnustandards.
Zack Weinberg [Tue, 3 Feb 2026 16:34:15 +0000 (11:34 -0500)]
syntax-check: avoid unsigned_* false positive on maint.mk
* maint.mk (sc_unsigned_char, sc_unsigned_short, sc_unsigned_int)
(sc_unsigned_log): Add ‘exclude’ patterns so that these tests do
not throw a false positive on their own commentary.
Zack Weinberg [Tue, 3 Feb 2026 15:56:12 +0000 (10:56 -0500)]
make fetch
Right now, Savannah’s HTTP interface to CVS repositories (viewvc) is
responding to all queries with a 429 Too Many Requests error code,
so those files were updated manually. (The actual CVS server is
still working fine.)
Zack Weinberg [Tue, 27 Jan 2026 21:17:43 +0000 (16:17 -0500)]
autoreconf: don’t fail if gtkdocize is unavailable (#110503)
Since 2.70, autoreconf has run gtkdocize when it detects a use of the
macro GTK_DOC_CHECK in the configure.ac. Some projects (e.g. per the
bug report, gnutls and harfbuzz) were using a clever hack with
m4_ifdef to allow people to build the project without having gtkdocize
installed, if they didn’t care about building the documentation; the
change to autoreconf broke this hack.
Attempt to make the hack work again, by only running gtkdocize if that
command is actually installed; autoreconf will not error out if the
macro is detected but the command is unavailable, similar to the
existing treatment of autopoint.
Problem reported by Marvin Scholz.
* bin/autoreconf.in (autoreconf_current_directory): Do not error out
if gtkdocize is wanted but unavailable.
Zack Weinberg [Tue, 27 Jan 2026 21:00:08 +0000 (16:00 -0500)]
autoreconf: require word boundaries when grepping for macros (#111271)
autoreconf’s first pass over configure.ac is effectively a grep
operation for a number of macros that almost always appear directly
in that file, if they’re going to appear at all. All but one of the
regular expressions made no attempt to check for word boundaries, and
the one that did was doing it incorrectly (using ^ rather than \b),
leading to issue #111271.
Fix all the regexps to surround each identifier with \b…\b and not
to use ^.
Reported by Kip, originally as gettext bug #52424.
* bin/autoreconf.in (autoreconf_current_directory): In the first pass,
require each of the macros we look for to be a complete word.
Ignore target feature flags in _AC_FC_LIBRARY_LDFLAGS (#111353)
Ignore target specific feature flags passed via '-target-feature'.
When encountered, ignore the flag passed after. These flags might
contain a '-l', e.g. '-target-feature -lwp', causing non-existent
libraries to be picked up, failing later checks, or the build of
the application.
This can e.g. be encountered when '-march=native' is passed to
configure during a build with LLVM on Zen 4 machines.
Reported by, and patch written by, Jan André Reuter <j.reuter@fz-juelich.de>.
* lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS): Skip arguments
immediately following ‘-target-feature’.
Luke Mewburn [Sat, 3 Jun 2023 15:10:30 +0000 (01:10 +1000)]
doc: cross-reference m4 manual for regex syntax (#111095)
The documentation of the various M4sugar macros that take regex
arguments did not explain GNU M4’s idiosyncratic regex syntax, which
resembles POSIX basic regexes but is not actually the same, nor is it
the same as Emacs regexes. Add cross-references to the GNU M4 manual
to rectify this.
Reported by Luke Mewburn <Luke@Mewburn.net>.
Patch originally by Luke Mewburn, revised by Zack Weinberg.
* doc/autoconf.texi: Add cross-references from the documentation of
‘m4_bpatsubst’ and ‘m4_bregexp’ to the GNU M4 manual sections that
explain ‘patsubst’ and ‘regexp’. Also add cross-references from
‘m4_bmatch’ and ‘m4_bpatsubsts’ to ‘m4_bregexp’ and ‘m4_bpatsubst’
respectively.
Paul Eggert [Tue, 27 Jan 2026 20:41:00 +0000 (12:41 -0800)]
Avoid trailing whitespace in config.h
Problem (and earlier patch) reported by Collin Funk in:
https://lists.gnu.org/archive/html/autoconf-patches/2025-10/msg00002.html
* NEWS: Mention this.
* lib/autoconf/status.m4 (_AC_OUTPUT_HEADERS_PREPARE):
Omit trailing white space from C macro definitions.
* tests/torture.at (No trailing white space in macro definitions):
New test.
Zack Weinberg [Mon, 26 Jan 2026 21:03:52 +0000 (16:03 -0500)]
Rename version.m4 to autoconf_version.m4.
Many existing projects have their own version.m4, and in some cases
having one is recommended by the Automake manual. As of 2.72, the
name collision causes a spurious warning about including ‘version.m4’
multiple times, because the “has this been included before” machinery
does not track full pathnames.
A proper fix is more complicated than anyone has time to develop;
let’s just rename our version.m4 to autoconf_version.m4, which should
be sufficiently distinctive.
Reported in <https://savannah.gnu.org/support/?111007>.
* lib/version.in: Rename to lib/autoconf_version.in.
* bootstrap, configure.ac, lib/freeze.mk, lib/local.mk,
lib/m4sugar/m4sugar.m4: Change all uses of version.m4 to
autoconf_version.m4, and all uses of version.in to
autoconf_version.in.
Bruno Haible [Tue, 20 Jan 2026 18:34:16 +0000 (19:34 +0100)]
autoreconf: Adapt to the on-disk situation after autopoint has run.
Reported in <https://savannah.gnu.org/support/?111273>.
* bin/autoreconf.in (autoreconf_current_directory): After invoking autopoint,
rerun aclocal. When doing so, pass extra options "-I m4" if the configure.ac
does not specify a macro dir.
Bruno Haible [Tue, 20 Jan 2026 16:52:17 +0000 (17:52 +0100)]
autoreconf: Invoke autopoint in more situations.
Reported in <https://savannah.gnu.org/support/?111272>.
* bin/autoreconf.in (autoreconf_current_directory): Invoke autopoint also when
the package uses AM_GNU_GETTEXT (without AM_GNU_GETTEXT_VERSION), AM_PO_SUBDIRS,
AM_ICONV, AC_LIB_LINKFLAGS, AC_LIB_HAVE_LINKFLAGS, AC_LIB_LINKFLAGS_FROM_LIBS,
or GUILE_FLAGS.
Jose E. Marchesi [Thu, 28 Aug 2025 19:30:16 +0000 (21:30 +0200)]
Support for the Algol 68 language
This patch adds support for the Algol 68 programming language to
Autoconf. It is based on the Algol 68 GCC front-end, which is
currently under development [1]. The front-end is temporarily hosted
in the sourceware forge until integration in GCC is completed [3].
Note that the GCC Algol 68 front-end is not yet integrated in the main
compiler, so it is developed and distributed off-tree. See
https://gcc.gnu.org/wiki/Algol68FrontEnd. Additional information
about the Algol 68 programming language, and how it is being evolved
by the GNU Algol 68 Working Group can be found at
https://algol68-lang.org.
Automake support for Algol 68 has been already pushed as of 2 February
2025.
Paul Eggert [Sat, 30 Aug 2025 21:51:43 +0000 (14:51 -0700)]
doc: improve sed doc
* src/autoconf.texi: Modernize description of sed limitations.
Prompted by a bug report by Daniel Locks in:
https://lists.gnu.org/r/bug-autoconf/2025-08/msg00001.html
Paul Eggert [Thu, 7 Aug 2025 20:50:53 +0000 (13:50 -0700)]
Port _AC_C_C99_TEST_MAIN to -Wc++-compat
Problem reported by Vincent Lefevre in:
https://lists.gnu.org/r/autoconf-patches/2025-08/msg00004.html
* lib/autoconf/c.m4 (_AC_C_C99_TEST_MAIN):
Don’t use malloc.
Paul Eggert [Thu, 7 Aug 2025 20:27:29 +0000 (13:27 -0700)]
Port _AC_C_C99_TEST_GLOBALS to -Wc++-compat
Problem reported by Vincent Lefevre in:
https://lists.gnu.org/r/autoconf-patches/2025-08/msg00004.html
* lib/autoconf/c.m4 (_AC_C_C99_TEST_GLOBALS): and → aND.
Vincent Lefevre [Thu, 7 Aug 2025 15:22:25 +0000 (17:22 +0200)]
Make _AC_C_C99_TEST_MAIN more robust with -Werror
The current code fails with gcc r16-2729-g0d276cd378e and
-Werror=discarded-qualifiers -Werror=write-strings
(the -Werror=write-strings is useful to check compatibility of
user code with C++, and the -Werror=discarded-qualifiers is an
upgrade of a default warning to an error). Since this is a test
for C99, we may assume that const is supported by the compiler,
and adding const makes the code more robust in this context.
Paul Eggert [Thu, 7 Aug 2025 16:03:21 +0000 (09:03 -0700)]
Port AC_C_CONST to GCC 16 -Wunused-but-set-variable
Problem reported by Vincent Lefevre in:
https://lists.gnu.org/r/autoconf-patches/2025-08/msg00001.html
https://lists.gnu.org/r/autoconf-patches/2025-08/msg00002.html
* lib/autoconf/c.m4 (AC_C_CONST): Combine two tests, use
the set variable, and don’t try to add 1 to a null pointer.
Paul Eggert [Sun, 27 Jul 2025 17:29:42 +0000 (10:29 -0700)]
doc: update cd info
* doc/autoconf.texi: Modernize and update description
of cd gotchas. Prompted by email from Farblos in:
https://lists.gnu.org/r/autoconf/2025-07/msg00004.html
Paul Eggert [Fri, 18 Jul 2025 18:00:17 +0000 (11:00 -0700)]
doc: omit confusing space before paren
* doc/autoconf.texi: Set txidefnamenospace to avoid confusing spaces.
Problem reported by Gavin Smith in:
https://lists.gnu.org/r/autoconf/2025-07/msg00000.html
Paul Eggert [Wed, 25 Jun 2025 18:28:24 +0000 (11:28 -0700)]
Document s/a/\n/ etc
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/autoconf-patches/2025-06/msg00001.html
* doc/autoconf.texi (Limitations of Usual Tools):
Also mention escapes in replacement strings.
While we’re at it, update -e and -f concatenation doc.
Bruno Haible [Mon, 26 May 2025 13:17:57 +0000 (15:17 +0200)]
Fix trap quoting (regression 2024-08-04).
* lib/autoconf/general.m4 (_AC_INIT_PREPARE): Emit functions ac_cache_dump,
ac_dump_debugging_info. In the trap command, invoke ac_dump_debugging_info.
(AC_CACHE_SAVE): Invoke ac_cache_dump instead of expanding _AC_CACHE_DUMP a
second time.
Bruno Haible [Sat, 24 May 2025 10:22:28 +0000 (12:22 +0200)]
AC_CHECK_DECL now ignores future Darwin functions
* lib/autoconf/general.m4 (_AC_UNDECLARED_BUILTIN):
Use shorter diagnostic, to be consistent with other changes.
(_AC_FUTURE_DARWIN): New macro.
(AC_CHECK_DECL): Require per-language _AC_FUTURE_DARWIN.
Use $ac_c_future_darwin_options alongside with
$ac_c_undeclared_builtin_options.
* NEWS: Mention the fix. Co-authored-by: Paul Eggert <eggert@cs.ucla.edu>
Paul Eggert [Fri, 18 Apr 2025 21:01:38 +0000 (14:01 -0700)]
Avoid grep in minimal configure
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE):
Use ‘sed -n '$='’ instead of ‘grep -c’, since these
are the only uses of grep in a minimal ‘configure’
and we are already using sed elsewhere.
Paul Eggert [Thu, 17 Apr 2025 08:08:52 +0000 (01:08 -0700)]
Document that 'configure' needs awk etc
Problem reported by Simon Josefsson in:
https://lists.gnu.org/r/bug-gnulib/2025-04/msg00127.html
* doc/install.texi (Installation Prerequisites): New section.
Paul Eggert [Mon, 7 Apr 2025 18:01:59 +0000 (11:01 -0700)]
Fix AC_DEFINE_UNQUOTED regexp
Problem reported by Eric Blake in:
https://savannah.gnu.org/support/?111221
* lib/autoconf/general.m4 (_AC_DEFINE_UNQUOTED): Fix typo that
caused us to not use a here-document in some cases when we should.
* tests/torture.at (Substitute and define special characters):
Test for the bug.
Paul Eggert [Sun, 9 Feb 2025 18:00:11 +0000 (10:00 -0800)]
Port install_aux_file to OS/2
* bin/autoreconf.in (install_aux_file): Port to OS/2,
which does not allow file name operations on open files.
Problem reported by KO Myung-Hun in:
https://lists.gnu.org/r/autoconf-patches/2025-02/msg00001.html
Yann E. MORIN [Wed, 29 Jan 2025 22:29:18 +0000 (15:29 -0700)]
tests/local.mk: fix dependencies for generating the wrapper template
Generating the tests wrapper template currently depends on the
dependencies needed for the frozen lib/m4sugar/m4sh.m4f. However,
it also requires that frozen sugar to actually be generated, or the
build will fail if it is not (or at least if it is in the process of
being generated).
Change the dependency to actually depend on the generated file, rather
than on its dependencies.
This kind of failure has been noticed on highly parallel builds on very
loaded machines.
Markus Mützel [Sun, 5 Jan 2025 18:14:19 +0000 (18:14 +0000)]
Keep "-lmingwex" and "-lmoldname" in linker flags for MinGW
It is needed when building Octave targeting Windows. Without it, the
implementation of "casin" from the Windows runtime is used instead of
the replacement from MinGW-w64. That means that results for the
"casin" function are wrong without that change.
* lib/autoconf/fortran.m4: Do not remove "-lmingwex" or "-lmoldname"
from the linker flags when targeting MinGW. Removing "-lmingwex" causes
an incorrect linker resolution for functions like "casin" for projects
that consist of Fortran and C++ sources. Removing "-lmoldname" causes
issues for Fortran projects that try to use POSIX-like C functions
without a '_' symbol prefix when targeting MinGW.
Paul Eggert [Wed, 1 Jan 2025 21:30:26 +0000 (13:30 -0800)]
Fix test failure on macOS 15.1.1
Problem reported by Sean Denny in:
https://lists.gnu.org/r/bug-autoconf/2024-12/msg00001.html
* doc/autoconf.texi (Limitations of Builtins):
Document the macOS sh bug.
* tests/base.at (AC_CACHE_CHECK):
* tests/local.at: Use test -ot rather than ls -t, as POSIX
requires the former to work reliably, but does not require the
latter (POSIX does not require a stable sort for ls -t).
Somewhat ironically, this should work around the macOS bug
because the use of its buggy test -ot should increase the
timestamp resolution to 1 s.
Paul Eggert [Sun, 17 Nov 2024 17:00:49 +0000 (09:00 -0800)]
Further improvements for C23 tests
Problems reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-11/msg00140.html
https://lists.gnu.org/r/bug-gnulib/2024-11/msg00141.html
https://lists.gnu.org/r/bug-gnulib/2024-11/msg00145.html
* lib/autoconf/c.m4 (_AC_C_C23_TEST_GLOBALS):
In use_u8, add parens to pacify GCC 15 -Wbool-compare,
and use sizeof to make it a conforming integer constant expression.
Do not test stdbit.h, as some current sort-of-C23 environments
lack it and want to use options like -std=gnu23 on such platforms.
Use null_pointer to pacify GCC -Wunused-const-variable.
Paul Eggert [Fri, 1 Nov 2024 01:29:54 +0000 (18:29 -0700)]
Fix use of $3 in _AC_FUNC_MALLOC_IF etc
Use m4_default in case $3 is omitted.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-10/msg00284.html
Also, use AS_CASE to defend against $3 containing macros
that might be expaned.
Paul Eggert [Tue, 29 Oct 2024 20:32:25 +0000 (13:32 -0700)]
Match Gnulib INSTALL for quoting
The manual was already using curved single quotes, so we
might as well use curved double quotes and en and em dashes too.
* doc/local.mk (AM_MAKEINFOFLAGS): Add ASCII_DASHES_AND_QUOTES=0,
CHECK_NORMAL_MENU_STRUCTURE=1.
* Makefile.am ($(srcdir)/INSTALL): Also use AM_MAKEINFOFLAGS.
This matches Gnulib INSTALL’s quoting practice.
Paul Eggert [Tue, 29 Oct 2024 04:27:35 +0000 (21:27 -0700)]
Merge from Gnulib for malloc, realloc checking
* lib/autoconf/functions.m4 (_AC_FUNC_MALLOC_IF, _AC_FUNC_REALLOC_IF):
Add 3rd argument for cross-guessing; all callers changed.
Use ‘volatile’ so that compilers don’t second-guess.
Also guess yes on gnu*, midipix*, midnightbsd*.
Paul Eggert [Sun, 27 Oct 2024 00:17:00 +0000 (17:17 -0700)]
Go back to using “POSIX” not “Posix”
In my Mon Oct 11 20:21:33 2004 +0000 commit when I standardized the
spelling of various acronyms in documentation and comments I spelled
it “Posix”. However, it seems that “POSIX” has won out in practice
(including my own practice!), so let’s change it back to “POSIX”.
Paul Eggert [Mon, 21 Oct 2024 17:49:30 +0000 (10:49 -0700)]
Avoid some echo '...\...' gotchas
Problem with AC_SUBST_FILE reported by Dylan Palauzov in:
https://lists.gnu.org/r/bug-autoconf/2024-10/msg00018.html
The other problems I found by a manual scan.
* bootstrap: Use printf, not echo.
* doc/autoconf.texi (Polymorphic Variables):
* lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT):
* lib/autoconf/general.m4 (_AC_CANONICAL_SPLIT):
* lib/autoconf/status.m4 (_AC_SUBST_FILES):
* lib/autotest/general.m4 (AT_FINISH):
Use AS_ECHO, not echo.
Paul Eggert [Sat, 28 Sep 2024 23:27:16 +0000 (16:27 -0700)]
Mention autogen.sh sooner in doc
* doc/install.texi (Basic Installation):
Be more explicit about bootstrapping scripts
not named ‘bootstrap’. Problem reported by Gavin Smith in:
https://lists.gnu.org/r/autoconf/2024-09/msg00003.html
Paul Eggert [Sun, 22 Sep 2024 05:56:14 +0000 (22:56 -0700)]
doc: remove IRIX from manual
* doc/autoconf.texi: Remove references to IRIX, except for the
obsolete macro AC_IRIX_SUN. IRIX has not been supported by its
vendor since 2013, and is no longer a documented Autoconf target.
Paul Eggert [Wed, 7 Aug 2024 00:57:32 +0000 (17:57 -0700)]
Stop documenting Tru64
* doc/autoconf.texi: Simplify manual by removing coverage of
Ultrix, OSF/1, Tru64, and DEC Alpha. HP stopped supporting the
last release at the end of 2012, so this platform is long dead.
(Long Lines in Makefiles, Tru64 Directory Magic): Remove.
Paul Eggert [Tue, 6 Aug 2024 17:13:05 +0000 (10:13 -0700)]
Improve coverage of ‘echo’ in manual
In manual, prefer AS_ECHO or printf instead of echo,
when that might make a difference.
Don’t use ‘date >timestamp’, to avoid spurious diffs.
* doc/autoconf.texi (Notices): No need to worry any more about
RCS or CVS being used to maintain Autoconf.
(Preset Output Variables): Say that ECHO_N etc. are obsolete.
(Automatic Remaking): Remove obsolescent mention of CVS.
(AS_ECHO): Mention that AS_ECHO expands to something involving “'”,
and how to work around this (rare) issue.
(Shell Substitutions, Slashes, Limitations of Builtins): Omit
no-longer-relevant discussion about ancient shell bugs that
involved a lot of ‘echo’s that would otherwise need to be
replaced.
(Limitations of Builtins): Don’t mention ‘echo "x$word"’ trick, as
it doesn’t resist backslashes. Just use printf. Expand on
discussion of ‘echo’ options. Say that even modernish shells (e.g.,
ksh93 on OmniOS) sometimes screw up with here-documents.
(Making testsuite Scripts): Simplify $(srcdir)/package.m4
rule by using printf instead of echo, and defend against
some shell metacharacters in $(srcdir).
Paul Eggert [Tue, 6 Aug 2024 17:00:26 +0000 (10:00 -0700)]
More defense against bad echo
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS)
(_AC_ARG_VAR_VALIDATE):
Defend against ‘echo’ interpreting ‘\’ or leading ‘-’.
(_AC_EVAL, _AC_EVAL_STDERR): Add to comment yet another reason
that these macros are obsolete and should be removed. There’s no
point trying to change them as that’s more likely to hurt than
help the (zero?) callers who still use them.
Paul Eggert [Tue, 6 Aug 2024 15:06:33 +0000 (08:06 -0700)]
Allow shell metachars in CONFIG_STATUS
* lib/autoconf/general.m4 (_AC_INIT_DEFAULTS, _AC_INIT_PREPARE):
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE)
(_AC_OUTPUT_FILE, _AC_OUTPUT_HEADERS_PREPARE, AC_OUTPUT)
(_AC_OUTPUT_CONFIG_STATUS):
Work even if $CONFIG_STATUS contains shell metacharacters,
leading ‘-’, or no ‘/’.
Paul Eggert [Tue, 6 Aug 2024 06:09:58 +0000 (23:09 -0700)]
Support more special chars in $(LIBDIR) etc
* lib/autoconf/libs.m4 (_AC_PATH_X_XMKMF):
* lib/autoconf/programs.m4 (AC_PROG_MAKE_SET):
Allow more special characters in ‘make’ macros like LIBDIR and MAKE.