Commit Graph

7008 Commits

Author SHA1 Message Date
Paul Eggert
eaea61e448 doc: fix broken cross-refs 2023-06-20 13:39:44 -07:00
Paul Eggert
a7421b411b Modernize INSTALL
Problem reported for gettext bootstrap by Julien Palard in:
https://savannah.gnu.org/bugs/?62196
* doc/install.texi: Give a brief info as to how to bootstrap,
on packages built from Git rather from a distribution tarball.
Remove aging details about c99, macOS, X, HP-UX, OSF/1, Solaris,
Haiku, sun4.  Improve documentation for enable/disable and
with/without options.
2023-06-20 13:24:40 -07:00
Paul Eggert
103514e40d Fix AC_SYS_LARGEFILE on GNU/Linux alpha, s390x
Problem reported by Matoro <https://bugs.gnu.org/64123>.
* lib/autoconf/specific.m4 (_AC_SYS_LARGEFILE_TEST_CODE):
New overridable macro FTYPE, to test types other than off_t.
(_AC_SYS_LARGEFILE_TEST_CODE): Test ino_t for
-D_FILE_OFFSETBITS=64 too, if no flags are needed for off_t.
Needed for GNU/Linux on alpha and s390x.
2023-06-19 14:06:21 -07:00
Paul Eggert
8e7281d7be Improve AC_FUNC_MMAP comments
* lib/autoconf/functions.m4 (AC_FUNC_MMAP): Add comment.
2023-05-17 11:50:27 -07:00
Paul Eggert
ccc0d640c4 Improve AC_SYS_YEAR2038_RECOMMENDED diagnostic
* lib/autoconf/specific.m4 (AC_SYS_YEAR2038_RECOMMENDED):
Do not recommend gcc -m64, as that likely will not work.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2023-05/msg00060.html
Instead, mention that 32-bit time_t is not recommended
for this package, before telling the builder how
to configure with 32-bit time_t anyway.
2023-05-13 09:57:44 -07:00
Paul Eggert
33c26d2700 Fix port of AC_FUNC_MMAP
Problem reported by Matt Turner in:
https://lists.gnu.org/r/bug-autoconf/2023-05/msg00005.html
* lib/autoconf/functions.m4 (AC_FUNC_MMAP): Go back to getting the
page size, since the zero-fill test needs this after all.
However, prefer sysconf (_SC_PAGESIZE) or sysconf (_SC_PAGE_SIZE)
to getpagesize (), and use ‘long’ not ‘int’ to store the page size.
Also, declare getpagesize if it is used as a function.
2023-05-10 22:58:21 -07:00
Paul Eggert
028526149e Port AC_FUNC_MMAP to more-modern systems
* lib/autoconf/functions.m4 (AC_FUNC_MMAP): Don’t call
getpagesize, as it’s tricky to configure, modern POSIX doesn’t
require it, and calling it without including <unistd.h> provokes a
compile-time error on modern systems.  Instead, rework the test
to not need getpagesize.  Add a FIXME comment for unnecessary
tests; I don't want to remove them now as we're too close to
a release.  Remove long-obsolete comment about GNU grep.
2023-05-10 17:23:11 -07:00
Paul Eggert
9c01837246 Tone down year-2038 changes
New macro AC_SYS_YEAR2038_RECOMMENDED replaces new macro
AC_SYS_YEAR2038_REQUIRED, and gives the builder an out of
specifying --disable-year2038.  Remove new macro
AC_SYS_LARGEFILE_REQUIRED, which was added only for symmetry and
does not seem to have a great need.
* NEWS, doc/autoconf.texi: Document this.
* lib/autoconf/specific.m4:
Be more specific about mid-January 2038 than just Jan 2038.
(_AC_SYS_YEAR2038_PROBE): Ignore IF-NOT-DETECTED arg.
If support is not detected, merely set ac_have_year2038=no instead
of erroring out.  All callers changed.
(_AC_SYS_YEAR2038_OPT_IN): Remove.  All callers removed.
(AC_SYS_YEAR2038): Simplify by requiring AC_SYS_LARGEFILE
and then testing the result.
(AC_SYS_YEAR2038_REQUIRED, AC_SYS_LARGEFILE_REQUIRED): Remove.
(AC_SYS_YEAR2038_RECOMMENDED): New macro.
(_AC_SYS_LARGEFILE_PROBE): If support is not detected, merely set
ac_have_largefile=no instead of erroring out.  All callers changed.
Take on the burden of invoking year2038 probe as needed.
(AC_SYS_LARGEFILE): Simplify.
2023-04-26 18:37:10 -07:00
Bruno Haible
2277f2c157 AC_SYS_YEAR2038_REQUIRED: Fix configure failure with MSVC.
* lib/autoconf/specific.m4 (_AC_SYS_LARGEFILE_PROBE): Distinguish the results
"support not detected" and "supported through gnulib". If the result is
"supported through gnulib", don't fail.
2023-04-19 14:18:44 -07:00
Bruno Haible
e704a13c96 Document limitation of BusyBox tr.
BusyBox 1.35.0 tr, which is shipped with Alpine Linux 3.17, does not support
the POSIX [x*n] syntax.

