bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] largefile, year2038: simplify if Autoconf 2.72


From: Paul Eggert
Subject: [PATCH] largefile, year2038: simplify if Autoconf 2.72
Date: Tue, 9 Aug 2022 11:12:58 -0700

* m4/largefile.m4 (gl_SET_LARGEFILE_SOURCE)
(_AC_SYS_LARGEFILE_MACRO_VALUE):
* m4/year2038.m4 (gl_YEAR2038_EARLY, gl_YEAR2038, gl_YEAR2038_BODY):
Adjust to Autoconf 2.72, which should contain the Gnulib
patches in this area and so should not need to be overridden.
---
 ChangeLog       |  9 +++++++++
 m4/largefile.m4 |  7 ++++++-
 m4/year2038.m4  | 10 +++++++++-
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 63691ebfb6..5dc57dc4f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-08-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       largefile, year2038: simplify if Autoconf 2.72
+       * m4/largefile.m4 (gl_SET_LARGEFILE_SOURCE)
+       (_AC_SYS_LARGEFILE_MACRO_VALUE):
+       * m4/year2038.m4 (gl_YEAR2038_EARLY, gl_YEAR2038, gl_YEAR2038_BODY):
+       Adjust to Autoconf 2.72, which should contain the Gnulib
+       patches in this area and so should not need to be overridden.
+
 2022-08-07  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool.py: Finish implementing option --extract-test-module.
diff --git a/m4/largefile.m4 b/m4/largefile.m4
index 3e8b5e39a7..ec9677c46d 100644
--- a/m4/largefile.m4
+++ b/m4/largefile.m4
@@ -10,8 +10,10 @@
 # It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this
 # setting of _LARGEFILE_SOURCE is needed so that <stdio.h> declares fseeko
 # and ftello in C++ mode as well.
+# Fixed in Autoconf 2.72, which has AC_SYS_YEAR2038.
 AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
 [
+ m4_ifndef([AC_SYS_YEAR2038], [
   AC_REQUIRE([AC_CANONICAL_HOST])
   AC_FUNC_FSEEKO
   case "$host_os" in
@@ -20,9 +22,10 @@ AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
         [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).])
       ;;
   esac
+ ])
 ])
 
-# Work around a problem in Autoconf through at least 2.71 on glibc 2.34+
+# Work around a problem in Autoconf through 2.71 on glibc 2.34+
 # with _TIME_BITS.  Also, work around a problem in autoconf <= 2.69:
 # AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5,
 # or configures them incorrectly in some cases.
@@ -43,6 +46,7 @@ m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
 ])
 ])# m4_version_prereq 2.70
 
+m4_ifndef([AC_SYS_YEAR2038], [
 
 # _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
 #                               CACHE-VAR,
@@ -118,6 +122,7 @@ AS_IF([test "$enable_largefile" != no],
     [64],
       [gl_YEAR2038_BODY([])])])
 ])# AC_SYS_LARGEFILE
+])# m4_ifndef AC_SYS_YEAR2038
 
 # Enable large files on systems where this is implemented by Gnulib, not by the
 # system headers.
diff --git a/m4/year2038.m4 b/m4/year2038.m4
index 06db589ba9..2e4427e6fa 100644
--- a/m4/year2038.m4
+++ b/m4/year2038.m4
@@ -1,4 +1,4 @@
-# year2038.m4 serial 7
+# year2038.m4 serial 8
 dnl Copyright (C) 2017-2022 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,6 +7,12 @@ dnl with or without modifications, as long as this notice is 
preserved.
 dnl Attempt to ensure that 'time_t' can go past the year 2038 and that
 dnl the functions 'time', 'stat', etc. work with post-2038 timestamps.
 
+m4_ifdef([AC_SYS_YEAR2038], [
+  AC_DEFUN([gl_YEAR2038_EARLY])
+  AC_DEFUN([gl_YEAR2038], [AC_SYS_YEAR2038])
+  AC_DEFUN([gl_YEAR2038_BODY], [_AC_SYS_YEAR2038])
+], [
+
 AC_DEFUN([gl_YEAR2038_EARLY],
 [
   AC_REQUIRE([AC_CANONICAL_HOST])
@@ -122,3 +128,5 @@ AC_DEFUN([gl_YEAR2038],
 [
   gl_YEAR2038_BODY([require-year2038-safe])
 ])
+
+]) # m4_ifndef AC_SYS_YEAR2038
-- 
2.37.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]