Re: remaining tasks before Autoconf release

Paul Eggert <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs,gmane.comp.sysutils.autoconf.general
Organization UCLA Computer Science Department
Message-ID <[email protected]>
On 2023-04-16 08:35, Bruno Haible wrote:
> There's still the rename of AC_SYS_YEAR2038_REQUIRED to AC_SYS_YEAR2038_OPT_OUT
> to do, that you proposed in [1] and Zack agreed [2].

Attached are proposed patches to do something along those lines, the 
first for Autoconf and the second to propagate this change into Gnulib. 
I haven't installed these.

I used the macro name AC_SYS_YEAR2038_RECOMMENDED instead, as I found 
the "OPT_OUT" name confusing (was it the configure.ac writer who was 
opting out, or the builder who is running 'configure'?). Also, I got rid 
of AC_SYS_LARGEFILE_RECOMMENDED as it's one less thing to test before a 
release and nobody appears to need that new macro.
0001-Tone-down-year-2038-changes.patch (text/x-patch, 18 KB)
From d9178438c5ae39936c9dbb789f2ffb3344c860c1 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Wed, 19 Apr 2023 13:17:00 -0700
Subject: [AUTOCONF PATCH] 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.

Fix year2038, largefile option processing
---
 NEWS                     |  18 ++--
 doc/autoconf.texi        |  34 +++-----
 lib/autoconf/specific.m4 | 177 +++++++++++----------------------------
 3 files changed, 69 insertions(+), 160 deletions(-)

diff --git a/NEWS b/NEWS
index 8e4ecc1b..a48a0085 100644
--- a/NEWS
+++ b/NEWS
@@ -51,7 +51,7 @@ GNU Autoconf NEWS - User visible changes.
 
 ** New features
 
-*** New macro AC_SYS_YEAR2038.
+*** New macros AC_SYS_YEAR2038 and AC_SYS_YEAR2038_RECOMMENDED.
   This causes 'configure' to widen time_t if possible on systems where
   time_t by default cannot represent file and other timestamps after
   January 2038.  Widening is possible only on 32-bit GNU/Linux x86 and
@@ -67,18 +67,14 @@ GNU Autoconf NEWS - User visible changes.
   This is similar to longstanding consistency requirements with
   --enable-largefile and --disable-largefile.
 
+  AC_SYS_YEAR2038_RECOMMENDED acts like AC_SYS_YEAR2038 except that
+  'configure' fails if the target lacks support for post-2038
+  timestamps and --disable-year2038 is not given.
+
 *** AC_SYS_LARGEFILE now optionally arranges to widen time_t.
   It now acts like AC_SYS_YEAR2038, except 'configure' defaults to
-  --disable-year2038 unless AC_SYS_YEAR2038 is also present.
-  As with AC_SYS_YEAR2038, application and library builders should
-  configure consistently.
-
-*** New macros AC_SYS_LARGEFILE_REQUIRED and AC_SYS_YEAR2038_REQUIRED.
-  These act like AC_SYS_LARGEFILE and AC_SYS_YEAR2038 respectively,
-  except that 'configure' fails if the target lacks support
-  for large files and for post-2038 timestamps, respectively.
-  As with AC_SYS_YEAR2038, application and library builders should
-  configure consistently.
+  --disable-year2038 unless either AC_SYS_YEAR2038 or
+  AC_SYS_YEAR2038_RECOMMENDED is also present.
 
 *** AC_USE_SYSTEM_EXTENSIONS now enables C23 Annex F extensions
   by defining __STDC_WANT_IEC_60559_EXT__.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index b3c708e8..0f3047b3 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -8808,18 +8808,20 @@ if possible.  These types may include @code{blkcnt_t}, @code{dev_t},
 
 Also, arrange for a @command{configure} option @code{--enable-year2038}
 to request widening the type @code{time_t} as needed to represent file
-wand other timestamps after January 2038.  This widening is possible
+wand other timestamps after mid-January 2038.  This widening is possible
 only on 32-bit GNU/Linux x86 and ARM systems with glibc 2.34 or later.
 If year-2038 support is requested but @command{configure} fails to find a way
 to widen @code{time_t} and inspection of the system suggests that
 this feature is available somehow, @command{configure} will error out.
 If you want the default to be @code{--enable-year2038}, you can use
-@code{AC_SYS_YEAR2038} instead of @code{AC_SYS_LARGEFILE}.
+@code{AC_SYS_YEAR2038} or @code{AC_SYS_YEAR2038_RECOMMENDED}
+instead of @code{AC_SYS_LARGEFILE}.
 In other words, older packages that have long used @code{AC_SYS_LARGEFILE}
 can have year-2038 support on 32-bit GNU/Linux x86 and ARM systems either by
 regenerating @file{configure} with current Autoconf and configuring with
-@option{--enable-year2038}, or by using @code{AC_SYS_YEAR2038} and
-configuring without @option{--disable-year2038}.
+@option{--enable-year2038}, or by using @code{AC_SYS_YEAR2038} or
+@code{AC_SYS_YEAR2038_RECOMMENDED} and configuring without
+@option{--disable-year2038}.
 A future version of Autoconf might change the @code{AC_SYS_LARGEFILE}
 default to @code{--enable-year2038}; if and when that happens,
 @code{AC_SYS_LARGEFILE} and @code{AC_SYS_YEAR2038} will become equivalent.
@@ -8886,19 +8888,6 @@ library, enabling or disabling the application's large-file support may
 break binary compatibility with that library.
 @end defmac
 
-@defmac AC_SYS_LARGEFILE_REQUIRED
-@acindex{SYS_LARGEFILE_REQUIRED}
-This macro has the same effect as @code{AC_SYS_LARGEFILE},
-but also declares that the program being configured
-requires support for large files.
-If a large @code{off_t} is unavailable,
-@command{configure} will error out.
-The @option{--disable-largefile} option will not be available.
-
-Large-file and year-2038 support for applications and libraries should
-be configured compatibly.  @xref{AC_SYS_LARGEFILE}.
-@end defmac
-
 @anchor{AC_SYS_LONG_FILE_NAMES}
 @defmac AC_SYS_LONG_FILE_NAMES
 @acindex{SYS_LONG_FILE_NAMES}