* doc/autoconf.texi (Limitations of Usual Tools): Document limitation of 'tr'
from BusyBox.
2023-04-17 09:02:07 -07:00
Bruno Haible
0cc3c4ca8e AC_SYS_YEAR2038: Fix configure failure on 32-bit mingw.
* lib/autoconf/specific.m4 (_AC_SYS_YEAR2038_PROBE): Use the same option
spelling as in _AC_SYS_YEAR2038_OPTIONS.
2023-04-14 21:54:13 -07:00
Paul Eggert
a1e82aff0f Improve year2038, largefile option processing
* lib/autoconf/specific.m4 (_AC_SYS_YEAR2038_PROBE)
(_AC_SYS_YEAR2038_ENABLE, _AC_SYS_YEAR2038_OPT_IN)
(AC_SYS_YEAR2038, _AC_SYS_LARGEFILE_PROBE)
(_AC_SYS_LARGEFILE_ENABLE): Do not use enable_largefile to record
whether largefile is required, as ‘./configure
--disable-largefile’ sets enable_largefile=no even if largefile is
required and this disables largefile.  Instead, use a separate
shell variable ac_largefile_required and test it as well.
Similarly for enable_year2038.
(_AC_SYS_LARGEFILE_ENABLE): Omit --disable-largefile help string
if year2038 is required, since largefile is a prereq for year2038.
2023-04-09 11:44:45 -07:00
Paul Eggert
1982523c6f Support circa early 2022 Gnulib
Problem reported by Frederic Berat in:
https://lists.gnu.org/r/bug-rcs/2023-04/msg00001.html
* lib/autoconf/specific.m4 (_AC_SYS_LARGEFILE_TEST_INCLUDES):
Bring back for compatibility with post-2.71, pre-2.73 Gnulib.
2023-04-03 09:18:40 -07:00
Zack Weinberg
e25dfa75e1
Remove the last few internal uses of AC_EGREP_CPP.
Most of the remaining uses were converted to AC_COMPILE_IFELSE.
The use in AC_FUNC_LOADAVG becomes an AC_PREPROC_IFELSE because
we can’t be sure getloadavg.c can be _compiled_ at this point in
the build.  The use in AC_C_VARARRAYS could be either _PREPROC_ or
_COMPILE_; we use _COMPILE_ because, _PREPROC_ is never used, then
we don’t have to do the “checking how to run the C preprocessor” test.

* lib/autoconf/c.m4 (AC_C_VARARRAYS): Use AC_COMPILE_IFELSE instead of
  AC_EGREP_CPP.
* lib/autoconf/headers.m4 (_AC_HEADER_TIOCGWINSZ_IN_TERMIOS_H)
  (_AC_HEADER_TIOCGWINSZ_IN_SYS_IOCTL_H): Likewise.
* lib/autoconf/functions.m4 (AC_FUNC_GETLOADAVG): Use AC_PREPROC_IFELSE
  instead of AC_EGREP_CPP.
2023-04-02 23:01:50 -04:00
Zack Weinberg
a7dc6d83c7
Fold AC_C_STRINGIZE into AC_PROG_CC.
Another of the last few uses of AC_EGREP_CPP is to check for the ISO C
“stringification” operator.  As this is a feature of C89, let’s fold
the test into the extensive C89 tests we already have, and make
AC_C_STRINGIZE just lean on AC_PROG_CC, in the same way
AC_C_PROTOTYPES does.

* lib/autoconf/c.m4 (_AC_C_C89_TEST_GLOBALS): Add test of preprocessor
  stringification and token pasting.
  (AC_C_STRINGIZE): Just check ac_prog_cc_stdc.
