autoconf/tests
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
..
data Work around memory-leak false alarms 2022-03-31 23:25:54 -07:00
atlocal.in make update-copyright 2022-05-19 13:57:38 -07:00
autoscan.at make update-copyright 2022-05-19 13:57:38 -07:00
autotest.at make update-copyright 2022-05-19 13:57:38 -07:00
base.at make update-copyright 2022-05-19 13:57:38 -07:00
c.at make update-copyright 2022-05-19 13:57:38 -07:00
compile.at make update-copyright 2022-05-19 13:57:38 -07:00
erlang.at make update-copyright 2022-05-19 13:57:38 -07:00
foreign.at make update-copyright 2022-05-19 13:57:38 -07:00
fortran.at Port to compilers that moan about K&R func decls 2022-09-02 12:09:32 -05:00
go.at make update-copyright 2022-05-19 13:57:38 -07:00
local.at AC_SYS_LARGEFILE: Don’t enlarge time_t by default 2022-12-25 11:04:20 -08:00
local.mk make update-copyright 2022-05-19 13:57:38 -07:00
m4sh.at make update-copyright 2022-05-19 13:57:38 -07:00
m4sugar.at Avoid \] in BREs and EREs 2022-06-28 18:27:40 -05:00
mktests.pl Require Perl 5.10.0 or later. 2022-07-10 10:52:33 -04:00
semantics.at Port to compilers that moan about K&R func decls 2022-09-02 12:09:32 -05:00
statesave.m4 make update-copyright 2022-05-19 13:57:38 -07:00
suite.at make update-copyright 2022-05-19 13:57:38 -07:00
tools.at testsuite: Handle `balanced ASCII quotes' correctly in m4 errors. 2022-07-06 16:05:42 -04:00
torture.at make update-copyright 2022-05-19 13:57:38 -07:00
wrapper.as make update-copyright 2022-05-19 13:57:38 -07:00