@@ -8927,14 +8916,13 @@ applications and libraries should be configured compatibly.
 @xref{AC_SYS_LARGEFILE}.
 @end defmac
 
-@defmac AC_SYS_YEAR2038_REQUIRED
-@acindex{SYS_YEAR2038_REQUIRED}
+@defmac AC_SYS_YEAR2038_RECOMMENDED
+@acindex{SYS_YEAR2038_RECOMMENDED}
 This macro has the same effect as @code{AC_SYS_YEAR2038},
 but also declares that the program being configured
-requires support for timestamps after mid-January of 2038.
-If a large @code{time_t} is unavailable,
-@command{configure} will unconditionally error out.
-The @option{--disable-year2038} option will not be available.
+should support timestamps after mid-January 2038.
+If a large @code{time_t} is unavailable, @command{configure} will error
+out unless the @option{--disable-year2038} option is specified.
 
 Year-2038 support for applications and libraries should be configured
 compatibly.  @xref{AC_SYS_YEAR2038}.
diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4
index 3bf1a0ed..011a52f3 100644
--- a/lib/autoconf/specific.m4
+++ b/lib/autoconf/specific.m4
@@ -115,8 +115,8 @@ m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize(
                                       dnl 32-bit MinGW (misconfiguration)
 ))
 
-# _AC_SYS_YEAR2038_PROBE([IF-NOT-DETECTED])
-# -----------------------------------------
+# _AC_SYS_YEAR2038_PROBE
+# ----------------------
 # Subroutine of AC_SYS_YEAR2038.  Probe for time_t that can represent
 # time points more than 2**31 - 1 seconds after the epoch (dates after
 # 2038-01-18, see above) and set the cache variable ac_cv_sys_year2038_opts