2023-04-02 23:01:50 -04:00
Zack Weinberg
b5891a57b5
Overhaul AC_TYPE_GETGROUPS and AC_FUNC_GETGROUPS.
AC_TYPE_GETGROUPS is the last remaining use of AC_EGREP_HEADER in
stock Autoconf macros.  It uses it only when cross compiling, as a
fallback from an AC_RUN_IFELSE check, testing for a bug in system
headers from the late 1980s or early 1990s, where gid_t *existed*
but the second argument to getgroups needed to be an array of int,
and this didn’t cause a compile error (i.e. the system headers
declare getgroups with no prototype or an incorrect prototype).
AC_FUNC_GETGROUPS also uses AC_RUN_IFELSE to test for obscure
problems specific to long-obsolete Unixes.

The downsides of AC_RUN_IFELSE and AC_EGREP_HEADER seem more severe
than the chances of someone compiling a current-generation program,
that uses getgroups, on an OS old enough to have one of the really
nasty bugs.  Accordingly, this patch changes AC_FUNC_GETGROUPS to use
a host_os-based *blacklist* both in native and cross compilation.
This is limited to the two host_os values for which either our old
code, or Gnulib, documented a serious bug: ultrix* and nextstep*.
Currently it does not try to pin down the exact version ranges subject
to the bugs — that would require research by someone with access to
the full history of these OSes.

An incorrect guess by this blacklist can be overridden by setting
ac_cv_func_getgroups_works in config.site.  AC_TYPE_GETGROUPS, for its
part, now does a series of regular old AC_COMPILE_IFELSE checks to
probe the prototype of getgroups, and considers that good enough.

While I was in there I noticed that AC_FUNC_GETGROUPS does not
AC_SUBST a documented output variable, and that the name of this
variable is misspelled in the manual.

* lib/autoconf/functions.m4 (AC_FUNC_GETGROUPS): Use AC_SEARCH_LIBS
  to probe for getgroups.  Use an AC_CANONICAL_HOST-based blacklist
  for bug detection, not AC_RUN_IFELSE.  AC_SUBST the GETGROUPS_LIB
  output variable.
* lib/autoconf/types.m4 (AC_TYPE_GETGROUPS): Check only the prototype
  of getgroups, using AC_COMPILE_IFELSE; do not use either AC_RUN_IFELSE
  or AC_EGREP_HEADER.
* doc/autoconf.texi: Update to match. Correct misspelling of
  GETGROUPS_LIB.
* tests.local.at (_AT_CHECK_ENV): Allow GETGROUPS_LIB output variable.
2023-04-02 23:01:49 -04:00
Zack Weinberg
daaca7f74f
Make AC_PROG_GCC_TRADITIONAL a compatibility alias for AC_PROG_CC.
This macro is one of the last remaining internal uses of AC_EGREP_CPP.
It has only ever done anything useful with GCC, and GCC dropped
support for ‘traditional’ compilation in version 3.3 (released 2003)
so I do not think it is worth trying to preserve.

* lib/autoconf/c.m4 (AC_PROG_GCC_TRADITIONAL): Make into a
  compatibility alias for AC_PROG_CC, similar to AC_PROG_CC_STDC.
* lib/autoconf/general.m4 (AC_EGREP_CPP): Remove stale comment.
* doc/autoconf.texi, NEWS: Document this change.
* tests/mktests.pl: Exclude AC_PROG_GCC_TRADITIONAL from
  autoupdate tests.
2023-04-02 23:01:06 -04:00
Zack Weinberg
51d98495d1
AC_TYPE_UID_T: Rewrite using AC_CHECK_TYPE.
AC_TYPE_UID_T uses AC_EGREP_HEADER to search sys/types.h for
occurrences of the string ‘uid_t’ and, if found, assumes both
uid_t and gid_t are available.  This would be better done using
a pair of AC_CHECK_TYPE operations.

I also converted two uses of old-style AC_CHECK_TYPE, immediately
below, to new-style.  (There are probably other old-style uses in
this file, I only did the ones I happened to see.)

* lib/autoconf/types.m4 (AC_TYPE_UID_T): Check for uid_t and gid_t,
  separately, using AC_CHECK_TYPE, instead of grepping sys/types.h.
  (AC_TYPE_SIZE_T, AC_TYPE_SSIZE_T): Use new-style AC_CHECK_TYPE.
2023-04-02 14:59:34 -04:00
Zack Weinberg
dcf9bb7e3b
AC_XENIX_DIR: Rewrite using AC_CANONICAL_HOST.
AC_XENIX_DIR is an obsolete macro, defined as AC_HEADER_DIRENT plus
code to make absolutely sure configure scripts that depended on a
shell variable internal to the original (2.13 era) definition of
AC_XENIX_DIR are not broken by autoupdate.  (That variable had the
temptingly public-sounding name “XENIX.”)  This compatibility code
uses AC_EGREP_CPP, which is itself discouraged for use in new
configure scripts.

