]> git.ipfire.org Git - thirdparty/autoconf.git/log
thirdparty/autoconf.git
44 hours agoautoheader: preserve hand-written template files master
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.

Fixes <https://savannah.gnu.org/support/index.php?111388>.

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.

7 days agoUpdate documentation for building Autoconf from a Git checkout.
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.

2 weeks agoGo: do not clobber GOFLAGS in AC_PROG_GO (sr #111383)
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.

2 weeks agoAlgol68: do not clobber A68FLAGS in AC_PROG_A68 (sr #111382)
Jose E. Marchesi [Mon, 9 Feb 2026 14:18:35 +0000 (09:18 -0500)] 
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.

3 weeks agoAC_PROG_LEX: Be compatible with Solaris 10 lex’s handling of C++.
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.

3 weeks agotests: AC_C_FLEXIBLE_ARRAY_MEMBER result can vary between C and C++.
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.

sr #111380

3 weeks agoAutoconf 2.72.90 (beta test 1 for Autoconf 2.73). v2.72.90
Zack Weinberg [Tue, 3 Feb 2026 19:38:59 +0000 (14:38 -0500)] 
Autoconf 2.72.90 (beta test 1 for Autoconf 2.73).

3 weeks agomaint.mk: remove overquotation in ‘announcement’ rule
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.

3 weeks agoNEWS: Briefly mention a few more improvements.
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.

3 weeks agofetch.pl: get GNU standards documents from gnulib
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.

3 weeks agosyntax-check: avoid unsigned_* false positive on maint.mk
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.

3 weeks agoautoconf.texi: typo fix
Zack Weinberg [Tue, 3 Feb 2026 16:30:53 +0000 (11:30 -0500)] 
autoconf.texi: typo fix

‘the the’ -> ‘the’ in one place.  Caught by ‘make syntax-check’.

3 weeks agomaint.mk: fix tab/space usage in release-prep script
Zack Weinberg [Tue, 3 Feb 2026 16:26:58 +0000 (11:26 -0500)] 
maint.mk: fix tab/space usage in release-prep script

This makes the ‘makefile_TAB_only_indentation’ syntax check happy.

3 weeks agocfg.mk: update old_NEWS_hash
Zack Weinberg [Tue, 3 Feb 2026 16:25:12 +0000 (11:25 -0500)] 
cfg.mk: update old_NEWS_hash

Commit c3705f11bc0f1796836cddacfcd97e9f7e243563 modified the copyright
dates at the bottom of NEWS but did not update old_NEWS_hash.

3 weeks agosyntax-check: avoid fsf_postal false positive on maint.mk
Zack Weinberg [Tue, 3 Feb 2026 16:18:48 +0000 (11:18 -0500)] 
syntax-check: avoid fsf_postal false positive on maint.mk

* maint.mk (sc_fsf_postal): Adjust ‘prohibit’ regex to not match itself.

3 weeks agoUpdate COPYING from https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
Zack Weinberg [Tue, 3 Feb 2026 16:15:02 +0000 (11:15 -0500)] 
Update COPYING from https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

Our copy still mentioned the FSF’s old postal mail address.

3 weeks agomake fetch
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.)

3 weeks agomaint: Suggest to use the savannah tracker for bug reports.
Bruno Haible [Tue, 3 Feb 2026 10:37:28 +0000 (11:37 +0100)] 
maint: Suggest to use the savannah tracker for bug reports.

* bin/autoconf.in ($help): Mention the savannah tracker as first bug
reporting option.
* bin/autoheader.in ($help): Likewise.
* bin/autom4te.in ($help): Likewise.
* bin/autoreconf.in ($help): Likewise.
* bin/autoscan.in ($help): Likewise.
* bin/autoupdate.in ($help): Likewise.
* bin/ifnames.in ($help): Likewise.

4 weeks agoMention strchr issues in NEWS
Paul Eggert [Tue, 27 Jan 2026 23:16:09 +0000 (15:16 -0800)] 
Mention strchr issues in NEWS

* NEWS: Mention problems with strchr-like functions in C23.

4 weeks agoautoreconf: don’t fail if gtkdocize is unavailable (#110503)
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.

4 weeks agoautoreconf: require word boundaries when grepping for macros (#111271)
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.

4 weeks agoIgnore target feature flags in _AC_FC_LIBRARY_LDFLAGS (#111353)
Jan André Reuter [Wed, 3 Dec 2025 11:59:43 +0000 (12:59 +0100)] 
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’.

4 weeks agodoc: cross-reference m4 manual for regex syntax (#111095)
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.

4 weeks agoAvoid trailing whitespace in config.h
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.

4 weeks agoRename version.m4 to autoconf_version.m4.
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.

4 weeks agolib/autom4te.in: Update Autoreconf-preselections.
Zack Weinberg [Mon, 26 Jan 2026 20:10:12 +0000 (15:10 -0500)] 
lib/autom4te.in: Update Autoreconf-preselections.

It looks like the trace list in autoreconf proper was updated several
times without keeping this in sync.

4 weeks agoautoreconf: Adapt to the on-disk situation after autopoint has run.
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.

4 weeks agoautoreconf: Invoke autopoint in more situations.
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.

4 weeks agoMove more code out of shell traps into shell functions.
Zack Weinberg [Tue, 27 May 2025 18:26:18 +0000 (14:26 -0400)] 
Move more code out of shell traps into shell functions.

Follow-up on 416b8f50c9bd4e38f9bc48b946505d2a18f6b1fd.

* lib/autoconf/general.m4 (_AC_INIT_PREPARE): Emit function ac_exit_trap,
  move remaining code from the 'trap 0' command to ac_exit_trap.

6 weeks agoFix quoting problem in Solaris commentary
Paul Eggert [Fri, 9 Jan 2026 22:10:12 +0000 (14:10 -0800)] 
Fix quoting problem in Solaris commentary

Problem reported by Nick Bowler in:
https://lists.gnu.org/r/bug-autoconf/2026-01/msg00001.html

7 weeks agomaint: update all copyright dates via "make update-copyright"
Paul Eggert [Thu, 1 Jan 2026 20:56:51 +0000 (12:56 -0800)] 
maint: update all copyright dates via "make update-copyright"

2 months agoUpdate Solaris commentary
Paul Eggert [Sat, 13 Dec 2025 06:25:49 +0000 (22:25 -0800)] 
Update Solaris commentary

3 months agoFix bug in Fortran implicit int handling
Christian Feld [Thu, 20 Nov 2025 16:14:01 +0000 (08:14 -0800)] 
Fix bug in Fortran implicit int handling

* lib/autoconf/fortran.m4 (_AC_FC_IMPLICIT_NONE):
Fix typo in argument numbering.
Copyright-paperwork-exempt: yes

4 months agoSupport for the Algol 68 language
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.

[1] https://gcc.gnu.org/wiki/Algol68FrontEnd
[2] https://inbox.sourceware.org/gcc-patches/20250101020952.18404-1-jose.marchesi@oracle.com/T/#t
[3] https://forge.sourceforge.org/gcc/gcc-a68

    Add support for the Algol68 programming language.

    * lib/autoconf/a68.m4: New file.
    * lib/autoconf/autoconf.m4: Include autoconf/a68.m4.
    * lib/autoconf/Makefile.am (dist_autoconflib_DATA): Add a68.m4.
    * lib/freeze.mk (autoconf_m4f_dependencies): Add
    $(src_libdir)/autoconf/a68.m4.
    * doc/autoconf.texi: Rebuild menus.
    (Preset Output Variables): Mention Algol 68.  Document A68FLAGS.
    (Algol 68 Compiler): New subsection.
    (Language Choice): Mention Algol 68.
    (Generating Sources): Likewise.
    (Running the Preprocessor): Likewise.
    * tests/a68.at: New file.
    * tests/suite.at: Include a68.at.
    * tests/local.at (_AT_CHECK_ENV): Add A68 and A68FLAGS.
    * NEWS: Update.

4 months agodoc: fix AC_LANG_PROGRAM signature
Basil L. Contovounesios [Tue, 14 Oct 2025 06:50:13 +0000 (08:50 +0200)] 
doc: fix AC_LANG_PROGRAM signature

* doc/autoconf.texi (Generating Sources): Mark AC_LANG_PROGRAM
arguments as optional to match its definition and common usage.

Copyright-paperwork-exempt: yes

5 months agodoc: improve sed doc
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

6 months agoPort _AC_C_C99_TEST_MAIN to -Wc++-compat
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.

6 months agoPort _AC_C_C99_TEST_GLOBALS to -Wc++-compat
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.

6 months agoMake _AC_C_C99_TEST_MAIN more robust with -Werror
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.

Copyright-paperwork-exempt: yes

6 months agoPort AC_C_CONST to GCC 16 -Wunused-but-set-variable
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.

7 months agoQuote $OLDPWD in doc
Paul Eggert [Mon, 28 Jul 2025 15:22:12 +0000 (08:22 -0700)] 
Quote $OLDPWD in doc

Problem reported by Florian Weimer in:
https://lists.gnu.org/r/autoconf/2025-07/msg00008.html

7 months agodoc: update cd info
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

7 months agodoc: omit confusing space before paren
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

8 months agoDocument s/a/\n/ etc
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.

9 months agoFix trap quoting (regression 2024-08-04).
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.

9 months agoAC_CHECK_DECL now ignores future Darwin functions
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>
9 months agoMore shell patterns to avoid
Paul Eggert [Tue, 6 May 2025 12:04:04 +0000 (05:04 -0700)] 
More shell patterns to avoid

* doc/autoconf.texi (Shell Pattern Matching):
Improve on the recent discussion about brace expansion.

9 months agodoc: Document another pitfall of shell pattern matching.
Bruno Haible [Tue, 6 May 2025 07:57:56 +0000 (09:57 +0200)] 
doc: Document another pitfall of shell pattern matching.

* doc/autoconf.texi (Shell Pattern Matching): Mention non-portability of
patterns with braces.

10 months agoFall back on busybox awk
Paul Eggert [Sun, 20 Apr 2025 17:36:19 +0000 (10:36 -0700)] 
Fall back on busybox awk

* lib/autoconf/programs.m4 (AC_PROG_AWK):
Fall back 'busybox awk' of none of the other awks work.

10 months agoAvoid grep in minimal configure
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.

10 months agoconfig.status now checks for missing awk
Paul Eggert [Fri, 18 Apr 2025 20:32:03 +0000 (13:32 -0700)] 
config.status now checks for missing awk

* lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS):
Diagnose missing awk and fail, rather than blundering on.

10 months agoImprove list of 'configure' prereqs
Paul Eggert [Thu, 17 Apr 2025 19:14:41 +0000 (12:14 -0700)] 
Improve list of 'configure' prereqs

* doc/install.texi (Installation Prerequisites):
Use a more-accurate list.

10 months agoDocument that 'configure' needs awk etc
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.

10 months agoFix AC_DEFINE_UNQUOTED regexp
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.

12 months agoPort install_aux_file to OS/2
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

12 months agoFix dependency issue for autoscan.list
Paul Eggert [Thu, 30 Jan 2025 04:10:09 +0000 (20:10 -0800)] 
Fix dependency issue for autoscan.list

* lib/local.mk (lib/autoscan/autoscan.list):
Depend on lib/autoconf/autoconf.m4f, not merely on its dependencies.

12 months agotests/local.mk: fix dependencies for generating the wrapper template
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.

Copyright-paperwork-exempt: yes

12 months agoDocument AIX 7.3 find exec + bug
Paul Eggert [Thu, 30 Jan 2025 04:02:25 +0000 (20:02 -0800)] 
Document AIX 7.3 find exec + bug

* doc/autoconf.texi (Limitations of Usual Tools):
Document AIX 7.3 bug with exit status of ‘find ... -exec ... +’.

12 months agoUpdate doc for POSIX, OS versions
Paul Eggert [Sun, 19 Jan 2025 18:14:31 +0000 (10:14 -0800)] 
Update doc for POSIX, OS versions

* doc/autoconf.texi: Some updates for newer POSIX and OS versions.
Omit no-longer-relevant version numbers.

13 months agoPort better to NVHPC
Paul Eggert [Thu, 16 Jan 2025 19:24:12 +0000 (11:24 -0800)] 
Port better to NVHPC

See <https://savannah.gnu.org/support/?111172>.
* lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS):
Ignore -l options with embedded '='.

13 months agoKeep "-lmingwex" and "-lmoldname" in linker flags for MinGW
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.

13 months agoAC_USE_SYSTEM_EXTENSIONS: Set _COSMO_SOURCE
Jack Kelly [Sun, 5 Jan 2025 06:19:09 +0000 (22:19 -0800)] 
AC_USE_SYSTEM_EXTENSIONS: Set _COSMO_SOURCE

This enables extensions when compiling with Cosmopolitan Libc.
https://justine.lol/cosmopolitan/
* lib/autoconf/specific.m4: Define _COSMO_SOURCE.

13 months agoFix test failure on macOS 15.1.1
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.

13 months agomaint: update all copyright dates via "make update-copyright"
Paul Eggert [Wed, 1 Jan 2025 20:24:04 +0000 (12:24 -0800)] 
maint: update all copyright dates via "make update-copyright"

13 months agoUpdate timestamp doc
Paul Eggert [Sun, 29 Dec 2024 00:04:09 +0000 (16:04 -0800)] 
Update timestamp doc

* doc/autoconf.texi (Limitations of Usual Tools)
(Timestamps and Make): Modernize discussion a bit,
and give a downside of the GNU make approach.

14 months agodoc: mention tr issues in multi-byte locales
Paul Eggert [Mon, 2 Dec 2024 20:47:54 +0000 (12:47 -0800)] 
doc: mention tr issues in multi-byte locales

* doc/autoconf.texi (tr): Mention multi-byte issues.

14 months agobootstrap: Disallow use of undefined shell variables, if possible.
R. Diez [Mon, 2 Dec 2024 16:01:25 +0000 (11:01 -0500)] 
bootstrap: Disallow use of undefined shell variables, if possible.

15 months agoFurther improvements for C23 tests
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.

15 months agoFix comment typo re malloc
Paul Eggert [Tue, 5 Nov 2024 22:46:53 +0000 (14:46 -0800)] 
Fix comment typo re malloc

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-11/msg00048.html

15 months agoFix use of $3 in _AC_FUNC_MALLOC_IF etc
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.

15 months agoAC_FUNC_MALLOC now guesses yes when cross-compiling
Bruno Haible [Fri, 1 Nov 2024 00:19:21 +0000 (17:19 -0700)] 
AC_FUNC_MALLOC now guesses yes when cross-compiling

The only platform that had this problem was native Windows,
and MSVC's malloc sets errno since 2015 at least.

* lib/autoconf/functions.m4 (AC_FUNC_MALLOC): Guess yes when
cross-compiling.

15 months agoSay malloc/realloc cache vars can have spaces
Paul Eggert [Fri, 1 Nov 2024 00:17:11 +0000 (17:17 -0700)] 
Say malloc/realloc cache vars can have spaces

15 months ago* functions.m4: Fix typos in previous change.
Paul Eggert [Tue, 29 Oct 2024 23:27:45 +0000 (16:27 -0700)] 
* functions.m4: Fix typos in previous change.

15 months agoUpdate ‘volatile’ doc for C23
Paul Eggert [Tue, 29 Oct 2024 20:37:19 +0000 (13:37 -0700)] 
Update ‘volatile’ doc for C23

* doc/autoconf.texi (Volatile Objects): Update for C23.

15 months agoMatch Gnulib INSTALL for quoting
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.

15 months agoMerge from Gnulib for malloc, realloc checking
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*.

16 months agoGo back to using “POSIX” not “Posix”
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”.

16 months agoRemove some doc for no-longer-used systems; update URLs
Paul Eggert [Sun, 27 Oct 2024 00:00:31 +0000 (17:00 -0700)] 
Remove some doc for no-longer-used systems; update URLs

16 months agoDocument realloc (p, 0) gotchas
Paul Eggert [Sat, 26 Oct 2024 23:29:49 +0000 (16:29 -0700)] 
Document realloc (p, 0) gotchas

* doc/autoconf.texi (Function Portability, Particular Functions):
Don’t recommend realloc-gnu as it doesn’t (and probably shouldn’t)
enforce glibc compatibility.  Document variance in glibc behavior.

16 months agoAvoid some echo '...\...' gotchas
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.

16 months agoMention autogen.sh sooner in doc
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

17 months agodoc: remove IRIX from manual
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.

17 months agoGive a URL for COPYING.EXCEPTION in notices
Paul Eggert [Fri, 6 Sep 2024 01:19:36 +0000 (18:19 -0700)] 
Give a URL for COPYING.EXCEPTION in notices

This can be useful if the file is copied elsewhere
but the COPYING.EXCEPTION file is not present at the destination.

18 months agoStop documenting Tru64
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.

18 months agoImprove coverage of ‘echo’ in manual
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).

18 months agoMore defense against bad echo
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.

18 months agoAllow shell metachars in CONFIG_STATUS
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 ‘/’.

18 months agoSupport more special chars in $(LIBDIR) etc
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.

18 months agoMinor AC_FUNC_SELECT_ARGTYPES speedups
Paul Eggert [Tue, 6 Aug 2024 06:05:53 +0000 (23:05 -0700)] 
Minor AC_FUNC_SELECT_ARGTYPES speedups

* lib/autoconf/functions.m4 (AC_FUNC_SELECT_ARGTYPES):
Don’t use ‘sed 's/\*/\*/g'’, which is a no-op.
Don’t use ‘echo’ either.

18 months agoDon’t mishandle ‘\’ in VERSION
Paul Eggert [Tue, 6 Aug 2024 03:43:36 +0000 (20:43 -0700)] 
Don’t mishandle ‘\’ in VERSION

This is minor, it’s just allowing more chars (though not all)
in $(VERSION).
* Makefile.am (edit, top_srcdir.version, dist-hook)
(check-coverage-report):
* man/local.mk (VERSION):
Work even if VERSION contains ‘\’.

18 months agoFollow own advice about \ in shell double-quoted strings
Paul Eggert [Sun, 4 Aug 2024 23:55:05 +0000 (16:55 -0700)] 
Follow own advice about \ in shell double-quoted strings

* lib/autoconf/headers.m4 (_AC_HEADERS_EXPANSION):
* lib/m4sugar/m4sh.m4 (AS_ECHO):
Go back to using '%s\n' instead of "%s\n".
(AS_VAR_GET): Work around the quoting problem by using printf
directly with "%s\\n" instead of AS_ECHO; this is safe now that we
assume printf.

18 months agoFix typos in previous $@ doc change
Paul Eggert [Sat, 3 Aug 2024 15:44:18 +0000 (08:44 -0700)] 
Fix typos in previous $@ doc change

Problem reported in <https://savannah.gnu.org/support/?111102>.

18 months agoPort to AIX 7.2 ksh93
Paul Eggert [Sat, 3 Aug 2024 03:42:57 +0000 (20:42 -0700)] 
Port to AIX 7.2 ksh93

Problem reported in <https://savannah.gnu.org/support/?111102>.
* lib/autotest/general.m4:
* lib/m4sugar/m4sh.m4 (_AS_REEXEC_WITH_SHELL):
* tests/wrapper.as:
Port to AIX 7.2 ksh93, whidh mishandles ${1+"$@"}, by not using
that construct.

19 months agoFix syntax-check complaints
Zack Weinberg [Wed, 17 Jul 2024 20:26:26 +0000 (16:26 -0400)] 
Fix syntax-check complaints

One complaint is correct: house style is “file system” not “filesystem.”

The other one is bogus: sc_two_space_separator_in_usage gets a false
positive on gendocs.sh, which isn’t even our code.  I tried to exclude
just that file using exclude_file_name_regexp but it didn’t immediately
work and my patience for debugging maint.mk is nil.

19 months agoAdjust set size correctly in all cases of m4_set_add_all.
Zack Weinberg [Mon, 8 Jul 2024 18:26:11 +0000 (14:26 -0400)] 
Adjust set size correctly in all cases of m4_set_add_all.

Both the recursive and the iterative versions of m4_set_add_all had a
bug where they did not update the set size correctly if the set
contained tombstones.  I guess m4_set_remove isn’t used that often.
(I found this bug by accident while investigating an unrelated thing.)

The root cause of the bug was that in the tombstone case we had two
different layers quarreling over who got the last word on the size of
the set: m4_set_add, called for each value argument, was updating the
set size for each actual addition, and then the outer expansion of
m4_set_add_all was clobbering those updates with a calculation based
on the number of times the loop evaluated to a ‘-’ character, which
in the tombstone case was always zero.

The fix is to not mess with the set size on each actual addition,
relying on the outer calculation in all cases.  Most of the volume
of the patch is refactoring to eliminate all the duplicate copies of
the “add this element only if it isn’t already there” logic which were
confusing the issue.

I also made m4_set_add_all not go into an infinite loop if invoked
with fewer than two arguments.  Possibly it should error out in this
case instead of silently doing nothing, but I don’t think it matters
very much.

* lib/m4sugar/m4sugar.m4 (_m4_set_add, _m4_set_add_clean):
  New macros, factoring out common “add element to set” logic.
  (m4_set_add): Redefine using _m4_set_add.
  (_m4_set_add_all): Rename to _m4_set_add_all_clean; use _m4_set_add_clean.
  (_m4_set_add_check): Use _m4_set_add, not m4_set_add; emit a string
  of dashes as _m4_set_add_all_clean does.
  (m4_set_add_all): Update to match renamed _m4_set_add_all_clean.
  Do nothing if invoked with fewer than two arguments.

* lib/m4sugar/foreach.m4: Define variants of _m4_set_add_all_clean and
  _m4_set_add_all_check, matching the behavior of the definitions in
  m4sugar.m4.  Do not define m4_set_add_all here.

* tests/m4sugar.at (m4_set): Add more tests of interaction among
  m4_set_add_all, m4_set_remove, and m4_set_size.

19 months agoQuote separators in foreach.m4 version of m4_joinall.
Zack Weinberg [Mon, 8 Jul 2024 15:22:44 +0000 (11:22 -0400)] 
Quote separators in foreach.m4 version of m4_joinall.

The entire output of m4_joinall is supposed to be quoted, including
separators, but the foreach.m4 implementation (used with M4 1.4.x)
was missing some quotes, and we didn’t notice because the test suite
wasn’t thorough enough.  Fix.

* lib/m4sugar/foreach.m4 (m4_joinall): Quote each separator as it’s
  emitted.
* tests/m4sugar.at (m4_join test): Expand tests of both m4_join and
  m4_joinall.

19 months agoAdd a FLAGS argument to AT_CHECK_M4SUGAR_TEXT.
Zack Weinberg [Mon, 8 Jul 2024 18:43:53 +0000 (14:43 -0400)] 
Add a FLAGS argument to AT_CHECK_M4SUGAR_TEXT.

This is not actually used within the testsuite at present, but is
handy for troubleshooting m4sugar tests.  For instance, you can pass
-v to a specific autom4te invocation and get told the underlying m4
invocation.

* tests/m4sugar.at (AT_CHECK_M4SUGAR_TEXT): Add fourth argument
  FLAGS which specifies additional command line arguments to pass to
  autom4te.

19 months agoEmit compat shims less often for old AS_ECHO implementation details.
Zack Weinberg [Mon, 24 Jun 2024 17:51:07 +0000 (13:51 -0400)] 
Emit compat shims less often for old AS_ECHO implementation details.

The shell variables $as_echo and $as_echo_n and the substitution
variables @ECHO_C@, @ECHO_N@, and @ECHO_T@ are implementation
details of the old implementation of AS_ECHO and AS_ECHO_N
(2.69-era; before the switch to use ‘printf’).  We continue
to provide them for compatibility with various third-party macros and
Makefiles that used them, even though, as far as I can tell, they were
never documented.  (Someone made ECHO_C etc. substitution variables on
purpose, though.)

For $as_echo and $as_echo_n, we can tell precisely when they are
needed, because all uses are exposed to M4 macro expansion.
Therefore, emit the necessary support code on first use and not
from AS_INIT.  As a side effect this means the -Wobsolete warning
only appears on the first use of each, which IMHO is polite.

For @ECHO_C@, @ECHO_N@, and @ECHO_T@, we have no way of knowing
whether a substitution variable is used, but we *do* know that
substitution variables are exclusively a configure.ac thing, so their
support code can be moved to general.m4 and emitted from AC_INIT
rather than from AS_INIT.

(It’s faintly possible that someone decided to use $ECHO_C in an
Autotest script but considering how rare it is for people to use
Autotest at all, or any other non-Autoconf application of M4sh,
I think we can worry about that when we hear about it.)

* lib/m4sugar/m4sh.m4 (_AS_ECHO_N_PREPARE): Removed.
  (AS_PREPARE, _AS_PREPARE): Don’t use _AS_ECHO_N_PREPARE.
  (_as_echo_var_prepare, _as_echo_n_var_prepare): New macros which
  emit the -Wobsolete warning and the support code for $as_echo and
  $as_echo_n respectively.
  (as_echo, as_echo_n): Move to bottom of the block that sets up
  the current implementation of AS_ECHO.  Invoke _as_echo_var_prepare
  and _as_echo_n_var_prepare, respectively, on first use.

* lib/autoconf/general.m4 (_AC_INIT_ECHO_N): New internal macro,
  contains the probe code that used to be in _AS_ECHO_N_PREPARE.
  AC_SUBSTs ECHO_C, ECHO_N, and ECHO_T.
  (AC_INIT): Don’t AC_SUBST ECHO_C, ECHO_N, and ECHO_T here.
  Invoke _AC_INIT_ECHO_N.

19 months agoPort AC_PROG_OBJC to RHEL 9
Bruno Haible [Tue, 16 Jul 2024 15:56:21 +0000 (15:56 +0000)] 
Port AC_PROG_OBJC to RHEL 9

* lib/autoconf/c.m4 (AC_PROG_OBJC): Search for gobjc before gcc.
* NEWS: Mention the change.

19 months agoDetect Android 5.0 strnlen bug
Paul Eggert [Tue, 16 Jul 2024 15:25:36 +0000 (08:25 -0700)] 
Detect Android 5.0 strnlen bug

This is useful for GNU Emacs, which still ports to that
old Android version.  The change here is imported from Gnulib.
* lib/autoconf/functions.m4 (AC_FUNC_STRNLEN):
Also detect Android 5.0 bug.  Use AC_COMPILE_IFELSE rather
than AC_CANONICAL_HOST for cross-compile test.