@@ -129,13 +129,10 @@ m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize(
 # AC_TRY_RUN.  Note also that some systems only support large time_t
 # together with large off_t.
 #
-# If support is not detected, the behavior depends on which of the
-# top-level AC_SYS_YEAR2038 macros was used (see below).
-#
 # If you change this macro you may also need to change
 # _AC_SYS_YEAR2038_OPTIONS.
 AC_DEFUN([_AC_SYS_YEAR2038_PROBE],
-[AC_CACHE_CHECK([for $CC option to enable timestamps after Jan 2038],
+[AC_CACHE_CHECK([for $CC option for timestamps after 2038],
   [ac_cv_sys_year2038_opts],
   [ac_save_CPPFLAGS="$CPPFLAGS"
   ac_opt_found=no
@@ -154,29 +151,7 @@ ac_have_year2038=yes
 AS_CASE([$ac_cv_sys_year2038_opts],
   ["none needed"], [],
   ["support not detected"],
-    [ac_have_year2038=no
-     AS_CASE([$ac_year2038_required,$enable_year2038],
-      [yes,*],
-        [AC_MSG_FAILURE([support for timestamps after Jan 2038 is required])],
-      [*,yes],
-        [# If we're not cross compiling and 'touch' works with a large
-        # timestamp, then we can presume the system supports wider time_t
-        # *somehow* and we just weren't able to detect it.  One common
-        # case that we deliberately *don't* probe for is a system that
-        # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers
-        # wide time_t.  (It would be inappropriate for us to override an
-        # intentional use of -m32.)  Error out, demanding use of
-        # --disable-year2038 if this is intentional.
-        AS_IF([test $cross_compiling = no],
-          [AS_IF([TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null],
-            [AS_CASE([`TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null`],
-              [*'Feb  7  2106'* | *'Feb  7 17:10'*],
-              [AC_MSG_FAILURE(m4_text_wrap(
-      [this system appears to support timestamps after January 2038,
-       but no mechanism for enabling wide 'time_t' was detected.
-       Did you mean to build a 64-bit binary? (e.g. 'CC="${CC} -m64"'.)
-       To proceed with 32-bit time_t, configure with '--disable-year2038'.],
-      [], [], [55]))])])])])],
+    [ac_have_year2038=no],
 
   ["-D_TIME_BITS=64"],
     [AC_DEFINE([_TIME_BITS], [64],
@@ -189,7 +164,7 @@ AS_CASE([$ac_cv_sys_year2038_opts],
   ["-U_USE_32_BIT_TIME_T"*],
     [AC_MSG_FAILURE(m4_text_wrap(
       [the 'time_t' type is currently forced to be 32-bit.
-       It will stop working after January 2038.
+       It will stop working after mid-January 2038.
        Remove _USE_32BIT_TIME_T from the compiler flags.],
       [], [], [55]))],
 
@@ -199,44 +174,23 @@ AS_CASE([$ac_cv_sys_year2038_opts],
 
 # _AC_SYS_YEAR2038_ENABLE
 # -----------------------
-# Subroutine of AC_SYS_YEAR2038 and _AC_SYS_YEAR2038_OPT_IN.
 # Depending on which of the YEAR2038 macros was used, add either an
-# --enable-year2038, or a --disable-year2038, or no option at all to
-# the configure script.  Note that this is expanded very late and
+# --enable-year2038 or a --disable-year2038 to
+# the configure script.  This is expanded very late and
 # therefore there cannot be any code in the AC_ARG_ENABLE.  The
 # default value for 'enable_year2038' is emitted unconditionally
 # because the generated code always looks at this variable.
 m4_define([_AC_SYS_YEAR2038_ENABLE],
 [m4_divert_text([DEFAULTS],
-  m4_provide_if([AC_SYS_YEAR2038_REQUIRED],
-    [ac_year2038_required=yes],
-    [ac_year2038_required=no]))dnl
-m4_divert_text([DEFAULTS],
   m4_provide_if([AC_SYS_YEAR2038],
     [enable_year2038=yes],
     [enable_year2038=no]))]dnl
-[m4_provide_if([AC_SYS_YEAR2038_REQUIRED], [],
 [AC_ARG_ENABLE([year2038],
   m4_provide_if([AC_SYS_YEAR2038],
     [AS_HELP_STRING([--disable-year2038],
-      [omit support for dates after Jan 2038])],
+      [don't support timestamps after 2038])],
     [AS_HELP_STRING([--enable-year2038],
-      [include support for dates after Jan 2038])]))])])
-
-# _AC_SYS_YEAR2038_OPT_IN
-# -----------------------
-# If the --enable-year2038 option is given to configure, attempt to
-# detect and activate support for large time_t on 32-bit systems.
-# This macro is automatically invoked by AC_SYS_LARGEFILE when large
-# *file* support is detected.  It does not AC_REQUIRE AC_SYS_LARGEFILE
-# to avoid a dependency loop, and is therefore unsafe to expose as a
-# documented macro.
-AC_DEFUN([_AC_SYS_YEAR2038_OPT_IN],
-[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl
-  AS_IF([test "$ac_year2038_required,$enable_year2038" != no,no],
-    [_AC_SYS_YEAR2038_PROBE])
-  AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])
-])])
+      [support timestamps after 2038])]))])
 
 # AC_SYS_YEAR2038
 # ---------------
@@ -244,28 +198,39 @@ AC_DEFUN([_AC_SYS_YEAR2038_OPT_IN],
 # On systems where time_t is not always 64 bits, this probe can be
 # skipped by passing the --disable-year2038 option to configure.
 AC_DEFUN([AC_SYS_YEAR2038],
-[m4_provide_if([AC_SYS_LARGEFILE_REQUIRED], [],
-  [AC_REQUIRE([AC_SYS_LARGEFILE])])]dnl
-[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl
-  AS_IF([test "$ac_year2038_required,$enable_year2038" != no,no],
-    [_AC_SYS_YEAR2038_PROBE])
-  AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])
-])])
-
-# AC_SYS_YEAR2038_REQUIRED
-# ------------------------
-# Same as AC_SYS_YEAR2038, but declares that this program *requires*
-# support for large time_t.  If we cannot find any way to make time_t
-# capable of representing values larger than 2**31 - 1, configure will
-# error out.  Furthermore, no --enable-year2038 nor --disable-year2038
-# option will be available.
-AC_DEFUN([AC_SYS_YEAR2038_REQUIRED],
-[m4_provide_if([AC_SYS_LARGEFILE_REQUIRED], [],
-  [AC_REQUIRE([AC_SYS_LARGEFILE])])]dnl
-[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl
-  _AC_SYS_YEAR2038_PROBE
-  AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])
-])])
+[AC_REQUIRE([AC_SYS_LARGEFILE])dnl
+AS_IF([test "$enable_year2038,$ac_have_year2038,$cross_compiling" = yes,no,no],
+ [# If we're not cross compiling and 'touch' works with a large
+  # timestamp, then we can presume the system supports wider time_t
+  # *somehow* and we just weren't able to detect it.  One common
+  # case that we deliberately *don't* probe for is a system that
+  # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers
+  # wide time_t.  (It would be inappropriate for us to override an
+  # intentional use of -m32.)  Error out, demanding use of
+  # --disable-year2038 if this is intentional.
+  AS_IF([TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null],
+    [AS_CASE([`TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null`],
+       [*'Feb  7  2106'* | *'Feb  7 17:10'*],
+       [AC_MSG_FAILURE(m4_text_wrap(
+	  [this system appears to support timestamps after mid-January 2038,
+	   but no mechanism for enabling wide 'time_t' was detected.
+	   Did you mean to build a 64-bit binary? (E.g., 'CC="${CC} -m64"'.)
+	   To proceed with 32-bit time_t, configure with '--disable-year2038'.],
+	  [], [], [55]))])])])])
+
+# AC_SYS_YEAR2038_RECOMMENDED
+# ---------------------------
+# Same as AC_SYS_YEAR2038, but recommend support for large time_t.
+# If we cannot find any way to make time_t capable of representing
+# values larger than 2**31 - 1, error out unless --disable-year2038 is given.
+AC_DEFUN([AC_SYS_YEAR2038_RECOMMENDED],
+[AC_REQUIRE([AC_SYS_YEAR2038])dnl
+AS_IF([test "$enable_year2038,$ac_have_year2038" = yes,no],
+   [AC_MSG_FAILURE(m4_text_wrap(
+      [could not enable timestamps after mid-January 2038.
+       Did you mean to build a 64-bit binary? (E.g., 'CC="${CC} -m64"'.)
+       To proceed with 32-bit time_t, configure with '--disable-year2038'.],
+      [], [], [55]))])])
 
 # _AC_SYS_LARGEFILE_TEST_CODE
 # ---------------------------
@@ -329,9 +294,7 @@ ac_have_largefile=yes
 AS_CASE([$ac_cv_sys_largefile_opts],
   ["none needed"], [],
   ["support not detected"],
-    [ac_have_largefile=no
-     AS_IF([test $ac_largefile_required,$ac_year2038_required != no,no],
-       [AC_MSG_FAILURE([support for large files is required])])],
+    [ac_have_largefile=no],
 
   ["-D_FILE_OFFSET_BITS=64"],
     [AC_DEFINE([_FILE_OFFSET_BITS], [64],
@@ -347,30 +310,9 @@ AS_CASE([$ac_cv_sys_largefile_opts],
   [AC_MSG_ERROR(
     [internal error: bad value for \$ac_cv_sys_largefile_opts])])
 
-_AC_SYS_YEAR2038_OPT_IN
-])
-
-# _AC_SYS_LARGEFILE_ENABLE
-# ------------------------
-# Subroutine of AC_SYS_LARGEFILE.  If AC_SYS_LARGEFILE_REQUIRED was
-# not used at any point in this configure script, add a
-# --disable-largefile option to the configure script.  Note that this
-# is expanded very late and therefore there cannot be any code in the
-# AC_ARG_ENABLE.  The default value for 'enable_largefile' is emitted
-# unconditionally because the generated shell code always looks at
-# this variable.
-m4_define([_AC_SYS_LARGEFILE_ENABLE],
-[m4_divert_text([DEFAULTS],
-  m4_provide_if([AC_SYS_LARGEFILE_REQUIRED],
-    [ac_largefile_required=yes],
-    [ac_largefile_required=no]))dnl
-m4_divert_text([DEFAULTS],
-  [enable_largefile=yes])]dnl
-[m4_provide_if([AC_SYS_LARGEFILE_REQUIRED], [],
-   [m4_provide_if([AC_SYS_YEAR2038_REQUIRED], [],
-      [AC_ARG_ENABLE([largefile],
-         [AS_HELP_STRING([--disable-largefile],
-	    [omit support for large files])])])])])
+AS_IF([test "$enable_year2038" != no],
+  [_AC_SYS_YEAR2038_PROBE])
+AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])])
 
 # AC_SYS_LARGEFILE
 # ----------------
