summaryrefslogtreecommitdiff
path: root/tests/local.at
diff options
context:
space:
mode:
authorZack Weinberg <zack@owlfolio.org>2022-12-24 23:24:51 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2022-12-25 11:04:20 -0800
commitcf09f48841b66fe76f606dd6018bb3a93242a7c9 (patch)
tree0c37133d949cc8d737783e58445119460a643ce1 /tests/local.at
parentbb7c8cbb0a620157a031540ff88bc12cbcb4d0c1 (diff)
downloadautoconf-cf09f48841b66fe76f606dd6018bb3a93242a7c9.tar.gz
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 f6657256a37da44c987c04bf9cd75575dfca3b60: 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.
Diffstat (limited to 'tests/local.at')
-rw-r--r--tests/local.at5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/local.at b/tests/local.at
index a9cf4050..158ba841 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -347,6 +347,8 @@ m4_define([AT_CHECK_CONFIGURE],
# Set by AC_INIT.
# - interpval
# Set by AC_SYS_INTERPRETER.
+# - enableval, withval, enable_*, with_*
+# Set by AC_ARG_ENABLE and AC_ARG_WITH.
# - CONFIG_STATUS and DEFS
# Set by AC_OUTPUT.
# - AC_SUBST'ed variables
@@ -381,7 +383,7 @@ if test -f state-env.before && test -f state-env.after; then
($EGREP -v '^(m4_join([|],
[a[cs]_.*],
[(exec_)?prefix|DEFS|CONFIG_STATUS],
- [CC|CFLAGS|CPP|GCC|CXX|CXXFLAGS|CXXCPP|GXX|F77|FFLAGS|FLIBS|G77],
+ [CC|CFLAGS|CPPFLAGS|CPP|GCC|CXX|CXXFLAGS|CXXCPP|GXX|F77|FFLAGS|FLIBS|G77],
[ERL|ERLC|ERLCFLAGS|ERLANG_PATH_ERL|ERLANG_ROOT_DIR|ERLANG_LIB_DIR],
[ERLANG_LIB_DIR_.*|ERLANG_LIB_VER_.*|ERLANG_INSTALL_LIB_DIR],
[ERLANG_INSTALL_LIB_DIR_.*|ERLANG_ERTS_VER|OBJC|OBJCPP|OBJCFLAGS],
@@ -395,6 +397,7 @@ if test -f state-env.before && test -f state-env.after; then
[X_(CFLAGS|(EXTRA_|PRE_)?LIBS)|x_(includes|libraries)|(have|no)_x],
[(host|build|target)(_(alias|cpu|vendor|os))?],
[cross_compiling|U],
+ [enableval|enable_.*|withval|with_.*],
[interpval|PATH_SEPARATOR],
[GFC|F77_DUMMY_MAIN|f77_(case|underscore)],
[FC(_DUMMY_MAIN|FLAGS|LIBS|FLAGS_[fF]|_MODEXT|_MODINC|_MODOUT|_DEFINE)?],