Commit Graph

6881 Commits

Author SHA1 Message Date
Jim Meyering
2e25d42eb2 tests: avoid an unwarranted test failure
* tests/autotest.at (parallel autotest and signal handling): This
test would consistently fail due to an exit status of 0. That was
considered failure because the test required a SIGHUP-indicating
exit status. However, an status of 0 is perfectly fine, too, so
accept that.
2023-03-26 22:08:02 -07:00
Jim Meyering
0b92bd72ca build: run "make fetch", which updated these:
Preparing to make a pre-release snapshot, update these:
* build-aux/announce-gen: Update from gnulib
* build-aux/gnupload: Likewise.
* build-aux/texinfo.tex: Update from texinfo.
2023-03-25 22:07:19 -07:00
Zack Weinberg
8db00aa848
Add experimental manifest.scm for testing Autoconf under guix shell.
‘guix shell’ is a utility for constructing isolated environments
for development; I’ve put together a “manifest” stating the
build and test requirements for autoconf, starting from a git
checkout.
2023-03-12 20:06:53 -04:00
Zack Weinberg
ddf21ca44a
bootstrap: Use an absolute path for ACBOOTDIR.
If we use a relative path for ACBOOTDIR, Automake can’t tell the
difference between Autoconf’s configure script’s aclocal.m4
inclusions (…/m4/*.m4) and the guts of Autoconf
itself (…/lib/autoconf/*.m4) so it puts both of them into
$(am__aclocal_m4_deps).  This would be harmless, except that the
guts-of-Autoconf files are named *relative to $ACBOOTDIR*, which
means Make can’t find them later.  And this is why a build from a
clean git checkout always starts by regenerating aclocal.m4 and
configure again.

Using an absolute path for ACBOOTDIR gives automake enough of a clue
what’s going on (see the heuristic circa 5500 of current automake.in,
commented “Some modified versions of autoconf don’t use frozen files…”)
for it to produce the same value for $(am__aclocal_m4) that it would
if we were running an installed Autoconf.
2023-03-12 19:39:47 -04:00
Zack Weinberg
d4566c84a1
Skip all Autotest parallelism tests if using Guix’s bash.
It is not clear to me why, but the “parallel autotest and signal
handling” test malfunctions if the active shell is Guix bash.  I don’t
think it’s worth investigating in detail, considering I intend to
reimplement parallel autotest using the same technique that Automake’s
parallel test driver uses, i.e. make -j, which should eliminate this
entire class of problems.
2023-03-12 19:08:03 -04:00
Zack Weinberg
e0681c50ac
Fix ‘make syntax-check’ complaints.
* cfg.mk (local-checks-to-skip): Add sc_unportable_grep_q, which has
  too many false positives to bother with; for instance, it triggers
  on autoconf.texi’s discussion of why grep -q is unportable, and on
  the code in maint.mk that implements the check!
  (old_NEWS_hash): Update for commit b751bf4949,
  which fixed spelling errors in old NEWS.

* doc/autoconf.texi: Remove a doubled word.
* lib/autoconf/programs.m4: Remove a space immediately before a tab.
* lib/m4sugar/m4sh.m4 (_AS_IF): Rephrase documentation to avoid saying
  “if IF-FALSE” which triggers the prohibit_doubled_word check.
2023-03-12 16:59:27 -04:00
Paul Eggert
beb6d82633 doc: improve AS_IF doc
* doc/autoconf.texi: Improve documentation of AS_IF, AS_CASE, etc.
Clarify the advice about when AS_IF is needed, and follow that
advice in examples.
2023-02-06 19:28:29 -08:00
Paul Eggert
ed36e97fa4 Update doc slightly for C23. 2023-02-05 21:51:20 -08:00
Paul Eggert
2a43cf6ab0 Clarify NEWS
* NEWS: Clarify recent items about AC_SYS_LARGEFILE_REQUIRED,
AC_SYS_YEAR2038_REQUIRED, AC_PROG_MKDIR_P. Reported by Bruno Haible in:
https://lists.gnu.org/r/bug-autoconf/2023-02/msg00005.html
2023-02-03 12:25:08 -08:00
Paul Eggert
e67c9ecda4 make fetch 2023-02-02 15:12:41 -08:00
Paul Eggert
a7e05c064d Improve year-2038 documentation
* NEWS, doc/autoconf.texi (System Services):
Improve documentation for behavior of largefile and year-2038 support.
Say that in the current implementation, year-2038 support
requires largefile support.  Say that year-2038 support
matters only for GNU/Linux glibc 2.34+ on 32-bit x86 and ARM.
Prefer brevity when this does not hurt understandability;
for example, prefer active to passive voice.
Prefer “wider” to “larger” when talking about the number of
bits in an integer, as this terminology is more standard.
Tone down the wording in warnings about enabling year-2038 support,
use similar wording in warnings about enabling largefile support,
and warn also about disabling largefile and year-2038 support.
No need for @emph.  Also mention rlim_t.
Be a bit more careful about saying “2 GiB” rather than “2 GB”.
Mention that a future version of Autoconf might change
AC_SYS_LARGEFILE to default to --enable-year2038, since
something has gotta happen before 2038.
Coalesce descriptions of --enable-largefile and --enable-year2038
to simplify documentation.  Mention that the only system where
AC_SYS_LARGEFILE changes CC is IRIX and that these systems
are obsolete.  Say that ‘stat’ can fail due to time_t
overflow.  Say that you can’t portably print time_t with %ld.
Say that binary compatibilty problems also can occur when one
library is linking to amother; it’s not just apps vs libraries.
Mention the possibility of modifying libraries to support both
32- and 64-bit interfaces.  Warn more consistently about
ABI compatibility issues, but put the bulk of this text
in one location that the other locations refer to.
2023-02-02 15:12:41 -08:00
Paul Eggert
9d2637467d Restore lib/Autom4te/FileUtils.pm local fixes
These were lost by 'make fetch'.
2023-01-21 01:18:08 -06:00
Paul Eggert
b751bf4949 spelling fixes 2023-01-21 00:58:47 -06:00
Paul Eggert
cb3ad19ddf make update-copyright 2023-01-20 23:41:13 -06:00
Paul Eggert
fc2a0b61c8 make fetch 2023-01-20 23:41:12 -06:00
Paul Eggert
d06f3b532e Improve OS version commentary
* lib/autoconf/specific.m4: Improve comments about which
OS releases need -D_LARGE_FILES, -n32, _ALL_SOURCE.
2022-12-30 12:53:38 -08:00
Paul Eggert
845c3d2d7a Restore *_REQUIRED macros
As per:
https://lists.gnu.org/r/autoconf-patches/2022-12/msg00004.html
2022-12-28 23:42:37 -08:00
Todd C. Miller
f612e10a80 fix AC_CHECK_HEADER_STDBOOL regression
Commit 6dcecb780a "Port
AC_CHECK_HEADER_STDBOOL to C23" causes AC_CHECK_HEADER_STDBOOL to
always fail, even on systems with a conforming stdbool.h.

There is no longer an 'a' variable so it should not be referenced
in the return statement.

Copyright-paperwork-exempt: yes
2022-12-26 10:10:34 -08:00
Paul Eggert
3f3354507b Omit just-added *_REQUIRED macros
They are not needed for Gnulib, and users have an easy way to get
their effect, so for now omit them and just document the easy way.
Also, redo documentation to make it clear that AC_YEAR_2038 is
like AC_SYS_LARGEFILE except with a different year-2038 default.
* NEWS, doc/autoconf.texi: Document the above.
* lib/autoconf/specific.m4 (AC_SYS_YEAR2038_REQUIRED):
(AC_SYS_LARGEFILE_REQUIRED): Remove.  Remove some support code.
Perhaps further simplification could be done but I quit while
I was ahead.
2022-12-25 11:04:20 -08:00
Zack Weinberg
cf09f48841 AC_SYS_LARGEFILE: Don’t enlarge time_t by default
Having AC_SYS_LARGEFILE enlarge time_t means that any program that has
already requested large file support will be abruptly migrated to
64-bit time_t (on 32-bit systems) as soon as its configure script is
regenerated with a sufficiently new Autoconf.  We’ve received reports
of several widely used programs and libraries that are not prepared
for this migration, with breakage ranging from annoying (garbage
timestamps in messages) through serious (binary compatibility break
in security-critical shared library) to catastrophic (on-disk data
corruption).

Partially revert f6657256a3: in the
absence of AC_SYS_YEAR2038, AC_SYS_LARGEFILE will now only add an
--enable-year2038 command line option to configure.  If this option is
used, time_t will be enlarged, allowing people to experiment with the
migration without needing to *edit* the configure script in question,
only regenerate it.

In the process, AC_SYS_LARGEFILE and AC_SYS_YEAR2038 were drastically
overhauled for modularity; it should now be much easier to add support
for platforms that offer large off_t / time_t but not with the standard
feature selection macros.  Also, new macros AC_SYS_LARGEFILE_REQUIRED and
AC_SYS_YEAR2038_REQUIRED can be used by programs for which large off_t /
time_t are essential.

The implementation is a little messy because it needs to gracefully
handle the case where AC_SYS_LARGEFILE and AC_SYS_LARGEFILE_REQUIRED
are both used in the same configure script — or, probably more common,
AC_SYS_LARGEFILE (which invokes _AC_SYS_YEAR2038_OPT_IN) followed by
AC_SYS_YEAR2038 — but if macro B is invoked after macro A, there’s no
way for B to change *what macro A expanded to*.  The best kludge I
managed to find is to AC_CONFIG_COMMANDS_PRE as a m4-level hook that
sets shell variables in an early diversion.

* lib/autoconf/functions.m4 (AC_FUNC_FSEEKO): Rewrite to avoid dependency
  on internal subroutines of AC_SYS_LARGEFILE.

* lib/autoconf/specific.m4 (_AC_SYS_YEAR2038_TEST_INCLUDES): Renamed to
  _AC_SYS_YEAR2038_TEST_CODE.
  (_AC_SYS_YEAR2038): Refactor into subroutines: _AC_SYS_YEAR2038_OPTIONS,
  _AC_SYS_YEAR2038_PROBE, _AC_SYS_YEAR2038_ENABLE.
  (AC_SYS_YEAR2038): Update for refactoring.
  (_AC_SYS_YEAR2038_OPT_IN): New sorta-top-level macro, for use by
  AC_SYS_LARGEFILE, that probes for large time_t only if the
  --enable-year2038 option is given.
  (AC_SYS_YEAR2038_REQUIRED): New top-level macro that insists on
  support for large time_t.

  (_AC_SYS_LARGEFILE_TEST_INCLUDES): Renamed to _AC_SYS_LARGEFILE_TEST_CODE.
  (_AC_SYS_LARGEFILE_MACRO_VALUE, AC_SYS_LARGEFILE): Refactor along same
  lines as above: _AC_SYS_LARGEFILE_OPTIONS, _AC_SYS_LARGEFILE_PROBE,
  _AC_SYS_LARGEFILE_ENABLE.  Invoke _AC_SYS_YEAR2038_OPT_IN at end of
  _AC_SYS_LARGEFILE_PROBE.  MinGW-specific logic moved to YEAR2038
  macros as it has nothing to do with large file support.
  (AC_SYS_LARGEFILE_REQUIRED): New top-level macro that insists on
  support for large off_t.

* tests/local.at (_AT_CHECK_ENV): Also allow changes in CPPFLAGS,
  enableval, enable_*, withval, with_*.

* doc/autoconf.texi, NEWS: Update documentation to match above changes.
  Fix typo in definition of @dvarv.
2022-12-25 11:04:20 -08:00
Paul Eggert
bb7c8cbb0a Move NEWS entry to better location 2022-12-24 23:15:56 -08:00
Paul Eggert
b724349cbc Document C23 <stdckdint.h> 2022-12-24 14:38:51 -08:00
Paul Eggert
8a228e9d58 Use UTF-8 and spell "François" correctly 2022-12-24 14:38:51 -08:00
Paul Eggert
28d3433229 AC_USE_SYSTEM_EXTENSIONS now enables C23 Annex F
* lib/autoconf/specific.m4 (AC_USE_SYSTEM_EXTENSIONS):
Also define __STDC_WANT_IEC_60559_EXT__, for C23.
2022-12-24 14:38:51 -08:00
Paul Eggert
078edd8c0f Cater better to underquoted callers
Problem reported by Frederic Berat in:
https://lists.gnu.org/r/autoconf/2022-11/msg00092.html
* lib/autoconf/c.m4 (AC_LANG_CALL(C)): Omit comma in comment,
which triggers bugs in underquoted callers.
2022-11-16 10:20:08 -08:00
Bruno Haible
9c123e6ee1
Fix misspelled NEWS entry 2022-11-12 11:06:36 -05:00
Paul Eggert
6f2aadd731 Modernize and regularize doc for C89 etc.
In documentation and comments, prefer the more-common “C89” to the
equivalent “C90”, and use 2-digit years for C standards as that’s
common usage.  Remove some confusing old doc for pre-C89 systems,
as Autoconf assumes C89 or later.  Mention C17 and C23 briefly.
Improve doc for malloc, realloc.
2022-11-11 00:32:40 -08:00
Zack Weinberg
bf5a75953b
More fixes for compilers that reject K&R function definitions.
This fixes all of the remaining failures exposed by running the
testsuite with GCC 12 and
CC='cc -Wimplicit-function-declaration -Wold-style-definition
       -Wimplicit-int -Werror'
.

* lib/autoconf/c.m4 (_AC_C_C89_TEST_GLOBALS): Don’t use K&R function
  definitions.
* lib/autoconf/specific.m4 (AC_SYS_RESTARTABLE_SYSCALLS): Likewise.
  (AC_FUNC_MKTIME): Declare functions taking no arguments as ‘fn (void)’
  not ‘fn ()’.
* lib/autoconf/c.m4 (_AC_C_C99_TEST_GLOBALS): Declare free().
2022-11-10 12:05:30 -05:00
Paul Eggert
3cc9b414aa Warn about TMPDIR
* doc/autoconf.texi (Initialization Macros): Warn about
setting TMPDIR, following up on this Paul Smith remark:
https://lists.gnu.org/r/autoconf/2022-10/msg00024.html
2022-10-28 15:21:45 -07:00
Paul Eggert
d081ac3ec8 MKDIR_P now falls back on mkdir -p
* lib/autoconf/programs.m4 (AC_PROG_MKDIR_P):
Fall back on mkdir -p instead of on a relative path to
install-sh, as the latter now seems to be more of a problem
than the former.
2022-10-12 12:02:31 -07:00
Paul Eggert
85c0db3433 Update M4 version numbers in documentation 2022-10-05 18:06:20 -07:00
Xi Ruoyao
412166e185
Fix testsuite failures with bash 5.2.
Bash v5.2 includes several new optimizations to the number of
subshells used for various constructs; as a side effect, the value of
SHLVL is less stable than it used to be.  Add SHLVL to the list of
built-in shell variables with unstable values, to be ignored when
checking for inappropriate differences to the shell environment
before and after a macro invocation / between two configure runs.

Problem and solution reported by Xi Ruoyao in
https://lists.gnu.org/archive/html/autoconf/2022-09/msg00015.html
Problem also reported by Bruce Dubbs in
https://lists.gnu.org/archive/html/bug-autoconf/2022-09/msg00010.html

* tests/local.at (_AT_CHECK_ENV, AT_CONFIG_CMP): Ignore changes in
  value of SHLVL.
Copyright-paperwork-exempt: yes
2022-09-30 11:37:13 -04:00
Paul Eggert
55dfa23776 Mention latest change in NEWS 2022-09-18 11:52:04 -07:00
Paul Eggert
df62fad153 Improve comment in previous change 2022-09-17 19:44:46 -07:00
Paul Eggert
30bf5c4982 Allow users to clear BINSH
Problem and solution reported by Roger Crew in:
https://lists.gnu.org/r/bug-autoconf/2022-09/msg00005.html
* lib/m4sugar/m4sh.m4 (_m4_divert(BINSH)): Change from 0 to 1,
and add 2 to HEADER-REVISION, HEADER-COMMENT, HEADER-COPYRIGHT,
M4SH-SANITIZE, M4SH-INIT-FN, and M4SH-INIT.
Copyright-paperwork-exempt: yes
2022-09-17 19:44:45 -07:00
Sergei Trofimovich
c2ab755698 autoconf: store autom4te request keys in sorted order
Notced unstable key order when debugging unrelated bug.
Data::Dumper's SortKeys() makes ordering stable and decreases
diffs from run to run. No functional change otherwise.

* lib/Autom4te/C4che.pm
* lib/Autom4te/Request.pm: Sort request keys in serialization.

Copyright-paperwork-exempt: yes
2022-09-09 17:51:25 -05:00
Paul Eggert
31f673434e Port to GNU make 4.4
* cfg.mk (PATH): Assign eagerly, and simplify shell use, avoiding
use of the shell entirely if PWD is set, as it should be.
Problem reported by Sergei Trofimovich in:
https://lists.gnu.org/r/autoconf-patches/2022-09/msg00007.html
2022-09-09 16:57:10 -05:00
Paul Eggert
8b5e2016c7 Port to compilers that moan about K&R func decls
* lib/autoconf/c.m4 (AC_LANG_CALL, AC_LANG_FUNC_LINK_TRY):
Use '(void)' rather than '()' in function prototypes, as the latter
provokes fatal errors in some compilers nowadays.
* lib/autoconf/functions.m4 (AC_FUNC_STRTOD):
* tests/fortran.at (AC_F77_DUMMY_MAIN usage):
* tests/semantics.at (AC_CHECK_DECLS):
Don’t use () in a function decl.
2022-09-02 12:09:32 -05:00
Paul Eggert
0a647a93cb Remove obsolete Solaris info from manual
Don't mention anything about Solaris 9 or older,
as Oracle no longer supports those old versions
and the obsolete info merely clutters the manual.
2022-08-25 14:27:02 -05:00
Paul Eggert
bc66c26f48 Improve doc for AC_SYS_LARGEFILE etc. 2022-08-18 15:20:46 -07:00
Paul Eggert
6dcecb780a Port AC_CHECK_HEADER_STDBOOL to C23
Modernize the bool documentation a bit too.
* lib/autoconf/headers.m4 (AC_CHECK_HEADER_STDBOOL):
Allow C23 too.
2022-08-13 19:39:59 -07:00
Paul Eggert
f6657256a3 AC_SYS_LARGEFILE now widens time_t if possible
This change is taken from Gnulib, and is needed for apps like GDB.
* lib/autoconf/specific.m4 (_AC_SYS_YEAR2038_TEST_INCLUDES)
(_AC_SYS_YEAR2038, AC_SYS_YEAR2038): New macros, taken (with
renaming) from Gnulib.
(_AC_SYS_LARGEFILE_MACRO_VALUE): #undef before #define.
(AC_SYS_LARGEFILE): Prefer AS_IF and AS_CASE to doing it by hand.
Widen time_t if possible, too.  Define  __MINGW_USE_VC2005_COMPAT
early if needed.
2022-08-09 11:07:03 -07:00
Paul Eggert
2b4b96d982 Fix compilation errors in 32-bit C++ mode on HP-UX 11/ia64
This should render unnecessary Gnulib’s gl_SET_LARGEFILE_SOURCE hack
https://lists.gnu.org/r/bug-gnulib/2019-12/msg00046.html
* lib/autoconf/functions.m4 (AC_FUNC_FSEEKO):
On that platform, simply set _LARGEFILE_SOURCE.
2022-08-09 11:07:03 -07:00
Paul Eggert
234fc6c866 Port AC_C_BIGENDIAN to cross gcc -std=c11 -flto
* lib/autoconf/c.m4 (AC_C_BIGENDIAN): Improve the
inherently-unportable grep trick well enough to survive gcc
-std=c11 -flto when cross-compiling (sr#110687).
2022-07-27 08:56:12 -07:00
Paul Eggert
e50a50c4dc basename and dirname are portable now
* doc/autoconf.texi (Limitations of Usual Tools):
basename and dirname are portable shell commands now.
2022-07-21 12:50:16 -07:00
Paul Eggert
f07de9b1db Handle z/OS Unix ‘set’ output
Problem and fix reported by Jeff Shimoda in:
https://lists.gnu.org/r/autoconf-patches/2022-06/msg00007.html
* tests/local.at (AT_CONFIG_CMP): Treat ‘var=""’ like ‘var=''’.
Copyright-paperwork-exempt: Yes
2022-07-14 12:25:18 -07:00
Zack Weinberg
56b21590f6
Fix testsuite failures on Darwin (aka macOS).
Tests of AC_{CHECK_,}HEADER_STDBOOL were failing on Darwin for two
reasons: an m4 quoting bug in tests/local.at causing Darwin sed to
throw syntax errors, and an excessively precise interpretation of how
C99 and C++11 interact.  The latter is worth mentioning in NEWS.

 * tests/local.at (_AT_DEFINES_CMP_PRUNE): Insert [] before ‘dnl’ in
   two places to keep it separate from the result of the m4_bpatsubsts
   operation that immediately precedes it.
 * lib/autoconf/headers.m4 (AC_CHECK_HEADER_STDBOOL): Allow ‘bool’,
   ‘true’, and ‘false’ not to be macros, after including stdbool.h,
   whenever __cplusplus is defined.
 * NEWS: Document change to AC_{CHECK_,}HEADER_STDBOOL.
2022-07-10 15:05:31 -04:00
Zack Weinberg
db7205a864
Make help-extract.pl work with Perl 5.10.x.
The main issue was use of s///r; the /r modifier was added in 5.14.
Since the baseline is now 5.10.0 instead of 5.6.0, a couple places
can be tidied up using slightly newer constructs.

* help-extract.pl: Use File::Spec::Functions instead of File::Spec
  for reduced clunkiness.
  (eval_qq_no_interpolation): Don’t use s///r.  Do use \K and (?=...)
  to match the empty string (but only in just the right locations),
  so we don’t need to use $& in the replacement.
  (main): Don’t use s///r.
2022-07-10 15:00:48 -04:00
Zack Weinberg
f580247d46
Remove ancient backward compatibility code from m4/m4.m4.
We have had AC_PREREQ([2.69]) in our own configure.ac since 2021,
and before that it was AC_PREREQ([2.62]) since 2012, so backcompat
code for 2.61 is not necessary anymore.

Also add logging of the name of each candidate executable and bump the
serial number.
2022-07-10 11:42:59 -04:00
Zack Weinberg
bfd655e5f1
make fetch
Our local patches to lib/Autom4te/FileUtils.pm and maint.mk were
manually reapplied.
2022-07-10 11:42:00 -04:00