@@ -381,29 +323,12 @@ m4_divert_text([DEFAULTS],
 # Additionally, on Linux file systems with 64-bit inodes a file that happens
 # to have a 64-bit inode number cannot be accessed by 32-bit applications on
 # Linux x86/x86_64.  This can occur with file systems such as XFS and NFS.
-# This macro allows configuration to continue if the system doesn't support
-# large files; see also AC_SYS_LARGEFILE_REQUIRED.
 AC_DEFUN([AC_SYS_LARGEFILE],
-[m4_provide_if([_AC_SYS_LARGEFILE_PROBE], [], [dnl
-  AS_IF([test "$ac_largefile_required,$enable_largefile,$ac_year2038_required" != no,no,no],
-    [_AC_SYS_LARGEFILE_PROBE])
-  AC_CONFIG_COMMANDS_PRE([_AC_SYS_LARGEFILE_ENABLE])
-])])
-
-# AC_SYS_LARGEFILE_REQUIRED
-# -------------------------
-# Same as AC_SYS_LARGEFILE, but declares that this program *requires*
-# support for large files.  If we cannot find a combination of compiler
-# options and #defines that makes 'off_t' capable of representing 2**63 - 1,
-# 'configure' will error out.  Furthermore, 'configure' will not offer a
-# --disable-largefile command line option.
-# If both AC_SYS_LARGEFILE and AC_SYS_LARGEFILE_REQUIRED are used in the
-# same configure script -- in either order -- AC_SYS_LARGEFILE_REQUIRED wins.
-AC_DEFUN([AC_SYS_LARGEFILE_REQUIRED],
-[m4_provide_if([_AC_SYS_LARGEFILE_PROBE], [], [dnl
-  _AC_SYS_LARGEFILE_PROBE
-  AC_CONFIG_COMMANDS_PRE([_AC_SYS_LARGEFILE_ENABLE])
-])])
+[AC_ARG_ENABLE([largefile],
+   [AS_HELP_STRING([--disable-largefile],
+      [omit support for large files])])dnl
+AS_IF([test "$enable_largefile,$enable_year2038" != no,no],
+  [_AC_SYS_LARGEFILE_PROBE])])
 
 # AC_SYS_LONG_FILE_NAMES
 # ----------------------
-- 
2.37.2
0001-year2038-tone-down-year2038-related-code.patch (text/x-patch, 23.9 KB)
From 45111db206a441ff9dec6e06396ec97172dc48d4 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Wed, 19 Apr 2023 14:04:33 -0700
Subject: [GNULIB PATCH] year2038: tone down year2038-related code
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Remove the year2038-required and largefile-required modules,
as they would make it harder to configure for older or smaller hosts.
Instead, add a module year2038-recommended.  (There seems to be
little need for largefile-recommended.)
* all-modules: Exclude year2038-recommended, not year2038-required.
* MODULES.html.sh, NEWS, doc/largefile.texi:
* doc/posix-headers/sys_types.texi, doc/posix-headers/time.texi:
* doc/year2038.texi: Document this.
* m4/largefile.m4: Sync from Autoconf master.
Conditionalize the workaround on AC_SYS_YEAR2038_RECOMMENDED rather
than on AC_SYS_LARGEFILE_REQUIRED so that we replace older but still
unreleased Autoconf.
(AC_SYS_LARGEFILE_REQUIRED, AC_SYS_YEAR2038_REQUIRED): New macros.
* modules/largefile-required, modules/year2038-required: Remove.
* modules/year2038 (Files): Add m4/largefile.m4, instead
of depending on largefile, since there’s no direct dependency
on the latter.
* modules/year2038-recommended: New file.
---
 ChangeLog                                     |  23 +++
 MODULES.html.sh                               |   3 +-
 NEWS                                          |   5 +
 all-modules                                   |   2 +-
 doc/largefile.texi                            |   8 +-
 doc/posix-headers/sys_types.texi              |   3 +-
 doc/posix-headers/time.texi                   |   2 +-
 doc/year2038.texi                             |  27 +--
 m4/largefile.m4                               | 181 +++++-------------
 modules/largefile-required                    |  28 ---
 modules/year2038                              |   2 +-
 ...year2038-required => year2038-recommended} |   5 +-
 12 files changed, 107 insertions(+), 182 deletions(-)
 delete mode 100644 modules/largefile-required
 rename modules/{year2038-required => year2038-recommended} (76%)

diff --git a/ChangeLog b/ChangeLog
index 88338a6cdc..9925acbd3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2023-04-19  Paul Eggert  <[email protected]>
+
+
+	year2038: tone down year2038-related code
+	Remove the year2038-required and largefile-required modules,
+	as they would make it harder to configure for older or smaller hosts.
+	Instead, add a module year2038-recommended.  (There seems to be
+	little need for largefile-recommended.)
+	* all-modules: Exclude year2038-recommended, not year2038-required.
+	* MODULES.html.sh, NEWS, doc/largefile.texi:
+	* doc/posix-headers/sys_types.texi, doc/posix-headers/time.texi:
+	* doc/year2038.texi: Document this.
+	* m4/largefile.m4: Sync from Autoconf master.
+	Conditionalize the workaround on AC_SYS_YEAR2038_RECOMMENDED rather
+	than on AC_SYS_LARGEFILE_REQUIRED so that we replace older but still
+	unreleased Autoconf.
+	(AC_SYS_LARGEFILE_REQUIRED, AC_SYS_YEAR2038_REQUIRED): New macros.
+	* modules/largefile-required, modules/year2038-required: Remove.
+	* modules/year2038 (Files): Add m4/largefile.m4, instead
+	of depending on largefile, since there’s no direct dependency
+	on the latter.
+	* modules/year2038-recommended: New file.
+
 2023-04-19  Bruno Haible  <[email protected]>
 
 	doc: Add references to changes accepted for future POSIX revisions.
