>From 1f49c355984a5e2bb7f5f4af5ebdd657cadf1988 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 16 Apr 2023 01:22:19 +0200 Subject: [PATCH] year2038-required: Fix configure failure with MSVC. * m4/largefile.m4 (_AC_SYS_LARGEFILE_PROBE): Require AC_CANONICAL_HOST. Distinguish the results "support not detected" and "supported through gnulib". If the result is "supported through gnulib", don't fail. --- ChangeLog | 7 +++++++ m4/largefile.m4 | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0e5a94eab1..d4ea19e445 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-04-15 Bruno Haible + + year2038-required: Fix configure failure with MSVC. + * m4/largefile.m4 (_AC_SYS_LARGEFILE_PROBE): Require AC_CANONICAL_HOST. + Distinguish the results "support not detected" and "supported through + gnulib". If the result is "supported through gnulib", don't fail. + 2023-04-15 Bruno Haible Fix compilation errors of list, set, oset, map, omap in C++ mode. diff --git a/m4/largefile.m4 b/m4/largefile.m4 index f741d0df6e..17518922be 100644 --- a/m4/largefile.m4 +++ b/m4/largefile.m4 @@ -253,7 +253,8 @@ m4_define([_AC_SYS_LARGEFILE_OPTIONS] # If you change this macro you may also need to change # _AC_SYS_LARGEFILE_OPTIONS. AC_DEFUN([_AC_SYS_LARGEFILE_PROBE], -[AC_CACHE_CHECK([for $CC option to enable large file support], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_CACHE_CHECK([for $CC option to enable large file support], [ac_cv_sys_largefile_opts], [ac_save_CC="$CC" ac_opt_found=no @@ -266,11 +267,23 @@ AC_DEFUN([_AC_SYS_LARGEFILE_PROBE] test $ac_opt_found = no || break done CC="$ac_save_CC" + dnl Gnulib implements large file support for native Windows, based on the + dnl variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE. + m4_ifdef([gl_LARGEFILE], [ + if test $ac_opt_found != yes; then + AS_CASE([$host_os], + [mingw*], + [ac_cv_sys_largefile_opts="supported through gnulib" + ac_opt_found=yes] + ) + fi + ]) test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected"]) ac_have_largefile=yes AS_CASE([$ac_cv_sys_largefile_opts], ["none needed"], [], + ["supported through gnulib"], [], ["support not detected"], [ac_have_largefile=no AS_IF([test $ac_largefile_required,$ac_year2038_required != no,no], -- 2.34.1