(N.B. codesearch.debian.net does not find any uses whatsoever of
this macro, nor any code in an .ac or .m4 file that depends on the
XENIX variable.)

Change the compatibility code to use AC_CANONICAL_HOST instead,
and clarify which pieces of the code inserted by autoupdate are
probably still necessary.

* lib/autoconf/specific.m4 (AC_XENIX_DIR): Set XENIX variable
  based on value of host_os. Clarify what manual cleanup is
  recommended after autoupdate replaces this obsolete macro.
2023-04-02 14:57:20 -04:00
Zack Weinberg
8babe5f2cc
New script for building inside Guix containers.
build-aux/test-build-guix, goes with the top level manifest.scm.
See the top of the file for usage instructions.
2023-04-02 09:17:57 -04:00
Paul Eggert
794182506c Support underquoted callers better
Problem reported bh Khem Raj for mcpp 2.7.2 (2008) in:
https://lists.gnu.org/r/autoconf/2023-04/msg00001.html
* lib/autoconf/programs.m4 (_AC_PATH_PROG_FLAVOR_GNU):
Add two ‘@%:@(’s to cater to underquoted callers.
* lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Use quadrigraph instead of
‘#’, for underquoted callers.
2023-04-01 20:26:41 -07:00
Paul Eggert
713d9822bb Fix timing bug on high-speed builds
Problem reported by Bogdan via Jacob Bachmeyer in:
https://lists.gnu.org/r/autoconf/2023-04/msg00002.html
* bin/autom4te.in: If a file timestamp equals a dependency’s
timestamp, consider the file to be out of date.  Although this may
result in extra work, it fixes some rare timing bugs.
2023-04-01 16:44:28 -07:00
Paul Eggert
05e295b60c Go back to requiring only Perl 5.6+ for users
Commit 61901a1a14 dated 2022-07-10
bumped the Perl requirement to 5.10 or later, because
commit 3a9802d601 dated 2021-08-31
added code using Time::HiRes’s ‘stat’ function, a feature
added in Perl 5.8.9+ or Perl 5.10+, and it was hard
to find Perl 5.8.9 hosts to test with.  Also, requiring Perl 5.10
meant that we could then use operators like Digest::SHA, the // and
//= operators, the regexp \K escape, and ‘state’ variables.

However, that Time::HiRes code, which was taken from Automake, has
recently been made optional by Automake, and it now works again with
Perl 5.6.  And Autoconf is not yet using any other post-5.6 feature,
except when developers run help-extract.pl (something Autoconf users
do not use).  So relax the Autoconf user requirement back to 5.6 as it
was in Autoconf 2.71; although Autoconf developers will need 5.10 or
better, Autoconf users can get by with 5.6.

I ran into this problem when testing the Autoconf release candidate on
Solaris 10, which has Perl 5.8.4.  Oracle says Solaris 10’s
end-of-life is January 2024, so it’s still (barely) a viable porting
target.  Of course with Solaris 10 one must install a recent-enough
GNU m4, but adding a requirement to also install a recent-enough Perl
is a new barrier, and if it’s not needed then it might be better to
wait until it is needed (or until 2024 arrives).

* NEWS: Update news item about Perl 5.6 vs 5.10.
* README-hacking: Bump Perl recommendation to 5.10.
* build-aux/fetch.pl: Do not munge imported code to require 5.10.
2023-03-31 12:52:50 -07:00
Paul Eggert
232cab5278 Cater to programs misusing AC_EGREP_HEADER
Problem reported by Frederic Berat in:
https://lists.gnu.org/archive/html/autoconf/2022-11/msg00127.html
* lib/autoconf/programs.m4 (AC_PROG_EGREP): Also set
EGREP_TRADITIONAL and ac_cv_path_EGREP_TRADITIONAL.
* tests/c.at (AC_PROG_EGREP and AC_EGREP_HEADER):
New test, taken from Frederic Berat’s email in:
https://lists.gnu.org/r/autoconf/2023-03/msg00043.html
2023-03-31 10:47:49 -07:00
Paul Eggert
e05aa44794 * NEWS: Tighten up wording. 2023-03-31 10:47:49 -07:00
Paul Eggert
e2220ed33e build: run "make fetch", which updated these:
* build-aux/texinfo.tex: Update from texinfo.
* lib/Autom4te/FileUtils.pm: Update from automake.
2023-03-29 17:19:08 -07:00
Paul Eggert
5ffc09fca3 mention prototypes more prominently in NEWS
* NEWS: Mention the function prototype issue early.
(From a suggestion by Zack Weinberg.)
2023-03-27 18:12:47 -07:00
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