diff --git a/MODULES.html.sh b/MODULES.html.sh
index 5892711519..01d8762fe5 100755
--- a/MODULES.html.sh
+++ b/MODULES.html.sh
@@ -1769,7 +1769,7 @@ func_all_modules ()
   func_module time-h
   func_module time_rz
   func_module year2038
-  func_module year2038-required
+  func_module year2038-recommended
   func_end_table
 
   element="Extra functions based on ANSI C 89"
@@ -2818,7 +2818,6 @@ func_all_modules ()
   func_module fts
   func_module isdir
   func_module largefile
-  func_module largefile-required
   func_module lchmod
   func_module lchown
   func_module mkancesdirs
diff --git a/NEWS b/NEWS
index fcfaf4906b..75c743b28e 100644
--- a/NEWS
+++ b/NEWS
@@ -74,6 +74,11 @@ User visible incompatible changes
 
 Date        Modules         Changes
 
+2023-04-19  largefile-required
+            year2038-required
+                            These modules are removed.  The latter one
+                            is partly replaced by year2038-recommended.
+
 2023-03-25  mtx             This module no longer provides the function
                             call_once.  To get this function, use the new
                             separate module 'call_once'.
diff --git a/all-modules b/all-modules
index 5b742245cc..571e2a97db 100755
--- a/all-modules
+++ b/all-modules
@@ -89,7 +89,7 @@ exclude_for_mingw="$exclude_for_mingw forkpty-tests forkpty login_tty-tests logi
 exclude_for_msvc="$exclude_for_mingw"
 
 # Command-line option processing.
-exclude="year2038-required"
+exclude="year2038-recommended"
 while test $# -gt 0; do
   case "$1" in
     --for-mingw | --for-ming | --for-min | --for-mi )
diff --git a/doc/largefile.texi b/doc/largefile.texi
index b5bfa5116a..c615b0ebb6 100644
--- a/doc/largefile.texi
+++ b/doc/largefile.texi
@@ -1,22 +1,22 @@
 @node Large File Support
 @section Large File Support
 
-The Gnulib @samp{largefile-required} module provides support for files
+The Gnulib @samp{largefile} module provides support for files
 2 GiB and larger, or with device or inode numbers exceeding 32 bits.
-To this effect, it ensures that types like @code{off_t} and
+To this effect, it attempts to ensure that types like @code{off_t} and
 @code{ino_t} are 64-bit,
 at least on the following platforms:
 glibc, Mac OS X, FreeBSD, NetBSD, OpenBSD, AIX, HP-UX, IRIX, Solaris,
 Cygwin, mingw, MSVC.
 
-The Gnulib @samp{largefile} module is similar, except that it gives
+It also gives
 @command{configure} an option @samp{--disable-largefile} that
 suppresses support for large files.  This may be useful if the package
 links to other libraries whose user-facing ABIs still require
 @code{off_t} or most other file-related types to be 32-bit on your
 platform.
 
-Both modules also add to @command{configure} an option
+It also gives @command{configure} an option
 @code{--enable-year2038}, needed on some platforms to access files
 with timestamps past the year 2038.  @xref{Avoiding the year 2038
 problem}.
diff --git a/doc/posix-headers/sys_types.texi b/doc/posix-headers/sys_types.texi
index 7590e78695..8739cc2625 100644
--- a/doc/posix-headers/sys_types.texi
+++ b/doc/posix-headers/sys_types.texi
@@ -38,7 +38,6 @@ are signed integer types that are wider than @code{long}:
 glibc x32
 @end itemize
 
-This module, together with the modules @code{largefile-required}
-or @code{largefile}, also defines the type
+This module, together with the module @code{largefile}, also defines the type
 @code{off_t} to a 64-bit integer type on some platforms:
 mingw, MSVC 14.
diff --git a/doc/posix-headers/time.texi b/doc/posix-headers/time.texi
index 70814d6cda..d7bd269333 100644
--- a/doc/posix-headers/time.texi
+++ b/doc/posix-headers/time.texi
@@ -19,7 +19,7 @@ NetBSD 5.0.
 @end itemize
 
 Portability problems fixed by the Gnulib module
-@code{year2038} or @code{year2038-required}:
+@code{year2038} or @code{year2038-recommended}:
 @itemize
 @item
 On some platforms where @code{time_t} defaults to 32-bit but can be
diff --git a/doc/year2038.texi b/doc/year2038.texi
index f0f6d51516..055c32a6c2 100644
--- a/doc/year2038.texi
+++ b/doc/year2038.texi
@@ -26,32 +26,34 @@ suppresses support for post-2038 timestamps.  This may be useful if
 the package links to other libraries whose user-facing ABIs still
 require @code{time_t} to be 32-bit on your platform.
 
-The Gnulib module @samp{year2038-required} is like @samp{year2038},
-except it rejects platforms where @code{time_t} cannot represent
-timestamps after 2038, and it lacks a @option{--disable-year2038}
-option.  If this module is used and a 32-platform cannot support
+The Gnulib module @samp{year2038-recommended} is like @samp{year2038},
+except that by default it rejects platforms where @code{time_t}
+cannot represent timestamps after 2038.
+If this module is used and a 32-platform cannot support
 64-bit @code{time_t}, one can still fix the year-2038 problem by using
 a 64-bit instead of a 32-bit build, as noted in the architecture list
 below.  If all else fails one can configure with
-@samp{ac_year2038_required=no}; however, the resulting programs will
+@option{--disable-year2038}; however, the resulting programs will
 mishandle timestamps after 2038.
 
-The Gnulib module @samp{year2038-required} is
+The Gnulib module @samp{year2038-recommended} is
 recommended for packages intended for use on 32-bit platforms
