summaryrefslogtreecommitdiffstats
path: root/m4/largefile.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/largefile.m4')
-rw-r--r--m4/largefile.m432
1 files changed, 21 insertions, 11 deletions
diff --git a/m4/largefile.m4 b/m4/largefile.m4
index 8d4bb7c..cbe9bc1 100644
--- a/m4/largefile.m4
+++ b/m4/largefile.m4
@@ -1,7 +1,7 @@
# Enable large files on systems where this is not the default.
# Enable support for files on Linux file systems with 64-bit inode numbers.
-# Copyright 1992-1996, 1998-2023 Free Software Foundation, Inc.
+# Copyright 1992-1996, 1998-2024 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -171,8 +171,9 @@ AC_DEFUN([AC_SYS_YEAR2038_RECOMMENDED],
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'.],
+ This package recommends support for these later timestamps.
+ However, to proceed with signed 32-bit time_t even though it
+ will fail then, configure with '--disable-year2038'.],
[], [], [55]))])])
# _AC_SYS_LARGEFILE_TEST_CODE
@@ -180,13 +181,16 @@ AS_IF([test "$enable_year2038,$ac_have_year2038" = yes,no],
# C code used to probe for large file support.
m4_define([_AC_SYS_LARGEFILE_TEST_CODE],
[@%:@include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
+@%:@ifndef FTYPE
+@%:@ define FTYPE off_t
+@%:@endif
+ /* Check that FTYPE can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_FTYPE to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-@%:@define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
- int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
+@%:@define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31))
+ int FTYPE_is_large[[(LARGE_FTYPE % 2147483629 == 721
+ && LARGE_FTYPE % 2147483647 == 1)
? 1 : -1]];[]dnl
])
# Defined by Autoconf 2.71 and circa 2022 Gnulib unwisely depended on it.
@@ -226,7 +230,13 @@ AC_DEFUN([_AC_SYS_LARGEFILE_PROBE],
AS_IF([test x"$ac_opt" != x"none needed"],
[CC="$ac_save_CC $ac_opt"])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_CODE])],
- [ac_cv_sys_largefile_opts="$ac_opt"
+ [AS_IF([test x"$ac_opt" = x"none needed"],
+ [# GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t.
+ CC="$CC -DFTYPE=ino_t"
+ AC_COMPILE_IFELSE([], [],
+ [CC="$CC -D_FILE_OFFSET_BITS=64"
+ AC_COMPILE_IFELSE([], [ac_opt='-D_FILE_OFFSET_BITS=64'])])])
+ ac_cv_sys_largefile_opts=$ac_opt
ac_opt_found=yes])
test $ac_opt_found = no || break
done
@@ -237,7 +247,7 @@ AC_DEFUN([_AC_SYS_LARGEFILE_PROBE],
AC_REQUIRE([AC_CANONICAL_HOST])
if test $ac_opt_found != yes; then
AS_CASE([$host_os],
- [mingw*],
+ [mingw* | windows*],
[ac_cv_sys_largefile_opts="supported through gnulib"
ac_opt_found=yes]
)
@@ -295,7 +305,7 @@ AC_DEFUN([gl_LARGEFILE],
[
AC_REQUIRE([AC_CANONICAL_HOST])
case "$host_os" in
- mingw*)
+ mingw* | windows*)
dnl Native Windows.
dnl mingw64 defines off_t to a 64-bit type already, if
dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE.