summaryrefslogtreecommitdiff
path: root/gl/m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4')
-rw-r--r--gl/m4/00gnulib.m42
-rw-r--r--gl/m4/__inline.m42
-rw-r--r--gl/m4/absolute-header.m42
-rw-r--r--gl/m4/alloca.m42
-rw-r--r--gl/m4/argp.m42
-rw-r--r--gl/m4/asm-underscore.m42
-rw-r--r--gl/m4/assert_h.m473
-rw-r--r--gl/m4/btowc.m459
-rw-r--r--gl/m4/builtin-expect.m42
-rw-r--r--gl/m4/c-bool.m451
-rw-r--r--gl/m4/calloc.m420
-rw-r--r--gl/m4/canonicalize.m410
-rw-r--r--gl/m4/chdir-long.m42
-rw-r--r--gl/m4/chown.m42
-rw-r--r--gl/m4/clock_time.m417
-rw-r--r--gl/m4/close.m46
-rw-r--r--gl/m4/closedir.m435
-rw-r--r--gl/m4/codeset.m42
-rw-r--r--gl/m4/ctype_h.m42
-rw-r--r--gl/m4/d-ino.m46
-rw-r--r--gl/m4/d-type.m42
-rw-r--r--gl/m4/dirent_h.m423
-rw-r--r--gl/m4/dirfd.m427
-rw-r--r--gl/m4/double-slash-root.m42
-rw-r--r--gl/m4/dup.m42
-rw-r--r--gl/m4/dup2.m42
-rw-r--r--gl/m4/eealloc.m42
-rw-r--r--gl/m4/environ.m42
-rw-r--r--gl/m4/errno_h.m42
-rw-r--r--gl/m4/error.m413
-rw-r--r--gl/m4/error_h.m4124
-rw-r--r--gl/m4/exponentd.m46
-rw-r--r--gl/m4/extensions.m413
-rw-r--r--gl/m4/extern-inline.m46
-rw-r--r--gl/m4/fchdir.m46
-rw-r--r--gl/m4/fcntl-o.m42
-rw-r--r--gl/m4/fcntl.m42
-rw-r--r--gl/m4/fcntl_h.m42
-rw-r--r--gl/m4/fdopendir.m416
-rw-r--r--gl/m4/filenamecat.m46
-rw-r--r--gl/m4/flexmember.m42
-rw-r--r--gl/m4/float_h.m42
-rw-r--r--gl/m4/flock.m42
-rw-r--r--gl/m4/fnmatch.m487
-rw-r--r--gl/m4/fnmatch_h.m42
-rw-r--r--gl/m4/free.m42
-rw-r--r--gl/m4/fstat.m42
-rw-r--r--gl/m4/fstatat.m42
-rw-r--r--gl/m4/getcwd-abort-bug.m42
-rw-r--r--gl/m4/getcwd-path-max.m42
-rw-r--r--gl/m4/getcwd.m46
-rw-r--r--gl/m4/getdelim.m455
-rw-r--r--gl/m4/getdtablesize.m42
-rw-r--r--gl/m4/getline.m422
-rw-r--r--gl/m4/getlogin.m411
-rw-r--r--gl/m4/getlogin_r.m49
-rw-r--r--gl/m4/getopt.m42
-rw-r--r--gl/m4/getpagesize.m42
-rw-r--r--gl/m4/getprogname.m423
-rw-r--r--gl/m4/getrandom.m424
-rw-r--r--gl/m4/gettime.m453
-rw-r--r--gl/m4/gettimeofday.m42
-rw-r--r--gl/m4/glob.m413
-rw-r--r--gl/m4/glob_h.m42
-rw-r--r--gl/m4/gnulib-common.m4623
-rw-r--r--gl/m4/gnulib-comp.m485
-rw-r--r--gl/m4/host-cpu-c-abi.m42
-rw-r--r--gl/m4/idpriv.m42
-rw-r--r--gl/m4/include_next.m42
-rw-r--r--gl/m4/intmax_t.m42
-rw-r--r--gl/m4/inttypes.m48
-rw-r--r--gl/m4/inttypes_h.m42
-rw-r--r--gl/m4/ioctl.m42
-rw-r--r--gl/m4/isblank.m42
-rw-r--r--gl/m4/langinfo_h.m42
-rw-r--r--gl/m4/largefile.m4344
-rw-r--r--gl/m4/lchown.m42
-rw-r--r--gl/m4/lib-ignore.m42
-rw-r--r--gl/m4/lib-ld.m46
-rw-r--r--gl/m4/lib-link.m44
-rw-r--r--gl/m4/lib-prefix.m42
-rw-r--r--gl/m4/limits-h.m425
-rw-r--r--gl/m4/localcharset.m42
-rw-r--r--gl/m4/locale-fr.m4125
-rw-r--r--gl/m4/locale-ja.m46
-rw-r--r--gl/m4/locale-zh.m46
-rw-r--r--gl/m4/locale_h.m42
-rw-r--r--gl/m4/localeconv.m441
-rw-r--r--gl/m4/lock.m42
-rw-r--r--gl/m4/lstat.m47
-rw-r--r--gl/m4/malloc.m46
-rw-r--r--gl/m4/malloca.m42
-rw-r--r--gl/m4/manywarnings.m4115
-rw-r--r--gl/m4/math_h.m42
-rw-r--r--gl/m4/mbrtowc.m498
-rw-r--r--gl/m4/mbsinit.m42
-rw-r--r--gl/m4/mbsrtowcs.m423
-rw-r--r--gl/m4/mbstate_t.m42
-rw-r--r--gl/m4/mbtowc.m49
-rw-r--r--gl/m4/memchr.m42
-rw-r--r--gl/m4/memmem.m42
-rw-r--r--gl/m4/mempcpy.m49
-rw-r--r--gl/m4/memrchr.m42
-rw-r--r--gl/m4/minmax.m42
-rw-r--r--gl/m4/mkdir.m48
-rw-r--r--gl/m4/mkdtemp.m42
-rw-r--r--gl/m4/mkstemp.m420
-rw-r--r--gl/m4/mmap-anon.m42
-rw-r--r--gl/m4/mode_t.m42
-rw-r--r--gl/m4/msvc-inval.m42
-rw-r--r--gl/m4/msvc-nothrow.m42
-rw-r--r--gl/m4/multiarch.m42
-rw-r--r--gl/m4/musl.m420
-rw-r--r--gl/m4/nanosleep.m429
-rw-r--r--gl/m4/nl_langinfo.m411
-rw-r--r--gl/m4/nocrash.m42
-rw-r--r--gl/m4/nonblocking.m42
-rw-r--r--gl/m4/off_t.m42
-rw-r--r--gl/m4/open-cloexec.m42
-rw-r--r--gl/m4/open-slash.m42
-rw-r--r--gl/m4/open.m42
-rw-r--r--gl/m4/openat.m42
-rw-r--r--gl/m4/opendir.m437
-rw-r--r--gl/m4/pathmax.m42
-rw-r--r--gl/m4/pipe.m42
-rw-r--r--gl/m4/printf.m4632
-rw-r--r--gl/m4/pselect.m46
-rw-r--r--gl/m4/pthread_rwlock_rdlock.m436
-rw-r--r--gl/m4/pthread_sigmask.m424
-rw-r--r--gl/m4/raise.m42
-rw-r--r--gl/m4/rawmemchr.m42
-rw-r--r--gl/m4/readdir.m410
-rw-r--r--gl/m4/readlink.m410
-rw-r--r--gl/m4/readlinkat.m49
-rw-r--r--gl/m4/realloc.m46
-rw-r--r--gl/m4/reallocarray.m49
-rw-r--r--gl/m4/regex.m46
-rw-r--r--gl/m4/rename.m410
-rw-r--r--gl/m4/renameat.m47
-rw-r--r--gl/m4/rewinddir.m410
-rw-r--r--gl/m4/rmdir.m44
-rw-r--r--gl/m4/save-cwd.m42
-rw-r--r--gl/m4/select.m413
-rw-r--r--gl/m4/setenv.m419
-rw-r--r--gl/m4/setlocale_null.m437
-rw-r--r--gl/m4/sigaction.m42
-rw-r--r--gl/m4/signal_h.m42
-rw-r--r--gl/m4/signalblocking.m42
-rw-r--r--gl/m4/sigpipe.m42
-rw-r--r--gl/m4/size_max.m42
-rw-r--r--gl/m4/sleep.m46
-rw-r--r--gl/m4/socketlib.m42
-rw-r--r--gl/m4/sockets.m42
-rw-r--r--gl/m4/socklen.m42
-rw-r--r--gl/m4/sockpfaf.m42
-rw-r--r--gl/m4/ssize_t.m430
-rw-r--r--gl/m4/stat-time.m42
-rw-r--r--gl/m4/stat.m46
-rw-r--r--gl/m4/stdalign.m4166
-rw-r--r--gl/m4/stdarg.m42
-rw-r--r--gl/m4/stdbool.m4117
-rw-r--r--gl/m4/stddef_h.m428
-rw-r--r--gl/m4/stdint.m42
-rw-r--r--gl/m4/stdint_h.m42
-rw-r--r--gl/m4/stdio_h.m438
-rw-r--r--gl/m4/stdlib_h.m466
-rw-r--r--gl/m4/stpcpy.m49
-rw-r--r--gl/m4/strcase.m42
-rw-r--r--gl/m4/strcasestr.m42
-rw-r--r--gl/m4/strchrnul.m49
-rw-r--r--gl/m4/strdup.m42
-rw-r--r--gl/m4/strerror.m432
-rw-r--r--gl/m4/string_h.m411
-rw-r--r--gl/m4/strings_h.m42
-rw-r--r--gl/m4/strndup.m42
-rw-r--r--gl/m4/strnlen.m42
-rw-r--r--gl/m4/strsep.m42
-rw-r--r--gl/m4/sys_file_h.m42
-rw-r--r--gl/m4/sys_ioctl_h.m42
-rw-r--r--gl/m4/sys_random_h.m42
-rw-r--r--gl/m4/sys_select_h.m42
-rw-r--r--gl/m4/sys_socket_h.m42
-rw-r--r--gl/m4/sys_stat_h.m42
-rw-r--r--gl/m4/sys_time_h.m42
-rw-r--r--gl/m4/sys_types_h.m42
-rw-r--r--gl/m4/sys_uio_h.m42
-rw-r--r--gl/m4/sysexits.m42
-rw-r--r--gl/m4/tempname.m42
-rw-r--r--gl/m4/termios_h.m42
-rw-r--r--gl/m4/threadlib.m441
-rw-r--r--gl/m4/time_h.m413
-rw-r--r--gl/m4/timespec.m42
-rw-r--r--gl/m4/unistd-safer.m42
-rw-r--r--gl/m4/unistd_h.m49
-rw-r--r--gl/m4/unlink.m46
-rw-r--r--gl/m4/unlinkat.m42
-rw-r--r--gl/m4/utime.m42
-rw-r--r--gl/m4/utime_h.m42
-rw-r--r--gl/m4/utimens.m410
-rw-r--r--gl/m4/utimes.m42
-rw-r--r--gl/m4/vasnprintf.m4188
-rw-r--r--gl/m4/vasprintf.m42
-rw-r--r--gl/m4/visibility.m42
-rw-r--r--gl/m4/vsnprintf.m42
-rw-r--r--gl/m4/warn-on-use.m423
-rw-r--r--gl/m4/warnings.m494
-rw-r--r--gl/m4/wchar_h.m49
-rw-r--r--gl/m4/wchar_t.m42
-rw-r--r--gl/m4/wcrtomb.m416
-rw-r--r--gl/m4/wctype_h.m42
-rw-r--r--gl/m4/wint_t.m42
-rw-r--r--gl/m4/wmemchr.m42
-rw-r--r--gl/m4/wmempcpy.m49
-rw-r--r--gl/m4/xalloc.m42
-rw-r--r--gl/m4/xgetcwd.m42
-rw-r--r--gl/m4/xsize.m42
-rw-r--r--gl/m4/xstrndup.m42
-rw-r--r--gl/m4/xvasprintf.m42
-rw-r--r--gl/m4/year2038.m4124
-rw-r--r--gl/m4/zzgnulib.m42
220 files changed, 3323 insertions, 1322 deletions
diff --git a/gl/m4/00gnulib.m4 b/gl/m4/00gnulib.m4
index dea34e83..7fe03e0b 100644
--- a/gl/m4/00gnulib.m4
+++ b/gl/m4/00gnulib.m4
@@ -1,5 +1,5 @@
# 00gnulib.m4 serial 8
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/__inline.m4 b/gl/m4/__inline.m4
index fbe2098e..acf8668b 100644
--- a/gl/m4/__inline.m4
+++ b/gl/m4/__inline.m4
@@ -1,5 +1,5 @@
# Test for __inline keyword
-dnl Copyright 2017-2022 Free Software Foundation, Inc.
+dnl Copyright 2017-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/absolute-header.m4 b/gl/m4/absolute-header.m4
index 67d6507c..e7947648 100644
--- a/gl/m4/absolute-header.m4
+++ b/gl/m4/absolute-header.m4
@@ -1,5 +1,5 @@
# absolute-header.m4 serial 17
-dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/alloca.m4 b/gl/m4/alloca.m4
index dc6f47e3..c685fac9 100644
--- a/gl/m4/alloca.m4
+++ b/gl/m4/alloca.m4
@@ -1,5 +1,5 @@
# alloca.m4 serial 21
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2022 Free Software Foundation,
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/argp.m4 b/gl/m4/argp.m4
index a6f7b8ef..1f8578bd 100644
--- a/gl/m4/argp.m4
+++ b/gl/m4/argp.m4
@@ -1,5 +1,5 @@
# argp.m4 serial 16
-dnl Copyright (C) 2003-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/asm-underscore.m4 b/gl/m4/asm-underscore.m4
index 950aa8d2..65ae55a7 100644
--- a/gl/m4/asm-underscore.m4
+++ b/gl/m4/asm-underscore.m4
@@ -1,5 +1,5 @@
# asm-underscore.m4 serial 5
-dnl Copyright (C) 2010-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/assert_h.m4 b/gl/m4/assert_h.m4
new file mode 100644
index 00000000..d255855d
--- /dev/null
+++ b/gl/m4/assert_h.m4
@@ -0,0 +1,73 @@
+# assert-h.m4
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+AC_DEFUN([gl_ASSERT_H],
+[
+ AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert],
+ [gl_save_CFLAGS=$CFLAGS
+ for gl_working in "yes, a keyword" "yes, an <assert.h> macro"; do
+ AS_CASE([$gl_working],
+ [*assert.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_ASSERT_H"])
+
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if defined __clang__ && __STDC_VERSION__ < 202311
+ #pragma clang diagnostic error "-Wc2x-extensions"
+ #pragma clang diagnostic error "-Wc++1z-extensions"
+ #endif
+ #ifdef INCLUDE_ASSERT_H
+ #include <assert.h>
+ #endif
+ static_assert (2 + 2 == 4, "arithmetic does not work");
+ static_assert (2 + 2 == 4);
+ ]],
+ [[
+ static_assert (sizeof (char) == 1, "sizeof does not work");
+ static_assert (sizeof (char) == 1);
+ ]])],
+ [gl_cv_static_assert=$gl_working],
+ [gl_cv_static_assert=no])
+ CFLAGS=$gl_save_CFLAGS
+ test "$gl_cv_static_assert" != no && break
+ done])
+
+ GL_GENERATE_ASSERT_H=false
+ AS_CASE([$gl_cv_static_assert],
+ [yes*keyword*],
+ [AC_DEFINE([HAVE_C_STATIC_ASSERT], [1],
+ [Define to 1 if the static_assert keyword works.])],
+ [no],
+ [GL_GENERATE_ASSERT_H=true
+ gl_NEXT_HEADERS([assert.h])])
+
+ dnl The "zz" puts this toward config.h's end, to avoid potential
+ dnl collisions with other definitions.
+ dnl #undef assert so that programs are not tempted to use it without
+ dnl specifically including assert.h.
+ dnl #undef __ASSERT_H__ so that on IRIX, when programs later include
+ dnl <assert.h>, this include actually defines assert.
+ dnl Break the #undef_s apart with a comment so that 'configure' does
+ dnl not comment them out.
+ AH_VERBATIM([zzstatic_assert],
+[#if (!defined HAVE_C_STATIC_ASSERT && !defined assert \
+ && (!defined __cplusplus \
+ || (__cpp_static_assert < 201411 \
+ && __GNUG__ < 6 && __clang_major__ < 6)))
+ #include <assert.h>
+ #undef/**/assert
+ #ifdef __sgi
+ #undef/**/__ASSERT_H__
+ #endif
+ /* Solaris 11.4 <assert.h> defines static_assert as a macro with 2 arguments.
+ We need it also to be invocable with a single argument. */
+ #if defined __sun && (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus
+ #undef/**/static_assert
+ #define static_assert _Static_assert
+ #endif
+#endif])
+])
diff --git a/gl/m4/btowc.m4 b/gl/m4/btowc.m4
index 45a61f5e..1cd100a2 100644
--- a/gl/m4/btowc.m4
+++ b/gl/m4/btowc.m4
@@ -1,5 +1,5 @@
-# btowc.m4 serial 12
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+# btowc.m4 serial 13
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -88,6 +88,49 @@ int main ()
fi
])
+ dnl On mingw, in the C locale, btowc is inconsistent with mbrtowc:
+ dnl mbrtowc avoids calling MultiByteToWideChar when MB_CUR_MAX is 1 and
+ dnl ___lc_codepage_func() is 0, but btowc is lacking this special case.
+ AC_CHECK_FUNCS_ONCE([mbrtowc])
+ AC_CACHE_CHECK([whether btowc is consistent with mbrtowc in the C locale],
+ [gl_cv_func_btowc_consistent],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+#if HAVE_MBRTOWC
+ wint_t wc1 = btowc (0x80);
+ wchar_t wc2 = (wchar_t) 0xbadface;
+ char buf[1] = { 0x80 };
+ mbstate_t state;
+ memset (&state, 0, sizeof (mbstate_t));
+ if (mbrtowc (&wc2, buf, 1, &state) != 1 || wc1 != wc2)
+ return 1;
+#endif
+ return 0;
+}]])],
+ [gl_cv_func_btowc_consistent=yes],
+ [gl_cv_func_btowc_consistent=no],
+ [case "$host_os" in
+ # Guess no on mingw.
+ mingw*) AC_EGREP_CPP([Problem], [
+#ifdef __MINGW32__
+ Problem
+#endif
+ ],
+ [gl_cv_func_btowc_consistent="guessing no"],
+ [gl_cv_func_btowc_consistent="guessing yes"])
+ ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_btowc_consistent="guessing yes" ;;
+ esac
+ ])
+ ])
+
case "$gl_cv_func_btowc_nul" in
*yes) ;;
*) REPLACE_BTOWC=1 ;;
@@ -96,10 +139,22 @@ int main ()
*yes) ;;
*) REPLACE_BTOWC=1 ;;
esac
+ case "$gl_cv_func_btowc_consistent" in
+ *yes) ;;
+ *) REPLACE_BTOWC=1 ;;
+ esac
+ if test $REPLACE_BTOWC = 0; then
+ gl_MBRTOWC_C_LOCALE
+ case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
+ *yes) ;;
+ *) REPLACE_BTOWC=1 ;;
+ esac
+ fi
fi
])
# Prerequisites of lib/btowc.c.
AC_DEFUN([gl_PREREQ_BTOWC], [
:
+ AC_CHECK_FUNCS_ONCE([mbrtowc])
])
diff --git a/gl/m4/builtin-expect.m4 b/gl/m4/builtin-expect.m4
index b1fb12a3..531ed48a 100644
--- a/gl/m4/builtin-expect.m4
+++ b/gl/m4/builtin-expect.m4
@@ -1,6 +1,6 @@
dnl Check for __builtin_expect.
-dnl Copyright 2016-2022 Free Software Foundation, Inc.
+dnl Copyright 2016-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/c-bool.m4 b/gl/m4/c-bool.m4
new file mode 100644
index 00000000..f614371b
--- /dev/null
+++ b/gl/m4/c-bool.m4
@@ -0,0 +1,51 @@
+# Check for bool that conforms to C2023.
+
+dnl Copyright 2022-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_C_BOOL],
+[
+ AC_CACHE_CHECK([for bool, true, false], [gl_cv_c_bool],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[
+ #if true == false
+ #error "true == false"
+ #endif
+ extern bool b;
+ bool b = true == false;]])],
+ [gl_cv_c_bool=yes],
+ [gl_cv_c_bool=no])])
+ if test "$gl_cv_c_bool" = yes; then
+ AC_DEFINE([HAVE_C_BOOL], [1],
+ [Define to 1 if bool, true and false work as per C2023.])
+ fi
+
+ AC_CHECK_HEADERS_ONCE([stdbool.h])
+
+ dnl The "zz" puts this toward config.h's end, to avoid potential
+ dnl collisions with other definitions.
+ dnl If 'bool', 'true' and 'false' do not work, arrange for them to work.
+ dnl In C, this means including <stdbool.h> if it is not already included.
+ dnl However, if the preprocessor mistakenly treats 'true' as 0,
+ dnl define it to a bool expression equal to 1; this is needed in
+ dnl Sun C++ 5.11 (Oracle Solaris Studio 12.2, 2010) and older.
+ AH_VERBATIM([zzbool],
+[#ifndef HAVE_C_BOOL
+# if !defined __cplusplus && !defined __bool_true_false_are_defined
+# if HAVE_STDBOOL_H
+# include <stdbool.h>
+# else
+# if defined __SUNPRO_C
+# error "<stdbool.h> is not usable with this configuration. To make it usable, add -D_STDC_C99= to $CC."
+# else
+# error "<stdbool.h> does not exist on this platform. Use gnulib module 'stdbool-c99' instead of gnulib module 'stdbool'."
+# endif
+# endif
+# endif
+# if !true
+# define true (!false)
+# endif
+#endif])
+])
diff --git a/gl/m4/calloc.m4 b/gl/m4/calloc.m4
index c01520e5..3789cbff 100644
--- a/gl/m4/calloc.m4
+++ b/gl/m4/calloc.m4
@@ -1,6 +1,6 @@
-# calloc.m4 serial 29
+# calloc.m4 serial 30
-# Copyright (C) 2004-2022 Free Software Foundation, Inc.
+# Copyright (C) 2004-2023 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.
@@ -36,14 +36,14 @@ AC_DEFUN([_AC_FUNC_CALLOC_IF],
[ac_cv_func_calloc_0_nonnull=no])
else
case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
- # Guess yes on musl systems.
- *-musl*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
- # Guess yes on native Windows.
- mingw*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
- # If we don't know, obey --enable-cross-guesses.
- *) ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl* | midipix*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;;
esac
fi
])
diff --git a/gl/m4/canonicalize.m4 b/gl/m4/canonicalize.m4
index b55d5c06..d319645f 100644
--- a/gl/m4/canonicalize.m4
+++ b/gl/m4/canonicalize.m4
@@ -1,6 +1,6 @@
-# canonicalize.m4 serial 37
+# canonicalize.m4 serial 38
-dnl Copyright (C) 2003-2007, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,8 @@ AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
[
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
- AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
+ AC_CHECK_FUNCS_ONCE([canonicalize_file_name])
+ gl_CHECK_FUNCS_ANDROID([faccessat], [[#include <unistd.h>]])
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
if test $ac_cv_func_canonicalize_file_name = no; then
@@ -58,7 +59,8 @@ AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
[
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
- AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
+ AC_CHECK_FUNCS_ONCE([canonicalize_file_name])
+ gl_CHECK_FUNCS_ANDROID([faccessat], [[#include <unistd.h>]])
dnl On native Windows, we use _getcwd(), regardless whether getcwd() is
dnl available through the linker option '-loldnames'.
diff --git a/gl/m4/chdir-long.m4 b/gl/m4/chdir-long.m4
index 4cadc3ff..4a92b30e 100644
--- a/gl/m4/chdir-long.m4
+++ b/gl/m4/chdir-long.m4
@@ -6,7 +6,7 @@
# never fails with ENAMETOOLONG.
# Arrange to compile chdir-long.c only on systems that define PATH_MAX.
-dnl Copyright (C) 2004-2007, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/chown.m4 b/gl/m4/chown.m4
index 56dda0a6..3e05f85a 100644
--- a/gl/m4/chown.m4
+++ b/gl/m4/chown.m4
@@ -1,7 +1,7 @@
# serial 35
# Determine whether we need the chown wrapper.
-dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009-2022 Free Software
+dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009-2023 Free Software
dnl Foundation, Inc.
dnl This file is free software; the Free Software Foundation
diff --git a/gl/m4/clock_time.m4 b/gl/m4/clock_time.m4
index 22535533..d624a73d 100644
--- a/gl/m4/clock_time.m4
+++ b/gl/m4/clock_time.m4
@@ -1,14 +1,14 @@
-# clock_time.m4 serial 11
-dnl Copyright (C) 2002-2006, 2009-2022 Free Software Foundation, Inc.
+# clock_time.m4 serial 12
+dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Check for clock_getres, clock_gettime and clock_settime,
-# and set LIB_CLOCK_GETTIME.
+# and set CLOCK_TIME_LIB.
# For a program named, say foo, you should add a line like the following
# in the corresponding Makefile.am file:
-# foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
+# foo_LDADD = $(LDADD) $(CLOCK_TIME_LIB)
AC_DEFUN([gl_CLOCK_TIME],
[
@@ -21,12 +21,15 @@ AC_DEFUN([gl_CLOCK_TIME],
# Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
# programs in the package would end up linked with that potentially-shared
# library, inducing unnecessary run-time overhead.
- LIB_CLOCK_GETTIME=
- AC_SUBST([LIB_CLOCK_GETTIME])
+ CLOCK_TIME_LIB=
+ AC_SUBST([CLOCK_TIME_LIB])
gl_saved_libs=$LIBS
AC_SEARCH_LIBS([clock_gettime], [rt posix4],
[test "$ac_cv_search_clock_gettime" = "none required" ||
- LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
+ CLOCK_TIME_LIB=$ac_cv_search_clock_gettime])
AC_CHECK_FUNCS([clock_getres clock_gettime clock_settime])
LIBS=$gl_saved_libs
+ # For backward compatibility.
+ LIB_CLOCK_GETTIME="$CLOCK_TIME_LIB"
+ AC_SUBST([LIB_CLOCK_GETTIME])
])
diff --git a/gl/m4/close.m4 b/gl/m4/close.m4
index f95dbc9d..0feabd69 100644
--- a/gl/m4/close.m4
+++ b/gl/m4/close.m4
@@ -1,10 +1,10 @@
-# close.m4 serial 9
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+# close.m4 serial 10
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-AC_DEFUN([gl_FUNC_CLOSE],
+AC_DEFUN_ONCE([gl_FUNC_CLOSE],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
m4_ifdef([gl_MSVC_INVAL], [
diff --git a/gl/m4/closedir.m4 b/gl/m4/closedir.m4
index cac29d6d..7e702def 100644
--- a/gl/m4/closedir.m4
+++ b/gl/m4/closedir.m4
@@ -1,5 +1,5 @@
-# closedir.m4 serial 6
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+# closedir.m4 serial 7
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,20 +12,23 @@ AC_DEFUN([gl_FUNC_CLOSEDIR],
AC_CHECK_FUNCS([closedir])
if test $ac_cv_func_closedir = no; then
HAVE_CLOSEDIR=0
- fi
- dnl Replace closedir() for supporting the gnulib-defined fchdir() function,
- dnl to keep fchdir's bookkeeping up-to-date.
- m4_ifdef([gl_FUNC_FCHDIR], [
- gl_TEST_FCHDIR
- if test $HAVE_FCHDIR = 0; then
- if test $HAVE_CLOSEDIR = 1; then
+ else
+ dnl Replace closedir() on native Windows, to support fdopendir().
+ AC_REQUIRE([gl_DIRENT_DIR])
+ if test $DIR_HAS_FD_MEMBER = 0; then
+ REPLACE_CLOSEDIR=1
+ fi
+ dnl Replace closedir() for supporting the gnulib-defined dirfd() function.
+ case $host_os in
+ os2*) REPLACE_CLOSEDIR=1 ;;
+ esac
+ dnl Replace closedir() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
REPLACE_CLOSEDIR=1
fi
- fi
- ])
- dnl Replace closedir() for supporting the gnulib-defined dirfd() function.
- case $host_os,$HAVE_CLOSEDIR in
- os2*,1)
- REPLACE_CLOSEDIR=1;;
- esac
+ ])
+ fi
])
diff --git a/gl/m4/codeset.m4 b/gl/m4/codeset.m4
index eb732601..5804f472 100644
--- a/gl/m4/codeset.m4
+++ b/gl/m4/codeset.m4
@@ -1,5 +1,5 @@
# codeset.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2022 Free Software
+dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2023 Free Software
dnl Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/ctype_h.m4 b/gl/m4/ctype_h.m4
index 6f420de3..219f2ed0 100644
--- a/gl/m4/ctype_h.m4
+++ b/gl/m4/ctype_h.m4
@@ -1,5 +1,5 @@
# ctype_h.m4 serial 9
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/d-ino.m4 b/gl/m4/d-ino.m4
index daefce9e..58f33115 100644
--- a/gl/m4/d-ino.m4
+++ b/gl/m4/d-ino.m4
@@ -1,11 +1,11 @@
-# serial 20
+# serial 21
dnl From Jim Meyering.
dnl
dnl Check whether struct dirent has a member named d_ino.
dnl
-# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2022 Free Software
+# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2023 Free Software
# Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -44,6 +44,8 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
# Guess yes on musl systems with Linux kernel.
linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
# If we don't know, obey --enable-cross-guesses.
diff --git a/gl/m4/d-type.m4 b/gl/m4/d-type.m4
index b8858b19..3f63bbe7 100644
--- a/gl/m4/d-type.m4
+++ b/gl/m4/d-type.m4
@@ -5,7 +5,7 @@ dnl
dnl Check whether struct dirent has a member named d_type.
dnl
-# Copyright (C) 1997, 1999-2004, 2006, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999-2004, 2006, 2009-2023 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/dirent_h.m4 b/gl/m4/dirent_h.m4
index ddaca168..b6c189c0 100644
--- a/gl/m4/dirent_h.m4
+++ b/gl/m4/dirent_h.m4
@@ -1,5 +1,5 @@
-# dirent_h.m4 serial 19
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+# dirent_h.m4 serial 20
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -21,12 +21,29 @@ AC_DEFUN_ONCE([gl_DIRENT_H],
fi
AC_SUBST([HAVE_DIRENT_H])
+ gl_DIRENT_DIR
+
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[#include <dirent.h>
]], [alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir])
])
+dnl Determine whether <dirent.h> needs to override the DIR type.
+AC_DEFUN_ONCE([gl_DIRENT_DIR],
+[
+ dnl Set DIR_HAS_FD_MEMBER if dirfd() works, i.e. not always returns -1,
+ dnl or has the __KLIBC__ workaround as in lib/dirfd.c.
+ dnl We could use the findings from gl_FUNC_DIRFD and gl_PREREQ_DIRFD, but
+ dnl it's simpler since we know the affected platforms.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*) DIR_HAS_FD_MEMBER=0 ;;
+ *) DIR_HAS_FD_MEMBER=1 ;;
+ esac
+ AC_SUBST([DIR_HAS_FD_MEMBER])
+])
+
# gl_DIRENT_MODULE_INDICATOR([modulename])
# sets the shell variable that indicates the presence of the given module
# to a C preprocessor expression that will evaluate to 1.
@@ -73,6 +90,8 @@ AC_DEFUN([gl_DIRENT_H_DEFAULTS],
HAVE_SCANDIR=1; AC_SUBST([HAVE_SCANDIR])
HAVE_ALPHASORT=1; AC_SUBST([HAVE_ALPHASORT])
REPLACE_OPENDIR=0; AC_SUBST([REPLACE_OPENDIR])
+ REPLACE_READDIR=0; AC_SUBST([REPLACE_READDIR])
+ REPLACE_REWINDDIR=0; AC_SUBST([REPLACE_REWINDDIR])
REPLACE_CLOSEDIR=0; AC_SUBST([REPLACE_CLOSEDIR])
REPLACE_DIRFD=0; AC_SUBST([REPLACE_DIRFD])
REPLACE_FDOPENDIR=0; AC_SUBST([REPLACE_FDOPENDIR])
diff --git a/gl/m4/dirfd.m4 b/gl/m4/dirfd.m4
index 92001700..7968b128 100644
--- a/gl/m4/dirfd.m4
+++ b/gl/m4/dirfd.m4
@@ -1,8 +1,8 @@
-# serial 26 -*- Autoconf -*-
+# serial 28 -*- Autoconf -*-
dnl Find out how to get the file descriptor associated with an open DIR*.
-# Copyright (C) 2001-2006, 2008-2022 Free Software Foundation, Inc.
+# Copyright (C) 2001-2006, 2008-2023 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.
@@ -12,7 +12,7 @@ dnl From Jim Meyering
AC_DEFUN([gl_FUNC_DIRFD],
[
AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([AC_CANONICAL_HOST])
dnl Persuade glibc <dirent.h> to declare dirfd().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
@@ -36,15 +36,20 @@ AC_DEFUN([gl_FUNC_DIRFD],
[gl_cv_func_dirfd_macro=yes],
[gl_cv_func_dirfd_macro=no])])
- # Use the replacement if we have no function or macro with that name,
- # or if OS/2 kLIBC whose dirfd() does not work.
- # Replace only if the system declares dirfd already.
- case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
- no,no,*,yes | *,*,os2*,yes)
+ if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no; then
+ HAVE_DIRFD=0
+ else
+ HAVE_DIRFD=1
+ dnl Replace dirfd() on native Windows, to support fdopendir().
+ AC_REQUIRE([gl_DIRENT_DIR])
+ if test $DIR_HAS_FD_MEMBER = 0; then
REPLACE_DIRFD=1
- AC_DEFINE([REPLACE_DIRFD], [1],
- [Define to 1 if gnulib's dirfd() replacement is used.]);;
- esac
+ fi
+ dnl OS/2 kLIBC dirfd() does not work.
+ case "$host_os" in
+ os2*) REPLACE_DIRFD=1 ;;
+ esac
+ fi
])
dnl Prerequisites of lib/dirfd.c.
diff --git a/gl/m4/double-slash-root.m4 b/gl/m4/double-slash-root.m4
index 09ff5f0d..1776e5eb 100644
--- a/gl/m4/double-slash-root.m4
+++ b/gl/m4/double-slash-root.m4
@@ -1,5 +1,5 @@
# double-slash-root.m4 serial 4 -*- Autoconf -*-
-dnl Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/dup.m4 b/gl/m4/dup.m4
index 3109a651..fc41c99c 100644
--- a/gl/m4/dup.m4
+++ b/gl/m4/dup.m4
@@ -1,5 +1,5 @@
# dup.m4 serial 7
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/dup2.m4 b/gl/m4/dup2.m4
index 7e777cde..e1cc73e1 100644
--- a/gl/m4/dup2.m4
+++ b/gl/m4/dup2.m4
@@ -1,5 +1,5 @@
#serial 27
-dnl Copyright (C) 2002, 2005, 2007, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005, 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/eealloc.m4 b/gl/m4/eealloc.m4
index a6aa2f88..cb3e08fe 100644
--- a/gl/m4/eealloc.m4
+++ b/gl/m4/eealloc.m4
@@ -1,5 +1,5 @@
# eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/environ.m4 b/gl/m4/environ.m4
index 583dac39..741dfc56 100644
--- a/gl/m4/environ.m4
+++ b/gl/m4/environ.m4
@@ -1,5 +1,5 @@
# environ.m4 serial 8
-dnl Copyright (C) 2001-2004, 2006-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2004, 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4
index 4be9780a..4c70d225 100644
--- a/gl/m4/errno_h.m4
+++ b/gl/m4/errno_h.m4
@@ -1,5 +1,5 @@
# errno_h.m4 serial 14
-dnl Copyright (C) 2004, 2006, 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/error.m4 b/gl/m4/error.m4
index 7a103446..93a7558b 100644
--- a/gl/m4/error.m4
+++ b/gl/m4/error.m4
@@ -1,6 +1,6 @@
-#serial 15
+#serial 16
-# Copyright (C) 1996-1998, 2001-2004, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 1996-1998, 2001-2004, 2009-2023 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -8,15 +8,6 @@
AC_DEFUN([gl_ERROR],
[
- dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
- dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
- AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <error.h>]],
- [[error_at_line (0, 0, "", 0, "an error occurred");]])],
- [ac_cv_lib_error_at_line=yes],
- [ac_cv_lib_error_at_line=no])])
])
# Prerequisites of lib/error.c.
diff --git a/gl/m4/error_h.m4 b/gl/m4/error_h.m4
new file mode 100644
index 00000000..e8a58f6f
--- /dev/null
+++ b/gl/m4/error_h.m4
@@ -0,0 +1,124 @@
+# error_h.m4 serial 4
+dnl Copyright (C) 1996-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Provide a working "error.h".
+
+AC_DEFUN_ONCE([gl_ERROR_H],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ gl_CHECK_NEXT_HEADERS([error.h])
+ if test $ac_cv_header_error_h = yes; then
+ HAVE_ERROR_H=1
+ else
+ HAVE_ERROR_H=0
+ fi
+ AC_SUBST([HAVE_ERROR_H])
+
+ REPLACE_ERROR=0
+
+ gl_CHECK_FUNCS_ANDROID([error], [[#include <error.h>]])
+ if test $ac_cv_func_error = yes; then
+ HAVE_ERROR=1
+ else
+ HAVE_ERROR=0
+ case "$gl_cv_onwards_func_error" in
+ future*) REPLACE_ERROR=1 ;;
+ esac
+ fi
+
+ dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
+ dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
+ dnl We need to notice a missing declaration, like gl_CHECK_FUNCS_ANDROID does.
+ AC_CHECK_DECL([error_at_line], , , [[#include <error.h>]])
+ if test $ac_cv_have_decl_error_at_line = yes; then
+ AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <error.h>]],
+ [[error_at_line (0, 0, "", 0, "an error occurred");]])],
+ [ac_cv_lib_error_at_line=yes],
+ [ac_cv_lib_error_at_line=no])])
+ else
+ ac_cv_lib_error_at_line=no
+ fi
+ if test $ac_cv_lib_error_at_line = yes; then
+ HAVE_ERROR_AT_LINE=1
+ else
+ HAVE_ERROR_AT_LINE=0
+ fi
+ REPLACE_ERROR_AT_LINE=0
+
+ if test $ac_cv_func_error = yes && test $ac_cv_lib_error_at_line = yes; then
+ dnl On Android 11, when error_print_progname is set, the output of the
+ dnl error() function contains an extra space.
+ AC_CACHE_CHECK([for working error function],
+ [gl_cv_func_working_error],
+ [if test $cross_compiling != yes; then
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <error.h>
+ static void print_no_progname (void) {}
+ ]], [[
+ error_print_progname = print_no_progname;
+ error (0, 0, "foo");
+ ]])
+ ],
+ [rm -f conftest.out
+ if test -s conftest$ac_exeext \
+ && ./conftest$ac_exeext 2> conftest.out; then
+ if grep ' ' conftest.out >/dev/null; then
+ gl_cv_func_working_error=no
+ else
+ gl_cv_func_working_error=yes
+ fi
+ else
+ gl_cv_func_working_error=no
+ fi
+ rm -f conftest.out
+ ],
+ [gl_cv_func_working_error=no])
+ else
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <error.h>
+ ]], [[
+ error (0, 0, "foo");
+ ]])
+ ],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_working_error="guessing yes" ;;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_working_error="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_working_error="$gl_cross_guess_normal" ;;
+ esac
+ ],
+ [gl_cv_func_working_error=no])
+ fi
+ ])
+ case "$gl_cv_func_working_error" in
+ *no)
+ REPLACE_ERROR=1
+ REPLACE_ERROR_AT_LINE=1
+ ;;
+ esac
+ fi
+
+ if test $HAVE_ERROR = 0 || test $REPLACE_ERROR = 1 \
+ || test $HAVE_ERROR_AT_LINE = 0 || test $REPLACE_ERROR_AT_LINE = 1; then
+ COMPILE_ERROR_C=1
+ else
+ COMPILE_ERROR_C=0
+ fi
+
+ AC_SUBST([HAVE_ERROR])
+ AC_SUBST([HAVE_ERROR_AT_LINE])
+ AC_SUBST([REPLACE_ERROR])
+ AC_SUBST([REPLACE_ERROR_AT_LINE])
+])
diff --git a/gl/m4/exponentd.m4 b/gl/m4/exponentd.m4
index 83ac08bf..163114b8 100644
--- a/gl/m4/exponentd.m4
+++ b/gl/m4/exponentd.m4
@@ -1,9 +1,9 @@
-# exponentd.m4 serial 3
-dnl Copyright (C) 2007-2008, 2010-2022 Free Software Foundation, Inc.
+# exponentd.m4 serial 4
+dnl Copyright (C) 2007-2008, 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-AC_DEFUN([gl_DOUBLE_EXPONENT_LOCATION],
+AC_DEFUN_ONCE([gl_DOUBLE_EXPONENT_LOCATION],
[
AC_CACHE_CHECK([where to find the exponent in a 'double'],
[gl_cv_cc_double_expbit0],
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
index 0b3e4b5a..5336b8da 100644
--- a/gl/m4/extensions.m4
+++ b/gl/m4/extensions.m4
@@ -1,7 +1,7 @@
-# serial 22 -*- Autoconf -*-
+# serial 23 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2022 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2023 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.
@@ -31,7 +31,7 @@ m4_ifndef([AC_CHECK_INCLUDES_DEFAULT],
# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
# invocation occurs in gl_EARLY, not in gl_INIT.
-m4_version_prereq([2.70.1], [], [
+m4_version_prereq([2.72], [], [
# AC_USE_SYSTEM_EXTENSIONS
# ------------------------
@@ -113,11 +113,15 @@ AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
# undef __STDC_WANT_IEC_60559_DFP_EXT__
#endif
+/* Enable extensions specified by C23 Annex F. */
+#ifndef __STDC_WANT_IEC_60559_EXT__
+# undef __STDC_WANT_IEC_60559_EXT__
+#endif
/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
#endif
-/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
+/* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */
#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
# undef __STDC_WANT_IEC_60559_TYPES_EXT__
#endif
@@ -187,6 +191,7 @@ dnl it should only be defined when necessary.
AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__])
AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__])
AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__])
+ AC_DEFINE([__STDC_WANT_IEC_60559_EXT__])
AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__])
AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__])
AC_DEFINE([__STDC_WANT_LIB_EXT2__])
diff --git a/gl/m4/extern-inline.m4 b/gl/m4/extern-inline.m4
index 8a12bddd..f9894d7f 100644
--- a/gl/m4/extern-inline.m4
+++ b/gl/m4/extern-inline.m4
@@ -1,6 +1,6 @@
dnl 'extern inline' a la ISO C99.
-dnl Copyright 2012-2022 Free Software Foundation, Inc.
+dnl Copyright 2012-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -79,7 +79,8 @@ AC_DEFUN([gl_EXTERN_INLINE],
# define _GL_EXTERN_INLINE_STDHEADER_BUG
#endif
#if ((__GNUC__ \
- ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+ ? (defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+ && !defined __PCC__) \
: (199901L <= __STDC_VERSION__ \
&& !defined __HP_cc \
&& !defined __PGI \
@@ -89,6 +90,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
# define _GL_EXTERN_INLINE extern inline
# define _GL_EXTERN_INLINE_IN_USE
#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
+ && !defined __PCC__ \
&& !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
diff --git a/gl/m4/fchdir.m4 b/gl/m4/fchdir.m4
index f85549a3..b587e0ea 100644
--- a/gl/m4/fchdir.m4
+++ b/gl/m4/fchdir.m4
@@ -1,5 +1,5 @@
-# fchdir.m4 serial 27
-dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+# fchdir.m4 serial 28
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -34,6 +34,8 @@ AC_DEFUN([gl_FUNC_FCHDIR],
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_open_directory_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
# Guess no on native Windows.
diff --git a/gl/m4/fcntl-o.m4 b/gl/m4/fcntl-o.m4
index 4dcde9e0..59d558bd 100644
--- a/gl/m4/fcntl-o.m4
+++ b/gl/m4/fcntl-o.m4
@@ -1,5 +1,5 @@
# fcntl-o.m4 serial 7
-dnl Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/fcntl.m4 b/gl/m4/fcntl.m4
index 428e5709..524a99af 100644
--- a/gl/m4/fcntl.m4
+++ b/gl/m4/fcntl.m4
@@ -1,5 +1,5 @@
# fcntl.m4 serial 11
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/fcntl_h.m4 b/gl/m4/fcntl_h.m4
index 267f98bf..68f4e648 100644
--- a/gl/m4/fcntl_h.m4
+++ b/gl/m4/fcntl_h.m4
@@ -1,6 +1,6 @@
# serial 20
# Configure fcntl.h.
-dnl Copyright (C) 2006-2007, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/fdopendir.m4 b/gl/m4/fdopendir.m4
index 30016084..dfcc46c0 100644
--- a/gl/m4/fdopendir.m4
+++ b/gl/m4/fdopendir.m4
@@ -1,7 +1,7 @@
-# serial 14
+# serial 15
# See if we need to provide fdopendir.
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -49,12 +49,12 @@ DIR *fdopendir (int);
[gl_cv_func_fdopendir_works=yes],
[gl_cv_func_fdopendir_works=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
- # Guess yes on musl systems.
- *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl* | midipix*) gl_cv_func_fdopendir_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
esac
])])
case "$gl_cv_func_fdopendir_works" in
diff --git a/gl/m4/filenamecat.m4 b/gl/m4/filenamecat.m4
index 4546b832..3dab236d 100644
--- a/gl/m4/filenamecat.m4
+++ b/gl/m4/filenamecat.m4
@@ -1,5 +1,5 @@
-# filenamecat.m4 serial 11
-dnl Copyright (C) 2002-2006, 2009-2022 Free Software Foundation, Inc.
+# filenamecat.m4 serial 12
+dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,5 +12,5 @@ AC_DEFUN([gl_FILE_NAME_CONCAT],
AC_DEFUN([gl_FILE_NAME_CONCAT_LGPL],
[
dnl Prerequisites of lib/filenamecat-lgpl.c.
- AC_CHECK_FUNCS_ONCE([mempcpy])
+ gl_CHECK_FUNCS_ANDROID([mempcpy], [[#include <string.h>]])
])
diff --git a/gl/m4/flexmember.m4 b/gl/m4/flexmember.m4
index 3b4237e9..13f7e870 100644
--- a/gl/m4/flexmember.m4
+++ b/gl/m4/flexmember.m4
@@ -1,7 +1,7 @@
# serial 5
# Check for flexible array member support.
-# Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009-2023 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.
diff --git a/gl/m4/float_h.m4 b/gl/m4/float_h.m4
index 0e845726..2f0c9c4e 100644
--- a/gl/m4/float_h.m4
+++ b/gl/m4/float_h.m4
@@ -1,5 +1,5 @@
# float_h.m4 serial 13
-dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/flock.m4 b/gl/m4/flock.m4
index 655395e9..e5478766 100644
--- a/gl/m4/flock.m4
+++ b/gl/m4/flock.m4
@@ -1,5 +1,5 @@
# flock.m4 serial 4
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/fnmatch.m4 b/gl/m4/fnmatch.m4
index 9c605595..eba70de2 100644
--- a/gl/m4/fnmatch.m4
+++ b/gl/m4/fnmatch.m4
@@ -1,6 +1,6 @@
-# Check for fnmatch - serial 15. -*- coding: utf-8 -*-
+# Check for fnmatch - serial 17 -*- coding: utf-8 -*-
-# Copyright (C) 2000-2007, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2000-2007, 2009-2023 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.
@@ -40,6 +40,8 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <fnmatch.h>
+ #include <locale.h>
+ #include <stddef.h>
static int
y (char const *pattern, char const *string, int flags)
{
@@ -60,69 +62,94 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
static char const bs_1[] = { '\\\\' - 1, 0 };
static char const bs01[] = { '\\\\' + 1, 0 };
int result = 0;
+ /* ==== Start of tests in the "C" locale ==== */
+ /* These are sanity checks. They all succeed on current platforms. */
if (!n ("a*", "", 0))
return 1;
if (!y ("a*", "abc", 0))
return 1;
- if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */
- return 1;
if (!n ("d*/*1", "d/s/1", FNM_PATHNAME))
- return 2;
+ return 1;
if (!y ("a\\\\bc", "abc", 0))
- return 3;
+ return 1;
if (!n ("a\\\\bc", "abc", FNM_NOESCAPE))
- return 3;
+ return 1;
if (!y ("*x", ".x", 0))
- return 4;
+ return 1;
if (!n ("*x", ".x", FNM_PERIOD))
- return 4;
+ return 1;
+ /* glibc bug <https://sourceware.org/bugzilla/show_bug.cgi?id=361>
+ exists in glibc 2.3.3, fixed in glibc 2.5. */
if (!y (Apat, "\\\\", 0))
- return 5;
+ result |= 2;
if (!y (Apat, "A", 0))
- return 5;
+ result |= 2;
if (!y (apat, "\\\\", 0))
- return 5;
+ result |= 2;
if (!y (apat, "a", 0))
- return 5;
+ result |= 2;
if (!(n (Apat, A_1, 0) == ('A' < '\\\\')))
- return 5;
+ result |= 2;
if (!(n (apat, a_1, 0) == ('a' < '\\\\')))
- return 5;
+ result |= 2;
if (!(y (Apat, A01, 0) == ('A' < '\\\\')))
- return 5;
+ result |= 2;
if (!(y (apat, a01, 0) == ('a' < '\\\\')))
- return 5;
+ result |= 2;
if (!(y (Apat, bs_1, 0) == ('A' < '\\\\')))
- return 5;
+ result |= 2;
if (!(y (apat, bs_1, 0) == ('a' < '\\\\')))
- return 5;
+ result |= 2;
if (!(n (Apat, bs01, 0) == ('A' < '\\\\')))
- return 5;
+ result |= 2;
if (!(n (apat, bs01, 0) == ('a' < '\\\\')))
- return 5;
- $gl_fnmatch_gnu_start
- if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
+ result |= 2;
+ /* glibc bug <https://sourceware.org/bugzilla/show_bug.cgi?id=12378>
+ exists in glibc 2.12, fixed in glibc 2.13. */
+ if (!y ("[/b", "[/b", 0)) /*"]]"*/
+ result |= 4;
+ /* This test fails on FreeBSD 13.2, NetBSD 9.3, Cygwin 3.4.6. */
+ if (!y ("[[:alnum:]]", "a", 0))
result |= 8;
+ $gl_fnmatch_gnu_start /* ==== Start of GNU extensions tests ==== */
+ /* Sanity checks, mainly to check the presence of the FNM_* macros. */
+ if (!y ("xxXX", "xXxX", FNM_CASEFOLD))
+ result |= 64;
if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH))
- result |= 16;
+ result |= 64;
if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME))
- result |= 32;
+ result |= 64;
if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR))
result |= 64;
if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR))
result |= 64;
if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))
result |= 64;
- $gl_fnmatch_gnu_end
+ $gl_fnmatch_gnu_end /* ==== End of GNU extensions tests ==== */
+ /* ==== End of tests in the "C" locale ==== */
+ /* ==== Start of tests that require a specific locale ==== */
+ /* This test fails on Solaris 11.4. */
+ if (setlocale (LC_ALL, "en_US.UTF-8") != NULL)
+ {
+ if (!n ("[!a-z]", "", 0))
+ result |= 16;
+ }
+ /* This test fails on NetBSD 9.3, Android 13. */
+ if (setlocale (LC_ALL, "C.UTF-8") != NULL)
+ {
+ if (!y ("x?y", "x\\303\\274y", 0))
+ result |= 32;
+ }
+ /* ==== End of tests that require a specific locale ==== */
return result;
]])],
[eval "$gl_fnmatch_cache_var=yes"],
[eval "$gl_fnmatch_cache_var=no"],
[case "$host_os" in
- # Guess yes on musl systems.
- *-musl*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;;
- # Guess no otherwise, even on glibc systems.
- *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;;
+ # Guess yes on musl systems.
+ *-musl* | midipix*) eval "$gl_fnmatch_cache_var=\"guessing yes\"" ;;
+ # Guess no otherwise, even on glibc systems.
+ *) eval "$gl_fnmatch_cache_var=\"guessing no\"" ;;
esac
])
])
diff --git a/gl/m4/fnmatch_h.m4 b/gl/m4/fnmatch_h.m4
index ae5cd869..40a62b6a 100644
--- a/gl/m4/fnmatch_h.m4
+++ b/gl/m4/fnmatch_h.m4
@@ -1,5 +1,5 @@
# fnmatch_h.m4 serial 8
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/free.m4 b/gl/m4/free.m4
index dfeecd2b..0389dea3 100644
--- a/gl/m4/free.m4
+++ b/gl/m4/free.m4
@@ -1,5 +1,5 @@
# free.m4 serial 6
-# Copyright (C) 2003-2005, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2003-2005, 2009-2023 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.
diff --git a/gl/m4/fstat.m4 b/gl/m4/fstat.m4
index 9e61bcce..7cb2edb0 100644
--- a/gl/m4/fstat.m4
+++ b/gl/m4/fstat.m4
@@ -1,5 +1,5 @@
# fstat.m4 serial 8
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/fstatat.m4 b/gl/m4/fstatat.m4
index e8604a6a..08307691 100644
--- a/gl/m4/fstatat.m4
+++ b/gl/m4/fstatat.m4
@@ -1,5 +1,5 @@
# fstatat.m4 serial 4
-dnl Copyright (C) 2004-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/getcwd-abort-bug.m4 b/gl/m4/getcwd-abort-bug.m4
index 2174e3f9..cd1240c7 100644
--- a/gl/m4/getcwd-abort-bug.m4
+++ b/gl/m4/getcwd-abort-bug.m4
@@ -3,7 +3,7 @@
# name is unusually large. Any length between 4k and 16k trigger the bug
# when using glibc-2.4.90-9 or older.
-# Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009-2023 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.
diff --git a/gl/m4/getcwd-path-max.m4 b/gl/m4/getcwd-path-max.m4
index e1204559..516c0789 100644
--- a/gl/m4/getcwd-path-max.m4
+++ b/gl/m4/getcwd-path-max.m4
@@ -6,7 +6,7 @@
# I've heard that this is due to a Linux kernel bug, and that it has
# been fixed between 2.4.21-pre3 and 2.4.21-pre4.
-# Copyright (C) 2003-2007, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2003-2007, 2009-2023 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.
diff --git a/gl/m4/getcwd.m4 b/gl/m4/getcwd.m4
index 076ca314..e95db056 100644
--- a/gl/m4/getcwd.m4
+++ b/gl/m4/getcwd.m4
@@ -1,12 +1,12 @@
# getcwd.m4 - check for working getcwd that is compatible with glibc
-# Copyright (C) 2001, 2003-2007, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003-2007, 2009-2023 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.
# Written by Paul Eggert.
-# serial 19
+# serial 20
AC_DEFUN([gl_FUNC_GETCWD_NULL],
[
@@ -53,6 +53,8 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
*-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
# Guess yes on musl systems.
*-musl*) gl_cv_func_getcwd_null="guessing yes";;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_getcwd_null="guessing yes";;
# Guess yes on Cygwin.
cygwin*) gl_cv_func_getcwd_null="guessing yes";;
# If we don't know, obey --enable-cross-guesses.
diff --git a/gl/m4/getdelim.m4 b/gl/m4/getdelim.m4
index 0b63b553..60555b97 100644
--- a/gl/m4/getdelim.m4
+++ b/gl/m4/getdelim.m4
@@ -1,6 +1,6 @@
-# getdelim.m4 serial 15
+# getdelim.m4 serial 19
-dnl Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
dnl
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,21 +11,31 @@ AC_PREREQ([2.59])
AC_DEFUN([gl_FUNC_GETDELIM],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([AC_CANONICAL_HOST])
dnl Persuade glibc <stdio.h> to declare getdelim().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_CHECK_DECLS_ONCE([getdelim])
- AC_CHECK_FUNCS_ONCE([getdelim])
+ gl_CHECK_FUNCS_ANDROID([getdelim], [[#include <stdio.h>]])
if test $ac_cv_func_getdelim = yes; then
HAVE_GETDELIM=1
dnl Found it in some library. Verify that it works.
AC_CACHE_CHECK([for working getdelim function],
[gl_cv_func_working_getdelim],
- [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ [case "$host_os" in
+ darwin*)
+ dnl On macOS 10.13, valgrind detected an out-of-bounds read during
+ dnl the GNU sed test suite:
+ dnl Invalid read of size 16
+ dnl at 0x100EE6A05: _platform_memchr$VARIANT$Base (in /usr/lib/system/libsystem_platform.dylib)
+ dnl by 0x100B7B0BD: getdelim (in /usr/lib/system/libsystem_c.dylib)
+ dnl by 0x10000B0BE: ck_getdelim (utils.c:254)
+ gl_cv_func_working_getdelim=no ;;
+ *)
+ echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
@@ -57,26 +67,28 @@ AC_DEFUN([gl_FUNC_GETDELIM],
return 0;
}
]])],
- [gl_cv_func_working_getdelim=yes],
- [gl_cv_func_working_getdelim=no],
- [dnl We're cross compiling.
- dnl Guess it works on glibc2 systems and musl systems.
- AC_EGREP_CPP([Lucky GNU user],
- [
+ [gl_cv_func_working_getdelim=yes],
+ [gl_cv_func_working_getdelim=no],
+ [dnl We're cross compiling.
+ dnl Guess it works on glibc2 systems and musl systems.
+ AC_EGREP_CPP([Lucky GNU user],
+ [
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ >= 2) && !defined __UCLIBC__
Lucky GNU user
#endif
#endif
- ],
- [gl_cv_func_working_getdelim="guessing yes"],
- [case "$host_os" in
- *-musl*) gl_cv_func_working_getdelim="guessing yes" ;;
- *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;;
- esac
- ])
- ])
+ ],
+ [gl_cv_func_working_getdelim="guessing yes"],
+ [case "$host_os" in
+ *-musl* | midipix*) gl_cv_func_working_getdelim="guessing yes" ;;
+ *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ ;;
+ esac
])
case "$gl_cv_func_working_getdelim" in
*yes) ;;
@@ -84,6 +96,9 @@ AC_DEFUN([gl_FUNC_GETDELIM],
esac
else
HAVE_GETDELIM=0
+ case "$gl_cv_onwards_func_getdelim" in
+ future*) REPLACE_GETDELIM=1 ;;
+ esac
fi
if test $ac_cv_have_decl_getdelim = no; then
diff --git a/gl/m4/getdtablesize.m4 b/gl/m4/getdtablesize.m4
index 6134eaac..8bcda905 100644
--- a/gl/m4/getdtablesize.m4
+++ b/gl/m4/getdtablesize.m4
@@ -1,5 +1,5 @@
# getdtablesize.m4 serial 8
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/getline.m4 b/gl/m4/getline.m4
index ca0301d2..83e7e931 100644
--- a/gl/m4/getline.m4
+++ b/gl/m4/getline.m4
@@ -1,6 +1,6 @@
-# getline.m4 serial 30
+# getline.m4 serial 33
-dnl Copyright (C) 1998-2003, 2005-2007, 2009-2022 Free Software Foundation,
+dnl Copyright (C) 1998-2003, 2005-2007, 2009-2023 Free Software Foundation,
dnl Inc.
dnl
dnl This file is free software; the Free Software Foundation
@@ -23,12 +23,9 @@ AC_DEFUN([gl_FUNC_GETLINE],
AC_CHECK_DECLS_ONCE([getline])
- gl_getline_needs_run_time_check=no
- AC_CHECK_FUNC([getline],
- [dnl Found it in some library. Verify that it works.
- gl_getline_needs_run_time_check=yes],
- [am_cv_func_working_getline=no])
- if test $gl_getline_needs_run_time_check = yes; then
+ gl_CHECK_FUNCS_ANDROID([getline], [[#include <stdio.h>]])
+ if test $ac_cv_func_getline = yes; then
+ dnl Found it in some library. Verify that it works.
AC_CACHE_CHECK([for working getline function],
[am_cv_func_working_getline],
[echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
@@ -79,12 +76,17 @@ AC_DEFUN([gl_FUNC_GETLINE],
],
[am_cv_func_working_getline="guessing yes"],
[case "$host_os" in
- *-musl*) am_cv_func_working_getline="guessing yes" ;;
- *) am_cv_func_working_getline="$gl_cross_guess_normal" ;;
+ *-musl* | midipix*) am_cv_func_working_getline="guessing yes" ;;
+ *) am_cv_func_working_getline="$gl_cross_guess_normal" ;;
esac
])
])
])
+ else
+ am_cv_func_working_getline=no
+ case "$gl_cv_onwards_func_getline" in
+ future*) REPLACE_GETLINE=1 ;;
+ esac
fi
if test $ac_cv_have_decl_getline = no; then
diff --git a/gl/m4/getlogin.m4 b/gl/m4/getlogin.m4
index d51d6cfd..0686b5f0 100644
--- a/gl/m4/getlogin.m4
+++ b/gl/m4/getlogin.m4
@@ -1,5 +1,5 @@
-# getlogin.m4 serial 5
-dnl Copyright (C) 2010-2022 Free Software Foundation, Inc.
+# getlogin.m4 serial 6
+dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -24,9 +24,12 @@ AC_DEFUN([gl_LIB_GETLOGIN],
AC_REQUIRE([AC_CANONICAL_HOST])
case $host_os in
mingw*)
- LIB_GETLOGIN='-ladvapi32' ;;
+ GETLOGIN_LIB='-ladvapi32' ;;
*)
- LIB_GETLOGIN= ;;
+ GETLOGIN_LIB= ;;
esac
+ AC_SUBST([GETLOGIN_LIB])
+ dnl For backward compatibility.
+ LIB_GETLOGIN="$GETLOGIN_LIB"
AC_SUBST([LIB_GETLOGIN])
])
diff --git a/gl/m4/getlogin_r.m4 b/gl/m4/getlogin_r.m4
index c60ef34d..4383ea6a 100644
--- a/gl/m4/getlogin_r.m4
+++ b/gl/m4/getlogin_r.m4
@@ -1,6 +1,6 @@
-#serial 13
+#serial 15
-# Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -25,9 +25,12 @@ AC_DEFUN([gl_FUNC_GETLOGIN_R],
HAVE_DECL_GETLOGIN_R=0
fi
- AC_CHECK_FUNCS_ONCE([getlogin_r])
+ gl_CHECK_FUNCS_ANDROID([getlogin_r], [[#include <unistd.h>]])
if test $ac_cv_func_getlogin_r = no; then
HAVE_GETLOGIN_R=0
+ case "$gl_cv_onwards_func_getlogin_r" in
+ future*) REPLACE_GETLOGIN_R=1 ;;
+ esac
else
HAVE_GETLOGIN_R=1
dnl On Mac OS X 10.13 and OSF/1 5.1, getlogin_r returns a truncated result
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
index ff78ed53..7981a095 100644
--- a/gl/m4/getopt.m4
+++ b/gl/m4/getopt.m4
@@ -1,5 +1,5 @@
# getopt.m4 serial 48
-dnl Copyright (C) 2002-2006, 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/getpagesize.m4 b/gl/m4/getpagesize.m4
index 19f894ca..79925a73 100644
--- a/gl/m4/getpagesize.m4
+++ b/gl/m4/getpagesize.m4
@@ -1,5 +1,5 @@
# getpagesize.m4 serial 10
-dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2022 Free Software Foundation,
+dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/getprogname.m4 b/gl/m4/getprogname.m4
index b26146e9..2b741f50 100644
--- a/gl/m4/getprogname.m4
+++ b/gl/m4/getprogname.m4
@@ -1,16 +1,33 @@
# getprogname.m4 - check for getprogname or replacements for it
-# Copyright (C) 2016-2022 Free Software Foundation, Inc.
+# Copyright (C) 2016-2023 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.
-# serial 4
+# serial 8
AC_DEFUN([gl_FUNC_GETPROGNAME],
[
- AC_CHECK_FUNCS_ONCE([getprogname getexecname])
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ gl_CHECK_FUNCS_ANDROID([getprogname], [[#include <stdlib.h>]])
+ if test $ac_cv_func_getprogname = no; then
+ HAVE_GETPROGNAME=0
+ case "$gl_cv_onwards_func_getprogname" in
+ future*) REPLACE_GETPROGNAME=1 ;;
+ esac
+ fi
+ AC_CHECK_DECLS([program_invocation_name],
+ [],
+ [HAVE_DECL_PROGRAM_INVOCATION_NAME=0],
+ [[#include <errno.h>]])
+])
+
+AC_DEFUN([gl_PREREQ_GETPROGNAME],
+[
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_FUNCS_ONCE([getexecname])
ac_found=0
AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [],
[#include <errno.h>])
diff --git a/gl/m4/getrandom.m4 b/gl/m4/getrandom.m4
index 6ca71500..7b7f9ce2 100644
--- a/gl/m4/getrandom.m4
+++ b/gl/m4/getrandom.m4
@@ -1,5 +1,5 @@
-# getrandom.m4 serial 8
-dnl Copyright 2020-2022 Free Software Foundation, Inc.
+# getrandom.m4 serial 11
+dnl Copyright 2020-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,9 +9,18 @@ dnl Written by Paul Eggert.
AC_DEFUN([gl_FUNC_GETRANDOM],
[
AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([getrandom])
+ gl_CHECK_FUNCS_ANDROID([getrandom],
+ [[/* Additional includes are needed before <sys/random.h> on uClibc
+ and Mac OS X. */
+ #include <sys/types.h>
+ #include <stdlib.h>
+ #include <sys/random.h>
+ ]])
if test "$ac_cv_func_getrandom" != yes; then
HAVE_GETRANDOM=0
+ case "$gl_cv_onwards_func_getrandom" in
+ future*) REPLACE_GETRANDOM=1 ;;
+ esac
else
dnl On Solaris 11.4 the return type is 'int', not 'ssize_t'.
AC_CACHE_CHECK([whether getrandom is compatible with its GNU+BSD signature],
@@ -56,13 +65,16 @@ AC_DEFUN([gl_FUNC_GETRANDOM],
if test $gl_cv_lib_assume_bcrypt = yes; then
AC_DEFINE([HAVE_LIB_BCRYPT], [1],
[Define to 1 if the bcrypt library is guaranteed to be present.])
- LIB_GETRANDOM='-lbcrypt'
+ GETRANDOM_LIB='-lbcrypt'
else
- LIB_GETRANDOM='-ladvapi32'
+ GETRANDOM_LIB='-ladvapi32'
fi
;;
*)
- LIB_GETRANDOM= ;;
+ GETRANDOM_LIB= ;;
esac
+ AC_SUBST([GETRANDOM_LIB])
+ dnl For backward compatibility.
+ LIB_GETRANDOM="$GETRANDOM_LIB"
AC_SUBST([LIB_GETRANDOM])
])
diff --git a/gl/m4/gettime.m4 b/gl/m4/gettime.m4
index f0aeb4d0..ec1f97ee 100644
--- a/gl/m4/gettime.m4
+++ b/gl/m4/gettime.m4
@@ -1,5 +1,5 @@
-# gettime.m4 serial 11
-dnl Copyright (C) 2002, 2004-2006, 2009-2022 Free Software Foundation, Inc.
+# gettime.m4 serial 14
+dnl Copyright (C) 2002, 2004-2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,54 @@ AC_DEFUN([gl_GETTIME],
dnl Prerequisites of lib/gettime.c.
AC_REQUIRE([gl_CLOCK_TIME])
AC_REQUIRE([gl_TIMESPEC])
- AC_CHECK_FUNCS_ONCE([timespec_get])
+
+ AC_REQUIRE([gl_CHECK_FUNC_TIMESPEC_GET])
+ if test $gl_cv_func_timespec_get = yes; then
+ AC_DEFINE([HAVE_TIMESPEC_GET], [1],
+ [Define if you have the timespec_get function.])
+ fi
+])
+
+dnl Tests whether the function timespec_get exists.
+dnl Sets gl_cv_func_timespec_get and gl_cv_onwards_func_timespec_get.
+AC_DEFUN([gl_CHECK_FUNC_TIMESPEC_GET],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ dnl Persuade OpenBSD <time.h> to declare timespec_get().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ dnl We can't use AC_CHECK_FUNC here, because timespec_get() is defined as a
+ dnl static inline function in <time.h> on MSVC 14.
+ dnl But at the same time, we need to notice a missing declaration, like
+ dnl gl_CHECK_FUNCS_ANDROID does.
+ AC_CHECK_DECL([timespec_get], , , [[#include <time.h>]])
+ AC_CACHE_CHECK([for timespec_get], [gl_cv_onwards_func_timespec_get],
+ [if test $ac_cv_have_decl_timespec_get = yes; then
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <time.h>
+ struct timespec ts;
+ ]],
+ [[return timespec_get (&ts, 0);]])
+ ],
+ [gl_cv_onwards_func_timespec_get=yes],
+ [gl_cv_onwards_func_timespec_get=no])
+ else
+ gl_cv_onwards_func_timespec_get=no
+ fi
+ case "$host_os" in
+ linux*-android*)
+ if test $gl_cv_onwards_func_timespec_get = no; then
+ gl_cv_onwards_func_timespec_get='future OS version'
+ fi
+ ;;
+ esac
+ ])
+ case "$gl_cv_onwards_func_timespec_get" in
+ future*) gl_cv_func_timespec_get=no ;;
+ *) gl_cv_func_timespec_get=$gl_cv_onwards_func_timespec_get ;;
+ esac
])
AC_DEFUN([gl_GETTIME_RES],
diff --git a/gl/m4/gettimeofday.m4 b/gl/m4/gettimeofday.m4
index f729601b..5051d61c 100644
--- a/gl/m4/gettimeofday.m4
+++ b/gl/m4/gettimeofday.m4
@@ -1,6 +1,6 @@
# serial 29
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2023 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.
diff --git a/gl/m4/glob.m4 b/gl/m4/glob.m4
index f59b84ff..62be6a33 100644
--- a/gl/m4/glob.m4
+++ b/gl/m4/glob.m4
@@ -1,5 +1,5 @@
-# glob.m4 serial 26
-dnl Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
+# glob.m4 serial 30
+dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,9 +12,13 @@ AC_DEFUN([gl_GLOB],
[
AC_REQUIRE([gl_GLOB_H])
- AC_CHECK_FUNCS_ONCE([glob glob_pattern_p])
+ AC_CHECK_FUNCS_ONCE([glob_pattern_p])
+ gl_CHECK_FUNCS_ANDROID([glob], [[#include <glob.h>]])
if test $ac_cv_func_glob = no; then
HAVE_GLOB=0
+ case "$gl_cv_onwards_func_glob" in
+ future*) REPLACE_GLOB=1 ;;
+ esac
else
AC_CACHE_CHECK([for GNU glob interface version 1 or 2],
@@ -125,5 +129,6 @@ AC_DEFUN([gl_PREREQ_GLOB],
[
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
AC_CHECK_HEADERS_ONCE([unistd.h])
- AC_CHECK_FUNCS_ONCE([getlogin_r getpwnam_r])
+ gl_CHECK_FUNCS_ANDROID([getlogin_r], [[#include <unistd.h>]])
+ gl_CHECK_FUNCS_ANDROID([getpwnam_r], [[#include <pwd.h>]])
])
diff --git a/gl/m4/glob_h.m4 b/gl/m4/glob_h.m4
index 41ffde23..3ab5031c 100644
--- a/gl/m4/glob_h.m4
+++ b/gl/m4/glob_h.m4
@@ -1,5 +1,5 @@
# glob_h.m4 serial 9
-dnl Copyright (C) 2018-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2018-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index 30911d15..2426eb63 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 73
-dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 87
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -15,6 +15,10 @@ AC_DEFUN([gl_COMMON], [
AC_REQUIRE([gl_ZZGNULIB])
])
AC_DEFUN([gl_COMMON_BODY], [
+ AH_VERBATIM([0witness],
+[/* Witness that <config.h> has been included. */
+#define _GL_CONFIG_H_INCLUDED 1
+])
AH_VERBATIM([_GL_GNUC_PREREQ],
[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */
#if defined __GNUC__ && defined __GNUC_MINOR__
@@ -38,6 +42,11 @@ AC_DEFUN([gl_COMMON_BODY], [
AIX system header files and several gnulib header files use precisely
this syntax with 'extern'. */
# define _Noreturn [[noreturn]]
+# elif (defined __clang__ && __clang_major__ < 16 \
+ && defined _GL_WORK_AROUND_LLVM_BUG_59792)
+ /* Compile with -D_GL_WORK_AROUND_LLVM_BUG_59792 to work around
+ that rare LLVM bug, though you may get many false-alarm warnings. */
+# define _Noreturn
# elif ((!defined __cplusplus || defined __clang__) \
&& (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
|| (!defined __STRICT_ANSI__ \
@@ -71,7 +80,7 @@ AC_DEFUN([gl_COMMON_BODY], [
&& (!defined __clang_minor__ \
|| (defined __apple_build_version__ \
? 6000000 <= __apple_build_version__ \
- : 3 < __clang_major__ + (5 <= __clang_minor__))))
+ : 5 <= __clang_major__)))
# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
#else
# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
@@ -105,17 +114,27 @@ AC_DEFUN([gl_COMMON_BODY], [
# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
#endif
-#ifdef __has_c_attribute
-# if ((defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710 \
- && _GL_GNUC_PREREQ (4, 6))
-# pragma GCC diagnostic ignored "-Wpedantic"
+/* Disable GCC -Wpedantic if using __has_c_attribute and this is not C23+. */
+#if (defined __has_c_attribute && _GL_GNUC_PREREQ (4, 6) \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710)
+# pragma GCC diagnostic ignored "-Wpedantic"
+#endif
+
+/* Define if, in a function declaration, the attributes in bracket syntax
+ [[...]] must come before the attributes in __attribute__((...)) syntax.
+ If this is defined, it is best to avoid the bracket syntax, so that the
+ various _GL_ATTRIBUTE_* can be cumulated on the same declaration in any
+ order. */
+#ifdef __cplusplus
+# if defined __clang__
+# define _GL_BRACKET_BEFORE_ATTRIBUTE 1
# endif
-# define _GL_HAS_C_ATTRIBUTE(attr) __has_c_attribute (__##attr##__)
#else
-# define _GL_HAS_C_ATTRIBUTE(attr) 0
+# if defined __GNUC__ && !defined __clang__
+# define _GL_BRACKET_BEFORE_ATTRIBUTE 1
+# endif
#endif
-
-]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's _Alignas instead.
+]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's alignas instead.
[
/* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function
is the size of the returned memory block.
@@ -123,29 +142,35 @@ AC_DEFUN([gl_COMMON_BODY], [
by the Nth argument of the function is the size of the returned memory block.
*/
/* Applies to: function, pointer to function, function types. */
-#if _GL_HAS_ATTRIBUTE (alloc_size)
-# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
-#else
-# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
+#ifndef _GL_ATTRIBUTE_ALLOC_SIZE
+# if _GL_HAS_ATTRIBUTE (alloc_size)
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
+# else
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
+# endif
#endif
/* _GL_ATTRIBUTE_ALWAYS_INLINE tells that the compiler should always inline the
function and report an error if it cannot do so. */
/* Applies to: function. */
-#if _GL_HAS_ATTRIBUTE (always_inline)
-# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
-#else
-# define _GL_ATTRIBUTE_ALWAYS_INLINE
+#ifndef _GL_ATTRIBUTE_ALWAYS_INLINE
+# if _GL_HAS_ATTRIBUTE (always_inline)
+# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
+# else
+# define _GL_ATTRIBUTE_ALWAYS_INLINE
+# endif
#endif
/* _GL_ATTRIBUTE_ARTIFICIAL declares that the function is not important to show
in stack traces when debugging. The compiler should omit the function from
stack traces. */
/* Applies to: function. */
-#if _GL_HAS_ATTRIBUTE (artificial)
-# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
-#else
-# define _GL_ATTRIBUTE_ARTIFICIAL
+#ifndef _GL_ATTRIBUTE_ARTIFICIAL
+# if _GL_HAS_ATTRIBUTE (artificial)
+# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
+# else
+# define _GL_ATTRIBUTE_ARTIFICIAL
+# endif
#endif
/* _GL_ATTRIBUTE_COLD declares that the function is rarely executed. */
@@ -153,14 +178,16 @@ AC_DEFUN([gl_COMMON_BODY], [
/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
<https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>.
Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */
-#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
-# ifndef __SUNPRO_C
-# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+#ifndef _GL_ATTRIBUTE_COLD
+# if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
+# ifndef __SUNPRO_C
+# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+# else
+# define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
+# endif
# else
-# define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
+# define _GL_ATTRIBUTE_COLD
# endif
-#else
-# define _GL_ATTRIBUTE_COLD
#endif
/* _GL_ATTRIBUTE_CONST declares that it is OK for a compiler to omit duplicate
@@ -170,10 +197,12 @@ AC_DEFUN([gl_COMMON_BODY], [
forever, and does not call longjmp.
(This attribute is stricter than _GL_ATTRIBUTE_PURE.) */
/* Applies to: functions. */
-#if _GL_HAS_ATTRIBUTE (const)
-# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
-#else
-# define _GL_ATTRIBUTE_CONST
+#ifndef _GL_ATTRIBUTE_CONST
+# if _GL_HAS_ATTRIBUTE (const)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+# else
+# define _GL_ATTRIBUTE_CONST
+# endif
#endif
/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
@@ -182,16 +211,25 @@ AC_DEFUN([gl_COMMON_BODY], [
_GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that
can be freed via 'free'; it can be used only after declaring 'free'. */
/* Applies to: functions. Cannot be used on inline functions. */
-#if _GL_GNUC_PREREQ (11, 0)
-# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
-#else
-# define _GL_ATTRIBUTE_DEALLOC(f, i)
+#ifndef _GL_ATTRIBUTE_DEALLOC
+# if _GL_GNUC_PREREQ (11, 0)
+# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
+# else
+# define _GL_ATTRIBUTE_DEALLOC(f, i)
+# endif
#endif
/* If gnulib's <string.h> or <wchar.h> has already defined this macro, continue
to use this earlier definition, since <stdlib.h> may not have been included
yet. */
#ifndef _GL_ATTRIBUTE_DEALLOC_FREE
-# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+# if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
+# else
+# define _GL_ATTRIBUTE_DEALLOC_FREE \
+ _GL_ATTRIBUTE_DEALLOC (free, 1)
+# endif
#endif
/* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated.
@@ -202,12 +240,20 @@ AC_DEFUN([gl_COMMON_BODY], [
- enumeration, enumeration item,
- typedef,
in C++ also: namespace, class, template specialization. */
-#if _GL_HAS_C_ATTRIBUTE (deprecated)
-# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
-#elif _GL_HAS_ATTRIBUTE (deprecated)
-# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
-#else
-# define _GL_ATTRIBUTE_DEPRECATED
+#ifndef _GL_ATTRIBUTE_DEPRECATED
+# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+# ifdef __has_c_attribute
+# if __has_c_attribute (__deprecated__)
+# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
+# endif
+# endif
+# endif
+# if !defined _GL_ATTRIBUTE_DEPRECATED && _GL_HAS_ATTRIBUTE (deprecated)
+# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
+# endif
+# ifndef _GL_ATTRIBUTE_DEPRECATED
+# define _GL_ATTRIBUTE_DEPRECATED
+# endif
#endif
/* _GL_ATTRIBUTE_ERROR(msg) requests an error if a function is called and
@@ -215,24 +261,28 @@ AC_DEFUN([gl_COMMON_BODY], [
_GL_ATTRIBUTE_WARNING(msg) requests a warning if a function is called and
the function call is not optimized away. */
/* Applies to: functions. */
-#if _GL_HAS_ATTRIBUTE (error)
-# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg)))
-# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg)))
-#elif _GL_HAS_ATTRIBUTE (diagnose_if)
-# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error")))
-# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning")))
-#else
-# define _GL_ATTRIBUTE_ERROR(msg)
-# define _GL_ATTRIBUTE_WARNING(msg)
+#if !(defined _GL_ATTRIBUTE_ERROR && defined _GL_ATTRIBUTE_WARNING)
+# if _GL_HAS_ATTRIBUTE (error)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg)))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg)))
+# elif _GL_HAS_ATTRIBUTE (diagnose_if)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error")))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning")))
+# else
+# define _GL_ATTRIBUTE_ERROR(msg)
+# define _GL_ATTRIBUTE_WARNING(msg)
+# endif
#endif
/* _GL_ATTRIBUTE_EXTERNALLY_VISIBLE declares that the entity should remain
visible to debuggers etc., even with '-fwhole-program'. */
/* Applies to: functions, variables. */
-#if _GL_HAS_ATTRIBUTE (externally_visible)
-# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
-#else
-# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+#ifndef _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+# if _GL_HAS_ATTRIBUTE (externally_visible)
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
+# else
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+# endif
#endif
/* _GL_ATTRIBUTE_FALLTHROUGH declares that it is not a programming mistake if
@@ -240,12 +290,18 @@ AC_DEFUN([gl_COMMON_BODY], [
'default' label. The compiler should not warn in this case. */
/* Applies to: Empty statement (;), inside a 'switch' statement. */
/* Always expands to something. */
-#if _GL_HAS_C_ATTRIBUTE (fallthrough)
-# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
-#elif _GL_HAS_ATTRIBUTE (fallthrough)
-# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
-#else
-# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
+#ifndef _GL_ATTRIBUTE_FALLTHROUGH
+# ifdef __has_c_attribute
+# if __has_c_attribute (__fallthrough__)
+# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
+# endif
+# endif
+# if !defined _GL_ATTRIBUTE_FALLTHROUGH && _GL_HAS_ATTRIBUTE (fallthrough)
+# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
+# endif
+# ifndef _GL_ATTRIBUTE_FALLTHROUGH
+# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
+# endif
#endif
/* _GL_ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK))
@@ -259,10 +315,12 @@ AC_DEFUN([gl_COMMON_BODY], [
If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK
are suitable for the format string. */
/* Applies to: functions. */
-#if _GL_HAS_ATTRIBUTE (format)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec)
+#ifndef _GL_ATTRIBUTE_FORMAT
+# if _GL_HAS_ATTRIBUTE (format)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+# else
+# define _GL_ATTRIBUTE_FORMAT(spec)
+# endif
#endif
/* _GL_ATTRIBUTE_LEAF declares that if the function is called from some other
@@ -270,19 +328,23 @@ AC_DEFUN([gl_COMMON_BODY], [
exception handling. This declaration lets the compiler optimize that unit
more aggressively. */
/* Applies to: functions. */
-#if _GL_HAS_ATTRIBUTE (leaf)
-# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
-#else
-# define _GL_ATTRIBUTE_LEAF
+#ifndef _GL_ATTRIBUTE_LEAF
+# if _GL_HAS_ATTRIBUTE (leaf)
+# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
+# else
+# define _GL_ATTRIBUTE_LEAF
+# endif
#endif
/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
allocated memory. */
/* Applies to: functions. */
-#if _GL_HAS_ATTRIBUTE (malloc)
-# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-#else
-# define _GL_ATTRIBUTE_MALLOC
+#ifndef _GL_ATTRIBUTE_MALLOC
+# if _GL_HAS_ATTRIBUTE (malloc)
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define _GL_ATTRIBUTE_MALLOC
+# endif
#endif
/* _GL_ATTRIBUTE_MAY_ALIAS declares that pointers to the type may point to the
@@ -290,10 +352,12 @@ AC_DEFUN([gl_COMMON_BODY], [
strict aliasing optimization. */
/* Applies to: types. */
/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */
-#if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
-# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
-#else
-# define _GL_ATTRIBUTE_MAY_ALIAS
+#ifndef _GL_ATTRIBUTE_MAY_ALIAS
+# if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
+# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
+# else
+# define _GL_ATTRIBUTE_MAY_ALIAS
+# endif
#endif
/* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if
@@ -305,15 +369,29 @@ AC_DEFUN([gl_COMMON_BODY], [
- enumeration, enumeration item,
- typedef,
in C++ also: class. */
-/* In C++ and C2x, this is spelled [[__maybe_unused__]].
+/* In C++ and C23, this is spelled [[__maybe_unused__]].
GCC's syntax is __attribute__ ((__unused__)).
- clang supports both syntaxes. */
-#if _GL_HAS_C_ATTRIBUTE (maybe_unused)
-# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
-#else
-# define _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_UNUSED
+ clang supports both syntaxes. Except that with clang ≥ 6, < 10, in C++ mode,
+ __has_c_attribute (__maybe_unused__) yields true but the use of
+ [[__maybe_unused__]] nevertheless produces a warning. */
+#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
+# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+# if defined __clang__ && defined __cplusplus
+# if !defined __apple_build_version__ && __clang_major__ >= 10
+# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
+# endif
+# elif defined __has_c_attribute
+# if __has_c_attribute (__maybe_unused__)
+# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
+# endif
+# endif
+# endif
+# ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
+# define _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_UNUSED
+# endif
#endif
-/* Alternative spelling of this macro, for convenience. */
+/* Alternative spelling of this macro, for convenience and for
+ compatibility with glibc/include/libc-symbols.h. */
#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
/* Earlier spellings of this macro. */
#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
@@ -322,21 +400,40 @@ AC_DEFUN([gl_COMMON_BODY], [
discard the return value. The compiler may warn if the caller does not use
the return value, unless the caller uses something like ignore_value. */
/* Applies to: function, enumeration, class. */
-#if _GL_HAS_C_ATTRIBUTE (nodiscard)
-# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
-#elif _GL_HAS_ATTRIBUTE (warn_unused_result)
-# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
-#else
-# define _GL_ATTRIBUTE_NODISCARD
+#ifndef _GL_ATTRIBUTE_NODISCARD
+# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
+# if defined __clang__ && defined __cplusplus
+ /* With clang up to 15.0.6 (at least), in C++ mode, [[__nodiscard__]] produces
+ a warning.
+ The 1000 below means a yet unknown threshold. When clang++ version X
+ starts supporting [[__nodiscard__]] without warning about it, you can
+ replace the 1000 with X. */
+# if __clang_major__ >= 1000
+# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
+# endif
+# elif defined __has_c_attribute
+# if __has_c_attribute (__nodiscard__)
+# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
+# endif
+# endif
+# endif
+# if !defined _GL_ATTRIBUTE_NODISCARD && _GL_HAS_ATTRIBUTE (warn_unused_result)
+# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
+# endif
+# ifndef _GL_ATTRIBUTE_NODISCARD
+# define _GL_ATTRIBUTE_NODISCARD
+# endif
#endif
/* _GL_ATTRIBUTE_NOINLINE tells that the compiler should not inline the
function. */
/* Applies to: functions. */
-#if _GL_HAS_ATTRIBUTE (noinline)
-# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
-#else
-# define _GL_ATTRIBUTE_NOINLINE
+#ifndef _GL_ATTRIBUTE_NOINLINE
+# if _GL_HAS_ATTRIBUTE (noinline)
+# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
+# else
+# define _GL_ATTRIBUTE_NOINLINE
+# endif
#endif
/* _GL_ATTRIBUTE_NONNULL ((N1, N2,...)) declares that the arguments N1, N2,...
@@ -344,20 +441,24 @@ AC_DEFUN([gl_COMMON_BODY], [
_GL_ATTRIBUTE_NONNULL () declares that all pointer arguments must not be
null. */
/* Applies to: functions. */
-#if _GL_HAS_ATTRIBUTE (nonnull)
-# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
-#else
-# define _GL_ATTRIBUTE_NONNULL(args)
+#ifndef _GL_ATTRIBUTE_NONNULL
+# if _GL_HAS_ATTRIBUTE (nonnull)
+# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
+# else
+# define _GL_ATTRIBUTE_NONNULL(args)
+# endif
#endif
/* _GL_ATTRIBUTE_NONSTRING declares that the contents of a character array is
not meant to be NUL-terminated. */
/* Applies to: struct/union members and variables that are arrays of element
type '[[un]signed] char'. */
-#if _GL_HAS_ATTRIBUTE (nonstring)
-# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
-#else
-# define _GL_ATTRIBUTE_NONSTRING
+#ifndef _GL_ATTRIBUTE_NONSTRING
+# if _GL_HAS_ATTRIBUTE (nonstring)
+# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
+# else
+# define _GL_ATTRIBUTE_NONSTRING
+# endif
#endif
/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */
@@ -365,10 +466,12 @@ AC_DEFUN([gl_COMMON_BODY], [
/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
*/
/* Applies to: functions. */
-#if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
-# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
-#else
-# define _GL_ATTRIBUTE_NOTHROW
+#ifndef _GL_ATTRIBUTE_NOTHROW
+# if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
+# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
+# else
+# define _GL_ATTRIBUTE_NOTHROW
+# endif
#endif
/* _GL_ATTRIBUTE_PACKED declares:
@@ -377,10 +480,12 @@ AC_DEFUN([gl_COMMON_BODY], [
minimizing the memory required. */
/* Applies to: struct members, struct, union,
in C++ also: class. */
-#if _GL_HAS_ATTRIBUTE (packed)
-# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
-#else
-# define _GL_ATTRIBUTE_PACKED
+#ifndef _GL_ATTRIBUTE_PACKED
+# if _GL_HAS_ATTRIBUTE (packed)
+# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
+# else
+# define _GL_ATTRIBUTE_PACKED
+# endif
#endif
/* _GL_ATTRIBUTE_PURE declares that It is OK for a compiler to omit duplicate
@@ -390,19 +495,23 @@ AC_DEFUN([gl_COMMON_BODY], [
observable state, and always returns exactly once.
(This attribute is looser than _GL_ATTRIBUTE_CONST.) */
/* Applies to: functions. */
-#if _GL_HAS_ATTRIBUTE (pure)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
-#else
-# define _GL_ATTRIBUTE_PURE
+#ifndef _GL_ATTRIBUTE_PURE
+# if _GL_HAS_ATTRIBUTE (pure)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+# define _GL_ATTRIBUTE_PURE
+# endif
#endif
/* _GL_ATTRIBUTE_RETURNS_NONNULL declares that the function's return value is
a non-NULL pointer. */
/* Applies to: functions. */
-#if _GL_HAS_ATTRIBUTE (returns_nonnull)
-# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
-#else
-# define _GL_ATTRIBUTE_RETURNS_NONNULL
+#ifndef _GL_ATTRIBUTE_RETURNS_NONNULL
+# if _GL_HAS_ATTRIBUTE (returns_nonnull)
+# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
+# else
+# define _GL_ATTRIBUTE_RETURNS_NONNULL
+# endif
#endif
/* _GL_ATTRIBUTE_SENTINEL(pos) declares that the variadic function expects a
@@ -410,17 +519,21 @@ AC_DEFUN([gl_COMMON_BODY], [
_GL_ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99).
_GL_ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */
/* Applies to: functions. */
-#if _GL_HAS_ATTRIBUTE (sentinel)
-# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
-#else
-# define _GL_ATTRIBUTE_SENTINEL(pos)
+#ifndef _GL_ATTRIBUTE_SENTINEL
+# if _GL_HAS_ATTRIBUTE (sentinel)
+# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
+# else
+# define _GL_ATTRIBUTE_SENTINEL(pos)
+# endif
#endif
/* A helper macro. Don't use it directly. */
-#if _GL_HAS_ATTRIBUTE (unused)
-# define _GL_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
-#else
-# define _GL_ATTRIBUTE_UNUSED
+#ifndef _GL_ATTRIBUTE_UNUSED
+# if _GL_HAS_ATTRIBUTE (unused)
+# define _GL_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+# else
+# define _GL_ATTRIBUTE_UNUSED
+# endif
#endif
]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead.
@@ -431,10 +544,24 @@ AC_DEFUN([gl_COMMON_BODY], [
/* Applies to: label (both in C and C++). */
/* Note that g++ < 4.5 does not support the '__attribute__ ((__unused__)) ;'
syntax. But clang does. */
-#if !(defined __cplusplus && !_GL_GNUC_PREREQ (4, 5)) || defined __clang__
-# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED
+#ifndef _GL_UNUSED_LABEL
+# if !(defined __cplusplus && !_GL_GNUC_PREREQ (4, 5)) || defined __clang__
+# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED
+# else
+# define _GL_UNUSED_LABEL
+# endif
+#endif
+])
+ AH_VERBATIM([c_linkage],
+[/* In C++, there is the concept of "language linkage", that encompasses
+ name mangling and function calling conventions.
+ The following macros start and end a block of "C" linkage. */
+#ifdef __cplusplus
+# define _GL_BEGIN_C_LINKAGE extern "C" {
+# define _GL_END_C_LINKAGE }
#else
-# define _GL_UNUSED_LABEL
+# define _GL_BEGIN_C_LINKAGE
+# define _GL_END_C_LINKAGE
#endif
])
AH_VERBATIM([async_safe],
@@ -492,7 +619,7 @@ AC_DEFUN([gl_COMMON_BODY], [
dnl gl_cross_guess_normal (to be used when 'yes' is good and 'no' is bad),
dnl gl_cross_guess_inverted (to be used when 'no' is good and 'yes' is bad).
AC_ARG_ENABLE([cross-guesses],
- [AS_HELP_STRING([--enable-cross-guesses={conservative|risky}],
+ [AS_HELP_STRING([[--enable-cross-guesses={conservative|risky}]],
[specify policy for cross-compilation guesses])],
[if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
AC_MSG_WARN([invalid argument supplied to --enable-cross-guesses])
@@ -1004,6 +1131,238 @@ AC_DEFUN([gl_CONDITIONAL_HEADER],
m4_popdef([gl_header_name])
])
+dnl Preparations for gl_CHECK_FUNCS_MACOS.
+AC_DEFUN([gl_PREPARE_CHECK_FUNCS_MACOS],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_COMPILER_CLANG])
+ AC_CACHE_CHECK([for compiler option needed when checking for future declarations],
+ [gl_cv_compiler_check_future_option],
+ [case "$host_os" in
+ dnl This is only needed on macOS.
+ darwin*)
+ if test $gl_cv_compiler_clang = yes; then
+ dnl Test whether the compiler supports the option
+ dnl '-Werror=unguarded-availability-new'.
+ save_ac_compile="$ac_compile"
+ ac_compile="$ac_compile -Werror=unguarded-availability-new"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
+ [gl_cv_compiler_check_future_option='-Werror=unguarded-availability-new'],
+ [gl_cv_compiler_check_future_option=none])
+ ac_compile="$save_ac_compile"
+ else
+ gl_cv_compiler_check_future_option=none
+ fi
+ ;;
+ *) gl_cv_compiler_check_future_option=none ;;
+ esac
+ ])
+])
+
+dnl Pieces of the expansion of
+dnl gl_CHECK_FUNCS_ANDROID
+dnl gl_CHECK_FUNCS_MACOS
+dnl gl_CHECK_FUNCS_ANDROID_MACOS
+
+AC_DEFUN([gl_CHECK_FUNCS_DEFAULT_CASE],
+[
+ *)
+ AC_CHECK_FUNC([$1])
+ [gl_cv_onwards_func_][$1]=$[ac_cv_func_][$1]
+ ;;
+])
+
+AC_DEFUN([gl_CHECK_FUNCS_CASE_FOR_ANDROID],
+[
+ linux*-android*)
+ AC_CHECK_DECL([$1], , , [$2])
+ if test $[ac_cv_have_decl_][$1] = yes; then
+ AC_CHECK_FUNC([[$1]])
+ if test $[ac_cv_func_][$1] = yes; then
+ [gl_cv_onwards_func_][$1]=yes
+ else
+ dnl The function is declared but does not exist. This should not
+ dnl happen normally. But anyway, we know that a future version
+ dnl of Android will have the function.
+ [gl_cv_onwards_func_][$1]='future OS version'
+ fi
+ else
+ [gl_cv_onwards_func_][$1]='future OS version'
+ fi
+ ;;
+])
+
+AC_DEFUN([gl_CHECK_FUNCS_CASE_FOR_MACOS],
+[
+ darwin*)
+ if test "x$gl_cv_compiler_check_future_option" != "xnone"; then
+ dnl Use a compile test, not a link test.
+ save_ac_compile="$ac_compile"
+ ac_compile="$ac_compile $gl_cv_compiler_check_future_option"
+ save_ac_compile_for_check_decl="$ac_compile_for_check_decl"
+ ac_compile_for_check_decl="$ac_compile_for_check_decl $gl_cv_compiler_check_future_option"
+ unset [ac_cv_have_decl_][$1]
+ AC_CHECK_DECL([$1], , , [$2])
+ ac_compile="$save_ac_compile"
+ ac_compile_for_check_decl="$save_ac_compile_for_check_decl"
+ [ac_cv_func_][$1]="$[ac_cv_have_decl_][$1]"
+ if test $[ac_cv_func_][$1] = yes; then
+ [gl_cv_onwards_func_][$1]=yes
+ else
+ unset [ac_cv_have_decl_][$1]
+ AC_CHECK_DECL([$1], , , [$2])
+ if test $[ac_cv_have_decl_][$1] = yes; then
+ [gl_cv_onwards_func_][$1]='future OS version'
+ else
+ [gl_cv_onwards_func_][$1]=no
+ fi
+ fi
+ else
+ AC_CHECK_FUNC([$1])
+ [gl_cv_onwards_func_][$1]=$[ac_cv_func_][$1]
+ fi
+ ;;
+])
+
+AC_DEFUN([gl_CHECK_FUNCS_SET_RESULTS],
+[
+ case "$[gl_cv_onwards_func_][$1]" in
+ future*) [ac_cv_func_][$1]=no ;;
+ *) [ac_cv_func_][$1]=$[gl_cv_onwards_func_][$1] ;;
+ esac
+ if test $[ac_cv_func_][$1] = yes; then
+ AC_DEFINE([HAVE_]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ]),
+ [1], [Define to 1 if you have the `$1' function.])
+ fi
+])
+
+dnl gl_CHECK_FUNCS_ANDROID([func], [[#include <foo.h>]])
+dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem
+dnl on Android.
+dnl
+dnl When code is compiled on Android, it is in the context of a certain
+dnl "Android API level", which indicates the minimum version of Android on
+dnl which the app can be installed. In other words, you don't compile for a
+dnl specific version of Android. You compile for all versions of Android,
+dnl onwards from the given API level.
+dnl Thus, the question "does the OS have the function func" has three possible
+dnl answers:
+dnl - yes, in all versions starting from the given API level,
+dnl - no, in no version,
+dnl - not in the given API level, but in a later version of Android.
+dnl
+dnl In detail, this works as follows:
+dnl If func was added to Android API level, say, 28, then the libc.so has the
+dnl symbol func always, whereas the header file <foo.h> declares func
+dnl conditionally:
+dnl #if __ANDROID_API__ >= 28
+dnl ... func (...) __INTRODUCED_IN(28);
+dnl #endif
+dnl Thus, when compiling with "clang -target armv7a-unknown-linux-android28",
+dnl the function func is declared and exists in libc.
+dnl Whereas when compiling with "clang -target armv7a-unknown-linux-android27",
+dnl the function func is not declared but exists in libc.
+dnl
+dnl This macro sets two variables:
+dnl - gl_cv_onwards_func_<func> to yes / no / "future OS version"
+dnl - ac_cv_func_<func> to yes / no / no
+dnl The first variable allows to distinguish all three cases.
+dnl The second variable is set, so that an invocation
+dnl gl_CHECK_FUNCS_ANDROID([func], [[#include <foo.h>]])
+dnl can be used as a drop-in replacement for
+dnl AC_CHECK_FUNCS([func]).
+AC_DEFUN([gl_CHECK_FUNCS_ANDROID],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([for [$1]],
+ [[gl_cv_onwards_func_][$1]],
+ [gl_SILENT([
+ case "$host_os" in
+ gl_CHECK_FUNCS_CASE_FOR_ANDROID([$1], [$2])
+ gl_CHECK_FUNCS_DEFAULT_CASE([$1])
+ esac
+ ])
+ ])
+ gl_CHECK_FUNCS_SET_RESULTS([$1])
+])
+
+dnl gl_CHECK_FUNCS_MACOS([func], [[#include <foo.h>]])
+dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem
+dnl on macOS.
+dnl
+dnl When code is compiled on macOS, it is in the context of a certain minimum
+dnl macOS version, that can be set through the option '-mmacosx-version-min='.
+dnl In other words, you don't compile for a specific version of macOS. You
+dnl compile for all versions of macOS, onwards from the given version.
+dnl Thus, the question "does the OS have the function func" has three possible
+dnl answers:
+dnl - yes, in all versions starting from the given version,
+dnl - no, in no version,
+dnl - not in the given version, but in a later version of macOS.
+dnl
+dnl In detail, this works as follows:
+dnl If func was added to, say, macOS version 13, then the libc has the
+dnl symbol func always, whereas the header file <foo.h> declares func
+dnl conditionally with a special availability attribute:
+dnl ... func (...) __attribute__((availability(macos,introduced=13.0)));
+dnl Thus, when compiling with "clang mmacosx-version-min=13", there is no
+dnl warning about the use of func, and the resulting binary
+dnl - runs fine on macOS 13,
+dnl - aborts with a dyld "Symbol not found" message on macOS 12.
+dnl Whereas, when compiling with "clang mmacosx-version-min=12", there is a
+dnl warning: 'func' is only available on macOS 13.0 or newer
+dnl [-Wunguarded-availability-new],
+dnl and the resulting binary
+dnl - runs fine on macOS 13,
+dnl - crashes with a SIGSEGV (signal 11) on macOS 12.
+dnl
+dnl This macro sets two variables:
+dnl - gl_cv_onwards_func_<func> to yes / no / "future OS version"
+dnl - ac_cv_func_<func> to yes / no / no
+dnl The first variable allows to distinguish all three cases.
+dnl The second variable is set, so that an invocation
+dnl gl_CHECK_FUNCS_MACOS([func], [[#include <foo.h>]])
+dnl can be used as a drop-in replacement for
+dnl AC_CHECK_FUNCS([func]).
+AC_DEFUN([gl_CHECK_FUNCS_MACOS],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_PREPARE_CHECK_FUNCS_MACOS])
+ AC_CACHE_CHECK([for [$1]],
+ [[gl_cv_onwards_func_][$1]],
+ [gl_SILENT([
+ case "$host_os" in
+ gl_CHECK_FUNCS_CASE_FOR_MACOS([$1], [$2])
+ gl_CHECK_FUNCS_DEFAULT_CASE([$1])
+ esac
+ ])
+ ])
+ gl_CHECK_FUNCS_SET_RESULTS([$1])
+])
+
+dnl gl_CHECK_FUNCS_ANDROID_MACOS([func], [[#include <foo.h>]])
+dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem
+dnl on Android and on macOS.
+dnl It is the combination of gl_CHECK_FUNCS_ANDROID and gl_CHECK_FUNCS_MACOS.
+AC_DEFUN([gl_CHECK_FUNCS_ANDROID_MACOS],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_PREPARE_CHECK_FUNCS_MACOS])
+ AC_CACHE_CHECK([for [$1]],
+ [[gl_cv_onwards_func_][$1]],
+ [gl_SILENT([
+ case "$host_os" in
+ gl_CHECK_FUNCS_CASE_FOR_ANDROID([$1], [$2])
+ gl_CHECK_FUNCS_CASE_FOR_MACOS([$1], [$2])
+ gl_CHECK_FUNCS_DEFAULT_CASE([$1])
+ esac
+ ])
+ ])
+ gl_CHECK_FUNCS_SET_RESULTS([$1])
+])
+
dnl Expands to some code for use in .c programs that, on native Windows, defines
dnl the Microsoft deprecated alias function names to the underscore-prefixed
dnl actual function names. With this macro, these function names are available
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 55a0a2c1..37a3a78b 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2022 Free Software Foundation, Inc.
+# Copyright (C) 2002-2023 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -43,10 +43,12 @@ AC_DEFUN([gl_EARLY],
AC_REQUIRE([gl_PROG_AR_RANLIB])
# Code from module absolute-header:
+ # Code from module alignasof:
# Code from module alloca:
# Code from module alloca-opt:
# Code from module argp:
# Code from module array-list:
+ # Code from module assert-h:
# Code from module assure:
# Code from module at-internal:
# Code from module attribute:
@@ -76,11 +78,11 @@ AC_DEFUN([gl_EARLY],
# Code from module double-slash-root:
# Code from module dup:
# Code from module dup2:
- # Code from module dynarray:
# Code from module eloop-threshold:
# Code from module environ:
# Code from module errno:
# Code from module error:
+ # Code from module error-h:
# Code from module exitfail:
# Code from module extensions:
# Code from module extern-inline:
@@ -117,6 +119,8 @@ AC_DEFUN([gl_EARLY],
# Code from module gettime:
# Code from module gettimeofday:
# Code from module gitlog-to-changelog:
+ # Code from module glibc-internal/dynarray:
+ # Code from module glibc-internal/scratch_buffer:
# Code from module glob:
# Code from module glob-h:
# Code from module gnupload:
@@ -140,7 +144,6 @@ AC_DEFUN([gl_EARLY],
# Code from module langinfo:
# Code from module largefile:
AC_REQUIRE([AC_SYS_LARGEFILE])
- AC_REQUIRE([gl_YEAR2038_EARLY])
# Code from module lchown:
# Code from module lib-ignore:
# Code from module libc-config:
@@ -204,7 +207,6 @@ AC_DEFUN([gl_EARLY],
# Code from module rmdir:
# Code from module same-inode:
# Code from module save-cwd:
- # Code from module scratch_buffer:
# Code from module select:
# Code from module set:
# Code from module setenv:
@@ -226,15 +228,16 @@ AC_DEFUN([gl_EARLY],
# Code from module stat:
# Code from module stat-time:
# Code from module std-gnu11:
- # Code from module stdalign:
# Code from module stdarg:
dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
dnl for the builtin va_copy to work. gl_PROG_CC_C99 arranges for this.
gl_PROG_CC_C99
# Code from module stdbool:
+ # Code from module stdckdint:
# Code from module stddef:
# Code from module stdint:
# Code from module stdio:
+ gl_STDIO_H_EARLY
# Code from module stdlib:
# Code from module stdopen:
# Code from module stpcpy:
@@ -266,7 +269,7 @@ AC_DEFUN([gl_EARLY],
# Code from module termios:
# Code from module threadlib:
gl_THREADLIB_EARLY
- # Code from module time:
+ # Code from module time-h:
# Code from module timespec:
# Code from module unistd:
# Code from module unistd-safer:
@@ -302,6 +305,8 @@ AC_DEFUN([gl_EARLY],
# Code from module xstdopen:
# Code from module xstrndup:
# Code from module xvasprintf:
+ # Code from module year2038-recommended:
+ AC_REQUIRE([AC_SYS_YEAR2038_RECOMMENDED])
])
# This macro should be invoked from ./configure.ac, in the section
@@ -322,6 +327,7 @@ AC_DEFUN([gl_INIT],
gl_COMMON
gl_source_base='gl/lib'
gl_source_base_prefix=
+ gl_ALIGNASOF
changequote(,)dnl
LTALLOCA=`echo "$ALLOCA" | sed -e 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
changequote([, ])dnl
@@ -333,6 +339,9 @@ AC_SUBST([LTALLOCA])
m4_ifdef([AM_XGETTEXT_OPTION],
[AM_][XGETTEXT_OPTION([--flag=argp_error:2:c-format])
AM_][XGETTEXT_OPTION([--flag=argp_failure:4:c-format])])
+ gl_ASSERT_H
+ gl_CONDITIONAL_HEADER([assert.h])
+ AC_PROG_MKDIR_P
AC_REQUIRE([AC_CANONICAL_HOST])
gl_FUNC_BTOWC
gl_CONDITIONAL([GL_COND_OBJ_BTOWC],
@@ -394,7 +403,7 @@ AC_SUBST([LTALLOCA])
AC_PROG_MKDIR_P
gl_FUNC_DIRFD
gl_CONDITIONAL([GL_COND_OBJ_DIRFD],
- [test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no || test $REPLACE_DIRFD = 1])
+ [test $HAVE_DIRFD = 0 || test $REPLACE_DIRFD = 1])
AM_COND_IF([GL_COND_OBJ_DIRFD], [
gl_PREREQ_DIRFD
])
@@ -413,20 +422,22 @@ AC_SUBST([LTALLOCA])
gl_PREREQ_DUP2
])
gl_UNISTD_MODULE_INDICATOR([dup2])
- AC_PROG_MKDIR_P
gl_ENVIRON
gl_UNISTD_MODULE_INDICATOR([environ])
gl_HEADER_ERRNO_H
gl_CONDITIONAL_HEADER([errno.h])
AC_PROG_MKDIR_P
+ AC_REQUIRE([gl_ERROR_H])
gl_ERROR
- gl_CONDITIONAL([GL_COND_OBJ_ERROR], [test "$ac_cv_lib_error_at_line" = no])
+ gl_CONDITIONAL([GL_COND_OBJ_ERROR], [test $COMPILE_ERROR_C = 1])
AM_COND_IF([GL_COND_OBJ_ERROR], [
gl_PREREQ_ERROR
])
m4_ifdef([AM_XGETTEXT_OPTION],
[AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
+ gl_ERROR_H
+ AC_PROG_MKDIR_P
AC_REQUIRE([gl_EXTERN_INLINE])
gl_FUNC_FCHDIR
gl_CONDITIONAL([GL_COND_OBJ_FCHDIR], [test $HAVE_FCHDIR = 0])
@@ -553,6 +564,12 @@ AC_SUBST([LTALLOCA])
])
gl_UNISTD_MODULE_INDICATOR([getopt-posix])
gl_FUNC_GETPROGNAME
+ gl_CONDITIONAL([GL_COND_OBJ_GETPROGNAME],
+ [test $HAVE_GETPROGNAME = 0 || test $REPLACE_GETPROGNAME = 1])
+ AM_COND_IF([GL_COND_OBJ_GETPROGNAME], [
+ gl_PREREQ_GETPROGNAME
+ ])
+ gl_STDLIB_MODULE_INDICATOR([getprogname])
AC_REQUIRE([AC_CANONICAL_HOST])
gl_FUNC_GETRANDOM
gl_CONDITIONAL([GL_COND_OBJ_GETRANDOM],
@@ -568,6 +585,8 @@ AC_SUBST([LTALLOCA])
gl_PREREQ_GETTIMEOFDAY
])
gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
+ AC_PROG_MKDIR_P
+ AC_PROG_MKDIR_P
gl_GLOB
dnl Because of gl_REPLACE_GLOB_H:
gl_CONDITIONAL_HEADER([glob.h])
@@ -584,7 +603,10 @@ AC_SUBST([LTALLOCA])
gl_CONDITIONAL_HEADER([glob.h])
AC_PROG_MKDIR_P
AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
- LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
+ HARD_LOCALE_LIB="$SETLOCALE_NULL_LIB"
+ AC_SUBST([HARD_LOCALE_LIB])
+ dnl For backward compatibility.
+ LIB_HARD_LOCALE="$HARD_LOCALE_LIB"
AC_SUBST([LIB_HARD_LOCALE])
AC_DEFUN([gl_HAVE_MODULE_HAVELIB])
gl_IDPRIV
@@ -695,7 +717,8 @@ AC_SUBST([LTALLOCA])
fi
gl_STRING_MODULE_INDICATOR([memmem])
gl_FUNC_MEMPCPY
- gl_CONDITIONAL([GL_COND_OBJ_MEMPCPY], [test $HAVE_MEMPCPY = 0])
+ gl_CONDITIONAL([GL_COND_OBJ_MEMPCPY],
+ [test $HAVE_MEMPCPY = 0 || test $REPLACE_MEMPCPY = 1])
AM_COND_IF([GL_COND_OBJ_MEMPCPY], [
gl_PREREQ_MEMPCPY
])
@@ -804,7 +827,8 @@ AC_SUBST([LTALLOCA])
])
gl_STRING_MODULE_INDICATOR([rawmemchr])
gl_FUNC_READDIR
- gl_CONDITIONAL([GL_COND_OBJ_READDIR], [test $HAVE_READDIR = 0])
+ gl_CONDITIONAL([GL_COND_OBJ_READDIR],
+ [test $HAVE_READDIR = 0 || test $REPLACE_READDIR = 1])
gl_DIRENT_MODULE_INDICATOR([readdir])
gl_FUNC_READLINK
gl_CONDITIONAL([GL_COND_OBJ_READLINK],
@@ -855,13 +879,13 @@ AC_SUBST([LTALLOCA])
AC_LIBOBJ([at-func2])
fi
gl_FUNC_REWINDDIR
- gl_CONDITIONAL([GL_COND_OBJ_REWINDDIR], [test $HAVE_REWINDDIR = 0])
+ gl_CONDITIONAL([GL_COND_OBJ_REWINDDIR],
+ [test $HAVE_REWINDDIR = 0 || test $REPLACE_REWINDDIR = 1])
gl_DIRENT_MODULE_INDICATOR([rewinddir])
gl_FUNC_RMDIR
gl_CONDITIONAL([GL_COND_OBJ_RMDIR], [test $REPLACE_RMDIR = 1])
gl_UNISTD_MODULE_INDICATOR([rmdir])
gl_SAVE_CWD
- AC_PROG_MKDIR_P
gl_FUNC_SELECT
gl_CONDITIONAL([GL_COND_OBJ_SELECT], [test $REPLACE_SELECT = 1])
gl_SYS_SELECT_MODULE_INDICATOR([select])
@@ -926,14 +950,17 @@ AC_SUBST([LTALLOCA])
gl_SYS_STAT_MODULE_INDICATOR([stat])
gl_STAT_TIME
gl_STAT_BIRTHTIME
- gl_STDALIGN_H
- gl_CONDITIONAL_HEADER([stdalign.h])
- AC_PROG_MKDIR_P
gl_STDARG_H
gl_CONDITIONAL_HEADER([stdarg.h])
AC_PROG_MKDIR_P
- gl_STDBOOL_H
- gl_CONDITIONAL_HEADER([stdbool.h])
+ gl_C_BOOL
+ AC_CHECK_HEADERS_ONCE([stdckdint.h])
+ if test $ac_cv_header_stdckdint_h = yes; then
+ GL_GENERATE_STDCKDINT_H=false
+ else
+ GL_GENERATE_STDCKDINT_H=true
+ fi
+ gl_CONDITIONAL_HEADER([stdckdint.h])
AC_PROG_MKDIR_P
gl_STDDEF_H
gl_STDDEF_H_REQUIRE_DEFAULTS
@@ -976,7 +1003,8 @@ AC_SUBST([LTALLOCA])
gl_STDLIB_H_REQUIRE_DEFAULTS
AC_PROG_MKDIR_P
gl_FUNC_STPCPY
- gl_CONDITIONAL([GL_COND_OBJ_STPCPY], [test $HAVE_STPCPY = 0])
+ gl_CONDITIONAL([GL_COND_OBJ_STPCPY],
+ [test $HAVE_STPCPY = 0 || test $REPLACE_STPCPY = 1])
AM_COND_IF([GL_COND_OBJ_STPCPY], [
gl_PREREQ_STPCPY
])
@@ -1152,7 +1180,8 @@ AC_SUBST([LTALLOCA])
gl_CONDITIONAL([GL_COND_OBJ_WMEMCHR], [test $HAVE_WMEMCHR = 0])
gl_WCHAR_MODULE_INDICATOR([wmemchr])
gl_FUNC_WMEMPCPY
- gl_CONDITIONAL([GL_COND_OBJ_WMEMPCPY], [test $HAVE_WMEMPCPY = 0])
+ gl_CONDITIONAL([GL_COND_OBJ_WMEMPCPY],
+ [test $HAVE_WMEMPCPY = 0 || test $REPLACE_WMEMPCPY = 1])
gl_WCHAR_MODULE_INDICATOR([wmempcpy])
gl_XALLOC
gl_MODULE_INDICATOR([xalloc])
@@ -1353,6 +1382,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/argp.h
lib/asnprintf.c
lib/asprintf.c
+ lib/assert.in.h
lib/assure.h
lib/at-func.c
lib/at-func2.c
@@ -1391,7 +1421,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/eloop-threshold.h
lib/errno.in.h
lib/error.c
- lib/error.h
+ lib/error.in.h
lib/exitfail.c
lib/exitfail.h
lib/fchdir.c
@@ -1496,6 +1526,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/idpriv-droptemp.c
lib/idpriv.h
lib/idx.h
+ lib/intprops-internal.h
lib/intprops.h
lib/inttypes.in.h
lib/ioctl.c
@@ -1521,7 +1552,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/malloc/dynarray_resize.c
lib/malloc/dynarray_resize_clear.c
lib/malloc/scratch_buffer.h
- lib/malloc/scratch_buffer_dupfree.c
lib/malloc/scratch_buffer_grow.c
lib/malloc/scratch_buffer_grow_preserve.c
lib/malloc/scratch_buffer_set_array_size.c
@@ -1617,9 +1647,8 @@ AC_DEFUN([gl_FILE_LIST], [
lib/stat-w32.c
lib/stat-w32.h
lib/stat.c
- lib/stdalign.in.h
lib/stdarg.in.h
- lib/stdbool.in.h
+ lib/stdckdint.in.h
lib/stddef.in.h
lib/stdint.in.h
lib/stdio-read.c
@@ -1721,8 +1750,10 @@ AC_DEFUN([gl_FILE_LIST], [
m4/alloca.m4
m4/argp.m4
m4/asm-underscore.m4
+ m4/assert_h.m4
m4/btowc.m4
m4/builtin-expect.m4
+ m4/c-bool.m4
m4/calloc.m4
m4/canonicalize.m4
m4/chdir-long.m4
@@ -1743,6 +1774,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/environ.m4
m4/errno_h.m4
m4/error.m4
+ m4/error_h.m4
m4/exponentd.m4
m4/extensions.m4
m4/extern-inline.m4
@@ -1824,6 +1856,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/msvc-inval.m4
m4/msvc-nothrow.m4
m4/multiarch.m4
+ m4/musl.m4
m4/nanosleep.m4
m4/nl_langinfo.m4
m4/nocrash.m4
@@ -1873,7 +1906,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/std-gnu11.m4
m4/stdalign.m4
m4/stdarg.m4
- m4/stdbool.m4
m4/stddef_h.m4
m4/stdint.m4
m4/stdint_h.m4
@@ -1932,6 +1964,5 @@ AC_DEFUN([gl_FILE_LIST], [
m4/xsize.m4
m4/xstrndup.m4
m4/xvasprintf.m4
- m4/year2038.m4
m4/zzgnulib.m4
])
diff --git a/gl/m4/host-cpu-c-abi.m4 b/gl/m4/host-cpu-c-abi.m4
index b9223241..134f2283 100644
--- a/gl/m4/host-cpu-c-abi.m4
+++ b/gl/m4/host-cpu-c-abi.m4
@@ -1,5 +1,5 @@
# host-cpu-c-abi.m4 serial 15
-dnl Copyright (C) 2002-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/idpriv.m4 b/gl/m4/idpriv.m4
index b3b1c7b4..fc3dd17d 100644
--- a/gl/m4/idpriv.m4
+++ b/gl/m4/idpriv.m4
@@ -1,5 +1,5 @@
# idpriv.m4 serial 1
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4
index a9247f6f..9f19215e 100644
--- a/gl/m4/include_next.m4
+++ b/gl/m4/include_next.m4
@@ -1,5 +1,5 @@
# include_next.m4 serial 26
-dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/intmax_t.m4 b/gl/m4/intmax_t.m4
index 8a15dabd..ef32e1b9 100644
--- a/gl/m4/intmax_t.m4
+++ b/gl/m4/intmax_t.m4
@@ -1,5 +1,5 @@
# intmax_t.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2022 Free Software Foundation,
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/inttypes.m4 b/gl/m4/inttypes.m4
index df25a21e..e7efbe94 100644
--- a/gl/m4/inttypes.m4
+++ b/gl/m4/inttypes.m4
@@ -1,5 +1,5 @@
-# inttypes.m4 serial 36
-dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+# inttypes.m4 serial 37
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -170,6 +170,10 @@ AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
HAVE_IMAXDIV_T=1; AC_SUBST([HAVE_IMAXDIV_T])
+ HAVE_IMAXABS=1; AC_SUBST([HAVE_IMAXABS])
+ HAVE_IMAXDIV=1; AC_SUBST([HAVE_IMAXDIV])
+ REPLACE_IMAXABS=0; AC_SUBST([REPLACE_IMAXABS])
+ REPLACE_IMAXDIV=0; AC_SUBST([REPLACE_IMAXDIV])
REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX])
REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX])
INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
diff --git a/gl/m4/inttypes_h.m4 b/gl/m4/inttypes_h.m4
index 6e9eebf1..68c60e9d 100644
--- a/gl/m4/inttypes_h.m4
+++ b/gl/m4/inttypes_h.m4
@@ -1,5 +1,5 @@
# inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/ioctl.m4 b/gl/m4/ioctl.m4
index 7c721345..83036c3a 100644
--- a/gl/m4/ioctl.m4
+++ b/gl/m4/ioctl.m4
@@ -1,5 +1,5 @@
# ioctl.m4 serial 6
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/isblank.m4 b/gl/m4/isblank.m4
index 1d0ed6ce..809eab46 100644
--- a/gl/m4/isblank.m4
+++ b/gl/m4/isblank.m4
@@ -1,5 +1,5 @@
# isblank.m4 serial 3
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/langinfo_h.m4 b/gl/m4/langinfo_h.m4
index 563c8c43..b17a526a 100644
--- a/gl/m4/langinfo_h.m4
+++ b/gl/m4/langinfo_h.m4
@@ -1,5 +1,5 @@
# langinfo_h.m4 serial 12
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/largefile.m4 b/gl/m4/largefile.m4
index 3e8b5e39..8b051c00 100644
--- a/gl/m4/largefile.m4
+++ b/gl/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-2022 Free Software Foundation, Inc.
+# Copyright 1992-1996, 1998-2023 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.
@@ -10,8 +10,9 @@
# 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.
+# This problem occurs in Autoconf 2.71 and earlier, which lack 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,56 +21,264 @@ AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
[Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).])
;;
esac
+ ]])
+)
+
+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
+# --------------------------
+# C code used to probe for time_t that can represent time points more
+# than 2**31 - 1 seconds after the epoch. With the usual Unix epoch,
+# these correspond to dates after 2038-01-18 22:14:07 +0000 (Gregorian),
+# hence the name.
+AC_DEFUN([_AC_SYS_YEAR2038_TEST_CODE],
+[[
+ #include <time.h>
+ /* Check that time_t can represent 2**32 - 1 correctly. */
+ #define LARGE_TIME_T \\
+ ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30)))
+ int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535
+ && LARGE_TIME_T % 65537 == 0)
+ ? 1 : -1];
+]])
+
+# _AC_SYS_YEAR2038_OPTIONS
+# ------------------------
+# List of known ways to enable support for large time_t. If you change
+# this list you probably also need to change the AS_CASE at the end of
+# _AC_SYS_YEAR2038_PROBE.
+m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize(
+ ["none needed"] dnl 64-bit and newer 32-bit Unix
+ ["-D_TIME_BITS=64"] dnl glibc 2.34 with some 32-bit ABIs
+ ["-D__MINGW_USE_VC2005_COMPAT"] dnl 32-bit MinGW
+ ["-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"]
+ dnl 32-bit MinGW (misconfiguration)
+))
+
+# _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
+# to one of the values in the _AC_SYS_YEAR2038_OPTIONS list, or to
+# "support not detected" if none of them worked. Then, set compilation
+# options and #defines as necessary to enable large time_t support.
+#
+# Note that we do not test whether mktime, localtime, etc. handle
+# large values of time_t correctly, as that would require use of
+# AC_TRY_RUN. Note also that some systems only support large time_t
+# together with large off_t.
+#
+# 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 for timestamps after 2038],
+ [ac_cv_sys_year2038_opts],
+ [ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_opt_found=no
+ for ac_opt in _AC_SYS_YEAR2038_OPTIONS; do
+ AS_IF([test x"$ac_opt" != x"none needed"],
+ [CPPFLAGS="$ac_save_CPPFLAGS $ac_opt"])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_YEAR2038_TEST_CODE])],
+ [ac_cv_sys_year2038_opts="$ac_opt"
+ ac_opt_found=yes])
+ test $ac_opt_found = no || break
+ done
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected"])
+
+ac_have_year2038=yes
+AS_CASE([$ac_cv_sys_year2038_opts],
+ ["none needed"], [],
+ ["support not detected"],
+ [ac_have_year2038=no],
+
+ ["-D_TIME_BITS=64"],
+ [AC_DEFINE([_TIME_BITS], [64],
+ [Number of bits in time_t, on hosts where this is settable.])],
+
+ ["-D__MINGW_USE_VC2005_COMPAT"],
+ [AC_DEFINE([__MINGW_USE_VC2005_COMPAT], [1],
+ [Define to 1 on platforms where this makes time_t a 64-bit type.])],
+
+ ["-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 mid-January 2038.
+ Remove _USE_32BIT_TIME_T from the compiler flags.],
+ [], [], [55]))],
+
+ [AC_MSG_ERROR(
+ [internal error: bad value for \$ac_cv_sys_year2038_opts])])
])
-# Work around a problem in Autoconf through at least 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.
-m4_version_prereq([2.70], [], [
-
-# _AC_SYS_LARGEFILE_TEST_INCLUDES
-# -------------------------------
-m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
-[#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,
+# _AC_SYS_YEAR2038_ENABLE
+# -----------------------
+# Depending on which of the YEAR2038 macros was used, add either an
+# --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],
+ [enable_year2038=yes],
+ [enable_year2038=no]))]dnl
+[AC_ARG_ENABLE([year2038],
+ m4_provide_if([AC_SYS_YEAR2038],
+ [AS_HELP_STRING([--disable-year2038],
+ [don't support timestamps after 2038])],
+ [AS_HELP_STRING([--enable-year2038],
+ [support timestamps after 2038])]))])
+
+# AC_SYS_YEAR2038
+# ---------------
+# Attempt to detect and activate support for large time_t.
+# 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],
+[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.
+ 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
+# ---------------------------
+# C code used to probe for large file support.
+m4_define([_AC_SYS_LARGEFILE_TEST_CODE],
+[@%:@include <sys/types.h>
+@%:@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)
- ? 1 : -1]];[]dnl
+@%:@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
])
-])# m4_version_prereq 2.70
-
-
-# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
-# CACHE-VAR,
-# DESCRIPTION,
-# PROLOGUE, [FUNCTION-BODY])
-# --------------------------------------------------------
-m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
-[AC_CACHE_CHECK([for $1 value needed for large files], [$3],
-[while :; do
- m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
- [AC_LANG_PROGRAM([$5], [$6])],
- [$3=no; break])
- m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
- [AC_LANG_PROGRAM([#undef $1
-#define $1 $2
-$5], [$6])],
- [$3=$2; break])
- $3=unknown
- break
-done])
-case $$3 in #(
- no | unknown) ;;
- *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);;
-esac
-rm -rf conftest*[]dnl
-])# _AC_SYS_LARGEFILE_MACRO_VALUE
+# Defined by Autoconf 2.71 and circa 2022 Gnulib unwisely depended on it.
+m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], [_AC_SYS_LARGEFILE_TEST_CODE])
+
+# _AC_SYS_LARGEFILE_OPTIONS
+# -------------------------
+# List of known ways to enable support for large files. If you change
+# this list you probably also need to change the AS_CASE at the end of
+# _AC_SYS_LARGEFILE_PROBE.
+m4_define([_AC_SYS_LARGEFILE_OPTIONS], m4_normalize(
+ ["none needed"] dnl Most current systems
+ ["-D_FILE_OFFSET_BITS=64"] dnl X/Open LFS spec
+ ["-D_LARGE_FILES=1"] dnl 32-bit AIX 4.2.1+, 32-bit z/OS
+ ["-n32"] dnl 32-bit IRIX 6, SGI cc (obsolete)
+))
+
+# _AC_SYS_LARGEFILE_PROBE
+# -----------------------
+# Subroutine of AC_SYS_LARGEFILE. Probe for large file support and set
+# the cache variable ac_cv_sys_largefile_opts to one of the values in
+# the _AC_SYS_LARGEFILE_OPTIONS list, or to "support not detected" if
+# none of the options in that list worked. Then, set compilation
+# options and #defines as necessary to enable large file support.
+#
+# If large file support is not detected, the behavior depends on which of
+# the top-level AC_SYS_LARGEFILE macros was used (see below).
+#
+# 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_cv_sys_largefile_opts],
+ [ac_save_CC="$CC"
+ ac_opt_found=no
+ for ac_opt in _AC_SYS_LARGEFILE_OPTIONS; do
+ 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])],
+ [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
+ 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], [
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ 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],
+
+ ["-D_FILE_OFFSET_BITS=64"],
+ [AC_DEFINE([_FILE_OFFSET_BITS], [64],
+ [Number of bits in a file offset, on hosts where this is settable.])],
+
+ ["-D_LARGE_FILES=1"],
+ [AC_DEFINE([_LARGE_FILES], [1],
+ [Define to 1 on platforms where this makes off_t a 64-bit type.])],
+
+ ["-n32"],
+ [CC="$CC -n32"],
+
+ [AC_MSG_ERROR(
+ [internal error: bad value for \$ac_cv_sys_largefile_opts])])
+AS_IF([test "$enable_year2038" != no],
+ [_AC_SYS_YEAR2038_PROBE])
+AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])])
# AC_SYS_LARGEFILE
# ----------------
@@ -81,43 +290,12 @@ rm -rf conftest*[]dnl
# 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.
AC_DEFUN([AC_SYS_LARGEFILE],
-[AC_ARG_ENABLE(largefile,
- [ --disable-largefile omit support for large files])
-AS_IF([test "$enable_largefile" != no],
- [AC_CACHE_CHECK([for special C compiler options needed for large files],
- ac_cv_sys_largefile_CC,
- [ac_cv_sys_largefile_CC=no
- if test "$GCC" != yes; then
- ac_save_CC=$CC
- while :; do
- # IRIX 6.2 and later do not support large files by default,
- # so use the C compiler's -n32 option if that helps.
- AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
- AC_COMPILE_IFELSE([], [break])
- CC="$CC -n32"
- AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
- break
- done
- CC=$ac_save_CC
- rm -f conftest.$ac_ext
- fi])
- if test "$ac_cv_sys_largefile_CC" != no; then
- CC=$CC$ac_cv_sys_largefile_CC
- fi
-
- _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
- ac_cv_sys_file_offset_bits,
- [Number of bits in a file offset, on hosts where this is settable.],
- [_AC_SYS_LARGEFILE_TEST_INCLUDES])
- AS_CASE([$ac_cv_sys_file_offset_bits],
- [unknown],
- [_AC_SYS_LARGEFILE_MACRO_VALUE([_LARGE_FILES], [1],
- [ac_cv_sys_large_files],
- [Define for large files, on AIX-style hosts.],
- [_AC_SYS_LARGEFILE_TEST_INCLUDES])],
- [64],
- [gl_YEAR2038_BODY([])])])
-])# AC_SYS_LARGEFILE
+[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/gl/m4/lchown.m4 b/gl/m4/lchown.m4
index 9f9cd427..c3e6c11f 100644
--- a/gl/m4/lchown.m4
+++ b/gl/m4/lchown.m4
@@ -1,7 +1,7 @@
# serial 17
# Determine whether we need the lchown wrapper.
-dnl Copyright (C) 1998, 2001, 2003-2007, 2009-2022 Free Software Foundation,
+dnl Copyright (C) 1998, 2001, 2003-2007, 2009-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
diff --git a/gl/m4/lib-ignore.m4 b/gl/m4/lib-ignore.m4
index 4928e67c..c4d02173 100644
--- a/gl/m4/lib-ignore.m4
+++ b/gl/m4/lib-ignore.m4
@@ -1,6 +1,6 @@
# If possible, ignore libraries that are not depended on.
-dnl Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/lib-ld.m4 b/gl/m4/lib-ld.m4
index 934207a7..acc61274 100644
--- a/gl/m4/lib-ld.m4
+++ b/gl/m4/lib-ld.m4
@@ -1,5 +1,5 @@
-# lib-ld.m4 serial 10
-dnl Copyright (C) 1996-2003, 2009-2022 Free Software Foundation, Inc.
+# lib-ld.m4 serial 11
+dnl Copyright (C) 1996-2003, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -29,7 +29,7 @@ AC_DEFUN([AC_LIB_PROG_LD],
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_ARG_WITH([gnu-ld],
- [AS_HELP_STRING([--with-gnu-ld],
+ [AS_HELP_STRING([[--with-gnu-ld]],
[assume the C compiler uses GNU ld [default=no]])],
[test "$withval" = no || with_gnu_ld=yes],
[with_gnu_ld=no])dnl
diff --git a/gl/m4/lib-link.m4 b/gl/m4/lib-link.m4
index 3b75bcd0..5f8afae6 100644
--- a/gl/m4/lib-link.m4
+++ b/gl/m4/lib-link.m4
@@ -1,5 +1,5 @@
# lib-link.m4 serial 33
-dnl Copyright (C) 2001-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -224,7 +224,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
additional_libdir3=
fi
dnl Search the library and its dependencies in $additional_libdir and
- dnl $LDFLAGS. Using breadth-first-seach.
+ dnl $LDFLAGS. Use breadth-first search.
LIB[]NAME=
LTLIB[]NAME=
INC[]NAME=
diff --git a/gl/m4/lib-prefix.m4 b/gl/m4/lib-prefix.m4
index 999f712f..aefe7f71 100644
--- a/gl/m4/lib-prefix.m4
+++ b/gl/m4/lib-prefix.m4
@@ -1,5 +1,5 @@
# lib-prefix.m4 serial 20
-dnl Copyright (C) 2001-2005, 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2005, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/limits-h.m4 b/gl/m4/limits-h.m4
index 5d5a5bf5..6a5983eb 100644
--- a/gl/m4/limits-h.m4
+++ b/gl/m4/limits-h.m4
@@ -1,6 +1,6 @@
dnl Check whether limits.h has needed features.
-dnl Copyright 2016-2022 Free Software Foundation, Inc.
+dnl Copyright 2016-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -23,14 +23,27 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
int wb = WORD_BIT;
int ullw = ULLONG_WIDTH;
int bw = BOOL_WIDTH;
+ int bm = BOOL_MAX;
+ int mblm = MB_LEN_MAX;
]])],
[gl_cv_header_limits_width=yes],
[gl_cv_header_limits_width=no])])
- if test "$gl_cv_header_limits_width" = yes; then
- GL_GENERATE_LIMITS_H=false
- else
- GL_GENERATE_LIMITS_H=true
- fi
+ GL_GENERATE_LIMITS_H=true
+ AS_IF([test "$gl_cv_header_limits_width" = yes],
+ [AC_CACHE_CHECK([whether limits.h has SSIZE_MAX],
+ [gl_cv_header_limits_ssize_max],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <limits.h>
+ #ifndef SSIZE_MAX
+ #error "SSIZE_MAX is not defined"
+ #endif
+ ]])],
+ [gl_cv_header_limits_ssize_max=yes],
+ [gl_cv_header_limits_ssize_max=no])])
+ if test "$gl_cv_header_limits_ssize_max" = yes; then
+ GL_GENERATE_LIMITS_H=false
+ fi])
])
dnl Unconditionally enables the replacement of <limits.h>.
diff --git a/gl/m4/localcharset.m4 b/gl/m4/localcharset.m4
index f5dbbd4f..15b6b2a5 100644
--- a/gl/m4/localcharset.m4
+++ b/gl/m4/localcharset.m4
@@ -1,5 +1,5 @@
# localcharset.m4 serial 8
-dnl Copyright (C) 2002, 2004, 2006, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004, 2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/locale-fr.m4 b/gl/m4/locale-fr.m4
index 3753891f..107ab931 100644
--- a/gl/m4/locale-fr.m4
+++ b/gl/m4/locale-fr.m4
@@ -1,5 +1,5 @@
-# locale-fr.m4 serial 20
-dnl Copyright (C) 2003, 2005-2022 Free Software Foundation, Inc.
+# locale-fr.m4 serial 21
+dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Determine the name of a french locale with traditional encoding.
-AC_DEFUN([gt_LOCALE_FR],
+AC_DEFUN_ONCE([gt_LOCALE_FR],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AM_LANGINFO_CODESET])
@@ -137,11 +137,21 @@ int main () {
])
dnl Determine the name of a french locale with UTF-8 encoding.
-AC_DEFUN([gt_LOCALE_FR_UTF8],
+AC_DEFUN_ONCE([gt_LOCALE_FR_UTF8],
[
+ AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
- AC_LANG_CONFTEST([AC_LANG_SOURCE([[
+ case "$host_os" in
+ *-musl* | midipix*)
+ dnl On musl libc, all kinds of ll_CC.UTF-8 locales exist, even without
+ dnl any locale file on disk. But they are effectively equivalent to the
+ dnl C.UTF-8 locale, except for locale categories (such as LC_MESSSAGES)
+ dnl for which localizations (.mo files) have been installed.
+ gt_cv_locale_fr_utf8=fr_FR.UTF-8
+ ;;
+ *)
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <locale.h>
#include <time.h>
#if HAVE_LANGINFO_CODESET
@@ -203,51 +213,76 @@ int main () {
#endif
return 0;
}
- ]])])
- if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
- case "$host_os" in
- # Handle native Windows specially, because there setlocale() interprets
- # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
- # "fr" or "fra" as "French" or "French_France.1252",
- # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
- # "ja" as "Japanese" or "Japanese_Japan.932",
- # and similar.
- mingw*)
- # Test for the hypothetical native Windows locale name.
- if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
- gt_cv_locale_fr_utf8=French_France.65001
- else
- # None found.
- gt_cv_locale_fr_utf8=none
- fi
- ;;
- *)
- # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
- # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
- # configure script would override the LC_ALL setting. Likewise for
- # LC_CTYPE, which is also set at the beginning of the configure script.
- # Test for the usual locale name.
- if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
- gt_cv_locale_fr_utf8=fr_FR
- else
- # Test for the locale name with explicit encoding suffix.
- if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
- gt_cv_locale_fr_utf8=fr_FR.UTF-8
- else
- # Test for the Solaris 7 locale name.
- if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
- gt_cv_locale_fr_utf8=fr.UTF-8
+ ]])])
+ if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+ case "$host_os" in
+ # Handle native Windows specially, because there setlocale() interprets
+ # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+ # "fr" or "fra" as "French" or "French_France.1252",
+ # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+ # "ja" as "Japanese" or "Japanese_Japan.932",
+ # and similar.
+ mingw*)
+ # Test for the hypothetical native Windows locale name.
+ if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=French_France.65001
else
# None found.
gt_cv_locale_fr_utf8=none
fi
- fi
- fi
- ;;
- esac
- fi
- rm -fr conftest*
+ ;;
+ *)
+ # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
+ # configure script would override the LC_ALL setting. Likewise for
+ # LC_CTYPE, which is also set at the beginning of the configure script.
+ # Test for the usual locale name.
+ if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr_FR
+ else
+ # Test for the locale name with explicit encoding suffix.
+ if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr_FR.UTF-8
+ else
+ # Test for the Solaris 7 locale name.
+ if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+ gt_cv_locale_fr_utf8=fr.UTF-8
+ else
+ # None found.
+ gt_cv_locale_fr_utf8=none
+ fi
+ fi
+ fi
+ ;;
+ esac
+ fi
+ rm -fr conftest*
+ ;;
+ esac
])
LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
AC_SUBST([LOCALE_FR_UTF8])
+
+ dnl Users of $LOCALE_FR_UTF8 need to know which of the locale categories they
+ dnl can rely on.
+ case "$host_os" in
+ *-musl* | midipix*)
+ dnl On musl libc, locale categories other than LC_CTYPE and LC_MESSAGES
+ dnl are effectively unimplemented.
+ LC_COLLATE_IMPLEMENTED=false
+ LC_NUMERIC_IMPLEMENTED=false
+ LC_TIME_IMPLEMENTED=false
+ LC_MONETARY_IMPLEMENTED=false
+ ;;
+ *)
+ LC_COLLATE_IMPLEMENTED=true
+ LC_NUMERIC_IMPLEMENTED=true
+ LC_TIME_IMPLEMENTED=true
+ LC_MONETARY_IMPLEMENTED=true
+ ;;
+ esac
+ AC_SUBST([LC_COLLATE_IMPLEMENTED])
+ AC_SUBST([LC_NUMERIC_IMPLEMENTED])
+ AC_SUBST([LC_TIME_IMPLEMENTED])
+ AC_SUBST([LC_MONETARY_IMPLEMENTED])
])
diff --git a/gl/m4/locale-ja.m4 b/gl/m4/locale-ja.m4
index 73a5d1ae..f6ca327b 100644
--- a/gl/m4/locale-ja.m4
+++ b/gl/m4/locale-ja.m4
@@ -1,5 +1,5 @@
-# locale-ja.m4 serial 15
-dnl Copyright (C) 2003, 2005-2022 Free Software Foundation, Inc.
+# locale-ja.m4 serial 16
+dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Determine the name of a japanese locale with EUC-JP encoding.
-AC_DEFUN([gt_LOCALE_JA],
+AC_DEFUN_ONCE([gt_LOCALE_JA],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AM_LANGINFO_CODESET])
diff --git a/gl/m4/locale-zh.m4 b/gl/m4/locale-zh.m4
index c997971f..94c54590 100644
--- a/gl/m4/locale-zh.m4
+++ b/gl/m4/locale-zh.m4
@@ -1,5 +1,5 @@
-# locale-zh.m4 serial 15
-dnl Copyright (C) 2003, 2005-2022 Free Software Foundation, Inc.
+# locale-zh.m4 serial 16
+dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Determine the name of a chinese locale with GB18030 encoding.
-AC_DEFUN([gt_LOCALE_ZH_CN],
+AC_DEFUN_ONCE([gt_LOCALE_ZH_CN],
[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AM_LANGINFO_CODESET])
diff --git a/gl/m4/locale_h.m4 b/gl/m4/locale_h.m4
index ca5d0d0f..a33a0a46 100644
--- a/gl/m4/locale_h.m4
+++ b/gl/m4/locale_h.m4
@@ -1,5 +1,5 @@
# locale_h.m4 serial 28
-dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/localeconv.m4 b/gl/m4/localeconv.m4
index 09c1a1ac..374dcbf5 100644
--- a/gl/m4/localeconv.m4
+++ b/gl/m4/localeconv.m4
@@ -1,5 +1,5 @@
-# localeconv.m4 serial 1
-dnl Copyright (C) 2012-2022 Free Software Foundation, Inc.
+# localeconv.m4 serial 2
+dnl Copyright (C) 2012-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -8,10 +8,45 @@ AC_DEFUN([gl_FUNC_LOCALECONV],
[
AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
AC_REQUIRE([gl_LOCALE_H])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
if test $REPLACE_STRUCT_LCONV = 1; then
REPLACE_LOCALECONV=1
fi
+ if test $REPLACE_LOCALECONV = 0; then
+ dnl Test whether fields of type 'char' are filled correctly.
+ dnl This test fails on mingw 5.0.3.
+ AC_CACHE_CHECK([whether localeconv works],
+ [gl_cv_func_localeconv_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <locale.h>
+ #include <limits.h>
+ int main ()
+ {
+ struct lconv *l = localeconv ();
+ return l->frac_digits != CHAR_MAX && l->frac_digits < 0;
+ }
+ ]])],
+ [gl_cv_func_localeconv_works=yes],
+ [gl_cv_func_localeconv_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_localeconv_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl* | midipix*) gl_cv_func_localeconv_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_localeconv_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_localeconv_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_localeconv_works" in
+ *yes) ;;
+ *) REPLACE_LOCALECONV=1 ;;
+ esac
+ fi
])
# Prerequisites of lib/localeconv.c.
@@ -19,4 +54,6 @@ AC_DEFUN([gl_PREREQ_LOCALECONV],
[
AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [],
[[#include <locale.h>]])
+ AC_CHECK_MEMBERS([struct lconv.int_p_cs_precedes], [], [],
+ [[#include <locale.h>]])
])
diff --git a/gl/m4/lock.m4 b/gl/m4/lock.m4
index c4cbf07b..88cf5575 100644
--- a/gl/m4/lock.m4
+++ b/gl/m4/lock.m4
@@ -1,5 +1,5 @@
# lock.m4 serial 14
-dnl Copyright (C) 2005-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/lstat.m4 b/gl/m4/lstat.m4
index d987060b..2bc46697 100644
--- a/gl/m4/lstat.m4
+++ b/gl/m4/lstat.m4
@@ -1,6 +1,6 @@
-# serial 33
+# serial 34
-# Copyright (C) 1997-2001, 2003-2022 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-2023 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -56,6 +56,9 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
linux-* | linux)
# Guess yes on Linux systems.
gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+ midipix*)
+ # Guess yes on systems that emulate the Linux system calls.
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
*-gnu* | gnu*)
# Guess yes on glibc systems.
gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4
index 6b76c1e6..bc580176 100644
--- a/gl/m4/malloc.m4
+++ b/gl/m4/malloc.m4
@@ -1,5 +1,5 @@
-# malloc.m4 serial 28
-dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+# malloc.m4 serial 29
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -25,7 +25,7 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
[case "$host_os" in
# Guess yes on platforms where we know the result.
*-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
- | gnu* | *-musl* | midnightbsd* \
+ | gnu* | *-musl* | midipix* | midnightbsd* \
| hpux* | solaris* | cygwin* | mingw* | msys* )
ac_cv_func_malloc_0_nonnull="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
diff --git a/gl/m4/malloca.m4 b/gl/m4/malloca.m4
index 77eb96a0..1d777ebe 100644
--- a/gl/m4/malloca.m4
+++ b/gl/m4/malloca.m4
@@ -1,5 +1,5 @@
# malloca.m4 serial 2
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2022 Free Software Foundation,
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4
index f4b5853f..a06f26f6 100644
--- a/gl/m4/manywarnings.m4
+++ b/gl/m4/manywarnings.m4
@@ -1,11 +1,13 @@
-# manywarnings.m4 serial 23
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+# manywarnings.m4 serial 24
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Simon Josefsson
+AC_PREREQ([2.64])
+
# gl_MANYWARN_COMPLEMENT(OUTVAR, LISTVAR, REMOVEVAR)
# --------------------------------------------------
# Copy LISTVAR to OUTVAR except for the entries in REMOVEVAR.
@@ -21,7 +23,7 @@ AC_DEFUN([gl_MANYWARN_COMPLEMENT],
*" $gl_warn_item "*)
;;
*)
- gl_AS_VAR_APPEND([gl_warn_set], [" $gl_warn_item"])
+ AS_VAR_APPEND([gl_warn_set], [" $gl_warn_item"])
;;
esac
done
@@ -46,43 +48,31 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
dnl First, check for some issues that only occur when combining multiple
dnl gcc warning categories.
AC_REQUIRE([AC_PROG_CC])
- if test -n "$GCC"; then
-
- dnl Check if -Wextra -Werror -Wno-missing-field-initializers is supported
- dnl with the current $CC $CFLAGS $CPPFLAGS.
- AC_CACHE_CHECK([whether -Wno-missing-field-initializers is supported],
- [gl_cv_cc_nomfi_supported],
- [gl_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Wextra -Werror -Wno-missing-field-initializers"
+ AS_IF([test -n "$GCC"], [
+ AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed],
+ [gl_cv_cc_nomfi_needed],
+ [gl_cv_cc_nomfi_needed=no
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Wextra -Werror"
AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[]], [[]])],
- [gl_cv_cc_nomfi_supported=yes],
- [gl_cv_cc_nomfi_supported=no])
+ [AC_LANG_PROGRAM(
+ [[struct file_data { int desc, name; };
+ struct cmp { struct file_data file[1]; };
+ void f (struct cmp *r)
+ {
+ typedef struct { int a; int b; } s_t;
+ s_t s1 = { 0, };
+ struct cmp cmp = { .file[0].desc = r->file[0].desc + s1.a };
+ *r = cmp;
+ }
+ ]],
+ [[]])],
+ [],
+ [CFLAGS="$CFLAGS -Wno-missing-field-initializers"
+ AC_COMPILE_IFELSE([],
+ [gl_cv_cc_nomfi_needed=yes])])
CFLAGS="$gl_save_CFLAGS"
- ])
-
- if test "$gl_cv_cc_nomfi_supported" = yes; then
- dnl Now check whether -Wno-missing-field-initializers is needed
- dnl for the { 0, } construct.
- AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed],
- [gl_cv_cc_nomfi_needed],
- [gl_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Wextra -Werror"
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[int f (void)
- {
- typedef struct { int a; int b; } s_t;
- s_t s1 = { 0, };
- return s1.b;
- }
- ]],
- [[]])],
- [gl_cv_cc_nomfi_needed=no],
- [gl_cv_cc_nomfi_needed=yes])
- CFLAGS="$gl_save_CFLAGS"
- ])
- fi
+ ])
dnl Next, check if -Werror -Wuninitialized is useful with the
dnl user's choice of $CFLAGS; some versions of gcc warn that it
@@ -97,8 +87,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
[gl_cv_cc_uninitialized_supported=no])
CFLAGS="$gl_save_CFLAGS"
])
-
- fi
+ ])
# List all gcc warning categories.
# To compare this list to your installed GCC's, run this Bash command:
@@ -109,7 +98,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
# <(LC_ALL=C gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort)
$1=
- for gl_manywarn_item in -fanalyzer -fno-common \
+ for gl_manywarn_item in -fanalyzer -fstrict-flex-arrays \
-Wall \
-Warith-conversion \
-Wbad-function-cast \
@@ -137,6 +126,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
-Wpointer-arith \
-Wshadow \
-Wstack-protector \
+ -Wstrict-flex-arrays \
-Wstrict-overflow \
-Wstrict-prototypes \
-Wsuggest-attribute=cold \
@@ -160,46 +150,51 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
-Wwrite-strings \
\
; do
- gl_AS_VAR_APPEND([$1], [" $gl_manywarn_item"])
+ AS_VAR_APPEND([$1], [" $gl_manywarn_item"])
done
# gcc --help=warnings outputs an unusual form for these options; list
# them here so that the above 'comm' command doesn't report a false match.
- gl_AS_VAR_APPEND([$1], [' -Warray-bounds=2'])
- gl_AS_VAR_APPEND([$1], [' -Wattribute-alias=2'])
- gl_AS_VAR_APPEND([$1], [' -Wbidi-chars=any,ucn'])
- gl_AS_VAR_APPEND([$1], [' -Wformat-overflow=2'])
- gl_AS_VAR_APPEND([$1], [' -Wformat=2'])
- gl_AS_VAR_APPEND([$1], [' -Wformat-truncation=2'])
- gl_AS_VAR_APPEND([$1], [' -Wimplicit-fallthrough=5'])
- gl_AS_VAR_APPEND([$1], [' -Wshift-overflow=2'])
- gl_AS_VAR_APPEND([$1], [' -Wuse-after-free=3'])
- gl_AS_VAR_APPEND([$1], [' -Wunused-const-variable=2'])
- gl_AS_VAR_APPEND([$1], [' -Wvla-larger-than=4031'])
+ AS_VAR_APPEND([$1], [' -Warray-bounds=2'])
+ AS_VAR_APPEND([$1], [' -Wattribute-alias=2'])
+ AS_VAR_APPEND([$1], [' -Wbidi-chars=any,ucn'])
+ AS_VAR_APPEND([$1], [' -Wformat-overflow=2'])
+ AS_VAR_APPEND([$1], [' -Wformat=2'])
+ AS_VAR_APPEND([$1], [' -Wformat-truncation=2'])
+ AS_VAR_APPEND([$1], [' -Wimplicit-fallthrough=5'])
+ AS_VAR_APPEND([$1], [' -Wshift-overflow=2'])
+ AS_VAR_APPEND([$1], [' -Wuse-after-free=3'])
+ AS_VAR_APPEND([$1], [' -Wunused-const-variable=2'])
+ AS_VAR_APPEND([$1], [' -Wvla-larger-than=4031'])
# These are needed for older GCC versions.
- if test -n "$GCC"; then
- case `($CC --version) 2>/dev/null` in
+ if test -n "$GCC" && gl_gcc_version=`($CC --version) 2>/dev/null`; then
+ case $gl_gcc_version in
'gcc (GCC) '[[0-3]].* | \
'gcc (GCC) '4.[[0-7]].*)
- gl_AS_VAR_APPEND([$1], [' -fdiagnostics-show-option'])
- gl_AS_VAR_APPEND([$1], [' -funit-at-a-time'])
+ AS_VAR_APPEND([$1], [' -fdiagnostics-show-option'])
+ AS_VAR_APPEND([$1], [' -funit-at-a-time'])
+ ;;
+ esac
+ case $gl_gcc_version in
+ 'gcc (GCC) '[[0-9]].*)
+ AS_VAR_APPEND([$1], [' -fno-common'])
;;
esac
fi
# Disable specific options as needed.
if test "$gl_cv_cc_nomfi_needed" = yes; then
- gl_AS_VAR_APPEND([$1], [' -Wno-missing-field-initializers'])
+ AS_VAR_APPEND([$1], [' -Wno-missing-field-initializers'])
fi
if test "$gl_cv_cc_uninitialized_supported" = no; then
- gl_AS_VAR_APPEND([$1], [' -Wno-uninitialized'])
+ AS_VAR_APPEND([$1], [' -Wno-uninitialized'])
fi
# This warning have too many false alarms in GCC 11.2.1.
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101713
- gl_AS_VAR_APPEND([$1], [' -Wno-analyzer-malloc-leak'])
+ AS_VAR_APPEND([$1], [' -Wno-analyzer-malloc-leak'])
AC_LANG_POP([C])
])
diff --git a/gl/m4/math_h.m4 b/gl/m4/math_h.m4
index a08526a7..d2e90ff1 100644
--- a/gl/m4/math_h.m4
+++ b/gl/m4/math_h.m4
@@ -1,5 +1,5 @@
# math_h.m4 serial 125
-dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4
index ec8716b5..430e9ad8 100644
--- a/gl/m4/mbrtowc.m4
+++ b/gl/m4/mbrtowc.m4
@@ -1,5 +1,5 @@
-# mbrtowc.m4 serial 38 -*- coding: utf-8 -*-
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2022 Free Software Foundation,
+# mbrtowc.m4 serial 43 -*- coding: utf-8 -*-
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -91,20 +91,23 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
fi
if test $REPLACE_MBSTATE_T = 1; then
case "$host_os" in
- mingw*) LIB_MBRTOWC= ;;
+ mingw*) MBRTOWC_LIB= ;;
*)
gl_WEAK_SYMBOLS
case "$gl_cv_have_weak" in
- *yes) LIB_MBRTOWC= ;;
- *) LIB_MBRTOWC="$LIBPTHREAD" ;;
+ *yes) MBRTOWC_LIB= ;;
+ *) MBRTOWC_LIB="$LIBPTHREAD" ;;
esac
;;
esac
else
- LIB_MBRTOWC=
+ MBRTOWC_LIB=
fi
- dnl LIB_MBRTOWC is expected to be '-pthread' or '-lpthread' on AIX
+ dnl MBRTOWC_LIB is expected to be '-pthread' or '-lpthread' on AIX
dnl with gcc or xlc, and empty otherwise.
+ AC_SUBST([MBRTOWC_LIB])
+ dnl For backward compatibility.
+ LIB_MBRTOWC="$MBRTOWC_LIB"
AC_SUBST([LIB_MBRTOWC])
])
@@ -114,7 +117,7 @@ dnl Result is REPLACE_MBSTATE_T.
dnl When this is set to 1, we replace both mbsinit() and mbrtowc(), in order to
dnl avoid inconsistencies.
-AC_DEFUN([gl_MBSTATE_T_BROKEN],
+AC_DEFUN_ONCE([gl_MBSTATE_T_BROKEN],
[
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
@@ -426,7 +429,8 @@ int main ()
int result = 0;
int found_some_locale = 0;
/* This fails on Solaris. */
- if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
{
char input[] = "B\303\274\303\237er"; /* "Büßer" */
mbstate_t state;
@@ -442,7 +446,8 @@ int main ()
found_some_locale = 1;
}
/* This fails on HP-UX 11.11. */
- if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ if (strcmp ("$LOCALE_JA", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
{
char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
mbstate_t state;
@@ -677,31 +682,28 @@ AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT],
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether mbrtowc works on empty input],
[gl_cv_func_mbrtowc_empty_input],
- [
- dnl Initial guess, used when cross-compiling or when no suitable locale
- dnl is present.
-changequote(,)dnl
- case "$host_os" in
- # Guess no on AIX and glibc systems.
- aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
- # Guess yes on native Windows.
- mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
- *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
- esac
-changequote([,])dnl
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
- #include <wchar.h>
- static wchar_t wc;
- static mbstate_t mbs;
- int
- main (void)
- {
- return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
- }]])],
- [gl_cv_func_mbrtowc_empty_input=yes],
- [gl_cv_func_mbrtowc_empty_input=no],
- [:])
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <wchar.h>
+ static wchar_t wc;
+ static mbstate_t mbs;
+ int
+ main (void)
+ {
+ return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
+ }]])],
+ [gl_cv_func_mbrtowc_empty_input=yes],
+ [gl_cv_func_mbrtowc_empty_input=no],
+ [case "$host_os" in
+ # Guess no on AIX and glibc systems.
+ aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+ *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+ esac
+ ])
])
])
@@ -709,18 +711,17 @@ dnl Test whether mbrtowc reports encoding errors in the C locale.
dnl Although POSIX was never intended to allow this, the GNU C Library
dnl and other implementations do it. See:
dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932
+dnl POSIX has now clarified it:
+dnl <https://pubs.opengroup.org/onlinepubs/9699919799/functions/mbrtowc.html>
+dnl says: "In the POSIX locale an [EILSEQ] error cannot occur since all byte
+dnl values are valid characters."
AC_DEFUN([gl_MBRTOWC_C_LOCALE],
[
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether the C locale is free of encoding errors],
[gl_cv_func_mbrtowc_C_locale_sans_EILSEQ],
- [
- dnl Initial guess, used when cross-compiling or when no suitable locale
- dnl is present.
- gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
-
- AC_RUN_IFELSE(
+ [AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <limits.h>
#include <locale.h>
@@ -741,13 +742,14 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
}
return 0;
]])],
- [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes],
- [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no],
- [case "$host_os" in
- # Guess yes on native Windows.
- mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
- esac
- ])
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes],
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no],
+ [case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
+ *) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal" ;;
+ esac
+ ])
])
])
diff --git a/gl/m4/mbsinit.m4 b/gl/m4/mbsinit.m4
index ebd2d4ff..c388a8b9 100644
--- a/gl/m4/mbsinit.m4
+++ b/gl/m4/mbsinit.m4
@@ -1,5 +1,5 @@
# mbsinit.m4 serial 9
-dnl Copyright (C) 2008, 2010-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/mbsrtowcs.m4 b/gl/m4/mbsrtowcs.m4
index f672fa52..720f727f 100644
--- a/gl/m4/mbsrtowcs.m4
+++ b/gl/m4/mbsrtowcs.m4
@@ -1,5 +1,5 @@
-# mbsrtowcs.m4 serial 14
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+# mbsrtowcs.m4 serial 16
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -32,6 +32,13 @@ AC_DEFUN([gl_FUNC_MBSRTOWCS],
*yes) ;;
*) REPLACE_MBSRTOWCS=1 ;;
esac
+ if test $REPLACE_MBSRTOWCS = 0; then
+ gl_MBRTOWC_C_LOCALE
+ case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
+ *yes) ;;
+ *) REPLACE_MBSRTOWCS=1 ;;
+ esac
+ fi
fi
fi
])
@@ -71,7 +78,8 @@ int main ()
int result = 0;
/* Test whether the function supports a NULL destination argument.
This fails on native Windows. */
- if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ if (strcmp ("$LOCALE_FR", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR") != NULL)
{
const char input[] = "\337er";
const char *src = input;
@@ -84,7 +92,8 @@ int main ()
}
/* Test whether the function works when started with a conversion state
in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */
- if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
{
const char input[] = "B\303\274\303\237er";
mbstate_t state;
@@ -98,7 +107,8 @@ int main ()
result |= 2;
}
}
- if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ if (strcmp ("$LOCALE_JA", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
{
const char input[] = "<\306\374\313\334\270\354>";
mbstate_t state;
@@ -112,7 +122,8 @@ int main ()
result |= 4;
}
}
- if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ if (strcmp ("$LOCALE_ZH_CN", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
{
const char input[] = "B\250\271\201\060\211\070er";
mbstate_t state;
diff --git a/gl/m4/mbstate_t.m4 b/gl/m4/mbstate_t.m4
index a6eba1bc..dcd66b96 100644
--- a/gl/m4/mbstate_t.m4
+++ b/gl/m4/mbstate_t.m4
@@ -1,5 +1,5 @@
# mbstate_t.m4 serial 14
-dnl Copyright (C) 2000-2002, 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/mbtowc.m4 b/gl/m4/mbtowc.m4
index 2827e833..02ed6ebb 100644
--- a/gl/m4/mbtowc.m4
+++ b/gl/m4/mbtowc.m4
@@ -1,5 +1,5 @@
-# mbtowc.m4 serial 3
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+# mbtowc.m4 serial 5
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -8,9 +8,12 @@ AC_DEFUN([gl_FUNC_MBTOWC],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- AC_CHECK_FUNCS([mbtowc])
+ gl_CHECK_FUNCS_ANDROID([mbtowc], [[#include <stdlib.h>]])
if test $ac_cv_func_mbtowc = no; then
HAVE_MBTOWC=0
+ case "$gl_cv_onwards_func_mbtowc" in
+ future*) REPLACE_MBTOWC=1 ;;
+ esac
else
if false; then
REPLACE_MBTOWC=1
diff --git a/gl/m4/memchr.m4 b/gl/m4/memchr.m4
index c7489d87..4f1aed01 100644
--- a/gl/m4/memchr.m4
+++ b/gl/m4/memchr.m4
@@ -1,5 +1,5 @@
# memchr.m4 serial 18
-dnl Copyright (C) 2002-2004, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/memmem.m4 b/gl/m4/memmem.m4
index e01aa5c7..3cf46bc2 100644
--- a/gl/m4/memmem.m4
+++ b/gl/m4/memmem.m4
@@ -1,5 +1,5 @@
# memmem.m4 serial 29
-dnl Copyright (C) 2002-2004, 2007-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/mempcpy.m4 b/gl/m4/mempcpy.m4
index 1107eb4a..612b77b3 100644
--- a/gl/m4/mempcpy.m4
+++ b/gl/m4/mempcpy.m4
@@ -1,5 +1,5 @@
-# mempcpy.m4 serial 12
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2022 Free Software Foundation,
+# mempcpy.m4 serial 14
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -14,9 +14,12 @@ AC_DEFUN([gl_FUNC_MEMPCPY],
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_STRING_H_DEFAULTS])
- AC_CHECK_FUNCS([mempcpy])
+ gl_CHECK_FUNCS_ANDROID([mempcpy], [[#include <string.h>]])
if test $ac_cv_func_mempcpy = no; then
HAVE_MEMPCPY=0
+ case "$gl_cv_onwards_func_mempcpy" in
+ future*) REPLACE_MEMPCPY=1 ;;
+ esac
fi
])
diff --git a/gl/m4/memrchr.m4 b/gl/m4/memrchr.m4
index ec5e2083..7611ac7e 100644
--- a/gl/m4/memrchr.m4
+++ b/gl/m4/memrchr.m4
@@ -1,5 +1,5 @@
# memrchr.m4 serial 11
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2022 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/minmax.m4 b/gl/m4/minmax.m4
index b9767397..fd09846f 100644
--- a/gl/m4/minmax.m4
+++ b/gl/m4/minmax.m4
@@ -1,5 +1,5 @@
# minmax.m4 serial 4
-dnl Copyright (C) 2005, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/mkdir.m4 b/gl/m4/mkdir.m4
index 8b78ce96..c2bc4da7 100644
--- a/gl/m4/mkdir.m4
+++ b/gl/m4/mkdir.m4
@@ -1,6 +1,6 @@
-# serial 17
+# serial 18
-# Copyright (C) 2001, 2003-2004, 2006, 2008-2022 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003-2004, 2006, 2008-2023 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.
@@ -27,6 +27,8 @@ AC_DEFUN([gl_FUNC_MKDIR],
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
# Guess yes on MSVC, no on mingw.
@@ -67,6 +69,8 @@ AC_DEFUN([gl_FUNC_MKDIR],
*-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
# If we don't know, obey --enable-cross-guesses.
diff --git a/gl/m4/mkdtemp.m4 b/gl/m4/mkdtemp.m4
index b616a9a7..f5dd4a88 100644
--- a/gl/m4/mkdtemp.m4
+++ b/gl/m4/mkdtemp.m4
@@ -1,5 +1,5 @@
# mkdtemp.m4 serial 8
-dnl Copyright (C) 2001-2003, 2006-2007, 2009-2022 Free Software Foundation,
+dnl Copyright (C) 2001-2003, 2006-2007, 2009-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/mkstemp.m4 b/gl/m4/mkstemp.m4
index 322f4bcd..d4a15ead 100644
--- a/gl/m4/mkstemp.m4
+++ b/gl/m4/mkstemp.m4
@@ -1,6 +1,6 @@
-#serial 28
+#serial 29
-# Copyright (C) 2001, 2003-2007, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003-2007, 2009-2023 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.
@@ -58,14 +58,14 @@ AC_DEFUN([gl_FUNC_MKSTEMP],
[gl_cv_func_working_mkstemp=yes],
[gl_cv_func_working_mkstemp=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_working_mkstemp="guessing yes" ;;
- # Guess yes on musl systems.
- *-musl*) gl_cv_func_working_mkstemp="guessing yes" ;;
- # Guess no on native Windows.
- mingw*) gl_cv_func_working_mkstemp="guessing no" ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_working_mkstemp="$gl_cross_guess_normal" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_working_mkstemp="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl* | midipix*) gl_cv_func_working_mkstemp="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_working_mkstemp="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_working_mkstemp="$gl_cross_guess_normal" ;;
esac
])
rm -rf conftest.mkstemp
diff --git a/gl/m4/mmap-anon.m4 b/gl/m4/mmap-anon.m4
index a4580ff9..d07d26e4 100644
--- a/gl/m4/mmap-anon.m4
+++ b/gl/m4/mmap-anon.m4
@@ -1,5 +1,5 @@
# mmap-anon.m4 serial 12
-dnl Copyright (C) 2005, 2007, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/mode_t.m4 b/gl/m4/mode_t.m4
index e08d27a7..82197c02 100644
--- a/gl/m4/mode_t.m4
+++ b/gl/m4/mode_t.m4
@@ -1,5 +1,5 @@
# mode_t.m4 serial 2
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/msvc-inval.m4 b/gl/m4/msvc-inval.m4
index b32cf6eb..8d9d21b5 100644
--- a/gl/m4/msvc-inval.m4
+++ b/gl/m4/msvc-inval.m4
@@ -1,5 +1,5 @@
# msvc-inval.m4 serial 1
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/msvc-nothrow.m4 b/gl/m4/msvc-nothrow.m4
index 16ceb1f1..0263e490 100644
--- a/gl/m4/msvc-nothrow.m4
+++ b/gl/m4/msvc-nothrow.m4
@@ -1,5 +1,5 @@
# msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4
index 5d942765..3ba5b0f7 100644
--- a/gl/m4/multiarch.m4
+++ b/gl/m4/multiarch.m4
@@ -1,5 +1,5 @@
# multiarch.m4 serial 9
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/musl.m4 b/gl/m4/musl.m4
new file mode 100644
index 00000000..e28a3fed
--- /dev/null
+++ b/gl/m4/musl.m4
@@ -0,0 +1,20 @@
+# musl.m4 serial 4
+dnl Copyright (C) 2019-2023 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Test for musl libc, despite the musl libc authors don't like it
+# <https://wiki.musl-libc.org/faq.html>
+# <https://lists.gnu.org/archive/html/bug-gnulib/2018-02/msg00079.html>.
+# From Bruno Haible.
+
+AC_DEFUN_ONCE([gl_MUSL_LIBC],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ *-musl* | midipix*)
+ AC_DEFINE([MUSL_LIBC], [1], [Define to 1 on musl libc.])
+ ;;
+ esac
+])
diff --git a/gl/m4/nanosleep.m4 b/gl/m4/nanosleep.m4
index 1964b1ea..e21a3e34 100644
--- a/gl/m4/nanosleep.m4
+++ b/gl/m4/nanosleep.m4
@@ -1,11 +1,11 @@
-# serial 41
+# serial 43
dnl From Jim Meyering.
dnl Check for the nanosleep function.
dnl If not found, use the supplied replacement.
dnl
-# Copyright (C) 1999-2001, 2003-2022 Free Software Foundation, Inc.
+# Copyright (C) 1999-2001, 2003-2023 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -25,11 +25,11 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
# Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
# Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
- LIB_NANOSLEEP=
- AC_SUBST([LIB_NANOSLEEP])
+ NANOSLEEP_LIB=
+ AC_SUBST([NANOSLEEP_LIB])
AC_SEARCH_LIBS([nanosleep], [rt posix4],
[test "$ac_cv_search_nanosleep" = "none required" ||
- LIB_NANOSLEEP=$ac_cv_search_nanosleep])
+ NANOSLEEP_LIB=$ac_cv_search_nanosleep])
if test "x$ac_cv_search_nanosleep" != xno; then
dnl The system has a nanosleep function.
@@ -100,15 +100,22 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
#else /* A simpler test for native Windows. */
if (nanosleep (&ts_sleep, &ts_remaining) < 0)
return 3;
+ /* Test for 32-bit mingw bug: negative nanosecond values do not
+ cause failure. */
+ ts_sleep.tv_sec = 1;
+ ts_sleep.tv_nsec = -1;
+ if (nanosleep (&ts_sleep, &ts_remaining) != -1)
+ return 7;
#endif
return 0;
}]])],
[gl_cv_func_nanosleep=yes],
- [case $? in dnl (
- 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; dnl (
- *) gl_cv_func_nanosleep=no;;
+ [case $? in
+ 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)' ;;
+ 7) gl_cv_func_nanosleep='no (mishandles negative tv_nsec)' ;;
+ *) gl_cv_func_nanosleep=no ;;
esac],
- [case "$host_os" in dnl ((
+ [case "$host_os" in
linux*) # Guess it halfway works when the kernel is Linux.
gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;;
mingw*) # Guess no on native Windows.
@@ -136,4 +143,8 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
HAVE_NANOSLEEP=0
fi
LIBS=$nanosleep_save_libs
+
+ # For backward compatibility.
+ LIB_NANOSLEEP="$NANOSLEEP_LIB"
+ AC_SUBST([LIB_NANOSLEEP])
])
diff --git a/gl/m4/nl_langinfo.m4 b/gl/m4/nl_langinfo.m4
index d20a09cf..7648d524 100644
--- a/gl/m4/nl_langinfo.m4
+++ b/gl/m4/nl_langinfo.m4
@@ -1,5 +1,5 @@
-# nl_langinfo.m4 serial 8
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+# nl_langinfo.m4 serial 11
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -8,7 +8,7 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
[
AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
AC_REQUIRE([gl_LANGINFO_H])
- AC_CHECK_FUNCS_ONCE([nl_langinfo])
+ gl_CHECK_FUNCS_ANDROID([nl_langinfo], [[#include <langinfo.h>]])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
AC_REQUIRE([gl_PTHREADLIB])
@@ -60,9 +60,12 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
fi
else
HAVE_NL_LANGINFO=0
+ case "$gl_cv_onwards_func_nl_langinfo" in
+ future*) REPLACE_NL_LANGINFO=1 ;;
+ esac
fi
if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then
- LIB_NL_LANGINFO="$LIB_SETLOCALE_NULL"
+ LIB_NL_LANGINFO="$SETLOCALE_NULL_LIB"
else
LIB_NL_LANGINFO=
fi
diff --git a/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4
index 91f00c1b..6a766387 100644
--- a/gl/m4/nocrash.m4
+++ b/gl/m4/nocrash.m4
@@ -1,5 +1,5 @@
# nocrash.m4 serial 5
-dnl Copyright (C) 2005, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/nonblocking.m4 b/gl/m4/nonblocking.m4
index b9d23251..f63d2aef 100644
--- a/gl/m4/nonblocking.m4
+++ b/gl/m4/nonblocking.m4
@@ -1,5 +1,5 @@
# nonblocking.m4 serial 3
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/off_t.m4 b/gl/m4/off_t.m4
index 0890adaf..880f3472 100644
--- a/gl/m4/off_t.m4
+++ b/gl/m4/off_t.m4
@@ -1,5 +1,5 @@
# off_t.m4 serial 1
-dnl Copyright (C) 2012-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/open-cloexec.m4 b/gl/m4/open-cloexec.m4
index 16cd5ec4..fd572fcd 100644
--- a/gl/m4/open-cloexec.m4
+++ b/gl/m4/open-cloexec.m4
@@ -1,6 +1,6 @@
# Test whether O_CLOEXEC is defined.
-dnl Copyright 2017-2022 Free Software Foundation, Inc.
+dnl Copyright 2017-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/open-slash.m4 b/gl/m4/open-slash.m4
index 4fbf491a..1f731f8a 100644
--- a/gl/m4/open-slash.m4
+++ b/gl/m4/open-slash.m4
@@ -1,5 +1,5 @@
# open-slash.m4 serial 2
-dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/open.m4 b/gl/m4/open.m4
index f82fd6ca..94fa2bb7 100644
--- a/gl/m4/open.m4
+++ b/gl/m4/open.m4
@@ -1,5 +1,5 @@
# open.m4 serial 15
-dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/openat.m4 b/gl/m4/openat.m4
index de747994..bbbcad85 100644
--- a/gl/m4/openat.m4
+++ b/gl/m4/openat.m4
@@ -1,7 +1,7 @@
# serial 46
# See if we need to use our replacement for Solaris' openat et al functions.
-dnl Copyright (C) 2004-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/opendir.m4 b/gl/m4/opendir.m4
index 7816dc54..2e9be769 100644
--- a/gl/m4/opendir.m4
+++ b/gl/m4/opendir.m4
@@ -1,5 +1,5 @@
-# opendir.m4 serial 5
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+# opendir.m4 serial 6
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,21 +12,24 @@ AC_DEFUN([gl_FUNC_OPENDIR],
AC_CHECK_FUNCS([opendir])
if test $ac_cv_func_opendir = no; then
HAVE_OPENDIR=0
- fi
- dnl Replace opendir() for supporting the gnulib-defined fchdir() function,
- dnl to keep fchdir's bookkeeping up-to-date.
- m4_ifdef([gl_FUNC_FCHDIR], [
- gl_TEST_FCHDIR
- if test $HAVE_FCHDIR = 0; then
- if test $HAVE_OPENDIR = 1; then
+ else
+ dnl Replace opendir() on native Windows, to support fdopendir().
+ AC_REQUIRE([gl_DIRENT_DIR])
+ if test $DIR_HAS_FD_MEMBER = 0; then
+ REPLACE_OPENDIR=1
+ fi
+ dnl Replace opendir() on OS/2 kLIBC to support dirfd() function replaced
+ dnl by gnulib.
+ case $host_os in
+ os2*) REPLACE_OPENDIR=1 ;;
+ esac
+ dnl Replace opendir() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
REPLACE_OPENDIR=1
fi
- fi
- ])
- dnl Replace opendir() on OS/2 kLIBC to support dirfd() function replaced
- dnl by gnulib.
- case $host_os,$HAVE_OPENDIR in
- os2*,1)
- REPLACE_OPENDIR=1;;
- esac
+ ])
+ fi
])
diff --git a/gl/m4/pathmax.m4 b/gl/m4/pathmax.m4
index 44add990..6d47d2c0 100644
--- a/gl/m4/pathmax.m4
+++ b/gl/m4/pathmax.m4
@@ -1,5 +1,5 @@
# pathmax.m4 serial 11
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2022 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/pipe.m4 b/gl/m4/pipe.m4
index 62871c6d..1ad6688f 100644
--- a/gl/m4/pipe.m4
+++ b/gl/m4/pipe.m4
@@ -1,5 +1,5 @@
# pipe.m4 serial 2
-dnl Copyright (C) 2010-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
index 667452e3..8b8f0106 100644
--- a/gl/m4/printf.m4
+++ b/gl/m4/printf.m4
@@ -1,5 +1,5 @@
-# printf.m4 serial 73
-dnl Copyright (C) 2003, 2007-2022 Free Software Foundation, Inc.
+# printf.m4 serial 84
+dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -63,7 +63,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
# Guess yes on musl systems.
- *-musl*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ *-musl* | midipix*) gl_cv_func_printf_sizes_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
@@ -101,6 +101,92 @@ changequote([,])dnl
])
])
+dnl Test whether the *printf family of functions supports the 'w8', 'w16',
+dnl 'w32', 'w64', 'wf8', 'wf16', 'wf32', 'wf64' size specifiers. (ISO C23)
+dnl Result is gl_cv_func_printf_sizes_c23.
+
+AC_DEFUN([gl_PRINTF_SIZES_C23],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports size specifiers as in C23],
+ [gl_cv_func_printf_sizes_c23],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+# include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+# include <inttypes.h>
+#endif
+static char buf[100];
+int main ()
+{
+ int result = 0;
+ buf[0] = '\0';
+ if (sprintf (buf, "%w8u %d", (uint8_t) 123, 33, 44, 55) < 0
+ || strcmp (buf, "123 33") != 0)
+ result |= 1;
+ buf[0] = '\0';
+ if (sprintf (buf, "%wf8u %d", (uint_fast8_t) 123, 33, 44, 55) < 0
+ || strcmp (buf, "123 33") != 0)
+ result |= 1;
+ buf[0] = '\0';
+ if (sprintf (buf, "%w16u %d", (uint16_t) 12345, 33, 44, 55) < 0
+ || strcmp (buf, "12345 33") != 0)
+ result |= 2;
+ buf[0] = '\0';
+ if (sprintf (buf, "%wf16u %d", (uint_fast16_t) 12345, 33, 44, 55) < 0
+ || strcmp (buf, "12345 33") != 0)
+ result |= 2;
+ buf[0] = '\0';
+ if (sprintf (buf, "%w32u %d", (uint32_t) 12345671, 33, 44, 55) < 0
+ || strcmp (buf, "12345671 33") != 0)
+ result |= 4;
+ buf[0] = '\0';
+ if (sprintf (buf, "%wf32u %d", (uint_fast32_t) 12345671, 33, 44, 55) < 0
+ || strcmp (buf, "12345671 33") != 0)
+ result |= 4;
+#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
+ buf[0] = '\0';
+ if (sprintf (buf, "%w64u %d", (uint64_t) 12345671, 33, 44, 55) < 0
+ || strcmp (buf, "12345671 33") != 0)
+ result |= 8;
+ buf[0] = '\0';
+ if (sprintf (buf, "%wf64u %d", (uint_fast64_t) 12345671, 33, 44, 55) < 0
+ || strcmp (buf, "12345671 33") != 0)
+ result |= 8;
+#else
+ result |= 8;
+#endif
+ return result;
+}]])],
+ [gl_cv_func_printf_sizes_c23=yes],
+ [gl_cv_func_printf_sizes_c23=no],
+ [
+ case "$host_os" in
+ # Guess no on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_sizes_c23="guessing no";;
+ # Guess no on musl systems.
+ *-musl* | midipix*) gl_cv_func_printf_sizes_c23="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_sizes_c23="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_sizes_c23="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_sizes_c23="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
dnl Test whether the *printf family of functions supports 'long double'
dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001)
dnl Result is gl_cv_func_printf_long_double.
@@ -244,7 +330,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_printf_infinite="guessing yes";;
# Guess yes on musl systems.
- *-musl*) gl_cv_func_printf_infinite="guessing yes";;
+ *-musl* | midipix*) gl_cv_func_printf_infinite="guessing yes";;
# Guess yes on FreeBSD >= 6.
freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
@@ -467,7 +553,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
# Guess yes on musl systems.
- *-musl*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ *-musl* | midipix*) gl_cv_func_printf_infinite_long_double="guessing yes";;
# Guess yes on FreeBSD >= 6.
freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
@@ -591,7 +677,7 @@ int main ()
[gl_cv_func_printf_directive_a="guessing no"])
;;
# Guess yes on musl systems.
- *-musl*) gl_cv_func_printf_directive_a="guessing yes";;
+ *-musl* | midipix*) gl_cv_func_printf_directive_a="guessing yes";;
# Guess no on Android.
linux*-android*) gl_cv_func_printf_directive_a="guessing no";;
# Guess no on native Windows.
@@ -603,6 +689,116 @@ int main ()
])
])
+dnl Test whether the *printf family of functions supports the 'b' conversion
+dnl specifier for binary output of integers.
+dnl (ISO C23)
+dnl Result is gl_cv_func_printf_directive_b.
+
+AC_DEFUN([gl_PRINTF_DIRECTIVE_B],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the 'b' directive],
+ [gl_cv_func_printf_directive_b],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+int main ()
+{
+ int result = 0;
+ if (sprintf (buf, "%b %d", 12345, 33, 44, 55) < 0
+ || strcmp (buf, "11000000111001 33") != 0)
+ result |= 1;
+ return result;
+}]])],
+ [gl_cv_func_printf_directive_b=yes],
+ [gl_cv_func_printf_directive_b=no],
+ [
+ case "$host_os" in
+ # Guess yes on glibc >= 2.35 systems.
+ *-gnu* | gnu*)
+ AC_EGREP_CPP([Lucky], [
+ #include <features.h>
+ #ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 35) || (__GLIBC__ > 2)
+ Lucky user
+ #endif
+ #endif
+ ],
+ [gl_cv_func_printf_directive_uppercase_b="guessing yes"],
+ [gl_cv_func_printf_directive_uppercase_b="guessing no"])
+ ;;
+ # Guess no on musl systems.
+ *-musl* | midipix*) gl_cv_func_printf_directive_b="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_b="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_directive_b="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_directive_b="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *printf family of functions supports the 'B' conversion
+dnl specifier for binary output of integers.
+dnl (GNU, encouraged by ISO C23 § 7.23.6.1)
+dnl Result is gl_cv_func_printf_directive_uppercase_b.
+
+AC_DEFUN([gl_PRINTF_DIRECTIVE_UPPERCASE_B],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the 'B' directive],
+ [gl_cv_func_printf_directive_uppercase_b],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+int main ()
+{
+ int result = 0;
+ if (sprintf (buf, "%#B %d", 12345, 33, 44, 55) < 0
+ || strcmp (buf, "0B11000000111001 33") != 0)
+ result |= 1;
+ return result;
+}]])],
+ [gl_cv_func_printf_directive_uppercase_b=yes],
+ [gl_cv_func_printf_directive_uppercase_b=no],
+ [
+ case "$host_os" in
+ # Guess yes on glibc >= 2.35 systems.
+ *-gnu* | gnu*)
+ AC_EGREP_CPP([Lucky], [
+ #include <features.h>
+ #ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 35) || (__GLIBC__ > 2)
+ Lucky user
+ #endif
+ #endif
+ ],
+ [gl_cv_func_printf_directive_uppercase_b="guessing yes"],
+ [gl_cv_func_printf_directive_uppercase_b="guessing no"])
+ ;;
+ # Guess no on musl systems.
+ *-musl* | midipix*) gl_cv_func_printf_directive_uppercase_b="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_uppercase_b="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_directive_uppercase_b="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_directive_uppercase_b="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
dnl Test whether the *printf family of functions supports the %F format
dnl directive. (ISO C99, POSIX:2001)
dnl Result is gl_cv_func_printf_directive_f.
@@ -643,7 +839,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_printf_directive_f="guessing yes";;
# Guess yes on musl systems.
- *-musl*) gl_cv_func_printf_directive_f="guessing yes";;
+ *-musl* | midipix*) gl_cv_func_printf_directive_f="guessing yes";;
# Guess yes on FreeBSD >= 6.
freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
@@ -829,11 +1025,58 @@ changequote([,])dnl
])
])
+dnl Test whether the *printf family of functions supports the %lc format
+dnl directive and in particular, when the argument is a null wide character,
+dnl whether the functions don't produce a NUL byte.
+dnl Result is gl_cv_func_printf_directive_lc.
+
+AC_DEFUN([gl_PRINTF_DIRECTIVE_LC],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether printf supports the 'lc' directive correctly],
+ [gl_cv_func_printf_directive_lc],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <wchar.h>
+#include <string.h>
+int main ()
+{
+ int result = 0;
+ char buf[100];
+ /* This test fails on glibc 2.35, FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2,
+ macOS 12.5, AIX 7.2, Solaris 11.4.
+ glibc 2.35 bug: <https://sourceware.org/bugzilla/show_bug.cgi?id=30257> */
+ {
+ buf[0] = '\0';
+ if (sprintf (buf, "%lc%lc%lc", (wint_t) 'a', (wint_t) 0, (wint_t) 'z') < 0
+ || strcmp (buf, "az") != 0)
+ result |= 1;
+ }
+ return result;
+}]])],
+ [gl_cv_func_printf_directive_lc=yes],
+ [gl_cv_func_printf_directive_lc=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on musl libc.
+ *-musl* | midipix*) gl_cv_func_printf_directive_lc="guessing yes";;
+ # Guess no otherwise.
+ *) gl_cv_func_printf_directive_lc="guessing no";;
+ esac
+changequote([,])dnl
+ ])
+ ])
+])
+
dnl Test whether the *printf family of functions supports POSIX/XSI format
dnl strings with positions. (POSIX:2001)
dnl Result is gl_cv_func_printf_positions.
-AC_DEFUN([gl_PRINTF_POSITIONS],
+AC_DEFUN_ONCE([gl_PRINTF_POSITIONS],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
@@ -990,18 +1233,18 @@ int main ()
[
changequote(,)dnl
case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
- # Guess yes on musl systems.
- *-musl*) gl_cv_func_printf_flag_zero="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_printf_flag_zero="guessing yes";;
- # Guess no on Android.
- linux*-android*) gl_cv_func_printf_flag_zero="guessing no";;
- # Guess no on native Windows.
- mingw*) gl_cv_func_printf_flag_zero="guessing no";;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl* | midipix*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_flag_zero="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_flag_zero="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";;
esac
changequote([,])dnl
])
@@ -1239,7 +1482,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess yes on musl systems.
- *-musl*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ *-musl* | midipix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
@@ -1344,7 +1587,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
# Guess yes on musl systems.
- *-musl*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ *-musl* | midipix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
@@ -1447,7 +1690,7 @@ int main ()
;;
changequote(,)dnl
# Guess yes on musl systems.
- *-musl*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ *-musl* | midipix*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on FreeBSD >= 5.
freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
@@ -1604,7 +1847,7 @@ changequote(,)dnl
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on musl systems.
- *-musl*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ *-musl* | midipix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
@@ -1641,88 +1884,275 @@ changequote([,])dnl
])
])
+dnl Test whether the swprintf function works correctly when it produces output
+dnl that contains null wide characters.
+dnl Result is gl_cv_func_swprintf_works.
+
+AC_DEFUN([gl_SWPRINTF_WORKS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_FUNCS_ONCE([swprintf])
+ AC_CACHE_CHECK([whether swprintf works],
+ [gl_cv_func_swprintf_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#ifndef __USE_MINGW_ANSI_STDIO
+# define __USE_MINGW_ANSI_STDIO 1
+#endif
+#include <stdio.h>
+#include <wchar.h>
+int main()
+{
+ int result = 0;
+ { /* This test fails on musl libc 1.2.3, FreeBSD, NetBSD, OpenBSD, macOS, AIX. */
+ wchar_t buf[5] = { 0xBEEF, 0xBEEF, 0xBEEF, 0xBEEF, 0xBEEF };
+ int ret = swprintf (buf, 4, L"%cz", '\0');
+ /* Expected result:
+ ret = 2, buf[0] = 0x0, buf[1] = 0x7a, buf[2] = 0x0, buf[3] = 0xbeef
+ musl libc 1.2.3:
+ ret = 2, buf[0] = 0x0, buf[1] = 0x0, buf[2] = 0x0, buf[3] = 0x0
+ Reported at <https://www.openwall.com/lists/musl/2023/03/22/9>.
+ FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2:
+ ret = 2, buf[0] = 0x0, buf[1] = 0xbeef, buf[2] = 0xbeef, buf[3] = 0xbeef
+ */
+ if (ret < 0 || buf[1] != 'z')
+ result |= 1;
+ }
+ { /* This test fails on mingw. */
+ wchar_t buf[2];
+ int ret = swprintf (buf, 2, L"%lc", (wint_t)0);
+ /* Expected: ret = 1
+ mingw: ret = 0
+ */
+ if (ret != 1)
+ result |= 2;
+ }
+ return result;
+}]])],
+ [gl_cv_func_swprintf_works=yes],
+ [gl_cv_func_swprintf_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_swprintf_works="guessing yes";;
+ # Guess no on musl systems.
+ *-musl* | midipix*) gl_cv_func_swprintf_works="guessing no";;
+ # Guess no on FreeBSD, NetBSD, OpenBSD, macOS, AIX.
+ freebsd* | midnightbsd* | netbsd* | openbsd* | darwin* | aix*)
+ gl_cv_func_swprintf_works="guessing no";;
+ # Guess no on native Windows.
+ mingw* | pw*) gl_cv_func_swprintf_works="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_swprintf_works="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *wprintf family of functions supports the 'a' and 'A'
+dnl conversion specifier for hexadecimal output of 'long double' numbers.
+dnl (ISO C99, POSIX:2001)
+dnl Result is gl_cv_func_swprintf_directive_la.
+
+AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LA],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether swprintf supports the 'La' and 'LA' directives],
+ [gl_cv_func_swprintf_directive_la],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <wchar.h>
+static wchar_t buf[100];
+int main ()
+{
+ int result = 0;
+ /* This catches a glibc 2.15 and Haiku 2022 bug. */
+ if (swprintf (buf, sizeof (buf) / sizeof (wchar_t),
+ L"%La %d", 3.1416015625L, 33, 44, 55) < 0
+ || (wcscmp (buf, L"0x1.922p+1 33") != 0
+ && wcscmp (buf, L"0x3.244p+0 33") != 0
+ && wcscmp (buf, L"0x6.488p-1 33") != 0
+ && wcscmp (buf, L"0xc.91p-2 33") != 0))
+ result |= 1;
+ return result;
+}]])],
+ [gl_cv_func_swprintf_directive_la=yes],
+ [gl_cv_func_swprintf_directive_la=no],
+ [case "$host_os" in
+ # Guess yes on glibc >= 2.17 systems.
+ *-gnu* | gnu*)
+ AC_EGREP_CPP([Unlucky], [
+ #include <features.h>
+ #ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16) || (__GLIBC__ > 2)) && !defined __UCLIBC__
+ Unlucky
+ #endif
+ #endif
+ ],
+ [gl_cv_func_swprintf_directive_la="guessing yes"],
+ [gl_cv_func_swprintf_directive_la="guessing no"])
+ ;;
+ # Guess yes on musl systems.
+ *-musl* | midipix*) gl_cv_func_swprintf_directive_la="guessing yes";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_swprintf_directive_la="guessing yes";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_swprintf_directive_la="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_swprintf_directive_la="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
+dnl Test whether the *wprintf family of functions supports the 'lc' conversion
+dnl specifier for all wide characters.
+dnl (ISO C11, POSIX:2001)
+dnl Result is gl_cv_func_swprintf_directive_lc.
+
+AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LC],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether swprintf supports the 'lc' directive],
+ [gl_cv_func_swprintf_directive_lc],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <wchar.h>
+static wchar_t buf[100];
+static wint_t L_invalid = (wchar_t) 0x76543210;
+int main ()
+{
+ int result = 0;
+ /* This catches a musl libc 1.2.4, Android bug.
+ Reported at <https://www.openwall.com/lists/musl/2023/06/12/3>. */
+ if (swprintf (buf, sizeof (buf) / sizeof (wchar_t),
+ L"%lc %d", L_invalid, 33, 44, 55) < 0)
+ result |= 1;
+ return result;
+}]])],
+ [gl_cv_func_swprintf_directive_lc=yes],
+ [gl_cv_func_swprintf_directive_lc=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_swprintf_directive_lc="guessing yes";;
+ # Guess no on musl systems.
+ *-musl* | midipix*) gl_cv_func_swprintf_directive_lc="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_swprintf_directive_lc="guessing no";;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_swprintf_directive_lc="guessing yes";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_swprintf_directive_lc="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+])
+
dnl The results of these tests on various platforms are:
dnl
dnl 1 = gl_PRINTF_SIZES_C99
-dnl 2 = gl_PRINTF_LONG_DOUBLE
-dnl 3 = gl_PRINTF_INFINITE
-dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE
-dnl 5 = gl_PRINTF_DIRECTIVE_A
-dnl 6 = gl_PRINTF_DIRECTIVE_F
-dnl 7 = gl_PRINTF_DIRECTIVE_N
-dnl 8 = gl_PRINTF_DIRECTIVE_LS
-dnl 9 = gl_PRINTF_POSITIONS
-dnl 10 = gl_PRINTF_FLAG_GROUPING
-dnl 11 = gl_PRINTF_FLAG_LEFTADJUST
-dnl 12 = gl_PRINTF_FLAG_ZERO
-dnl 13 = gl_PRINTF_PRECISION
-dnl 14 = gl_PRINTF_ENOMEM
-dnl 15 = gl_SNPRINTF_PRESENCE
-dnl 16 = gl_SNPRINTF_TRUNCATION_C99
-dnl 17 = gl_SNPRINTF_RETVAL_C99
-dnl 18 = gl_SNPRINTF_DIRECTIVE_N
-dnl 19 = gl_SNPRINTF_SIZE1
-dnl 20 = gl_VSNPRINTF_ZEROSIZE_C99
+dnl 2 = gl_PRINTF_SIZES_C23
+dnl 3 = gl_PRINTF_LONG_DOUBLE
+dnl 4 = gl_PRINTF_INFINITE
+dnl 5 = gl_PRINTF_INFINITE_LONG_DOUBLE
+dnl 6 = gl_PRINTF_DIRECTIVE_A
+dnl 7 = gl_PRINTF_DIRECTIVE_B
+dnl 8 = gl_PRINTF_DIRECTIVE_UPPERCASE_B
+dnl 9 = gl_PRINTF_DIRECTIVE_F
+dnl 10 = gl_PRINTF_DIRECTIVE_N
+dnl 11 = gl_PRINTF_DIRECTIVE_LS
+dnl 12 = gl_PRINTF_DIRECTIVE_LC
+dnl 13 = gl_PRINTF_POSITIONS
+dnl 14 = gl_PRINTF_FLAG_GROUPING
+dnl 15 = gl_PRINTF_FLAG_LEFTADJUST
+dnl 16 = gl_PRINTF_FLAG_ZERO
+dnl 17 = gl_PRINTF_PRECISION
+dnl 18 = gl_PRINTF_ENOMEM
+dnl 19 = gl_SNPRINTF_PRESENCE
+dnl 20 = gl_SNPRINTF_TRUNCATION_C99
+dnl 21 = gl_SNPRINTF_RETVAL_C99
+dnl 22 = gl_SNPRINTF_DIRECTIVE_N
+dnl 23 = gl_SNPRINTF_SIZE1
+dnl 24 = gl_VSNPRINTF_ZEROSIZE_C99
+dnl 25 = gl_SWPRINTF_WORKS
+dnl 26 = gl_SWPRINTF_DIRECTIVE_LA
+dnl 27 = gl_SWPRINTF_DIRECTIVE_LC
dnl
dnl 1 = checking whether printf supports size specifiers as in C99...
-dnl 2 = checking whether printf supports 'long double' arguments...
-dnl 3 = checking whether printf supports infinite 'double' arguments...
-dnl 4 = checking whether printf supports infinite 'long double' arguments...
-dnl 5 = checking whether printf supports the 'a' and 'A' directives...
-dnl 6 = checking whether printf supports the 'F' directive...
-dnl 7 = checking whether printf supports the 'n' directive...
-dnl 8 = checking whether printf supports the 'ls' directive...
-dnl 9 = checking whether printf supports POSIX/XSI format strings with positions...
-dnl 10 = checking whether printf supports the grouping flag...
-dnl 11 = checking whether printf supports the left-adjust flag correctly...
-dnl 12 = checking whether printf supports the zero flag correctly...
-dnl 13 = checking whether printf supports large precisions...
-dnl 14 = checking whether printf survives out-of-memory conditions...
-dnl 15 = checking for snprintf...
-dnl 16 = checking whether snprintf truncates the result as in C99...
-dnl 17 = checking whether snprintf returns a byte count as in C99...
-dnl 18 = checking whether snprintf fully supports the 'n' directive...
-dnl 19 = checking whether snprintf respects a size of 1...
-dnl 20 = checking whether vsnprintf respects a zero size as in C99...
+dnl 2 = checking whether printf supports size specifiers as in C23...
+dnl 3 = checking whether printf supports 'long double' arguments...
+dnl 4 = checking whether printf supports infinite 'double' arguments...
+dnl 5 = checking whether printf supports infinite 'long double' arguments...
+dnl 6 = checking whether printf supports the 'a' and 'A' directives...
+dnl 7 = checking whether printf supports the 'b' directive...
+dnl 8 = checking whether printf supports the 'B' directive...
+dnl 9 = checking whether printf supports the 'F' directive...
+dnl 10 = checking whether printf supports the 'n' directive...
+dnl 11 = checking whether printf supports the 'ls' directive...
+dnl 12 = checking whether printf supports the 'lc' directive correctly...
+dnl 13 = checking whether printf supports POSIX/XSI format strings with positions...
+dnl 14 = checking whether printf supports the grouping flag...
+dnl 15 = checking whether printf supports the left-adjust flag correctly...
+dnl 16 = checking whether printf supports the zero flag correctly...
+dnl 17 = checking whether printf supports large precisions...
+dnl 18 = checking whether printf survives out-of-memory conditions...
+dnl 19 = checking for snprintf...
+dnl 20 = checking whether snprintf truncates the result as in C99...
+dnl 21 = checking whether snprintf returns a byte count as in C99...
+dnl 22 = checking whether snprintf fully supports the 'n' directive...
+dnl 23 = checking whether snprintf respects a size of 1...
+dnl 24 = checking whether vsnprintf respects a zero size as in C99...
+dnl 25 = checking whether swprintf works...
+dnl 26 = checking whether swprintf supports the 'La' and 'LA' directives...
+dnl 27 = checking whether swprintf supports the 'lc' directive...
dnl
dnl . = yes, # = no.
dnl
-dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . .
-dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . .
-dnl FreeBSD 13.0 . . . . # . . . . . . . . # . . . . . .
-dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . .
-dnl Mac OS X 10.13.5 . . . # # . # . . . . . . . . . . # . .
-dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . .
-dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . .
-dnl OpenBSD 6.0, 6.7 . . . . # . . . . . . . . # . . . . . .
-dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . .
-dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . .
-dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . .
-dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . .
-dnl Solaris 11.4 . . # # # . . # . . . # . . . . . . . .
-dnl Solaris 11.3 . . . . # . . # . . . . . . . . . . . .
-dnl Solaris 11.0 . . # # # . . # . . . # . . . . . . . .
-dnl Solaris 10 . . # # # . . # . . . # # . . . . . . .
-dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . .
-dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # #
-dnl AIX 7.1 . . # # # . . . . . . # # . . . . . . .
-dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . .
-dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . # . . .
-dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . .
-dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . #
-dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? #
-dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . .
-dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . #
-dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # #
-dnl NetBSD 9.0 . . . . # . . . . . . . . . . . . . . .
-dnl NetBSD 5.0 . . . # # . . . . . . # . # . . . . . .
-dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ?
-dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . .
-dnl Haiku . . . # # # . # . . . . . ? . . ? . . .
-dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . .
-dnl Android 4.3 . . # # # # # # . # . # . # . . . # . .
-dnl old mingw / msvcrt # # # # # # . . # # . # # ? . # # # . .
-dnl MSVC 9 # # # # # # # . # # . # # ? # # # # . .
-dnl mingw 2009-2011 . # . # . . . . # # . . . ? . . . . . .
-dnl mingw-w64 2011 # # # # # # . . # # . # # ? . # # # . .
+dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
+dnl musl libc 1.2.3 . # . . . . # # . . . . . . . . . . . . . . . . # . #
+dnl glibc 2.35 . # . . . . . . . . . # . . . . . . . . . . . . . . .
+dnl glibc 2.5 . # . . . . # # . . . # . . . . . . . . . . . . . # .
+dnl glibc 2.3.6 . # . . . # # # . . . # . . . . . . . . . . . . . # .
+dnl FreeBSD 13.0 . # . . . # # # . . . # . . . . . # . . . . . . # . #
+dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . # . . . # . # . . . . . . # ? ?
+dnl Mac OS X 10.13.5 . # . . # # # # . # . # . . . . . . . . . # . . # ? ?
+dnl Mac OS X 10.5.8 . # . . # # # # . . . # . . . # . . . . . . . . # ? ?
+dnl Mac OS X 10.3.9 . # . . . # # # . . . # . . . # . # . . . . . . # ? ?
+dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . # . . . . . # . . . . . . # . #
+dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # # . # . # . # . . . . . . # ? ?
+dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . . . . . ? . . . . . . ? ? ?
+dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . . . . . # . . . . . . ? ? ?
+dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . # . # # # . . . . . . ? ? ?
+dnl Solaris 11.4 . # . # # # # # . . # # . . . # . . . . . . . . . # .
+dnl Solaris 11.3 . # . . . # # # . . # # . . . . . . . . . . . . . # .
+dnl Solaris 11.0 . # . # # # # # . . # # . . . # . . . . . . . . ? ? ?
+dnl Solaris 10 . # . # # # # # . . # # . . . # # . . . . . . . . # .
+dnl Solaris 2.6 ... 9 # # . # # # # # # . # # . . . # # . . . # . . . ? ? ?
+dnl Solaris 2.5.1 # # . # # # # # # . # # . . . # . . # # # # # # ? ? ?
+dnl AIX 7.1 . # . # # # # # . . . # . . . # # . . . . . . . # . .
+dnl AIX 5.2 . # . # # # # # . . . # . . . # . . . . . . . . # ? ?
+dnl AIX 4.3.2, 5.1 # # . # # # # # # . . # . . . # . . . . # . . . # ? ?
+dnl HP-UX 11.31 . # . . . # # # . . . ? . . . # . . . . # # . . ? ? ?
+dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . . . # . . . . # # . # ? ? ?
+dnl HP-UX 10.20 # # . # . # # # # . ? ? . . # # . . . . # # ? # ? ? ?
+dnl IRIX 6.5 # # . # # # # # # . # # . . . # . . . . # . . . # ? ?
+dnl OSF/1 5.1 # # . # # # # # # . . ? . . . # . . . . # . . # ? ? ?
+dnl OSF/1 4.0d # # . # # # # # # . . ? . . . # . . # # # # # # ? ? ?
+dnl NetBSD 9.0 . # . . . # # # . . . # . . . . . . . . . . . . # . #
+dnl NetBSD 5.0 . # . . # # # # . . . # . . . # . # . . . . . . # ? ?
+dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? # . ? ? ? ? ? . . . ? ? ? # ? ?
+dnl NetBSD 3.0 . # . . . # # # # . ? # # # ? # . # . . . . . . # ? ?
+dnl Haiku . # . . # # # # # . # ? . . . . . ? . . ? . . . . # .
+dnl BeOS # # # . # # # # # . ? ? # . ? . # ? . . ? . . . ? ? ?
+dnl Android 4.3 . # . # # # # # # # # ? . # . # . # . . . # . . ? ? ?
+dnl old mingw / msvcrt # # # # # # # # # . . ? # # . # # ? . # # # . . # ? ?
+dnl MSVC 9 # # # # # # # # # # . ? # # . # # ? # # # # . . # ? ?
+dnl mingw 2009-2011 . # # . # . # # . . . ? # # . . . ? . . . . . . # ? ?
+dnl mingw-w64 2011 # # # # # # # # # . . ? # # . # # ? . # # # . . # ? ?
diff --git a/gl/m4/pselect.m4 b/gl/m4/pselect.m4
index 86114416..6c3d1b8f 100644
--- a/gl/m4/pselect.m4
+++ b/gl/m4/pselect.m4
@@ -1,5 +1,5 @@
-# pselect.m4 serial 10
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+# pselect.m4 serial 11
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -54,6 +54,8 @@ AC_DEFUN([gl_FUNC_PSELECT],
case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_pselect_detects_ebadf="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_pselect_detects_ebadf="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_pselect_detects_ebadf="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
diff --git a/gl/m4/pthread_rwlock_rdlock.m4 b/gl/m4/pthread_rwlock_rdlock.m4
index 8ad78392..66b29f89 100644
--- a/gl/m4/pthread_rwlock_rdlock.m4
+++ b/gl/m4/pthread_rwlock_rdlock.m4
@@ -1,5 +1,5 @@
-# pthread_rwlock_rdlock.m4 serial 4
-dnl Copyright (C) 2017-2022 Free Software Foundation, Inc.
+# pthread_rwlock_rdlock.m4 serial 5
+dnl Copyright (C) 2017-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -156,22 +156,22 @@ main ()
[gl_cv_pthread_rwlock_rdlock_prefer_writer=yes],
[gl_cv_pthread_rwlock_rdlock_prefer_writer=no],
[case "$host_os" in
- # Guess no on glibc systems.
- *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
- # Guess no on musl systems.
- *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
- # Guess no on bionic systems.
- *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
- # Guess yes on native Windows with the mingw-w64 winpthreads library.
- # Guess no on native Windows with the gnulib windows-rwlock module.
- mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
- gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
- else
- gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
- fi
- ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
+ # Guess no on glibc systems.
+ *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess no on musl systems.
+ *-musl* | midipix*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess no on bionic systems.
+ *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess yes on native Windows with the mingw-w64 winpthreads library.
+ # Guess no on native Windows with the gnulib windows-rwlock module.
+ mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+ gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
+ else
+ gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
+ fi
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
esac
])
LIBS="$save_LIBS"
diff --git a/gl/m4/pthread_sigmask.m4 b/gl/m4/pthread_sigmask.m4
index 0aa8c53f..27795282 100644
--- a/gl/m4/pthread_sigmask.m4
+++ b/gl/m4/pthread_sigmask.m4
@@ -1,5 +1,5 @@
-# pthread_sigmask.m4 serial 21
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+# pthread_sigmask.m4 serial 22
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -24,7 +24,7 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
[gl_cv_func_pthread_sigmask_macro=no])
])
- LIB_PTHREAD_SIGMASK=
+ PTHREAD_SIGMASK_LIB=
if test $gl_cv_func_pthread_sigmask_macro = yes; then
dnl pthread_sigmask is a dummy macro.
@@ -62,7 +62,7 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
])
if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
dnl pthread_sigmask is available with -pthread or -lpthread.
- LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
+ PTHREAD_SIGMASK_LIB="$LIBMULTITHREAD"
else
dnl pthread_sigmask is not available at all.
HAVE_PTHREAD_SIGMASK=0
@@ -101,6 +101,9 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
])
fi
+ AC_SUBST([PTHREAD_SIGMASK_LIB])
+ dnl For backward compatibility.
+ LIB_PTHREAD_SIGMASK="$PTHREAD_SIGMASK_LIB"
AC_SUBST([LIB_PTHREAD_SIGMASK])
dnl We don't need a variable LTLIB_PTHREAD_SIGMASK, because when
dnl "$gl_threads_api" = posix, $LTLIBMULTITHREAD and $LIBMULTITHREAD are the
@@ -114,7 +117,7 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
dnl On FreeBSD 13.0, MidnightBSD 1.1, HP-UX 11.31, Solaris 9, in programs
dnl that are not linked with -lpthread, the pthread_sigmask() function
dnl always returns 0 and has no effect.
- if test -z "$LIB_PTHREAD_SIGMASK"; then
+ if test -z "$PTHREAD_SIGMASK_LIB"; then
case " $LIBS " in
*' -pthread '*) ;;
*' -lpthread '*) ;;
@@ -162,7 +165,7 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
[gl_cv_func_pthread_sigmask_return_works],
[
gl_save_LIBS="$LIBS"
- LIBS="$LIBS $LIB_PTHREAD_SIGMASK"
+ LIBS="$LIBS $PTHREAD_SIGMASK_LIB"
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <pthread.h>
@@ -208,13 +211,14 @@ int main ()
gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
esac
m4_ifdef([gl_][THREADLIB],
- [dnl Link against $LIBMULTITHREAD, not only $LIB_PTHREAD_SIGMASK.
+ [dnl Link against $LIBMULTITHREAD, not only $PTHREAD_SIGMASK_LIB.
dnl Otherwise we get a false positive on those platforms where
dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no".
gl_save_LIBS=$LIBS
LIBS="$LIBS $LIBMULTITHREAD"])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
+#include <limits.h>
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
@@ -230,14 +234,16 @@ sigint_handler (int sig)
int main ()
{
sigset_t set;
- int pid = getpid ();
+ pid_t pid = getpid ();
char command[80];
+ if (LONG_MAX < pid)
+ return 6;
signal (SIGINT, sigint_handler);
sigemptyset (&set);
sigaddset (&set, SIGINT);
if (!(pthread_sigmask (SIG_BLOCK, &set, NULL) == 0))
return 1;
- sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid);
+ sprintf (command, "sh -c 'sleep 1; kill -INT %ld' &", (long) pid);
if (!(system (command) == 0))
return 2;
sleep (2);
diff --git a/gl/m4/raise.m4 b/gl/m4/raise.m4
index 0c78d095..f20c439f 100644
--- a/gl/m4/raise.m4
+++ b/gl/m4/raise.m4
@@ -1,5 +1,5 @@
# raise.m4 serial 4
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/rawmemchr.m4 b/gl/m4/rawmemchr.m4
index dae41935..a48d8295 100644
--- a/gl/m4/rawmemchr.m4
+++ b/gl/m4/rawmemchr.m4
@@ -1,5 +1,5 @@
# rawmemchr.m4 serial 3
-dnl Copyright (C) 2003, 2007-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/readdir.m4 b/gl/m4/readdir.m4
index ff3d2ab7..81337e2f 100644
--- a/gl/m4/readdir.m4
+++ b/gl/m4/readdir.m4
@@ -1,5 +1,5 @@
-# readdir.m4 serial 1
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+# readdir.m4 serial 2
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,5 +11,11 @@ AC_DEFUN([gl_FUNC_READDIR],
AC_CHECK_FUNCS([readdir])
if test $ac_cv_func_readdir = no; then
HAVE_READDIR=0
+ else
+ dnl Replace readdir() on native Windows, to support fdopendir().
+ AC_REQUIRE([gl_DIRENT_DIR])
+ if test $DIR_HAS_FD_MEMBER = 0; then
+ REPLACE_READDIR=1
+ fi
fi
])
diff --git a/gl/m4/readlink.m4 b/gl/m4/readlink.m4
index d1dd5212..f1d41d2b 100644
--- a/gl/m4/readlink.m4
+++ b/gl/m4/readlink.m4
@@ -1,5 +1,5 @@
-# readlink.m4 serial 16
-dnl Copyright (C) 2003, 2007, 2009-2022 Free Software Foundation, Inc.
+# readlink.m4 serial 17
+dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -38,6 +38,9 @@ AC_DEFUN([gl_FUNC_READLINK],
# Guess yes on Linux or glibc systems.
linux-* | linux | *-gnu* | gnu*)
gl_cv_func_readlink_trailing_slash="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*)
+ gl_cv_func_readlink_trailing_slash="guessing yes" ;;
# Guess no on AIX or HP-UX.
aix* | hpux*)
gl_cv_func_readlink_trailing_slash="guessing no" ;;
@@ -75,6 +78,9 @@ AC_DEFUN([gl_FUNC_READLINK],
# Guess yes on Linux or glibc systems.
linux-* | linux | *-gnu* | gnu*)
gl_cv_func_readlink_truncate="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*)
+ gl_cv_func_readlink_truncate="guessing yes" ;;
# Guess no on AIX or HP-UX.
aix* | hpux*)
gl_cv_func_readlink_truncate="guessing no" ;;
diff --git a/gl/m4/readlinkat.m4 b/gl/m4/readlinkat.m4
index 63c5205e..5c513562 100644
--- a/gl/m4/readlinkat.m4
+++ b/gl/m4/readlinkat.m4
@@ -1,7 +1,7 @@
-# serial 6
+# serial 8
# See if we need to provide readlinkat replacement.
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,10 +12,13 @@ AC_DEFUN([gl_FUNC_READLINKAT],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_FUNCS_ONCE([readlinkat])
+ gl_CHECK_FUNCS_ANDROID([readlinkat], [[#include <unistd.h>]])
AC_REQUIRE([gl_FUNC_READLINK])
if test $ac_cv_func_readlinkat = no; then
HAVE_READLINKAT=0
+ case "$gl_cv_onwards_func_readlinkat" in
+ future*) REPLACE_READLINKAT=1 ;;
+ esac
else
AC_CACHE_CHECK([whether readlinkat signature is correct],
[gl_cv_decl_readlinkat_works],
diff --git a/gl/m4/realloc.m4 b/gl/m4/realloc.m4
index 86e57c25..26053914 100644
--- a/gl/m4/realloc.m4
+++ b/gl/m4/realloc.m4
@@ -1,5 +1,5 @@
-# realloc.m4 serial 26
-dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+# realloc.m4 serial 27
+dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -25,7 +25,7 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF],
[case "$host_os" in
# Guess yes on platforms where we know the result.
*-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
- | gnu* | *-musl* | midnightbsd* \
+ | gnu* | *-musl* | midipix* | midnightbsd* \
| hpux* | solaris* | cygwin* | mingw* | msys* )
ac_cv_func_realloc_0_nonnull="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
diff --git a/gl/m4/reallocarray.m4 b/gl/m4/reallocarray.m4
index f39ab6ea..6a5b5ab3 100644
--- a/gl/m4/reallocarray.m4
+++ b/gl/m4/reallocarray.m4
@@ -1,5 +1,5 @@
-# reallocarray.m4 serial 3
-dnl Copyright (C) 2017-2022 Free Software Foundation, Inc.
+# reallocarray.m4 serial 5
+dnl Copyright (C) 2017-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,9 +11,12 @@ AC_DEFUN([gl_FUNC_REALLOCARRAY],
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([gl_CHECK_MALLOC_PTRDIFF])
- AC_CHECK_FUNCS([reallocarray])
+ gl_CHECK_FUNCS_ANDROID([reallocarray], [[#include <stdlib.h>]])
if test "$ac_cv_func_reallocarray" = no; then
HAVE_REALLOCARRAY=0
+ case "$gl_cv_onwards_func_reallocarray" in
+ future*) REPLACE_REALLOCARRAY=1 ;;
+ esac
elif test "$gl_cv_malloc_ptrdiff" = no; then
REPLACE_REALLOCARRAY=1
fi
diff --git a/gl/m4/regex.m4 b/gl/m4/regex.m4
index 47342986..7acadc48 100644
--- a/gl/m4/regex.m4
+++ b/gl/m4/regex.m4
@@ -1,6 +1,6 @@
-# serial 73
+# serial 74
-# Copyright (C) 1996-2001, 2003-2022 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2023 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,7 @@ AC_DEFUN([gl_REGEX],
[
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_ARG_WITH([included-regex],
- [AS_HELP_STRING([--without-included-regex],
+ [AS_HELP_STRING([[--without-included-regex]],
[don't compile regex; this is the default on systems
with recent-enough versions of the GNU C Library
(use with caution on other systems).])])
diff --git a/gl/m4/rename.m4 b/gl/m4/rename.m4
index 9f1a5654..efabf1a2 100644
--- a/gl/m4/rename.m4
+++ b/gl/m4/rename.m4
@@ -1,6 +1,6 @@
-# serial 33
+# serial 34
-# Copyright (C) 2001, 2003, 2005-2006, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005-2006, 2009-2023 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.
@@ -57,6 +57,8 @@ AC_DEFUN([gl_FUNC_RENAME],
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
# Guess no on native Windows.
@@ -113,6 +115,8 @@ AC_DEFUN([gl_FUNC_RENAME],
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
# Guess yes on native Windows.
@@ -184,6 +188,8 @@ AC_DEFUN([gl_FUNC_RENAME],
case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_rename_link_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
# Guess yes on native Windows.
diff --git a/gl/m4/renameat.m4 b/gl/m4/renameat.m4
index e8f40d56..37805786 100644
--- a/gl/m4/renameat.m4
+++ b/gl/m4/renameat.m4
@@ -1,7 +1,7 @@
-# serial 3
+# serial 4
# See if we need to provide renameat replacement.
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -15,11 +15,12 @@ AC_DEFUN([gl_FUNC_RENAMEAT],
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_HEADERS([linux/fs.h])
- AC_CHECK_FUNCS_ONCE([renameat renameat2])
+ AC_CHECK_FUNCS_ONCE([renameat])
if test $ac_cv_func_renameat = no; then
HAVE_RENAMEAT=0
elif test $REPLACE_RENAME = 1; then
dnl Solaris 9 and 10 have the same bugs in renameat as in rename.
REPLACE_RENAMEAT=1
fi
+ gl_CHECK_FUNCS_ANDROID([renameat2], [[#include <stdio.h>]])
])
diff --git a/gl/m4/rewinddir.m4 b/gl/m4/rewinddir.m4
index 87c050f6..d0d24de8 100644
--- a/gl/m4/rewinddir.m4
+++ b/gl/m4/rewinddir.m4
@@ -1,5 +1,5 @@
-# rewinddir.m4 serial 1
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+# rewinddir.m4 serial 2
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,5 +11,11 @@ AC_DEFUN([gl_FUNC_REWINDDIR],
AC_CHECK_FUNCS([rewinddir])
if test $ac_cv_func_rewinddir = no; then
HAVE_REWINDDIR=0
+ else
+ dnl Replace rewinddir() on native Windows, to support fdopendir().
+ AC_REQUIRE([gl_DIRENT_DIR])
+ if test $DIR_HAS_FD_MEMBER = 0; then
+ REPLACE_REWINDDIR=1
+ fi
fi
])
diff --git a/gl/m4/rmdir.m4 b/gl/m4/rmdir.m4
index 54880278..b19c8901 100644
--- a/gl/m4/rmdir.m4
+++ b/gl/m4/rmdir.m4
@@ -1,5 +1,5 @@
# rmdir.m4 serial 18
-dnl Copyright (C) 2002, 2005, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -36,6 +36,8 @@ AC_DEFUN([gl_FUNC_RMDIR],
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_rmdir_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
# Guess no on native Windows.
diff --git a/gl/m4/save-cwd.m4 b/gl/m4/save-cwd.m4
index 90073eeb..2e6cf58e 100644
--- a/gl/m4/save-cwd.m4
+++ b/gl/m4/save-cwd.m4
@@ -1,5 +1,5 @@
# serial 10
-dnl Copyright (C) 2002-2006, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/select.m4 b/gl/m4/select.m4
index 163f8fbf..88861af4 100644
--- a/gl/m4/select.m4
+++ b/gl/m4/select.m4
@@ -1,5 +1,5 @@
-# select.m4 serial 13
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+# select.m4 serial 15
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -77,6 +77,8 @@ changequote([,])dnl
case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
@@ -91,7 +93,7 @@ changequote([,])dnl
fi
dnl Determine the needed libraries.
- LIB_SELECT="$LIBSOCKET"
+ SELECT_LIB="$LIBSOCKET"
if test $REPLACE_SELECT = 1; then
case "$host_os" in
mingw*)
@@ -109,9 +111,12 @@ main ()
return 0;
}]])],
[],
- [LIB_SELECT="$LIB_SELECT -luser32"])
+ [SELECT_LIB="$SELECT_LIB -luser32"])
;;
esac
fi
+ AC_SUBST([SELECT_LIB])
+ dnl For backward compatibility.
+ LIB_SELECT="$LIB_SELECT"
AC_SUBST([LIB_SELECT])
])
diff --git a/gl/m4/setenv.m4 b/gl/m4/setenv.m4
index 2000039a..a30523d6 100644
--- a/gl/m4/setenv.m4
+++ b/gl/m4/setenv.m4
@@ -1,5 +1,5 @@
-# setenv.m4 serial 30
-dnl Copyright (C) 2001-2004, 2006-2022 Free Software Foundation, Inc.
+# setenv.m4 serial 33
+dnl Copyright (C) 2001-2004, 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -35,12 +35,12 @@ AC_DEFUN([gl_FUNC_SETENV],
]])],
[gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
- # Guess yes on musl systems.
- *-musl*) gl_cv_func_setenv_works="guessing yes" ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl* | midipix*) gl_cv_func_setenv_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
esac
])])
case "$gl_cv_func_setenv_works" in
@@ -151,11 +151,10 @@ int unsetenv (const char *name);
# Prerequisites of lib/setenv.c.
AC_DEFUN([gl_PREREQ_SETENV],
[
- AC_REQUIRE([AC_FUNC_ALLOCA])
AC_REQUIRE([gl_ENVIRON])
AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CHECK_HEADERS([search.h])
- AC_CHECK_FUNCS([tsearch])
+ gl_CHECK_FUNCS_ANDROID([tsearch], [[#include <search.h>]])
])
# Prerequisites of lib/unsetenv.c.
diff --git a/gl/m4/setlocale_null.m4 b/gl/m4/setlocale_null.m4
index 09ea50ea..1105d693 100644
--- a/gl/m4/setlocale_null.m4
+++ b/gl/m4/setlocale_null.m4
@@ -1,5 +1,5 @@
-# setlocale_null.m4 serial 5
-dnl Copyright (C) 2019-2022 Free Software Foundation, Inc.
+# setlocale_null.m4 serial 8
+dnl Copyright (C) 2019-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -13,9 +13,23 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL],
AC_CACHE_CHECK([whether setlocale (LC_ALL, NULL) is multithread-safe],
[gl_cv_func_setlocale_null_all_mtsafe],
[case "$host_os" in
- # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
- *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
+ # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku.
+ *-musl* | midipix* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku*)
gl_cv_func_setlocale_null_all_mtsafe=no ;;
+ # Guess no on Cygwin < 3.4.6.
+ cygwin*)
+ AC_EGREP_CPP([Lucky user],
+ [
+#if defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED >= CYGWIN_VERSION_DLL_MAKE_COMBINED (3004, 6)
+ Lucky user
+ #endif
+#endif
+ ],
+ [gl_cv_func_setlocale_null_all_mtsafe=yes],
+ [gl_cv_func_setlocale_null_all_mtsafe=no])
+ ;;
# Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
*-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
gl_cv_func_setlocale_null_all_mtsafe=yes ;;
@@ -48,7 +62,7 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL],
openbsd* | aix*)
gl_cv_func_setlocale_null_one_mtsafe=no ;;
# Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
- *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
+ *-gnu* | gnu* | *-musl* | midipix* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
gl_cv_func_setlocale_null_one_mtsafe=yes ;;
# If we don't know, obey --enable-cross-guesses.
*)
@@ -74,20 +88,23 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL],
dnl Determine link dependencies of lib/setlocale_null.c and lib/setlocale-lock.c.
if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
case "$host_os" in
- mingw*) LIB_SETLOCALE_NULL= ;;
+ mingw*) SETLOCALE_NULL_LIB= ;;
*)
gl_WEAK_SYMBOLS
case "$gl_cv_have_weak" in
- *yes) LIB_SETLOCALE_NULL= ;;
- *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
+ *yes) SETLOCALE_NULL_LIB= ;;
+ *) SETLOCALE_NULL_LIB="$LIBPTHREAD" ;;
esac
;;
esac
else
- LIB_SETLOCALE_NULL=
+ SETLOCALE_NULL_LIB=
fi
- dnl LIB_SETLOCALE_NULL is expected to be '-pthread' or '-lpthread' on AIX
+ dnl SETLOCALE_NULL_LIB is expected to be '-pthread' or '-lpthread' on AIX
dnl with gcc or xlc, and empty otherwise.
+ AC_SUBST([SETLOCALE_NULL_LIB])
+ dnl For backward compatibility.
+ LIB_SETLOCALE_NULL="$SETLOCALE_NULL_LIB"
AC_SUBST([LIB_SETLOCALE_NULL])
])
diff --git a/gl/m4/sigaction.m4 b/gl/m4/sigaction.m4
index 62c83e03..e981a744 100644
--- a/gl/m4/sigaction.m4
+++ b/gl/m4/sigaction.m4
@@ -1,5 +1,5 @@
# sigaction.m4 serial 7
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/signal_h.m4 b/gl/m4/signal_h.m4
index 4c05c627..cdd6812f 100644
--- a/gl/m4/signal_h.m4
+++ b/gl/m4/signal_h.m4
@@ -1,5 +1,5 @@
# signal_h.m4 serial 22
-dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/signalblocking.m4 b/gl/m4/signalblocking.m4
index b586ef53..81cc91a9 100644
--- a/gl/m4/signalblocking.m4
+++ b/gl/m4/signalblocking.m4
@@ -1,5 +1,5 @@
# signalblocking.m4 serial 17
-dnl Copyright (C) 2001-2002, 2006-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2002, 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sigpipe.m4 b/gl/m4/sigpipe.m4
index e0524443..1b6ec427 100644
--- a/gl/m4/sigpipe.m4
+++ b/gl/m4/sigpipe.m4
@@ -1,5 +1,5 @@
# sigpipe.m4 serial 3
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/size_max.m4 b/gl/m4/size_max.m4
index 1d6abaea..0763366d 100644
--- a/gl/m4/size_max.m4
+++ b/gl/m4/size_max.m4
@@ -1,5 +1,5 @@
# size_max.m4 serial 12
-dnl Copyright (C) 2003, 2005-2006, 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2006, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sleep.m4 b/gl/m4/sleep.m4
index e73651f5..269b73b9 100644
--- a/gl/m4/sleep.m4
+++ b/gl/m4/sleep.m4
@@ -1,5 +1,5 @@
-# sleep.m4 serial 11
-dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+# sleep.m4 serial 12
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -50,6 +50,8 @@ handle_alarm (int sig)
*-gnu* | gnu*) gl_cv_func_sleep_works="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_sleep_works="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_sleep_works="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_sleep_works="guessing no" ;;
# If we don't know, obey --enable-cross-guesses.
diff --git a/gl/m4/socketlib.m4 b/gl/m4/socketlib.m4
index b8bd0afa..a556af1e 100644
--- a/gl/m4/socketlib.m4
+++ b/gl/m4/socketlib.m4
@@ -1,5 +1,5 @@
# socketlib.m4 serial 3
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sockets.m4 b/gl/m4/sockets.m4
index aa04acc3..ed9cb873 100644
--- a/gl/m4/sockets.m4
+++ b/gl/m4/sockets.m4
@@ -1,5 +1,5 @@
# sockets.m4 serial 7
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/socklen.m4 b/gl/m4/socklen.m4
index 1390ac41..1c63a853 100644
--- a/gl/m4/socklen.m4
+++ b/gl/m4/socklen.m4
@@ -1,5 +1,5 @@
# socklen.m4 serial 11
-dnl Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sockpfaf.m4 b/gl/m4/sockpfaf.m4
index b1c4068a..6c6dc2f7 100644
--- a/gl/m4/sockpfaf.m4
+++ b/gl/m4/sockpfaf.m4
@@ -1,5 +1,5 @@
# sockpfaf.m4 serial 10
-dnl Copyright (C) 2004, 2006, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/ssize_t.m4 b/gl/m4/ssize_t.m4
index 03b2b895..52bd77d2 100644
--- a/gl/m4/ssize_t.m4
+++ b/gl/m4/ssize_t.m4
@@ -1,23 +1,37 @@
-# ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2022 Free Software Foundation, Inc.
+# ssize_t.m4 serial 6
+dnl Copyright (C) 2001-2003, 2006, 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
-dnl Test whether ssize_t is defined.
+dnl Define ssize_t if it does not already exist.
AC_DEFUN([gt_TYPE_SSIZE_T],
[
- AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t],
+ AC_CACHE_CHECK([for ssize_t], [gl_cv_ssize_t],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/types.h>]],
[[int x = sizeof (ssize_t *) + sizeof (ssize_t);
return !x;]])],
- [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])])
- if test $gt_cv_ssize_t = no; then
- AC_DEFINE([ssize_t], [int],
- [Define as a signed type of the same size as size_t.])
+ [gl_cv_ssize_t=yes], [gl_cv_ssize_t=no])])
+ if test $gl_cv_ssize_t = no; then
+ dnl On 64-bit native Windows, ssize_t needs to be defined as 'long long',
+ dnl for consistency with the 64-bit size_t.
+ AC_CACHE_CHECK([whether size_t is wider than 'long'], [gl_cv_size_t_large],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ typedef int array [2 * (sizeof (size_t) > sizeof (long)) - 1];
+ ]])],
+ [gl_cv_size_t_large=yes], [gl_cv_size_t_large=no])])
+ if test $gl_cv_size_t_large = yes; then
+ gl_def_ssize_t='long long'
+ else
+ gl_def_ssize_t='long'
+ fi
+ AC_DEFINE_UNQUOTED([ssize_t], [$gl_def_ssize_t],
+ [Define as a signed type of the same size as size_t.])
fi
])
diff --git a/gl/m4/stat-time.m4 b/gl/m4/stat-time.m4
index 342857d3..40993d57 100644
--- a/gl/m4/stat-time.m4
+++ b/gl/m4/stat-time.m4
@@ -1,6 +1,6 @@
# Checks for stat-related time functions.
-# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2022 Free Software
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2023 Free Software
# Foundation, Inc.
# This file is free software; the Free Software Foundation
diff --git a/gl/m4/stat.m4 b/gl/m4/stat.m4
index 916eb886..6d1628c2 100644
--- a/gl/m4/stat.m4
+++ b/gl/m4/stat.m4
@@ -1,6 +1,6 @@
-# serial 18
+# serial 19
-# Copyright (C) 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2009-2023 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -45,6 +45,8 @@ AC_DEFUN([gl_FUNC_STAT],
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_stat_file_slash="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
# If we don't know, obey --enable-cross-guesses.
diff --git a/gl/m4/stdalign.m4 b/gl/m4/stdalign.m4
index 78577cb2..1a236d66 100644
--- a/gl/m4/stdalign.m4
+++ b/gl/m4/stdalign.m4
@@ -1,20 +1,28 @@
-# Check for stdalign.h that conforms to C11.
+# Check for alignas and alignof that conform to C23.
-dnl Copyright 2011-2022 Free Software Foundation, Inc.
+dnl Copyright 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl Written by Paul Eggert and Bruno Haible.
+
# Prepare for substituting <stdalign.h> if it is not supported.
-AC_DEFUN([gl_STDALIGN_H],
+AC_DEFUN([gl_ALIGNASOF],
[
- AC_CACHE_CHECK([for working stdalign.h],
+ AC_CACHE_CHECK([for alignas and alignof],
[gl_cv_header_working_stdalign_h],
- [AC_COMPILE_IFELSE(
+ [gl_save_CFLAGS=$CFLAGS
+ for gl_working in "yes, keywords" "yes, <stdalign.h> macros"; do
+ AS_CASE([$gl_working],
+ [*stdalign.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_STDALIGN_H"])
+ AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdint.h>
- #include <stdalign.h>
+ #ifdef INCLUDE_STDALIGN_H
+ #include <stdalign.h>
+ #endif
#include <stddef.h>
/* Test that alignof yields a result consistent with offsetof.
@@ -30,7 +38,7 @@ AC_DEFUN([gl_STDALIGN_H],
char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
- /* Test _Alignas only on platforms where gnulib can help. */
+ /* Test alignas only on platforms where gnulib can help. */
#if \
((defined __cplusplus && 201103 <= __cplusplus) \
|| (__TINYC__ && defined __attribute__) \
@@ -45,12 +53,148 @@ AC_DEFUN([gl_STDALIGN_H],
? 1 : -1];
#endif
]])],
- [gl_cv_header_working_stdalign_h=yes],
- [gl_cv_header_working_stdalign_h=no])])
+ [gl_cv_header_working_stdalign_h=$gl_working],
+ [gl_cv_header_working_stdalign_h=no])
+
+ CFLAGS=$gl_save_CFLAGS
+ test "$gl_cv_header_working_stdalign_h" != no && break
+ done])
+
+ AS_CASE([$gl_cv_header_working_stdalign_h],
+ [yes*keyword*],
+ [AC_DEFINE([HAVE_C_ALIGNASOF], [1],
+ [Define to 1 if the alignas and alignof keywords work.])])
+
+ dnl The "zz" puts this toward config.h's end, to avoid potential
+ dnl collisions with other definitions.
+ AH_VERBATIM([zzalignas],
+[#if !defined HAVE_C_ALIGNASOF && __cplusplus < 201103 && !defined alignof
+# if HAVE_STDALIGN_H
+# include <stdalign.h>
+# endif
+
+/* ISO C23 alignas and alignof for platforms that lack it.
+
+ References:
+ ISO C23 (latest free draft
+ <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n3047.pdf>)
+ sections 6.5.3.4, 6.7.5, 7.15.
+ C++11 (latest free draft
+ <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>)
+ section 18.10. */
+
+/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment
+ requirement of a structure member (i.e., slot or field) that is of
+ type TYPE, as an integer constant expression.
+
+ This differs from GCC's and clang's __alignof__ operator, which can
+ yield a better-performing alignment for an object of that type. For
+ example, on x86 with GCC and on Linux/x86 with clang,
+ __alignof__ (double) and __alignof__ (long long) are 8, whereas
+ alignof (double) and alignof (long long) are 4 unless the option
+ '-malign-double' is used.
+
+ The result cannot be used as a value for an 'enum' constant, if you
+ want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. */
+
+/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
+ clang versions < 8.0.0 have the same bug. */
+# if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+ || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
+ && !defined __clang__) \
+ || (defined __clang__ && __clang_major__ < 8))
+# undef/**/_Alignof
+# ifdef __cplusplus
+# if (201103 <= __cplusplus || defined _MSC_VER)
+# define _Alignof(type) alignof (type)
+# else
+ template <class __t> struct __alignof_helper { char __a; __t __b; };
+# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
+# define _GL_STDALIGN_NEEDS_STDDEF 1
+# endif
+# else
+# if (defined __GNUC__ && 4 <= __GNUC__) || defined __clang__
+# define _Alignof(type) __builtin_offsetof (struct { char __a; type __b; }, __b)
+# else
+# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
+# define _GL_STDALIGN_NEEDS_STDDEF 1
+# endif
+# endif
+# endif
+# if ! (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))
+# undef/**/alignof
+# define alignof _Alignof
+# endif
+
+/* alignas (A), also known as _Alignas (A), aligns a variable or type
+ to the alignment A, where A is an integer constant expression. For
+ example:
+
+ int alignas (8) foo;
+ struct s { int a; int alignas (8) bar; };
- if test $gl_cv_header_working_stdalign_h = yes; then
+ aligns the address of FOO and the offset of BAR to be multiples of 8.
+
+ A should be a power of two that is at least the type's alignment
+ and at most the implementation's alignment limit. This limit is
+ 2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable
+ to MSVC through at least version 10.0, A should be an integer
+ constant, as MSVC does not support expressions such as 1 << 3.
+ To be portable to Sun C 5.11, do not align auto variables to
+ anything stricter than their default alignment.
+
+ The following C23 requirements are not supported here:
+
+ - If A is zero, alignas has no effect.
+ - alignas can be used multiple times; the strictest one wins.
+ - alignas (TYPE) is equivalent to alignas (alignof (TYPE)).
+
+ */
+# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)
+# define _Alignas(a) alignas (a)
+# elif (!defined __attribute__ \
+ && ((defined __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__ && !defined __ibmxl__) \
+ || (4 <= __clang_major__) \
+ || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+ || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__))
+# define _Alignas(a) __attribute__ ((__aligned__ (a)))
+# elif 1300 <= _MSC_VER
+# define _Alignas(a) __declspec (align (a))
+# endif
+# endif
+# if !HAVE_STDALIGN_H
+# if ((defined _Alignas \
+ && !(defined __cplusplus \
+ && (201103 <= __cplusplus || defined _MSC_VER))) \
+ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
+# define alignas _Alignas
+# endif
+# endif
+
+# if _GL_STDALIGN_NEEDS_STDDEF
+# include <stddef.h>
+# endif
+#endif])
+])
+
+AC_DEFUN([gl_STDALIGN_H],
+[
+ AC_REQUIRE([gl_ALIGNASOF])
+ if test "$gl_cv_header_working_stdalign_h" = no; then
+ GL_GENERATE_STDALIGN_H=true
+ else
GL_GENERATE_STDALIGN_H=false
+ fi
+
+ gl_CHECK_NEXT_HEADERS([stdalign.h])
+ if test $ac_cv_header_stdalign_h = yes; then
+ HAVE_STDALIGN_H=1
else
- GL_GENERATE_STDALIGN_H=true
+ HAVE_STDALIGN_H=0
fi
+ AC_SUBST([HAVE_STDALIGN_H])
])
diff --git a/gl/m4/stdarg.m4 b/gl/m4/stdarg.m4
index eafa86cb..94787ccc 100644
--- a/gl/m4/stdarg.m4
+++ b/gl/m4/stdarg.m4
@@ -1,5 +1,5 @@
# stdarg.m4 serial 8
-dnl Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/stdbool.m4 b/gl/m4/stdbool.m4
deleted file mode 100644
index 3e6c4005..00000000
--- a/gl/m4/stdbool.m4
+++ /dev/null
@@ -1,117 +0,0 @@
-# Check for stdbool.h that conforms to C99.
-
-dnl Copyright (C) 2002-2006, 2009-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,
-dnl with or without modifications, as long as this notice is preserved.
-
-#serial 9
-
-# Prepare for substituting <stdbool.h> if it is not supported.
-
-AC_DEFUN([gl_STDBOOL_H],
-[
- AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
- AC_REQUIRE([AC_CANONICAL_HOST])
-
- dnl On some platforms, <stdbool.h> does not exist or does not conform to C99.
- dnl On Solaris 10 with CC=cc CXX=CC, <stdbool.h> exists but is not usable
- dnl in C++ mode (and no <cstdbool> exists). In this case, we use our
- dnl replacement, also in C mode (for binary compatibility between C and C++).
- if test "$ac_cv_header_stdbool_h" = yes; then
- case "$host_os" in
- solaris*)
- if test -z "$GCC"; then
- GL_GENERATE_STDBOOL_H=true
- else
- GL_GENERATE_STDBOOL_H=false
- fi
- ;;
- *)
- GL_GENERATE_STDBOOL_H=false
- ;;
- esac
- else
- GL_GENERATE_STDBOOL_H=true
- fi
-
- if test "$ac_cv_type__Bool" = yes; then
- HAVE__BOOL=1
- else
- HAVE__BOOL=0
- fi
- AC_SUBST([HAVE__BOOL])
-])
-
-# This version of the macro is needed in autoconf <= 2.68.
-
-AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
- [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
- [ac_cv_header_stdbool_h],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
- #include <stdbool.h>
-
- #ifdef __cplusplus
- typedef bool Bool;
- #else
- typedef _Bool Bool;
- #ifndef bool
- "error: bool is not defined"
- #endif
- #ifndef false
- "error: false is not defined"
- #endif
- #if false
- "error: false is not 0"
- #endif
- #ifndef true
- "error: true is not defined"
- #endif
- #if true != 1
- "error: true is not 1"
- #endif
- #endif
-
- #ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
- #endif
-
- struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s;
-
- char a[true == 1 ? 1 : -1];
- char b[false == 0 ? 1 : -1];
- char c[__bool_true_false_are_defined == 1 ? 1 : -1];
- char d[(bool) 0.5 == true ? 1 : -1];
- /* See body of main program for 'e'. */
- char f[(Bool) 0.0 == false ? 1 : -1];
- char g[true];
- char h[sizeof (Bool)];
- char i[sizeof s.t];
- enum { j = false, k = true, l = false * true, m = true * 256 };
- /* The following fails for
- HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
- Bool n[m];
- char o[sizeof n == m * sizeof n[0] ? 1 : -1];
- char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
- /* Catch a bug in an HP-UX C compiler. See
- https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
- https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
- */
- Bool q = true;
- Bool *pq = &q;
- bool *qq = &q;
- ]],
- [[
- bool e = &s;
- *pq |= q; *pq |= ! q;
- *qq |= q; *qq |= ! q;
- /* Refer to every declared value, to avoid compiler optimizations. */
- return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
- + !m + !n + !o + !p + !q + !pq + !qq);
- ]])],
- [ac_cv_header_stdbool_h=yes],
- [ac_cv_header_stdbool_h=no])])
- AC_CHECK_TYPES([_Bool])
-])
diff --git a/gl/m4/stddef_h.m4 b/gl/m4/stddef_h.m4
index abfd2030..aa012219 100644
--- a/gl/m4/stddef_h.m4
+++ b/gl/m4/stddef_h.m4
@@ -1,5 +1,5 @@
-# stddef_h.m4 serial 12
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+# stddef_h.m4 serial 14
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -22,7 +22,14 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
[gl_cv_type_max_align_t],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
- [[#include <stddef.h>
+ [[/* On FreeBSD 12.0/x86, max_align_t defined by <stddef.h> has
+ the correct alignment with the default (wrong) definition of
+ _Alignof, but a wrong alignment as soon as we activate an
+ ISO C compliant _Alignof definition. */
+ #if ((defined __GNUC__ && 4 <= __GNUC__) || defined __clang__) && !defined __cplusplus
+ #define _Alignof(type) __builtin_offsetof (struct { char __a; type __b; }, __b)
+ #endif
+ #include <stddef.h>
unsigned int s = sizeof (max_align_t);
#if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
@@ -61,6 +68,21 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
GL_GENERATE_STDDEF_H=true
fi
+ AC_CACHE_CHECK([for unreachable],
+ [gl_cv_func_unreachable],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ ]],
+ [[unreachable ();
+ ]])],
+ [gl_cv_func_unreachable=yes],
+ [gl_cv_func_unreachable=no])
+ ])
+ if test $gl_cv_func_unreachable = no; then
+ GL_GENERATE_STDDEF_H=true
+ fi
+
if $GL_GENERATE_STDDEF_H; then
gl_NEXT_HEADERS([stddef.h])
fi
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index c3f08942..d6961b09 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,5 +1,5 @@
# stdint.m4 serial 61
-dnl Copyright (C) 2001-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/stdint_h.m4 b/gl/m4/stdint_h.m4
index b8684b61..70349f6c 100644
--- a/gl/m4/stdint_h.m4
+++ b/gl/m4/stdint_h.m4
@@ -1,5 +1,5 @@
# stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
index 42e96071..dbfa0d5d 100644
--- a/gl/m4/stdio_h.m4
+++ b/gl/m4/stdio_h.m4
@@ -1,12 +1,22 @@
-# stdio_h.m4 serial 59
-dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+# stdio_h.m4 serial 63
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-AC_DEFUN_ONCE([gl_STDIO_H],
+AC_DEFUN([gl_STDIO_H_EARLY],
[
- AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ dnl Defining __USE_MINGW_ANSI_STDIO to 1 must be done early, because
+ dnl the results of several configure tests depend on it: The tests
+ dnl - checking whether snprintf returns a byte count as in C99...
+ dnl - checking whether snprintf truncates the result as in C99...
+ dnl - checking whether printf supports the 'F' directive...
+ dnl - checking whether printf supports the grouping flag...
+ dnl - checking whether printf supports the zero flag correctly...
+ dnl - checking whether printf supports infinite 'double' arguments...
+ dnl - checking whether printf supports large precisions...
+ dnl report 'yes' if __USE_MINGW_ANSI_STDIO is 1 but 'no' if
+ dnl __USE_MINGW_ANSI_STDIO is not set.
AH_VERBATIM([MINGW_ANSI_STDIO],
[/* Use GNU style printf and scanf. */
#ifndef __USE_MINGW_ANSI_STDIO
@@ -14,6 +24,11 @@ AC_DEFUN_ONCE([gl_STDIO_H],
#endif
])
AC_DEFINE([__USE_MINGW_ANSI_STDIO])
+])
+
+AC_DEFUN_ONCE([gl_STDIO_H],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
gl_NEXT_HEADERS([stdio.h])
dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and
@@ -40,6 +55,9 @@ AC_DEFUN_ONCE([gl_STDIO_H],
attribute "__gnu_printf__" instead of "__printf__"])
fi
+ dnl For defining _PRINTF_NAN_LEN_MAX.
+ gl_MUSL_LIBC
+
dnl This ifdef is an optimization, to avoid performing a configure check whose
dnl result is not used. But it does not make the test of
dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant.
@@ -82,6 +100,16 @@ AC_DEFUN_ONCE([gl_STDIO_H],
if test $ac_cv_have_decl_fcloseall = no; then
HAVE_DECL_FCLOSEALL=0
fi
+
+ AC_CHECK_DECLS_ONCE([getw])
+ if test $ac_cv_have_decl_getw = no; then
+ HAVE_DECL_GETW=0
+ fi
+
+ AC_CHECK_DECLS_ONCE([putw])
+ if test $ac_cv_have_decl_putw = no; then
+ HAVE_DECL_PUTW=0
+ fi
])
# gl_STDIO_MODULE_INDICATOR([modulename])
@@ -178,7 +206,9 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO])
HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
+ HAVE_DECL_GETW=1; AC_SUBST([HAVE_DECL_GETW])
HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
+ HAVE_DECL_PUTW=1; AC_SUBST([HAVE_DECL_PUTW])
HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF])
diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4
index 9e209697..f47c1eb3 100644
--- a/gl/m4/stdlib_h.m4
+++ b/gl/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 66
-dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 75
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -23,15 +23,58 @@ AC_DEFUN_ONCE([gl_STDLIB_H],
# include <random.h>
#endif
]], [_Exit aligned_alloc atoll canonicalize_file_name free
- getloadavg getsubopt grantpt
- initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps
- posix_memalign posix_openpt ptsname ptsname_r qsort_r
+ getloadavg getprogname getsubopt grantpt
+ initstate initstate_r mbstowcs mbtowc mkdtemp mkostemp mkostemps mkstemp
+ mkstemps posix_memalign posix_openpt ptsname ptsname_r qsort_r
random random_r reallocarray realpath rpmatch secure_getenv setenv
setstate setstate_r srandom srandom_r
strtod strtol strtold strtoll strtoul strtoull unlockpt unsetenv])
AC_REQUIRE([AC_C_RESTRICT])
+ dnl Test whether MB_CUR_MAX needs to be overridden.
+ dnl On Solaris 10, in UTF-8 locales, its value is 3 but needs to be 4.
+ dnl Fortunately, we can do this because on this platform MB_LEN_MAX is 5.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ AC_CACHE_CHECK([whether MB_CUR_MAX is correct],
+ [gl_cv_macro_MB_CUR_MAX_good],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Solaris.
+ solaris*) gl_cv_macro_MB_CUR_MAX_good="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_macro_MB_CUR_MAX_good="guessing yes" ;;
+ esac
+changequote([,])dnl
+ if test $LOCALE_FR_UTF8 != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdlib.h>
+int main ()
+{
+ int result = 0;
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ if (MB_CUR_MAX < 4)
+ result |= 1;
+ }
+ return result;
+}]])],
+ [gl_cv_macro_MB_CUR_MAX_good=yes],
+ [gl_cv_macro_MB_CUR_MAX_good=no],
+ [:])
+ fi
+ ])
+ case "$gl_cv_macro_MB_CUR_MAX_good" in
+ *yes) ;;
+ *) REPLACE_MB_CUR_MAX=1 ;;
+ esac
+
AC_CHECK_DECLS_ONCE([ecvt])
if test $ac_cv_have_decl_ecvt = no; then
HAVE_DECL_ECVT=0
@@ -73,10 +116,12 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CANONICALIZE_FILE_NAME])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREE_POSIX])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOADAVG])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPROGNAME])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSUBOPT])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GRANTPT])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_GNU])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_POSIX])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOWCS])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBTOWC])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDTEMP])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMP])
@@ -130,6 +175,8 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_DECL_FCVT=1; AC_SUBST([HAVE_DECL_FCVT])
HAVE_DECL_GCVT=1; AC_SUBST([HAVE_DECL_GCVT])
HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
+ HAVE_DECL_PROGRAM_INVOCATION_NAME=1; AC_SUBST([HAVE_DECL_PROGRAM_INVOCATION_NAME])
+ HAVE_GETPROGNAME=1; AC_SUBST([HAVE_GETPROGNAME])
HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT])
HAVE_INITSTATE=1; AC_SUBST([HAVE_INITSTATE])
@@ -166,17 +213,26 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
+ REPLACE__EXIT=0; AC_SUBST([REPLACE__EXIT])
REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC])
REPLACE_CALLOC_FOR_CALLOC_GNU=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_GNU])
REPLACE_CALLOC_FOR_CALLOC_POSIX=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_POSIX])
REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
REPLACE_FREE=0; AC_SUBST([REPLACE_FREE])
+ REPLACE_GETLOADAVG=0; AC_SUBST([REPLACE_GETLOADAVG])
+ REPLACE_GETPROGNAME=0; AC_SUBST([REPLACE_GETPROGNAME])
+ REPLACE_GETSUBOPT=0; AC_SUBST([REPLACE_GETSUBOPT])
REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE])
REPLACE_MALLOC_FOR_MALLOC_GNU=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_GNU])
REPLACE_MALLOC_FOR_MALLOC_POSIX=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_POSIX])
+ REPLACE_MB_CUR_MAX=0; AC_SUBST([REPLACE_MB_CUR_MAX])
+ REPLACE_MBSTOWCS=0; AC_SUBST([REPLACE_MBSTOWCS])
REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC])
+ REPLACE_MKOSTEMP=0; AC_SUBST([REPLACE_MKOSTEMP])
+ REPLACE_MKOSTEMPS=0; AC_SUBST([REPLACE_MKOSTEMPS])
REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN])
+ REPLACE_POSIX_OPENPT=0; AC_SUBST([REPLACE_POSIX_OPENPT])
REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME])
REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
diff --git a/gl/m4/stpcpy.m4 b/gl/m4/stpcpy.m4
index 241e68c8..f3acbee7 100644
--- a/gl/m4/stpcpy.m4
+++ b/gl/m4/stpcpy.m4
@@ -1,5 +1,5 @@
-# stpcpy.m4 serial 9
-dnl Copyright (C) 2002, 2007, 2009-2022 Free Software Foundation, Inc.
+# stpcpy.m4 serial 11
+dnl Copyright (C) 2002, 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -13,9 +13,12 @@ AC_DEFUN([gl_FUNC_STPCPY],
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_STRING_H_DEFAULTS])
- AC_CHECK_FUNCS([stpcpy])
+ gl_CHECK_FUNCS_ANDROID([stpcpy], [[#include <string.h>]])
if test $ac_cv_func_stpcpy = no; then
HAVE_STPCPY=0
+ case "$gl_cv_onwards_func_stpcpy" in
+ future*) REPLACE_STPCPY=1 ;;
+ esac
fi
])
diff --git a/gl/m4/strcase.m4 b/gl/m4/strcase.m4
index d1ffaba3..3cf740d2 100644
--- a/gl/m4/strcase.m4
+++ b/gl/m4/strcase.m4
@@ -1,5 +1,5 @@
# strcase.m4 serial 12
-dnl Copyright (C) 2002, 2005-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/strcasestr.m4 b/gl/m4/strcasestr.m4
index 6344b7e5..971e0b23 100644
--- a/gl/m4/strcasestr.m4
+++ b/gl/m4/strcasestr.m4
@@ -1,5 +1,5 @@
# strcasestr.m4 serial 28
-dnl Copyright (C) 2005, 2007-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/strchrnul.m4 b/gl/m4/strchrnul.m4
index 630699b8..9b9ab11a 100644
--- a/gl/m4/strchrnul.m4
+++ b/gl/m4/strchrnul.m4
@@ -1,5 +1,5 @@
-# strchrnul.m4 serial 10
-dnl Copyright (C) 2003, 2007, 2009-2022 Free Software Foundation, Inc.
+# strchrnul.m4 serial 12
+dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,9 +10,12 @@ AC_DEFUN([gl_FUNC_STRCHRNUL],
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_STRING_H_DEFAULTS])
- AC_CHECK_FUNCS([strchrnul])
+ gl_CHECK_FUNCS_ANDROID([strchrnul], [[#include <string.h>]])
if test $ac_cv_func_strchrnul = no; then
HAVE_STRCHRNUL=0
+ case "$gl_cv_onwards_func_strchrnul" in
+ future*) REPLACE_STRCHRNUL=1 ;;
+ esac
else
AC_CACHE_CHECK([whether strchrnul works],
[gl_cv_func_strchrnul_works],
diff --git a/gl/m4/strdup.m4 b/gl/m4/strdup.m4
index da8899d1..ecfcdd01 100644
--- a/gl/m4/strdup.m4
+++ b/gl/m4/strdup.m4
@@ -1,6 +1,6 @@
# strdup.m4 serial 15
-dnl Copyright (C) 2002-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/strerror.m4 b/gl/m4/strerror.m4
index 4716649b..9f1dddd5 100644
--- a/gl/m4/strerror.m4
+++ b/gl/m4/strerror.m4
@@ -1,5 +1,5 @@
-# strerror.m4 serial 23
-dnl Copyright (C) 2002, 2007-2022 Free Software Foundation, Inc.
+# strerror.m4 serial 24
+dnl Copyright (C) 2002, 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -24,12 +24,12 @@ AC_DEFUN([gl_FUNC_STRERROR],
[gl_cv_func_working_strerror=yes],
[gl_cv_func_working_strerror=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
- # Guess yes on musl systems.
- *-musl*) gl_cv_func_working_strerror="guessing yes" ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl* | midipix*) gl_cv_func_working_strerror="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
esac
])
])
@@ -80,14 +80,14 @@ AC_DEFUN([gl_FUNC_STRERROR_0],
[gl_cv_func_strerror_0_works=yes],
[gl_cv_func_strerror_0_works=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
- # Guess yes on musl systems.
- *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;;
- # Guess yes on native Windows.
- mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl* | midipix*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/gl/m4/string_h.m4 b/gl/m4/string_h.m4
index 9e09b96e..7f51391c 100644
--- a/gl/m4/string_h.m4
+++ b/gl/m4/string_h.m4
@@ -1,11 +1,11 @@
# Configure a GNU-like replacement for <string.h>.
-# Copyright (C) 2007-2022 Free Software Foundation, Inc.
+# Copyright (C) 2007-2023 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.
-# serial 34
+# serial 37
# Written by Paul Eggert.
@@ -21,7 +21,8 @@ AC_DEFUN_ONCE([gl_STRING_H],
dnl guaranteed by C89.
gl_WARN_ON_USE_PREPARE([[#include <string.h>
]],
- [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
+ [explicit_bzero ffsl ffsll memmem mempcpy memrchr memset_explicit
+ rawmemchr stpcpy stpncpy strchrnul
strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
strerror_r strerrorname_np sigabbrev_np sigdescr_np strsignal strverscmp])
@@ -54,6 +55,7 @@ AC_DEFUN([gl_STRING_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMMEM])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMPCPY])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMRCHR])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMSET_EXPLICIT])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAWMEMCHR])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPCPY])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPNCPY])
@@ -107,6 +109,7 @@ AC_DEFUN([gl_STRING_H_DEFAULTS],
HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL])
HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
+ HAVE_MEMSET_EXPLICIT=1; AC_SUBST([HAVE_MEMSET_EXPLICIT])
HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
HAVE_RAWMEMCHR=1; AC_SUBST([HAVE_RAWMEMCHR])
HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY])
@@ -128,6 +131,8 @@ AC_DEFUN([gl_STRING_H_DEFAULTS],
REPLACE_FFSLL=0; AC_SUBST([REPLACE_FFSLL])
REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
+ REPLACE_MEMPCPY=0; AC_SUBST([REPLACE_MEMPCPY])
+ REPLACE_STPCPY=0; AC_SUBST([REPLACE_STPCPY])
REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
diff --git a/gl/m4/strings_h.m4 b/gl/m4/strings_h.m4
index 6965b7c1..4c41221b 100644
--- a/gl/m4/strings_h.m4
+++ b/gl/m4/strings_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <strings.h>.
# serial 9
-# Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2023 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.
diff --git a/gl/m4/strndup.m4 b/gl/m4/strndup.m4
index a239d45a..9ec9715c 100644
--- a/gl/m4/strndup.m4
+++ b/gl/m4/strndup.m4
@@ -1,5 +1,5 @@
# strndup.m4 serial 23
-dnl Copyright (C) 2002-2003, 2005-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2005-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/strnlen.m4 b/gl/m4/strnlen.m4
index 0934274d..d2cac59b 100644
--- a/gl/m4/strnlen.m4
+++ b/gl/m4/strnlen.m4
@@ -1,5 +1,5 @@
# strnlen.m4 serial 14
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2022 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/strsep.m4 b/gl/m4/strsep.m4
index 602f96ab..e0da09a3 100644
--- a/gl/m4/strsep.m4
+++ b/gl/m4/strsep.m4
@@ -1,5 +1,5 @@
# strsep.m4 serial 11
-dnl Copyright (C) 2002-2004, 2007, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sys_file_h.m4 b/gl/m4/sys_file_h.m4
index 61bd733e..60d4e305 100644
--- a/gl/m4/sys_file_h.m4
+++ b/gl/m4/sys_file_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <sys/file.h>.
# serial 9
-# Copyright (C) 2008-2022 Free Software Foundation, Inc.
+# Copyright (C) 2008-2023 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.
diff --git a/gl/m4/sys_ioctl_h.m4 b/gl/m4/sys_ioctl_h.m4
index be653643..80f0510e 100644
--- a/gl/m4/sys_ioctl_h.m4
+++ b/gl/m4/sys_ioctl_h.m4
@@ -1,5 +1,5 @@
# sys_ioctl_h.m4 serial 15
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sys_random_h.m4 b/gl/m4/sys_random_h.m4
index a5ba85c6..01d5feeb 100644
--- a/gl/m4/sys_random_h.m4
+++ b/gl/m4/sys_random_h.m4
@@ -1,5 +1,5 @@
# sys_random_h.m4 serial 8
-dnl Copyright (C) 2020-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sys_select_h.m4 b/gl/m4/sys_select_h.m4
index 2743cd17..4ec5ed7a 100644
--- a/gl/m4/sys_select_h.m4
+++ b/gl/m4/sys_select_h.m4
@@ -1,5 +1,5 @@
# sys_select_h.m4 serial 23
-dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4
index ba3ae68e..98a10416 100644
--- a/gl/m4/sys_socket_h.m4
+++ b/gl/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
# sys_socket_h.m4 serial 29
-dnl Copyright (C) 2005-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sys_stat_h.m4 b/gl/m4/sys_stat_h.m4
index 2adbfdee..ca57398a 100644
--- a/gl/m4/sys_stat_h.m4
+++ b/gl/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
# sys_stat_h.m4 serial 42 -*- Autoconf -*-
-dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sys_time_h.m4 b/gl/m4/sys_time_h.m4
index bc5e2b13..45a1f8b0 100644
--- a/gl/m4/sys_time_h.m4
+++ b/gl/m4/sys_time_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <sys/time.h>.
# serial 12
-# Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2023 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.
diff --git a/gl/m4/sys_types_h.m4 b/gl/m4/sys_types_h.m4
index a5bef220..627671fb 100644
--- a/gl/m4/sys_types_h.m4
+++ b/gl/m4/sys_types_h.m4
@@ -1,5 +1,5 @@
# sys_types_h.m4 serial 13
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sys_uio_h.m4 b/gl/m4/sys_uio_h.m4
index 36f55ead..93a65d26 100644
--- a/gl/m4/sys_uio_h.m4
+++ b/gl/m4/sys_uio_h.m4
@@ -1,5 +1,5 @@
# sys_uio_h.m4 serial 3
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sysexits.m4 b/gl/m4/sysexits.m4
index fe590b3a..5dfc193a 100644
--- a/gl/m4/sysexits.m4
+++ b/gl/m4/sysexits.m4
@@ -1,5 +1,5 @@
# sysexits.m4 serial 7
-dnl Copyright (C) 2003, 2005, 2007, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005, 2007, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/tempname.m4 b/gl/m4/tempname.m4
index 22ccec1f..abed7991 100644
--- a/gl/m4/tempname.m4
+++ b/gl/m4/tempname.m4
@@ -1,6 +1,6 @@
#serial 5
-# Copyright (C) 2006-2007, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007, 2009-2023 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.
diff --git a/gl/m4/termios_h.m4 b/gl/m4/termios_h.m4
index 6c835388..4a690033 100644
--- a/gl/m4/termios_h.m4
+++ b/gl/m4/termios_h.m4
@@ -1,5 +1,5 @@
# termios_h.m4 serial 7
-dnl Copyright (C) 2010-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/threadlib.m4 b/gl/m4/threadlib.m4
index ecb4970a..1fc5777e 100644
--- a/gl/m4/threadlib.m4
+++ b/gl/m4/threadlib.m4
@@ -1,5 +1,5 @@
-# threadlib.m4 serial 32
-dnl Copyright (C) 2005-2022 Free Software Foundation, Inc.
+# threadlib.m4 serial 38
+dnl Copyright (C) 2005-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -85,10 +85,11 @@ AC_DEFUN([gl_WEAK_SYMBOLS],
AC_CACHE_CHECK([whether imported symbols can be declared weak],
[gl_cv_have_weak],
[case "$host_os" in
- cygwin*)
- dnl On Cygwin 3.2.0 with gcc 10.2, the test below would succeed, but
- dnl programs that use pthread_in_use() with weak symbol references
- dnl crash miserably at runtime.
+ cygwin* | mingw*)
+ dnl On Cygwin 3.2.0 with gcc 10.2, and likewise on mingw 10.0.0 with
+ dnl gcc 11.3, the test below would succeed, but programs that use
+ dnl pthread_in_use() with weak symbol references crash miserably at
+ dnl runtime.
gl_cv_have_weak="guessing no"
;;
*)
@@ -174,7 +175,7 @@ dnl Sets the variable LIBPMULTITHREAD, for programs that really need
dnl multithread functionality. The difference between LIBPTHREAD and
dnl LIBPMULTITHREAD is that on platforms supporting weak symbols, typically
dnl LIBPTHREAD is empty whereas LIBPMULTITHREAD is not.
-dnl Sets the variable LIB_SCHED_YIELD to the linker options needed to use the
+dnl Sets the variable SCHED_YIELD_LIB to the linker options needed to use the
dnl sched_yield() function.
dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
dnl multithread-safe programs.
@@ -261,7 +262,9 @@ AC_DEFUN([gl_PTHREADLIB_BODY],
# On Solaris 10 or newer, this test is no longer needed, because
# libc contains the fully functional pthread functions.
case "$host_os" in
+changequote(,)dnl
solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
+changequote([,])dnl
AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
[Define if the pthread_in_use() detection is hard.])
esac
@@ -297,13 +300,16 @@ AC_DEFUN([gl_PTHREADLIB_BODY],
[AC_LANG_PROGRAM(
[[#include <sched.h>]],
[[sched_yield ();]])],
- [LIB_SCHED_YIELD=
+ [SCHED_YIELD_LIB=
],
[dnl Solaris 7...10 has sched_yield in librt, not in libpthread or libc.
- AC_CHECK_LIB([rt], [sched_yield], [LIB_SCHED_YIELD=-lrt],
+ AC_CHECK_LIB([rt], [sched_yield], [SCHED_YIELD_LIB=-lrt],
[dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
- AC_CHECK_LIB([posix4], [sched_yield], [LIB_SCHED_YIELD=-lposix4])])
+ AC_CHECK_LIB([posix4], [sched_yield], [SCHED_YIELD_LIB=-lposix4])])
])
+ AC_SUBST([SCHED_YIELD_LIB])
+ dnl For backward compatibility.
+ LIB_SCHED_YIELD="$SCHED_YIELD_LIB"
AC_SUBST([LIB_SCHED_YIELD])
gl_pthreadlib_body_done=done
@@ -349,7 +355,7 @@ AC_DEFUN([gl_STDTHREADLIB_BODY],
dnl on libpthread (for the symbol 'pthread_mutexattr_gettype').
dnl glibc >= 2.34, AIX >= 7.1, and Solaris >= 11.4 have thrd_create in
dnl libc.
- AC_CHECK_FUNCS([thrd_create])
+ gl_CHECK_FUNCS_ANDROID([thrd_create], [[#include <threads.h>]])
if test $ac_cv_func_thrd_create = yes; then
LIBSTDTHREAD=
else
@@ -362,7 +368,7 @@ AC_DEFUN([gl_STDTHREADLIB_BODY],
fi
else
dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c.
- LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
+ LIBSTDTHREAD="$LIBPMULTITHREAD $SCHED_YIELD_LIB"
fi
;;
esac
@@ -433,10 +439,12 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY],
m4_ifdef([gl_THREADLIB_DEFAULT_NO],
[m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
[m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
- m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=])
+ dnl gl_use_winpthreads_default defaults to 'no', because in mingw 10, like
+ dnl in mingw 5, the use of libwinpthread still makes test-pthread-tss crash.
+ m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=no])
AC_ARG_ENABLE([threads],
-AS_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
-AS_HELP_STRING([--disable-threads], [build without multithread safety])]),
+AS_HELP_STRING([[--enable-threads={isoc|posix|isoc+posix|windows}]], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+AS_HELP_STRING([[--disable-threads]], [build without multithread safety])]),
[gl_use_threads=$enableval],
[if test -n "$gl_use_threads_default"; then
gl_use_threads="$gl_use_threads_default"
@@ -599,7 +607,8 @@ dnl -------------------
dnl Sets the gl_THREADLIB default so that on mingw, a dependency to the
dnl libwinpthread DLL (mingw-w64 winpthreads library) is avoided.
dnl The user can still override it at installation time, by using the
-dnl configure option '--enable-threads'.
+dnl configure option '--enable-threads=posix'.
+dnl As of 2023, this is now the default.
AC_DEFUN([gl_AVOID_WINPTHREAD], [
m4_divert_text([INIT_PREPARE], [gl_use_winpthreads_default=no])
diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4
index 98d7b6e0..51d553a2 100644
--- a/gl/m4/time_h.m4
+++ b/gl/m4/time_h.m4
@@ -1,8 +1,8 @@
# Configure a more-standard replacement for <time.h>.
-# Copyright (C) 2000-2001, 2003-2007, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc.
-# serial 19
+# serial 22
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -19,6 +19,12 @@ AC_DEFUN_ONCE([gl_TIME_H],
gl_NEXT_HEADERS([time.h])
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+#include <time.h>
+ ]], [asctime_r ctime_r])
+
AC_REQUIRE([AC_C_RESTRICT])
AC_CACHE_CHECK([for TIME_UTC in <time.h>],
@@ -131,6 +137,7 @@ AC_DEFUN([gl_TIME_H_REQUIRE_DEFAULTS],
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NANOSLEEP])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRFTIME])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPTIME])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMEGM])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GET])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GETRES])
@@ -163,7 +170,9 @@ AC_DEFUN([gl_TIME_H_DEFAULTS],
REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME])
REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP])
REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME])
+ REPLACE_TIME=0; AC_SUBST([REPLACE_TIME])
REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
+ REPLACE_TIMESPEC_GET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMESPEC_GET])
REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET])
dnl Hack so that the time module doesn't depend on the sys_time module.
diff --git a/gl/m4/timespec.m4 b/gl/m4/timespec.m4
index 6a1afef0..95f475f2 100644
--- a/gl/m4/timespec.m4
+++ b/gl/m4/timespec.m4
@@ -1,6 +1,6 @@
#serial 15
-# Copyright (C) 2000-2001, 2003-2007, 2009-2022 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/unistd-safer.m4 b/gl/m4/unistd-safer.m4
index 33158a48..ced03b01 100644
--- a/gl/m4/unistd-safer.m4
+++ b/gl/m4/unistd-safer.m4
@@ -1,5 +1,5 @@
#serial 9
-dnl Copyright (C) 2002, 2005-2006, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index 4c66ccc0..1c961581 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 90
-dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+# unistd_h.m4 serial 94
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -225,6 +225,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_COPY_FILE_RANGE=0; AC_SUBST([REPLACE_COPY_FILE_RANGE])
REPLACE_DUP=0; AC_SUBST([REPLACE_DUP])
REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2])
+ REPLACE_DUP3=0; AC_SUBST([REPLACE_DUP3])
REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL])
REPLACE_EXECLE=0; AC_SUBST([REPLACE_EXECLE])
REPLACE_EXECLP=0; AC_SUBST([REPLACE_EXECLP])
@@ -234,10 +235,12 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE])
REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT])
REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT])
+ REPLACE_FDATASYNC=0; AC_SUBST([REPLACE_FDATASYNC])
REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE])
REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE])
+ REPLACE_GETENTROPY=0; AC_SUBST([REPLACE_GETENTROPY])
REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R])
REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS])
REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
@@ -248,12 +251,14 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_LINK=0; AC_SUBST([REPLACE_LINK])
REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT])
REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
+ REPLACE_PIPE2=0; AC_SUBST([REPLACE_PIPE2])
REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD])
REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE])
REPLACE_READ=0; AC_SUBST([REPLACE_READ])
REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK])
REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT])
REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR])
+ REPLACE_SETHOSTNAME=0; AC_SUBST([REPLACE_SETHOSTNAME])
REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP])
REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK])
REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT])
diff --git a/gl/m4/unlink.m4 b/gl/m4/unlink.m4
index e25b5679..1fecaac5 100644
--- a/gl/m4/unlink.m4
+++ b/gl/m4/unlink.m4
@@ -1,5 +1,5 @@
-# unlink.m4 serial 15
-dnl Copyright (C) 2009-2022 Free Software Foundation, Inc.
+# unlink.m4 serial 16
+dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -45,6 +45,8 @@ AC_DEFUN([gl_FUNC_UNLINK],
[case "$host_os" in
# Guess yes on Linux systems.
linux-* | linux) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
+ # Guess yes on systems that emulate the Linux system calls.
+ midipix*) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
# Guess no on native Windows.
diff --git a/gl/m4/unlinkat.m4 b/gl/m4/unlinkat.m4
index 55af07d2..55cdb2a0 100644
--- a/gl/m4/unlinkat.m4
+++ b/gl/m4/unlinkat.m4
@@ -1,5 +1,5 @@
# unlinkat.m4 serial 2
-dnl Copyright (C) 2004-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/utime.m4 b/gl/m4/utime.m4
index d73e8aaf..4c0443ae 100644
--- a/gl/m4/utime.m4
+++ b/gl/m4/utime.m4
@@ -1,5 +1,5 @@
# utime.m4 serial 4
-dnl Copyright (C) 2017-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2017-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/utime_h.m4 b/gl/m4/utime_h.m4
index 739ef118..6b6403e2 100644
--- a/gl/m4/utime_h.m4
+++ b/gl/m4/utime_h.m4
@@ -1,5 +1,5 @@
# utime_h.m4 serial 8
-dnl Copyright (C) 2017-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2017-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/utimens.m4 b/gl/m4/utimens.m4
index 62aec78a..5f860616 100644
--- a/gl/m4/utimens.m4
+++ b/gl/m4/utimens.m4
@@ -1,9 +1,9 @@
-dnl Copyright (C) 2003-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-dnl serial 11
+dnl serial 15
AC_DEFUN([gl_UTIMENS],
[
@@ -11,7 +11,11 @@ AC_DEFUN([gl_UTIMENS],
AC_REQUIRE([gl_FUNC_UTIMES])
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CHECK_FUNCS_ONCE([futimes futimesat futimens utimensat lutimes])
+ gl_CHECK_FUNCS_ANDROID([futimes], [[#include <sys/time.h>]])
+ gl_CHECK_FUNCS_ANDROID([futimesat], [[#include <sys/time.h>]])
+ gl_CHECK_FUNCS_ANDROID([lutimes], [[#include <sys/time.h>]])
+ gl_CHECK_FUNCS_ANDROID([futimens], [[#include <sys/stat.h>]])
+ gl_CHECK_FUNCS_ANDROID([utimensat], [[#include <sys/stat.h>]])
if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then
dnl FreeBSD 8.0-rc2 mishandles futimesat(fd,NULL,time). It is not
diff --git a/gl/m4/utimes.m4 b/gl/m4/utimes.m4
index bf221614..73b9a2da 100644
--- a/gl/m4/utimes.m4
+++ b/gl/m4/utimes.m4
@@ -1,7 +1,7 @@
# Detect some bugs in glibc's implementation of utimes.
# serial 8
-dnl Copyright (C) 2003-2005, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2005, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4
index afdece71..df87b9e7 100644
--- a/gl/m4/vasnprintf.m4
+++ b/gl/m4/vasnprintf.m4
@@ -1,5 +1,5 @@
-# vasnprintf.m4 serial 38
-dnl Copyright (C) 2002-2004, 2006-2022 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 50
+dnl Copyright (C) 2002-2004, 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -29,6 +29,15 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
gl_PREREQ_ASNPRINTF
])
+AC_DEFUN([gl_FUNC_VASNWPRINTF],
+[
+ AC_LIBOBJ([printf-args])
+ gl_PREREQ_PRINTF_ARGS
+ gl_PREREQ_PRINTF_PARSE
+ gl_PREREQ_VASNWPRINTF
+ gl_PREREQ_ASNPRINTF
+])
+
# Prerequisites of lib/printf-args.h, lib/printf-args.c.
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
@@ -37,6 +46,7 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
])
# Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
+# Prerequisites of lib/wprintf-parse.h, lib/wprintf-parse.c.
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([gl_FEATURES_H])
@@ -50,19 +60,13 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
])
-# Prerequisites of lib/vasnprintf.c.
+# Prerequisites of lib/vasnprintf.c if !WIDE_CHAR_VERSION.
AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
[
- AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
- AC_REQUIRE([gt_TYPE_WINT_T])
- AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
+ AC_CHECK_FUNCS([snprintf strnlen wcrtomb])
dnl Use the _snprintf function only if it is declared (because on NetBSD it
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
AC_CHECK_DECLS([_snprintf], , , [[#include <stdio.h>]])
- dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
- dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE.
- AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
dnl We can avoid a lot of code by assuming that snprintf's return value
dnl conforms to ISO C99. So check that.
AC_REQUIRE([gl_SNPRINTF_RETVAL_C99])
@@ -84,6 +88,107 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
terminated.])
;;
esac
+ gl_PREREQ_VASNXPRINTF
+])
+
+# Prerequisites of lib/vasnwprintf.c.
+AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF],
+[
+ AC_CHECK_FUNCS_ONCE([swprintf wcsnlen mbrtowc])
+ AC_CHECK_DECLS([_snwprintf], , , [[#include <stdio.h>]])
+ AC_CHECK_DECLS([wcsnlen], , , [[#include <wchar.h>]])
+ gl_SWPRINTF_WORKS
+ case "$gl_cv_func_swprintf_works" in
+ *yes)
+ AC_DEFINE([HAVE_WORKING_SWPRINTF], [1],
+ [Define if the swprintf function works correctly when it produces output
+ that contains null wide characters.])
+ ;;
+ esac
+ gl_MBRTOWC_C_LOCALE
+ case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
+ *yes)
+ AC_CACHE_CHECK([whether swprintf in the C locale is free of encoding errors],
+ [gl_cv_func_swprintf_C_locale_sans_EILSEQ],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#ifndef __USE_MINGW_ANSI_STDIO
+# define __USE_MINGW_ANSI_STDIO 1
+#endif
+#include <stdio.h>
+#include <wchar.h>
+int main()
+{
+ int result = 0;
+ { /* This test fails on glibc 2.35, musl libc 1.2.4, FreeBSD 13.2, NetBSD 9.3,
+ OpenBSD 7.2, Cygwin 2.9.0.
+ Reported at <https://www.openwall.com/lists/musl/2023/06/12/2>. */
+ wchar_t buf[12];
+ int ret = swprintf (buf, 12, L"%c", '\377');
+ if (ret < 0)
+ result |= 1;
+ }
+ return result;
+}]])],
+ [gl_cv_func_swprintf_C_locale_sans_EILSEQ=yes],
+ [gl_cv_func_swprintf_C_locale_sans_EILSEQ=no],
+ [case "$host_os" in
+ # Guess no on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_swprintf_C_locale_sans_EILSEQ="guessing yes";;
+ # Guess no on musl systems.
+ *-musl* | midipix*) gl_cv_func_swprintf_C_locale_sans_EILSEQ="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_swprintf_C_locale_sans_EILSEQ="$gl_cross_guess_normal";;
+ esac
+ ])
+ ])
+ ;;
+ esac
+ if case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
+ *yes) false ;;
+ *) true ;;
+ esac \
+ || case "$gl_cv_func_swprintf_C_locale_sans_EILSEQ" in
+ *yes) false ;;
+ *) true ;;
+ esac; then
+ AC_DEFINE([NEED_WPRINTF_DIRECTIVE_C], [1],
+ [Define if the vasnwprintf implementation needs special code for
+ the 'c' directive.])
+ fi
+ gl_SWPRINTF_DIRECTIVE_LA
+ case "$gl_cv_func_swprintf_directive_la" in
+ *yes) ;;
+ *)
+ AC_DEFINE([NEED_WPRINTF_DIRECTIVE_LA], [1],
+ [Define if the vasnwprintf implementation needs special code for
+ the 'a' directive with 'long double' arguments.])
+ ;;
+ esac
+ gl_SWPRINTF_DIRECTIVE_LC
+ case "$gl_cv_func_swprintf_directive_lc" in
+ *yes) ;;
+ *)
+ AC_DEFINE([NEED_WPRINTF_DIRECTIVE_LC], [1],
+ [Define if the vasnwprintf implementation needs special code for
+ the 'lc' directive.])
+ ;;
+ esac
+ gl_MUSL_LIBC
+ gl_PREREQ_VASNXPRINTF
+])
+
+# Common prerequisites of lib/vasnprintf.c and lib/vasnwprintf.c.
+AC_DEFUN_ONCE([gl_PREREQ_VASNXPRINTF],
+[
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WINT_T])
+ AC_CHECK_FUNCS([wcslen])
+ dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
+ dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE.
+ AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
])
# Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
@@ -152,7 +257,22 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A],
AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1],
[Define if the vasnprintf implementation needs special code for
the 'a' and 'A' directives.])
- AC_CHECK_FUNCS([nl_langinfo])
+ gl_CHECK_FUNCS_ANDROID([nl_langinfo], [[#include <langinfo.h>]])
+ ;;
+ esac
+])
+
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'b' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_B],
+[
+ AC_REQUIRE([gl_PRINTF_DIRECTIVE_B])
+ case "$gl_cv_func_printf_directive_b" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_DIRECTIVE_B], [1],
+ [Define if the vasnprintf implementation needs special code for
+ the 'b' directive.])
;;
esac
])
@@ -187,6 +307,21 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS],
esac
])
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'lc' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LC],
+[
+ AC_REQUIRE([gl_PRINTF_DIRECTIVE_LC])
+ case "$gl_cv_func_printf_directive_lc" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_DIRECTIVE_LC], [1],
+ [Define if the vasnprintf implementation needs special code for
+ the 'lc' directive.])
+ ;;
+ esac
+])
+
# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag.
AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
[
@@ -276,15 +411,17 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM],
])
# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance.
-AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS],
+AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS],
[
AC_REQUIRE([gl_PREREQ_VASNPRINTF])
gl_PREREQ_VASNPRINTF_LONG_DOUBLE
gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE
gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
gl_PREREQ_VASNPRINTF_DIRECTIVE_A
+ gl_PREREQ_VASNPRINTF_DIRECTIVE_B
gl_PREREQ_VASNPRINTF_DIRECTIVE_F
gl_PREREQ_VASNPRINTF_DIRECTIVE_LS
+ gl_PREREQ_VASNPRINTF_DIRECTIVE_LC
gl_PREREQ_VASNPRINTF_FLAG_GROUPING
gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
gl_PREREQ_VASNPRINTF_FLAG_ZERO
@@ -292,7 +429,34 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS],
gl_PREREQ_VASNPRINTF_ENOMEM
])
+# Extra prerequisites of lib/vasnprintf.c for supporting the 'B' directive.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_UPPERCASE_B],
+[
+ AC_REQUIRE([gl_PRINTF_DIRECTIVE_UPPERCASE_B])
+ case "$gl_cv_func_printf_directive_uppercase_b" in
+ *yes)
+ ;;
+ *)
+ AC_DEFINE([NEED_PRINTF_DIRECTIVE_UPPERCASE_B], [1],
+ [Define if the vasnprintf implementation needs special code for
+ the 'B' directive.])
+ ;;
+ esac
+])
+
+# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance
+# and GNU compatibility.
+AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS],
+[
+ gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
+ AC_DEFINE([SUPPORT_GNU_PRINTF_DIRECTIVES], [1],
+ [Define if the vasnprintf implementation should support GNU compatible
+ printf directives.])
+ gl_PREREQ_VASNPRINTF_DIRECTIVE_UPPERCASE_B
+])
+
# Prerequisites of lib/asnprintf.c.
+# Prerequisites of lib/asnwprintf.c.
AC_DEFUN([gl_PREREQ_ASNPRINTF],
[
])
diff --git a/gl/m4/vasprintf.m4 b/gl/m4/vasprintf.m4
index b92977b6..6e6156a7 100644
--- a/gl/m4/vasprintf.m4
+++ b/gl/m4/vasprintf.m4
@@ -1,5 +1,5 @@
# vasprintf.m4 serial 6
-dnl Copyright (C) 2002-2003, 2006-2007, 2009-2022 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2023 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/visibility.m4 b/gl/m4/visibility.m4
index 4a212a4e..f0468e89 100644
--- a/gl/m4/visibility.m4
+++ b/gl/m4/visibility.m4
@@ -1,5 +1,5 @@
# visibility.m4 serial 8
-dnl Copyright (C) 2005, 2008, 2010-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008, 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/vsnprintf.m4 b/gl/m4/vsnprintf.m4
index 02b448f3..7fbb11c4 100644
--- a/gl/m4/vsnprintf.m4
+++ b/gl/m4/vsnprintf.m4
@@ -1,5 +1,5 @@
# vsnprintf.m4 serial 7
-dnl Copyright (C) 2002-2004, 2007-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/warn-on-use.m4 b/gl/m4/warn-on-use.m4
index d43355ab..10649c5c 100644
--- a/gl/m4/warn-on-use.m4
+++ b/gl/m4/warn-on-use.m4
@@ -1,5 +1,5 @@
-# warn-on-use.m4 serial 9
-dnl Copyright (C) 2010-2022 Free Software Foundation, Inc.
+# warn-on-use.m4 serial 10
+dnl Copyright (C) 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -32,17 +32,30 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
undefining macros.])])dnl
for gl_func in m4_flatten([$2]); do
AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
+ dnl As a workaround to implicit built-in function declarations in
+ dnl clang (e.g. strndup), reference ac_compile_for_check_decl instead
+ dnl of ac_compile. If, for whatever reason, the override of AC_PROG_CC
+ dnl in zzgnulib.m4 is inactive, use the original ac_compile.
+ ac_save_ac_compile="$ac_compile"
+ if test -n "$ac_compile_for_check_decl"; then
+ ac_compile="$ac_compile_for_check_decl"
+ fi
AC_CACHE_CHECK([whether $gl_func is declared without a macro],
[gl_Symbol],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
[[#undef $gl_func
(void) $gl_func;]])],
[AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])])
+ ac_compile="$ac_save_ac_compile"
AS_VAR_IF([gl_Symbol], [yes],
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
- dnl shortcut - if the raw declaration exists, then set a cache
- dnl variable to allow skipping any later AC_CHECK_DECL efforts
- eval ac_cv_have_decl_$gl_func=yes])
+ dnl Shortcut for an AC_CHECK_DECL invocation that may come later:
+ dnl If the raw declaration exists with the given includes, then
+ dnl AC_CHECK_DECL with its many includes would see it as well.
+ dnl So, set a cache variable to allow skipping any later
+ dnl AC_CHECK_DECL invocation for $gl_func.
+ eval "ac_cv_have_decl_$gl_func=yes"
+ ])
AS_VAR_POPDEF([gl_Symbol])dnl
done
])
diff --git a/gl/m4/warnings.m4 b/gl/m4/warnings.m4
index 60088f93..9433cb52 100644
--- a/gl/m4/warnings.m4
+++ b/gl/m4/warnings.m4
@@ -1,19 +1,12 @@
-# warnings.m4 serial 16
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+# warnings.m4 serial 19
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Simon Josefsson
-# gl_AS_VAR_APPEND(VAR, VALUE)
-# ----------------------------
-# Provide the functionality of AS_VAR_APPEND if Autoconf does not have it.
-m4_ifdef([AS_VAR_APPEND],
-[m4_copy([AS_VAR_APPEND], [gl_AS_VAR_APPEND])],
-[m4_define([gl_AS_VAR_APPEND],
-[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])])
-
+AC_PREREQ([2.64])
# gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED],
# [PROGRAM = AC_LANG_PROGRAM()])
@@ -34,7 +27,7 @@ esac
m4_pushdef([gl_Positive], [$gl_positive])])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], [gl_Warn], [
gl_save_compiler_FLAGS="$gl_Flags"
- gl_AS_VAR_APPEND(m4_defn([gl_Flags]),
+ AS_VAR_APPEND(m4_defn([gl_Flags]),
[" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["])
AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([[]])])],
[AS_VAR_SET([gl_Warn], [yes])],
@@ -88,16 +81,18 @@ AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL],
# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS/WARN_CXXFLAGS],
# [PROGRAM = AC_LANG_PROGRAM()])
# -----------------------------------------------------------
-# Adds parameter to WARN_CFLAGS/WARN_CXXFLAGS if the compiler supports it
-# when compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]).
+# Adds OPTION to VARIABLE (which defaults to WARN_CFLAGS or WARN_CXXFLAGS)
+# if the compiler supports it when compiling PROGRAM.
#
# If VARIABLE is a variable name, AC_SUBST it.
#
# The effects of this macro depend on the current language (_AC_LANG).
+#
+# Example: gl_WARN_ADD([-Wparentheses]).
AC_DEFUN([gl_WARN_ADD],
[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS(]_AC_LANG[)])
gl_COMPILER_OPTION_IF([$1],
- [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_]_AC_LANG_PREFIX[FLAGS]], [[$2]]), [" $1"])],
+ [AS_VAR_APPEND(m4_if([$2], [], [[WARN_]_AC_LANG_PREFIX[FLAGS]], [[$2]]), [" $1"])],
[],
[$3])
m4_ifval([$2],
@@ -105,6 +100,77 @@ m4_ifval([$2],
[AC_SUBST([WARN_]_AC_LANG_PREFIX[FLAGS])])dnl
])
+
+# gl_CC_INHIBIT_WARNINGS
+# sets and substitutes a variable GL_CFLAG_INHIBIT_WARNINGS, to a $(CC) option
+# that reverts all preceding -W* options, if available.
+# This is expected to be '-w' at least on gcc, clang, AIX xlc, xlclang, Sun cc,
+# "compile cl" (MSVC), "compile clang-cl" (MSVC-compatible clang). Or it can be
+# empty.
+AC_DEFUN([gl_CC_INHIBIT_WARNINGS],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([for C compiler option to inhibit all warnings],
+ [gl_cv_cc_winhibit],
+ [rm -f conftest*
+ echo 'int dummy;' > conftest.c
+ AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c 2>conftest1.err]) >/dev/null
+ AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -w -c conftest.c 2>conftest2.err]) >/dev/null
+ if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then
+ gl_cv_cc_winhibit='-w'
+ else
+ gl_cv_cc_winhibit=none
+ fi
+ rm -f conftest*
+ ])
+ case "$gl_cv_cc_winhibit" in
+ none) GL_CFLAG_INHIBIT_WARNINGS='' ;;
+ *)
+ GL_CFLAG_INHIBIT_WARNINGS="$gl_cv_cc_winhibit"
+ dnl If all warnings are inhibited, there's no point in having the GCC
+ dnl analyzer enabled. This saves RAM requirements and CPU consumption.
+ gl_WARN_ADD([-fno-analyzer], [GL_CFLAG_INHIBIT_WARNINGS])
+ ;;
+ esac
+ AC_SUBST([GL_CFLAG_INHIBIT_WARNINGS])
+])
+
+# gl_CXX_INHIBIT_WARNINGS
+# sets and substitutes a variable GL_CXXFLAG_INHIBIT_WARNINGS, to a $(CC) option
+# that reverts all preceding -W* options, if available.
+AC_DEFUN([gl_CXX_INHIBIT_WARNINGS],
+[
+ dnl Requires AC_PROG_CXX or gl_PROG_ANSI_CXX.
+ if test -n "$CXX" && test "$CXX" != no; then
+ AC_CACHE_CHECK([for C++ compiler option to inhibit all warnings],
+ [gl_cv_cxx_winhibit],
+ [rm -f conftest*
+ echo 'int dummy;' > conftest.cc
+ AC_TRY_COMMAND([${CXX-c++} $CXXFLAGS $CPPFLAGS -c conftest.cc 2>conftest1.err]) >/dev/null
+ AC_TRY_COMMAND([${CXX-c++} $CXXFLAGS $CPPFLAGS -w -c conftest.cc 2>conftest2.err]) >/dev/null
+ if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then
+ gl_cv_cxx_winhibit='-w'
+ else
+ gl_cv_cxx_winhibit=none
+ fi
+ rm -f conftest*
+ ])
+ case "$gl_cv_cxx_winhibit" in
+ none) GL_CXXFLAG_INHIBIT_WARNINGS='' ;;
+ *)
+ GL_CXXFLAG_INHIBIT_WARNINGS="$gl_cv_cxx_winhibit"
+ dnl If all warnings are inhibited, there's no point in having the GCC
+ dnl analyzer enabled. This saves RAM requirements and CPU consumption.
+ gl_WARN_ADD([-fno-analyzer], [GL_CXXFLAG_INHIBIT_WARNINGS])
+ ;;
+ esac
+ else
+ GL_CXXFLAG_INHIBIT_WARNINGS=''
+ fi
+ AC_SUBST([GL_CXXFLAG_INHIBIT_WARNINGS])
+])
+
+
# Local Variables:
# mode: autoconf
# End:
diff --git a/gl/m4/wchar_h.m4 b/gl/m4/wchar_h.m4
index 4baba1af..442932be 100644
--- a/gl/m4/wchar_h.m4
+++ b/gl/m4/wchar_h.m4
@@ -1,13 +1,13 @@
dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
-dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl Written by Eric Blake.
-# wchar_h.m4 serial 55
+# wchar_h.m4 serial 60
AC_DEFUN_ONCE([gl_WCHAR_H],
[
@@ -253,5 +253,10 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH])
REPLACE_WCSFTIME=0; AC_SUBST([REPLACE_WCSFTIME])
+ REPLACE_WCSCMP=0; AC_SUBST([REPLACE_WCSCMP])
+ REPLACE_WCSNCMP=0; AC_SUBST([REPLACE_WCSNCMP])
+ REPLACE_WCSSTR=0; AC_SUBST([REPLACE_WCSSTR])
REPLACE_WCSTOK=0; AC_SUBST([REPLACE_WCSTOK])
+ REPLACE_WMEMCMP=0; AC_SUBST([REPLACE_WMEMCMP])
+ REPLACE_WMEMPCPY=0; AC_SUBST([REPLACE_WMEMPCPY])
])
diff --git a/gl/m4/wchar_t.m4 b/gl/m4/wchar_t.m4
index 268e3e51..50bde08a 100644
--- a/gl/m4/wchar_t.m4
+++ b/gl/m4/wchar_t.m4
@@ -1,5 +1,5 @@
# wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/wcrtomb.m4 b/gl/m4/wcrtomb.m4
index fee21d7e..fa503b53 100644
--- a/gl/m4/wcrtomb.m4
+++ b/gl/m4/wcrtomb.m4
@@ -1,5 +1,5 @@
-# wcrtomb.m4 serial 17
-dnl Copyright (C) 2008-2022 Free Software Foundation, Inc.
+# wcrtomb.m4 serial 18
+dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -97,12 +97,14 @@ changequote([,])dnl
int main ()
{
int result = 0;
- if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+ if (strcmp ("$LOCALE_FR", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR") != NULL)
{
if (wcrtomb (NULL, 0, NULL) != 1)
result |= 1;
}
- if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
{
if (wcrtomb (NULL, 0, NULL) != 1)
result |= 2;
@@ -113,12 +115,14 @@ int main ()
result |= 2;
}
}
- if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+ if (strcmp ("$LOCALE_JA", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
{
if (wcrtomb (NULL, 0, NULL) != 1)
result |= 4;
}
- if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+ if (strcmp ("$LOCALE_ZH_CN", "none") != 0
+ && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
{
if (wcrtomb (NULL, 0, NULL) != 1)
result |= 8;
diff --git a/gl/m4/wctype_h.m4 b/gl/m4/wctype_h.m4
index 702cb39c..6856a735 100644
--- a/gl/m4/wctype_h.m4
+++ b/gl/m4/wctype_h.m4
@@ -2,7 +2,7 @@
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
-dnl Copyright (C) 2006-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4
index adc58661..dfd743b3 100644
--- a/gl/m4/wint_t.m4
+++ b/gl/m4/wint_t.m4
@@ -1,5 +1,5 @@
# wint_t.m4 serial 11
-dnl Copyright (C) 2003, 2007-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/wmemchr.m4 b/gl/m4/wmemchr.m4
index e75b5519..ac414fbc 100644
--- a/gl/m4/wmemchr.m4
+++ b/gl/m4/wmemchr.m4
@@ -1,5 +1,5 @@
# wmemchr.m4 serial 5
-dnl Copyright (C) 2011-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/wmempcpy.m4 b/gl/m4/wmempcpy.m4
index 9765039b..abf1df34 100644
--- a/gl/m4/wmempcpy.m4
+++ b/gl/m4/wmempcpy.m4
@@ -1,5 +1,5 @@
-# wmempcpy.m4 serial 1
-dnl Copyright (C) 2020-2022 Free Software Foundation, Inc.
+# wmempcpy.m4 serial 3
+dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -14,8 +14,11 @@ AC_DEFUN([gl_FUNC_WMEMPCPY],
dnl The wmempcpy() declaration in lib/wchar.in.h uses 'restrict'.
AC_REQUIRE([AC_C_RESTRICT])
- AC_CHECK_FUNCS_ONCE([wmempcpy])
+ gl_CHECK_FUNCS_ANDROID([wmempcpy], [[#include <wchar.h>]])
if test $ac_cv_func_wmempcpy = no; then
HAVE_WMEMPCPY=0
+ case "$gl_cv_onwards_func_wmempcpy" in
+ future*) REPLACE_WMEMPCPY=1 ;;
+ esac
fi
])
diff --git a/gl/m4/xalloc.m4 b/gl/m4/xalloc.m4
index 17a9c06d..fc56f59a 100644
--- a/gl/m4/xalloc.m4
+++ b/gl/m4/xalloc.m4
@@ -1,5 +1,5 @@
# xalloc.m4 serial 18
-dnl Copyright (C) 2002-2006, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/xgetcwd.m4 b/gl/m4/xgetcwd.m4
index 8b48535d..9695d999 100644
--- a/gl/m4/xgetcwd.m4
+++ b/gl/m4/xgetcwd.m4
@@ -1,5 +1,5 @@
#serial 8
-dnl Copyright (C) 2002-2006, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/xsize.m4 b/gl/m4/xsize.m4
index 0109049e..649db9c5 100644
--- a/gl/m4/xsize.m4
+++ b/gl/m4/xsize.m4
@@ -1,5 +1,5 @@
# xsize.m4 serial 5
-dnl Copyright (C) 2003-2004, 2008-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/xstrndup.m4 b/gl/m4/xstrndup.m4
index 41eabd3e..1fb6a7dd 100644
--- a/gl/m4/xstrndup.m4
+++ b/gl/m4/xstrndup.m4
@@ -1,5 +1,5 @@
# xstrndup.m4 serial 2
-dnl Copyright (C) 2003, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/xvasprintf.m4 b/gl/m4/xvasprintf.m4
index 10480a23..b7e0701c 100644
--- a/gl/m4/xvasprintf.m4
+++ b/gl/m4/xvasprintf.m4
@@ -1,5 +1,5 @@
# xvasprintf.m4 serial 2
-dnl Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/year2038.m4 b/gl/m4/year2038.m4
deleted file mode 100644
index 06db589b..00000000
--- a/gl/m4/year2038.m4
+++ /dev/null
@@ -1,124 +0,0 @@
-# year2038.m4 serial 7
-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,
-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.
-
-AC_DEFUN([gl_YEAR2038_EARLY],
-[
- AC_REQUIRE([AC_CANONICAL_HOST])
- case "$host_os" in
- mingw*)
- AC_DEFINE([__MINGW_USE_VC2005_COMPAT], [1],
- [For 64-bit time_t on 32-bit mingw.])
- ;;
- esac
-])
-
-# gl_YEAR2038_TEST_INCLUDES
-# -------------------------
-AC_DEFUN([gl_YEAR2038_TEST_INCLUDES],
-[[
- #include <time.h>
- /* Check that time_t can represent 2**32 - 1 correctly. */
- #define LARGE_TIME_T \\
- ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30)))
- int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535
- && LARGE_TIME_T % 65537 == 0)
- ? 1 : -1];
-]])
-
-# gl_YEAR2038_BODY(REQUIRE-YEAR2038-SAFE)
------------------------------------------
-AC_DEFUN([gl_YEAR2038_BODY],
-[
- AC_ARG_ENABLE([year2038],
- [ --disable-year2038 omit support for timestamps past the year 2038])
- AS_IF([test "$enable_year2038" != no],
- [
- dnl On many systems, time_t is already a 64-bit type.
- dnl On those systems where time_t is still 32-bit, it requires kernel
- dnl and libc support to make it 64-bit. For glibc 2.34 and later on Linux,
- dnl defining _TIME_BITS=64 and _FILE_OFFSET_BITS=64 is needed on x86 and ARM.
- dnl
- dnl On native Windows, the system include files define types __time32_t
- dnl and __time64_t. By default, time_t is an alias of
- dnl - __time32_t on 32-bit mingw,
- dnl - __time64_t on 64-bit mingw and on MSVC (since MSVC 8).
- dnl But when compiling with -D__MINGW_USE_VC2005_COMPAT, time_t is an
- dnl alias of __time64_t.
- dnl And when compiling with -D_USE_32BIT_TIME_T, time_t is an alias of
- dnl __time32_t.
- AC_CACHE_CHECK([for time_t past the year 2038], [gl_cv_type_time_t_y2038],
- [AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE([gl_YEAR2038_TEST_INCLUDES])],
- [gl_cv_type_time_t_y2038=yes], [gl_cv_type_time_t_y2038=no])
- ])
- if test "$gl_cv_type_time_t_y2038" = no; then
- AC_CACHE_CHECK([for 64-bit time_t with _TIME_BITS=64],
- [gl_cv_type_time_t_bits_macro],
- [AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE([[#define _TIME_BITS 64
- #define _FILE_OFFSET_BITS 64
- ]gl_YEAR2038_TEST_INCLUDES])],
- [gl_cv_type_time_t_bits_macro=yes],
- [gl_cv_type_time_t_bits_macro=no])
- ])
- if test "$gl_cv_type_time_t_bits_macro" = yes; then
- AC_DEFINE([_TIME_BITS], [64],
- [Number of bits in a timestamp, on hosts where this is settable.])
- dnl AC_SYS_LARGFILE also defines this; it's OK if we do too.
- AC_DEFINE([_FILE_OFFSET_BITS], [64],
- [Number of bits in a file offset, on hosts where this is settable.])
- gl_cv_type_time_t_y2038=yes
- fi
- fi
- if test $gl_cv_type_time_t_y2038 = no; then
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#ifdef _USE_32BIT_TIME_T
- int ok;
- #else
- error fail
- #endif
- ]])],
- [AC_MSG_FAILURE(
- [The 'time_t' type stops working after January 2038.
- Remove _USE_32BIT_TIME_T from the compiler flags.])],
- [# If not cross-compiling and $1 says we should check,
- # and 'touch' works with a large timestamp, then evidently wider time_t
- # is desired and supported, so fail and ask the builder to fix the
- # problem. Otherwise, just warn the builder.
- m4_ifval([$1],
- [if test $cross_compiling = no \
- && TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null; then
- case `TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null` in
- *'Feb 7 2106'* | *'Feb 7 17:10'*)
- AC_MSG_FAILURE(
- [The 'time_t' type stops working after January 2038,
- and your system appears to support a wider 'time_t'.
- Try configuring with 'CC="${CC} -m64"'.
- To build with a 32-bit time_t anyway (not recommended),
- configure with '--disable-year2038'.]);;
- esac
- rm -f conftest.time
- fi])
- if test "$gl_warned_about_y2038" != yes; then
- AC_MSG_WARN(
- [The 'time_t' type stops working after January 2038,
- and this package needs a wider 'time_t' type
- if there is any way to access timestamps after that.
- Configure with 'CC="${CC} -m64"' perhaps?])
- gl_warned_about_y2038=yes
- fi
- ])
- fi])
-])
-
-AC_DEFUN([gl_YEAR2038],
-[
- gl_YEAR2038_BODY([require-year2038-safe])
-])
diff --git a/gl/m4/zzgnulib.m4 b/gl/m4/zzgnulib.m4
index fd73a201..362102b6 100644
--- a/gl/m4/zzgnulib.m4
+++ b/gl/m4/zzgnulib.m4
@@ -1,5 +1,5 @@
# zzgnulib.m4 serial 1
-dnl Copyright (C) 2020-2022 Free Software Foundation, Inc.
+dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.