-after the year 2038.  However, if your package needs to support
-32-bit platforms that will not be used after the year 2038,
+after mid-January 2038.  However, if you want builders to be able to
+configure for 32-bit platforms that will be used only before the year
+2038, and to do so without the inconvenience of giving
+@command{configure} the @option{--disable-year2038} option,
 you can use the @samp{year2038} module instead.
 
 If the Gnulib module @samp{largefile} is used but neither
-@samp{year2038} nor @samp{year2038-required} is used,
+@samp{year2038} nor @samp{year2038-recommended} is used,
 @command{configure} will have an option @option{--enable-year2038}
 that causes @code{configure} to behave as if @samp{year2038} was used.
 This is for packages that have long used @samp{largefile} but have not
 gotten around to upgrading their Gnulib module list to include
-@samp{year2038} or @samp{year2038-required}.
+@samp{year2038} or @samp{year2038-recommended}.
 @xref{Large File Support}.
 
-With the @samp{year2038-required} module, @command{configure} by
+With the @samp{year2038-recommended} module, @command{configure} by
 default should work on the following 32-bit platforms (or 32-bit ABIs
 in bi-arch systems):
 
@@ -74,7 +76,8 @@ Minix 3.3.
 @end itemize
 
 @noindent
-Whereas @command{configure} with @samp{year2038-required} will fail on
+Whereas @command{configure} with @samp{year2038-recommended} by default
+(i.e., without the @option{--disable-year2038} option) will fail on
 earlier versions of the abovementioned platforms if a version is listed,
 and it will also fail on all versions of the following older 32-bit
 platforms or ABIs:
diff --git a/m4/largefile.m4 b/m4/largefile.m4
index f741d0df6e..b1c00ebf1a 100644
--- a/m4/largefile.m4
+++ b/m4/largefile.m4
@@ -24,8 +24,8 @@ AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
  ]])
 )
 
-m4_ifndef([AC_SYS_LARGEFILE_REQUIRED], [
-# Support AC_SYS_LARGEFILE_REQUIRED and Y2038 macros, even if
+m4_ifndef([AC_SYS_YEAR2038_RECOMMENDED], [
+# Support AC_SYS_YEAR2038_RECOMMENDED and related macros, even if
 # Autoconf 2.71 or earlier.  This code is taken from Autoconf master.
 
 # _AC_SYS_YEAR2038_TEST_CODE
@@ -58,8 +58,8 @@ m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize(
                                       dnl 32-bit MinGW (misconfiguration)
 ))
 
-# _AC_SYS_YEAR2038_PROBE([IF-NOT-DETECTED])
-# -----------------------------------------
+# _AC_SYS_YEAR2038_PROBE
+# ----------------------
 # Subroutine of AC_SYS_YEAR2038.  Probe for time_t that can represent
 # time points more than 2**31 - 1 seconds after the epoch (dates after
 # 2038-01-18, see above) and set the cache variable ac_cv_sys_year2038_opts
@@ -72,13 +72,10 @@ m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize(
 # AC_TRY_RUN.  Note also that some systems only support large time_t
 # together with large off_t.
 #
-# If support is not detected, the behavior depends on which of the
-# top-level AC_SYS_YEAR2038 macros was used (see below).
-#
 # If you change this macro you may also need to change
 # _AC_SYS_YEAR2038_OPTIONS.
 AC_DEFUN([_AC_SYS_YEAR2038_PROBE],
-[AC_CACHE_CHECK([for $CC option to enable timestamps after Jan 2038],
+[AC_CACHE_CHECK([for $CC option for timestamps after 2038],
   [ac_cv_sys_year2038_opts],
   [ac_save_CPPFLAGS="$CPPFLAGS"
   ac_opt_found=no
@@ -97,29 +94,7 @@ ac_have_year2038=yes
 AS_CASE([$ac_cv_sys_year2038_opts],
   ["none needed"], [],
   ["support not detected"],
-    [ac_have_year2038=no
-     AS_CASE([$ac_year2038_required,$enable_year2038],
-      [yes,*],
-        [AC_MSG_FAILURE([support for timestamps after Jan 2038 is required])],
-      [*,yes],
-        [# If we're not cross compiling and 'touch' works with a large
-        # timestamp, then we can presume the system supports wider time_t
-        # *somehow* and we just weren't able to detect it.  One common
-        # case that we deliberately *don't* probe for is a system that
-        # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers
-        # wide time_t.  (It would be inappropriate for us to override an
-        # intentional use of -m32.)  Error out, demanding use of
-        # --disable-year2038 if this is intentional.
-        AS_IF([test $cross_compiling = no],
-          [AS_IF([TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null],
-            [AS_CASE([`TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null`],
-              [*'Feb  7  2106'* | *'Feb  7 17:10'*],
-              [AC_MSG_FAILURE(m4_text_wrap(
-      [this system appears to support timestamps after January 2038,
-       but no mechanism for enabling wide 'time_t' was detected.
-       Did you mean to build a 64-bit binary? (e.g. 'CC="${CC} -m64"'.)
-       To proceed with 32-bit time_t, configure with '--disable-year2038'.],
-      [], [], [55]))])])])])],
+    [ac_have_year2038=no],
 
   ["-D_TIME_BITS=64"],
     [AC_DEFINE([_TIME_BITS], [64],
@@ -132,7 +107,7 @@ AS_CASE([$ac_cv_sys_year2038_opts],
   ["-U_USE_32_BIT_TIME_T"*],
     [AC_MSG_FAILURE(m4_text_wrap(
       [the 'time_t' type is currently forced to be 32-bit.
-       It will stop working after January 2038.
+       It will stop working after mid-January 2038.
        Remove _USE_32BIT_TIME_T from the compiler flags.],
       [], [], [55]))],
 
@@ -142,44 +117,23 @@ AS_CASE([$ac_cv_sys_year2038_opts],
 
 # _AC_SYS_YEAR2038_ENABLE
 # -----------------------
-# Subroutine of AC_SYS_YEAR2038 and _AC_SYS_YEAR2038_OPT_IN.
 # Depending on which of the YEAR2038 macros was used, add either an
-# --enable-year2038, or a --disable-year2038, or no option at all to
-# the configure script.  Note that this is expanded very late and
+# --enable-year2038 or a --disable-year2038 to
+# the configure script.  This is expanded very late and
 # therefore there cannot be any code in the AC_ARG_ENABLE.  The
 # default value for 'enable_year2038' is emitted unconditionally
 # because the generated code always looks at this variable.
 m4_define([_AC_SYS_YEAR2038_ENABLE],
 [m4_divert_text([DEFAULTS],
-  m4_provide_if([AC_SYS_YEAR2038_REQUIRED],
-    [ac_year2038_required=yes],
-    [ac_year2038_required=no]))dnl
-m4_divert_text([DEFAULTS],
   m4_provide_if([AC_SYS_YEAR2038],
     [enable_year2038=yes],
     [enable_year2038=no]))]dnl
-[m4_provide_if([AC_SYS_YEAR2038_REQUIRED], [],
 [AC_ARG_ENABLE([year2038],
   m4_provide_if([AC_SYS_YEAR2038],
     [AS_HELP_STRING([--disable-year2038],
-      [omit support for dates after Jan 2038])],
+      [don't support timestamps after 2038])],
     [AS_HELP_STRING([--enable-year2038],
-      [include support for dates after Jan 2038])]))])])
-
-# _AC_SYS_YEAR2038_OPT_IN
-# -----------------------
-# If the --enable-year2038 option is given to configure, attempt to
-# detect and activate support for large time_t on 32-bit systems.
-# This macro is automatically invoked by AC_SYS_LARGEFILE when large
-# *file* support is detected.  It does not AC_REQUIRE AC_SYS_LARGEFILE
-# to avoid a dependency loop, and is therefore unsafe to expose as a
-# documented macro.
-AC_DEFUN([_AC_SYS_YEAR2038_OPT_IN],
-[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl
-  AS_IF([test "$ac_year2038_required,$enable_year2038" != no,no],
-    [_AC_SYS_YEAR2038_PROBE])
-  AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])
-])])
+      [support timestamps after 2038])]))])
 
 # AC_SYS_YEAR2038
 # ---------------
@@ -187,28 +141,39 @@ AC_DEFUN([_AC_SYS_YEAR2038_OPT_IN],
 # On systems where time_t is not always 64 bits, this probe can be
 # skipped by passing the --disable-year2038 option to configure.
 AC_DEFUN([AC_SYS_YEAR2038],
-[m4_provide_if([AC_SYS_LARGEFILE_REQUIRED], [],
-  [AC_REQUIRE([AC_SYS_LARGEFILE])])]dnl
-[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl
-  AS_IF([test "$ac_year2038_required,$enable_year2038" != no,no],
-    [_AC_SYS_YEAR2038_PROBE])
-  AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])
-])])
+[AC_REQUIRE([AC_SYS_LARGEFILE])dnl
+AS_IF([test "$enable_year2038,$ac_have_year2038,$cross_compiling" = yes,no,no],
+ [# If we're not cross compiling and 'touch' works with a large
+  # timestamp, then we can presume the system supports wider time_t
+  # *somehow* and we just weren't able to detect it.  One common
+  # case that we deliberately *don't* probe for is a system that
+  # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers
+  # wide time_t.  (It would be inappropriate for us to override an
+  # intentional use of -m32.)  Error out, demanding use of
+  # --disable-year2038 if this is intentional.
+  AS_IF([TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null],
+    [AS_CASE([`TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null`],
+       [*'Feb  7  2106'* | *'Feb  7 17:10'*],
+       [AC_MSG_FAILURE(m4_text_wrap(
+	  [this system appears to support timestamps after mid-January 2038,
+	   but no mechanism for enabling wide 'time_t' was detected.
+	   Did you mean to build a 64-bit binary? (E.g., 'CC="${CC} -m64"'.)
+	   To proceed with 32-bit time_t, configure with '--disable-year2038'.],
+	  [], [], [55]))])])])])
 
-# AC_SYS_YEAR2038_REQUIRED
-# ------------------------
-# Same as AC_SYS_YEAR2038, but declares that this program *requires*
-# support for large time_t.  If we cannot find any way to make time_t
-# capable of representing values larger than 2**31 - 1, configure will
-# error out.  Furthermore, no --enable-year2038 nor --disable-year2038
-# option will be available.
-AC_DEFUN([AC_SYS_YEAR2038_REQUIRED],
-[m4_provide_if([AC_SYS_LARGEFILE_REQUIRED], [],
-  [AC_REQUIRE([AC_SYS_LARGEFILE])])]dnl
-[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl
-  _AC_SYS_YEAR2038_PROBE
-  AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])
-])])
+# AC_SYS_YEAR2038_RECOMMENDED
+# ---------------------------
+# Same as AC_SYS_YEAR2038, but recommend support for large time_t.
+# If we cannot find any way to make time_t capable of representing
+# values larger than 2**31 - 1, error out unless --disable-year2038 is given.
+AC_DEFUN([AC_SYS_YEAR2038_RECOMMENDED],
+[AC_REQUIRE([AC_SYS_YEAR2038])dnl
+AS_IF([test "$enable_year2038,$ac_have_year2038" = yes,no],
+   [AC_MSG_FAILURE(m4_text_wrap(
+      [could not enable timestamps after mid-January 2038.
+       Did you mean to build a 64-bit binary? (E.g., 'CC="${CC} -m64"'.)
+       To proceed with 32-bit time_t, configure with '--disable-year2038'.],
+      [], [], [55]))])])
 
 # _AC_SYS_LARGEFILE_TEST_CODE
 # ---------------------------
@@ -272,9 +237,7 @@ ac_have_largefile=yes
 AS_CASE([$ac_cv_sys_largefile_opts],
   ["none needed"], [],
   ["support not detected"],
-    [ac_have_largefile=no
-     AS_IF([test $ac_largefile_required,$ac_year2038_required != no,no],
-       [AC_MSG_FAILURE([support for large files is required])])],
+    [ac_have_largefile=no],
 
   ["-D_FILE_OFFSET_BITS=64"],
     [AC_DEFINE([_FILE_OFFSET_BITS], [64],
@@ -290,30 +253,9 @@ AS_CASE([$ac_cv_sys_largefile_opts],
   [AC_MSG_ERROR(
     [internal error: bad value for \$ac_cv_sys_largefile_opts])])
 
-_AC_SYS_YEAR2038_OPT_IN
-])
-
-# _AC_SYS_LARGEFILE_ENABLE
-# ------------------------
-# Subroutine of AC_SYS_LARGEFILE.  If AC_SYS_LARGEFILE_REQUIRED was
-# not used at any point in this configure script, add a
-# --disable-largefile option to the configure script.  Note that this
-# is expanded very late and therefore there cannot be any code in the
-# AC_ARG_ENABLE.  The default value for 'enable_largefile' is emitted
-# unconditionally because the generated shell code always looks at
-# this variable.
-m4_define([_AC_SYS_LARGEFILE_ENABLE],
-[m4_divert_text([DEFAULTS],
-  m4_provide_if([AC_SYS_LARGEFILE_REQUIRED],
-    [ac_largefile_required=yes],
-    [ac_largefile_required=no]))dnl
-m4_divert_text([DEFAULTS],
-  [enable_largefile=yes])]dnl
-[m4_provide_if([AC_SYS_LARGEFILE_REQUIRED], [],
-   [m4_provide_if([AC_SYS_YEAR2038_REQUIRED], [],
-      [AC_ARG_ENABLE([largefile],
-         [AS_HELP_STRING([--disable-largefile],
-	    [omit support for large files])])])])])
+AS_IF([test "$enable_year2038" != no],
+  [_AC_SYS_YEAR2038_PROBE])
+AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])])
 
 # AC_SYS_LARGEFILE
 # ----------------
@@ -324,30 +266,13 @@ m4_divert_text([DEFAULTS],
 # Additionally, on Linux file systems with 64-bit inodes a file that happens
 # to have a 64-bit inode number cannot be accessed by 32-bit applications on
 # Linux x86/x86_64.  This can occur with file systems such as XFS and NFS.
-# This macro allows configuration to continue if the system doesn't support
-# large files; see also AC_SYS_LARGEFILE_REQUIRED.
 AC_DEFUN([AC_SYS_LARGEFILE],
-[m4_provide_if([_AC_SYS_LARGEFILE_PROBE], [], [dnl
-  AS_IF([test "$ac_largefile_required,$enable_largefile,$ac_year2038_required" != no,no,no],
-    [_AC_SYS_LARGEFILE_PROBE])
-  AC_CONFIG_COMMANDS_PRE([_AC_SYS_LARGEFILE_ENABLE])
-])])
-
-# AC_SYS_LARGEFILE_REQUIRED
-# -------------------------
-# Same as AC_SYS_LARGEFILE, but declares that this program *requires*
-# support for large files.  If we cannot find a combination of compiler
-# options and #defines that makes 'off_t' capable of representing 2**63 - 1,
-# 'configure' will error out.  Furthermore, 'configure' will not offer a
-# --disable-largefile command line option.
-# If both AC_SYS_LARGEFILE and AC_SYS_LARGEFILE_REQUIRED are used in the
-# same configure script -- in either order -- AC_SYS_LARGEFILE_REQUIRED wins.
-AC_DEFUN([AC_SYS_LARGEFILE_REQUIRED],
-[m4_provide_if([_AC_SYS_LARGEFILE_PROBE], [], [dnl
-  _AC_SYS_LARGEFILE_PROBE
-  AC_CONFIG_COMMANDS_PRE([_AC_SYS_LARGEFILE_ENABLE])
-])])
-])# m4_ifndef AC_SYS_LARGEFILE_REQUIRED
+[AC_ARG_ENABLE([largefile],
+   [AS_HELP_STRING([--disable-largefile],
+      [omit support for large files])])dnl
+AS_IF([test "$enable_largefile,$enable_year2038" != no,no],
+  [_AC_SYS_LARGEFILE_PROBE])])
+])# m4_ifndef AC_SYS_YEAR2038_RECOMMENDED
 
 # Enable large files on systems where this is implemented by Gnulib, not by the
 # system headers.
diff --git a/modules/largefile-required b/modules/largefile-required
deleted file mode 100644
index eea5ecf4fc..0000000000
--- a/modules/largefile-required
+++ /dev/null
@@ -1,28 +0,0 @@
-Description:
-Require support for files 2 GiB and larger.
-
-Comment:
-This module should not be used as a dependency from a test module,
-otherwise when this module occurs as a tests-related module, it will
-have side effects on the compilation of the main modules in lib/.
-
-Files:
-m4/largefile.m4
-
-Depends-on:
-largefile
-
-configure.ac:
-AC_REQUIRE([AC_SYS_LARGEFILE_REQUIRED])
-
-configure.ac:
-
-Makefile.am:
-
-Include:
-
-License:
-LGPLv2+
-
-Maintainer:
-all
diff --git a/modules/year2038 b/modules/year2038
index c44d4dc868..be01240513 100644
--- a/modules/year2038
+++ b/modules/year2038
@@ -7,9 +7,9 @@ otherwise when this module occurs as a tests-related module, it will
 have side effects on the compilation of the main modules in lib/.
 
 Files:
+m4/largefile.m4
 
 Depends-on:
-largefile
 
 configure.ac-early:
 AC_REQUIRE([AC_SYS_YEAR2038])
diff --git a/modules/year2038-required b/modules/year2038-recommended
similarity index 76%
rename from modules/year2038-required
rename to modules/year2038-recommended
index 29dd556410..7e2598ca32 100644
--- a/modules/year2038-required
+++ b/modules/year2038-recommended
@@ -1,5 +1,5 @@
 Description:
-Ensure that 'time_t' can go past the year 2038.
+Recommend that 'time_t' go past the year 2038.
 
 Comment:
 This module should not be used as a dependency from a test module,
@@ -10,10 +10,9 @@ Files:
 m4/largefile.m4
 
 Depends-on:
-largefile-required
 
 configure.ac-early:
-AC_REQUIRE([AC_SYS_YEAR2038_REQUIRED])
+AC_REQUIRE([AC_SYS_YEAR2038_RECOMMENDED])
 
 Makefile.am:
 
-- 
2.37.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.