From 5fc9e0f4acbb0647b6564d091257340b4ce800f1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 10:56:12 +0200 Subject: Merging upstream version 1.24.5. Signed-off-by: Daniel Baumann --- m4/00gnulib.m4 | 12 +- m4/__inline.m4 | 2 +- m4/absolute-header.m4 | 6 +- m4/access.m4 | 55 +++- m4/af_alg.m4 | 2 +- m4/alloca.m4 | 2 +- m4/arpa_inet_h.m4 | 2 +- m4/asm-underscore.m4 | 2 +- m4/assert_h.m4 | 8 +- m4/base32.m4 | 2 +- m4/btowc.m4 | 45 ++-- m4/build-to-host.m4 | 79 ++++++ m4/builtin-expect.m4 | 2 +- m4/byteswap.m4 | 2 +- m4/c-bool.m4 | 2 +- m4/calloc.m4 | 6 +- m4/canonicalize.m4 | 28 +- m4/chdir-long.m4 | 2 +- m4/clock_time.m4 | 34 ++- m4/close.m4 | 2 +- m4/closedir.m4 | 11 +- m4/codeset.m4 | 2 +- m4/ctype_h.m4 | 2 +- m4/d-ino.m4 | 24 +- m4/dirent_h.m4 | 11 +- m4/dirfd.m4 | 15 +- m4/double-slash-root.m4 | 2 +- m4/dup.m4 | 10 +- m4/dup2.m4 | 6 +- m4/eaccess.m4 | 2 +- m4/eealloc.m4 | 2 +- m4/environ.m4 | 2 +- m4/errno_h.m4 | 2 +- m4/error.m4 | 2 +- m4/error_h.m4 | 11 +- m4/exponentd.m4 | 2 +- m4/extensions.m4 | 2 +- m4/extern-inline.m4 | 2 +- m4/fatal-signal.m4 | 2 +- m4/fchdir.m4 | 34 ++- m4/fclose.m4 | 6 +- m4/fcntl-o.m4 | 10 +- m4/fcntl.m4 | 2 +- m4/fcntl_h.m4 | 2 +- m4/fdopendir.m4 | 2 +- m4/fflush.m4 | 10 +- m4/filenamecat.m4 | 2 +- m4/findprog-in.m4 | 2 +- m4/flexmember.m4 | 2 +- m4/float_h.m4 | 12 +- m4/flock.m4 | 2 +- m4/fnmatch.m4 | 110 ++++++-- m4/fnmatch_h.m4 | 2 +- m4/fopen.m4 | 8 +- m4/fpurge.m4 | 2 +- m4/freading.m4 | 2 +- m4/free.m4 | 2 +- m4/fseek.m4 | 2 +- m4/fseeko.m4 | 2 +- m4/fstat.m4 | 8 +- m4/fstatat.m4 | 6 +- m4/ftell.m4 | 2 +- m4/ftello.m4 | 18 +- m4/futimens.m4 | 2 +- m4/getaddrinfo.m4 | 8 +- m4/getcwd-abort-bug.m4 | 2 +- m4/getcwd-path-max.m4 | 2 +- m4/getcwd.m4 | 13 +- m4/getdelim.m4 | 2 +- m4/getdtablesize.m4 | 2 +- m4/getgroups.m4 | 8 +- m4/getline.m4 | 2 +- m4/getopt.m4 | 8 +- m4/getpagesize.m4 | 6 +- m4/getpass.m4 | 2 +- m4/getprogname.m4 | 2 +- m4/getrandom.m4 | 8 +- m4/gettext.m4 | 93 ++++--- m4/gettime.m4 | 6 +- m4/gettimeofday.m4 | 6 +- m4/gl-openssl.m4 | 7 +- m4/gnulib-common.m4 | 134 +++++---- m4/gnulib-comp.m4 | 289 +++++++++++++++++++- m4/group-member.m4 | 2 +- m4/host-cpu-c-abi.m4 | 245 ++++------------- m4/hostent.m4 | 8 +- m4/iconv.m4 | 16 +- m4/iconv_h.m4 | 2 +- m4/include_next.m4 | 12 +- m4/inet_ntop.m4 | 8 +- m4/inline.m4 | 2 +- m4/intlmacosx.m4 | 10 +- m4/intmax_t.m4 | 2 +- m4/inttypes.m4 | 2 +- m4/inttypes_h.m4 | 2 +- m4/ioctl.m4 | 2 +- m4/isblank.m4 | 2 +- m4/iswblank.m4 | 2 +- m4/iswctype.m4 | 13 + m4/iswdigit.m4 | 19 +- m4/iswpunct.m4 | 48 ++++ m4/iswxdigit.m4 | 16 +- m4/langinfo_h.m4 | 2 +- m4/largefile.m4 | 32 ++- m4/lib-ld.m4 | 12 +- m4/lib-link.m4 | 34 +-- m4/lib-prefix.m4 | 29 +- m4/libunistring-base.m4 | 2 +- m4/libunistring-optional.m4 | 2 +- m4/libunistring.m4 | 8 +- m4/limits-h.m4 | 23 +- m4/link.m4 | 2 +- m4/localcharset.m4 | 2 +- m4/locale-fr.m4 | 137 ++++++---- m4/locale-ja.m4 | 14 +- m4/locale-zh.m4 | 12 +- m4/locale_h.m4 | 10 +- m4/localeconv.m4 | 6 +- m4/lock.m4 | 2 +- m4/lseek.m4 | 6 +- m4/lstat.m4 | 8 +- m4/malloc.m4 | 11 +- m4/malloca.m4 | 2 +- m4/mbchar.m4 | 2 +- m4/mbiter.m4 | 2 +- m4/mbrtoc32.m4 | 266 ++++++++++++++++++ m4/mbrtowc.m4 | 105 ++++---- m4/mbsinit.m4 | 6 +- m4/mbsrtowcs.m4 | 26 +- m4/mbstate_t.m4 | 2 +- m4/mbtowc.m4 | 2 +- m4/md4.m4 | 2 +- m4/md5.m4 | 2 +- m4/memchr.m4 | 16 +- m4/mempcpy.m4 | 2 +- m4/memrchr.m4 | 2 +- m4/minmax.m4 | 2 +- m4/mkdir.m4 | 53 ++-- m4/mkostemp.m4 | 2 +- m4/mkstemp.m4 | 6 +- m4/mktime.m4 | 13 +- m4/mmap-anon.m4 | 2 +- m4/mode_t.m4 | 2 +- m4/msvc-inval.m4 | 2 +- m4/msvc-nothrow.m4 | 2 +- m4/multiarch.m4 | 2 +- m4/musl.m4 | 2 +- m4/nanosleep.m4 | 25 +- m4/netdb_h.m4 | 2 +- m4/netinet_in_h.m4 | 2 +- m4/nl_langinfo.m4 | 2 +- m4/nls.m4 | 2 +- m4/nocrash.m4 | 2 +- m4/off_t.m4 | 2 +- m4/open-cloexec.m4 | 2 +- m4/open-slash.m4 | 2 +- m4/open.m4 | 6 +- m4/openat.m4 | 2 +- m4/opendir.m4 | 12 +- m4/pathmax.m4 | 2 +- m4/pipe.m4 | 2 +- m4/pipe2.m4 | 2 +- m4/posix_spawn.m4 | 16 +- m4/posix_spawn_faction_addchdir.m4 | 8 +- m4/printf.m4 | 538 +++++++++++++++++++++++-------------- m4/pselect.m4 | 2 +- m4/pthread_rwlock_rdlock.m4 | 12 +- m4/pthread_sigmask.m4 | 16 +- m4/quote.m4 | 2 +- m4/quotearg.m4 | 2 +- m4/raise.m4 | 2 +- m4/rawmemchr.m4 | 2 +- m4/readdir.m4 | 7 +- m4/readlink.m4 | 2 +- m4/realloc.m4 | 9 +- m4/reallocarray.m4 | 2 +- m4/regex.m4 | 12 +- m4/rename.m4 | 82 +++--- m4/rewinddir.m4 | 7 +- m4/rmdir.m4 | 24 +- m4/save-cwd.m4 | 2 +- m4/sched_h.m4 | 2 +- m4/secure_getenv.m4 | 2 +- m4/select.m4 | 6 +- m4/servent.m4 | 8 +- m4/setlocale_null.m4 | 16 +- m4/sh-filename.m4 | 2 +- m4/sha1.m4 | 2 +- m4/sha256.m4 | 2 +- m4/sha512.m4 | 2 +- m4/sig_atomic_t.m4 | 2 +- m4/sigaction.m4 | 2 +- m4/signal_h.m4 | 2 +- m4/signalblocking.m4 | 2 +- m4/sigpipe.m4 | 2 +- m4/size_max.m4 | 2 +- m4/snprintf.m4 | 2 +- m4/socketlib.m4 | 18 +- m4/sockets.m4 | 2 +- m4/socklen.m4 | 2 +- m4/sockpfaf.m4 | 2 +- m4/spawn-pipe.m4 | 2 +- m4/spawn_h.m4 | 2 +- m4/ssize_t.m4 | 30 ++- m4/stat-time.m4 | 2 +- m4/stat.m4 | 12 +- m4/stdalign.m4 | 24 +- m4/stddef_h.m4 | 2 +- m4/stdint.m4 | 17 +- m4/stdint_h.m4 | 2 +- m4/stdio_h.m4 | 2 +- m4/stdlib_h.m4 | 9 +- m4/stpcpy.m4 | 2 +- m4/strcase.m4 | 2 +- m4/strchrnul.m4 | 2 +- m4/strdup.m4 | 2 +- m4/strerror.m4 | 6 +- m4/strerror_r.m4 | 2 +- m4/string_h.m4 | 6 +- m4/strings_h.m4 | 2 +- m4/strndup.m4 | 2 +- m4/strnlen.m4 | 2 +- m4/strpbrk.m4 | 2 +- m4/strptime.m4 | 2 +- m4/strtok_r.m4 | 14 +- m4/strtol.m4 | 20 +- m4/strtoll.m4 | 20 +- m4/symlink.m4 | 2 +- m4/sys_file_h.m4 | 2 +- m4/sys_ioctl_h.m4 | 2 +- m4/sys_random_h.m4 | 2 +- m4/sys_select_h.m4 | 2 +- m4/sys_socket_h.m4 | 2 +- m4/sys_stat_h.m4 | 2 +- m4/sys_time_h.m4 | 2 +- m4/sys_types_h.m4 | 2 +- m4/sys_uio_h.m4 | 2 +- m4/sys_wait_h.m4 | 2 +- m4/tcgetattr.m4 | 2 +- m4/tempname.m4 | 2 +- m4/threadlib.m4 | 29 +- m4/time_h.m4 | 38 ++- m4/time_r.m4 | 6 +- m4/timegm.m4 | 5 +- m4/timespec.m4 | 2 +- m4/tm_gmtoff.m4 | 2 +- m4/tmpdir.m4 | 2 +- m4/uchar_h.m4 | 249 +++++++++++++++++ m4/ungetc.m4 | 6 +- m4/unicase_h.m4 | 2 +- m4/unictype_h.m4 | 8 +- m4/uninorm_h.m4 | 2 +- m4/unistd-safer.m4 | 2 +- m4/unistd_h.m4 | 5 +- m4/unlink.m4 | 24 +- m4/unlocked-io.m4 | 2 +- m4/utime.m4 | 23 +- m4/utime_h.m4 | 2 +- m4/utimens.m4 | 17 +- m4/utimes.m4 | 14 +- m4/vasnprintf.m4 | 84 +++++- m4/vasprintf.m4 | 2 +- m4/visibility.m4 | 12 +- m4/vsnprintf.m4 | 2 +- m4/wait-process.m4 | 2 +- m4/waitpid.m4 | 6 +- m4/warn-on-use.m4 | 8 +- m4/warnings.m4 | 98 +++++-- m4/wchar_h.m4 | 14 +- m4/wchar_t.m4 | 2 +- m4/wcrtomb.m4 | 22 +- m4/wctype.m4 | 51 ++++ m4/wctype_h.m4 | 8 +- m4/wcwidth.m4 | 2 +- m4/wget.m4 | 2 +- m4/wget_manywarnings.m4 | 2 +- m4/wint_t.m4 | 2 +- m4/wmemchr.m4 | 2 +- m4/wmempcpy.m4 | 2 +- m4/write.m4 | 2 +- m4/xalloc.m4 | 2 +- m4/xsize.m4 | 2 +- m4/xstrndup.m4 | 2 +- m4/zzgnulib.m4 | 2 +- 284 files changed, 2932 insertions(+), 1502 deletions(-) create mode 100644 m4/build-to-host.m4 create mode 100644 m4/iswctype.m4 create mode 100644 m4/iswpunct.m4 create mode 100644 m4/mbrtoc32.m4 create mode 100644 m4/uchar_h.m4 create mode 100644 m4/wctype.m4 (limited to 'm4') diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4 index 7fe03e0..99c99d1 100644 --- a/m4/00gnulib.m4 +++ b/m4/00gnulib.m4 @@ -1,5 +1,5 @@ -# 00gnulib.m4 serial 8 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +# 00gnulib.m4 serial 9 +dnl Copyright (C) 2009-2024 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,14 +49,14 @@ dnl AC_REQUIRE([gl_COMPILER_CLANG]) [if test $gl_cv_compiler_clang = yes; then dnl Test whether the compiler supports the option dnl '-Werror=implicit-function-declaration'. - save_ac_compile="$ac_compile" + saved_ac_compile="$ac_compile" ac_compile="$ac_compile -Werror=implicit-function-declaration" dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])], [gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'], [gl_cv_compiler_check_decl_option=none]) - ac_compile="$save_ac_compile" + ac_compile="$saved_ac_compile" else gl_cv_compiler_check_decl_option=none fi @@ -71,11 +71,11 @@ dnl Redefine _AC_CHECK_DECL_BODY so that it references ac_compile_for_check_decl dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC dnl in zzgnulib.m4 is inactive, use the original ac_compile. m4_define([_AC_CHECK_DECL_BODY], -[ ac_save_ac_compile="$ac_compile" +[ ac_saved_ac_compile="$ac_compile" if test -n "$ac_compile_for_check_decl"; then ac_compile="$ac_compile_for_check_decl" fi] -m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile" +m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_saved_ac_compile" ]) # gl_00GNULIB diff --git a/m4/__inline.m4 b/m4/__inline.m4 index acf8668..992e16f 100644 --- a/m4/__inline.m4 +++ b/m4/__inline.m4 @@ -1,5 +1,5 @@ # Test for __inline keyword -dnl Copyright 2017-2023 Free Software Foundation, Inc. +dnl Copyright 2017-2024 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/m4/absolute-header.m4 b/m4/absolute-header.m4 index e794764..0e9f9ba 100644 --- a/m4/absolute-header.m4 +++ b/m4/absolute-header.m4 @@ -1,5 +1,5 @@ -# absolute-header.m4 serial 17 -dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. +# absolute-header.m4 serial 18 +dnl Copyright (C) 2006-2024 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. @@ -66,7 +66,7 @@ AC_DEFUN([gl_ABSOLUTE_HEADER_ONE], esac changequote(,) case "$host_os" in - mingw*) + mingw* | windows*) dnl For the sake of native Windows compilers (excluding gcc), dnl treat backslash as a directory separator, like /. dnl Actually, these compilers use a double-backslash as diff --git a/m4/access.m4 b/m4/access.m4 index 0c8064f..c2c347f 100644 --- a/m4/access.m4 +++ b/m4/access.m4 @@ -1,5 +1,5 @@ -# access.m4 serial 1 -dnl Copyright (C) 2019-2023 Free Software Foundation, Inc. +# access.m4 serial 3 +dnl Copyright (C) 2019-2024 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,6 +11,55 @@ AC_DEFUN([gl_FUNC_ACCESS], dnl On native Windows, access (= _access) does not support the X_OK mode. dnl It works by chance on some versions of mingw. case "$host_os" in - mingw*) REPLACE_ACCESS=1 ;; + mingw* | windows*) + REPLACE_ACCESS=1 + ;; + *) + dnl Mac OS X 10.5 mistakenly allows access("link-to-file/",amode). + AC_CHECK_FUNCS_ONCE([lstat]) + AC_CACHE_CHECK([whether access honors trailing slash], + [gl_cv_func_access_slash_works], + [# Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + rm -rf conftest.f conftest.lnk + touch conftest.f || AC_MSG_ERROR([cannot create temporary files]) + ln -s conftest.f conftest.lnk + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[ + #include + ]], + [[int result = 0; + if (access ("conftest.lnk/", R_OK) == 0) + result |= 1; + return result; + ]])], + [gl_cv_func_access_slash_works=yes], + [gl_cv_func_access_slash_works=no], + dnl When crosscompiling, assume access is broken. + [case "$host_os" in + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_access_slash_works="guessing yes" ;; + # Guess yes on systems that emulate the Linux system calls. + midipix*) gl_cv_func_access_slash_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_access_slash_works="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_access_slash_works="$gl_cross_guess_normal" ;; + esac + ]) + rm -rf conftest.f conftest.lnk + else + gl_cv_func_access_slash_works="guessing yes" + fi + ]) + case "$gl_cv_func_access_slash_works" in + *yes) ;; + *) + REPLACE_ACCESS=1 + AC_DEFINE([ACCESS_TRAILING_SLASH_BUG], [1], + [Define if access does not correctly handle trailing slashes.]) + ;; + esac + ;; esac ]) diff --git a/m4/af_alg.m4 b/m4/af_alg.m4 index f4c0d62..e88d624 100644 --- a/m4/af_alg.m4 +++ b/m4/af_alg.m4 @@ -1,5 +1,5 @@ # af_alg.m4 serial 6 -dnl Copyright 2018-2023 Free Software Foundation, Inc. +dnl Copyright 2018-2024 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/m4/alloca.m4 b/m4/alloca.m4 index c685fac..9096021 100644 --- a/m4/alloca.m4 +++ b/m4/alloca.m4 @@ -1,5 +1,5 @@ # alloca.m4 serial 21 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2023 Free Software Foundation, +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2024 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/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4 index fa5fe83..754b38e 100644 --- a/m4/arpa_inet_h.m4 +++ b/m4/arpa_inet_h.m4 @@ -1,5 +1,5 @@ # arpa_inet_h.m4 serial 17 -dnl Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2024 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/m4/asm-underscore.m4 b/m4/asm-underscore.m4 index 65ae55a..cc63465 100644 --- a/m4/asm-underscore.m4 +++ b/m4/asm-underscore.m4 @@ -1,5 +1,5 @@ # asm-underscore.m4 serial 5 -dnl Copyright (C) 2010-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2024 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/m4/assert_h.m4 b/m4/assert_h.m4 index d255855..d3d4c42 100644 --- a/m4/assert_h.m4 +++ b/m4/assert_h.m4 @@ -1,5 +1,5 @@ # assert-h.m4 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2024 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,10 +9,10 @@ dnl From Paul Eggert. AC_DEFUN([gl_ASSERT_H], [ AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert], - [gl_save_CFLAGS=$CFLAGS + [gl_saved_CFLAGS=$CFLAGS for gl_working in "yes, a keyword" "yes, an macro"; do AS_CASE([$gl_working], - [*assert.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_ASSERT_H"]) + [*assert.h*], [CFLAGS="$gl_saved_CFLAGS -DINCLUDE_ASSERT_H"]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( @@ -32,7 +32,7 @@ AC_DEFUN([gl_ASSERT_H], ]])], [gl_cv_static_assert=$gl_working], [gl_cv_static_assert=no]) - CFLAGS=$gl_save_CFLAGS + CFLAGS=$gl_saved_CFLAGS test "$gl_cv_static_assert" != no && break done]) diff --git a/m4/base32.m4 b/m4/base32.m4 index 06dcdaf..dd768cf 100644 --- a/m4/base32.m4 +++ b/m4/base32.m4 @@ -1,5 +1,5 @@ # base32.m4 serial 4 -dnl Copyright (C) 2004, 2006, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2009-2024 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/m4/btowc.m4 b/m4/btowc.m4 index 1cd100a..8bb55dc 100644 --- a/m4/btowc.m4 +++ b/m4/btowc.m4 @@ -1,5 +1,5 @@ -# btowc.m4 serial 13 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +# btowc.m4 serial 14 +dnl Copyright (C) 2008-2024 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. @@ -40,12 +40,12 @@ int main () [ changequote(,)dnl case "$host_os" in - # Guess no on Cygwin. - cygwin*) gl_cv_func_btowc_nul="guessing no" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_btowc_nul="guessing yes" ;; - # Guess yes otherwise. - *) gl_cv_func_btowc_nul="guessing yes" ;; + # Guess no on Cygwin. + cygwin*) gl_cv_func_btowc_nul="guessing no" ;; + # Guess yes on native Windows. + mingw* | windows*) gl_cv_func_btowc_nul="guessing yes" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_nul="guessing yes" ;; esac changequote([,])dnl ]) @@ -59,12 +59,12 @@ changequote([,])dnl dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on IRIX. - irix*) gl_cv_func_btowc_eof="guessing no" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_btowc_eof="guessing yes" ;; - # Guess yes otherwise. - *) gl_cv_func_btowc_eof="guessing yes" ;; + # Guess no on IRIX. + irix*) gl_cv_func_btowc_eof="guessing no" ;; + # Guess yes on native Windows. + mingw* | windows*) gl_cv_func_btowc_eof="guessing yes" ;; + # Guess yes otherwise. + *) gl_cv_func_btowc_eof="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR != none; then @@ -116,17 +116,18 @@ int main () [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], [ + # Guess no on mingw. + mingw* | windows*) + 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" ;; + ], + [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 ]) ]) diff --git a/m4/build-to-host.m4 b/m4/build-to-host.m4 new file mode 100644 index 0000000..ad22a0a --- /dev/null +++ b/m4/build-to-host.m4 @@ -0,0 +1,79 @@ +# build-to-host.m4 serial 3 +dnl Copyright (C) 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 Bruno Haible. + +dnl When the build environment ($build_os) is different from the target runtime +dnl environment ($host_os), file names may need to be converted from the build +dnl environment syntax to the target runtime environment syntax. This is +dnl because the Makefiles are executed (mostly) by build environment tools and +dnl therefore expect file names in build environment syntax, whereas the runtime +dnl expects file names in target runtime environment syntax. +dnl +dnl For example, if $build_os = cygwin and $host_os = mingw32, filenames need +dnl be converted from Cygwin syntax to native Windows syntax: +dnl /cygdrive/c/foo/bar -> C:\foo\bar +dnl /usr/local/share -> C:\cygwin64\usr\local\share +dnl +dnl gl_BUILD_TO_HOST([somedir]) +dnl This macro takes as input an AC_SUBSTed variable 'somedir', which must +dnl already have its final value assigned, and produces two additional +dnl AC_SUBSTed variables 'somedir_c' and 'somedir_c_make', that designate the +dnl same file name value, just in different syntax: +dnl - somedir_c is the file name in target runtime environment syntax, +dnl as a C string (starting and ending with a double-quote, +dnl and with escaped backslashes and double-quotes in +dnl between). +dnl - somedir_c_make is the same thing, escaped for use in a Makefile. + +AC_DEFUN([gl_BUILD_TO_HOST], +[ + AC_REQUIRE([AC_CANONICAL_BUILD]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_BUILD_TO_HOST_INIT]) + + dnl Define somedir_c. + gl_final_[$1]="$[$1]" + dnl Translate it from build syntax to host syntax. + case "$build_os" in + cygwin*) + case "$host_os" in + mingw* | windows*) + gl_final_[$1]=`cygpath -w "$gl_final_[$1]"` ;; + esac + ;; + esac + dnl Convert it to C string syntax. + [$1]_c=`printf '%s\n' "$gl_final_[$1]" | sed -e "$gl_sed_double_backslashes" -e "$gl_sed_escape_doublequotes" | tr -d "$gl_tr_cr"` + [$1]_c='"'"$[$1]_c"'"' + AC_SUBST([$1_c]) + + dnl Define somedir_c_make. + [$1]_c_make=`printf '%s\n' "$[$1]_c" | sed -e "$gl_sed_escape_for_make_1" -e "$gl_sed_escape_for_make_2" | tr -d "$gl_tr_cr"` + dnl Use the substituted somedir variable, when possible, so that the user + dnl may adjust somedir a posteriori when there are no special characters. + if test "$[$1]_c_make" = '\"'"${gl_final_[$1]}"'\"'; then + [$1]_c_make='\"$([$1])\"' + fi + AC_SUBST([$1_c_make]) +]) + +dnl Some initializations for gl_BUILD_TO_HOST. +AC_DEFUN([gl_BUILD_TO_HOST_INIT], +[ + gl_sed_double_backslashes='s/\\/\\\\/g' + gl_sed_escape_doublequotes='s/"/\\"/g' +changequote(,)dnl + gl_sed_escape_for_make_1="s,\\([ \"&'();<>\\\\\`|]\\),\\\\\\1,g" +changequote([,])dnl + gl_sed_escape_for_make_2='s,\$,\\$$,g' + dnl Find out how to remove carriage returns from output. Solaris /usr/ucb/tr + dnl does not understand '\r'. + case `echo r | tr -d '\r'` in + '') gl_tr_cr='\015' ;; + *) gl_tr_cr='\r' ;; + esac +]) diff --git a/m4/builtin-expect.m4 b/m4/builtin-expect.m4 index 531ed48..8faffc5 100644 --- a/m4/builtin-expect.m4 +++ b/m4/builtin-expect.m4 @@ -1,6 +1,6 @@ dnl Check for __builtin_expect. -dnl Copyright 2016-2023 Free Software Foundation, Inc. +dnl Copyright 2016-2024 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/m4/byteswap.m4 b/m4/byteswap.m4 index 8058d17..5493d90 100644 --- a/m4/byteswap.m4 +++ b/m4/byteswap.m4 @@ -1,5 +1,5 @@ # byteswap.m4 serial 5 -dnl Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2007, 2009-2024 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/m4/c-bool.m4 b/m4/c-bool.m4 index f614371..44fba3c 100644 --- a/m4/c-bool.m4 +++ b/m4/c-bool.m4 @@ -1,6 +1,6 @@ # Check for bool that conforms to C2023. -dnl Copyright 2022-2023 Free Software Foundation, Inc. +dnl Copyright 2022-2024 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/m4/calloc.m4 b/m4/calloc.m4 index 3789cbf..49303d9 100644 --- a/m4/calloc.m4 +++ b/m4/calloc.m4 @@ -1,6 +1,6 @@ -# calloc.m4 serial 30 +# calloc.m4 serial 31 -# Copyright (C) 2004-2023 Free Software Foundation, Inc. +# Copyright (C) 2004-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -41,7 +41,7 @@ AC_DEFUN([_AC_FUNC_CALLOC_IF], # 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" ;; + mingw* | windows*) 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 diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4 index d319645..05dc6dd 100644 --- a/m4/canonicalize.m4 +++ b/m4/canonicalize.m4 @@ -1,6 +1,6 @@ -# canonicalize.m4 serial 38 +# canonicalize.m4 serial 39 -dnl Copyright (C) 2003-2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -66,8 +66,8 @@ AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE], dnl available through the linker option '-loldnames'. AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in - mingw*) ;; - *) AC_CHECK_FUNCS([getcwd]) ;; + mingw* | windows*) ;; + *) AC_CHECK_FUNCS([getcwd]) ;; esac AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) @@ -158,16 +158,16 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS], esac ], [case "$host_os" in - # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;; - # Guess 'nearly' on musl systems. - *-musl*) gl_cv_func_realpath_works="guessing nearly" ;; - # Guess no on Cygwin. - cygwin*) gl_cv_func_realpath_works="guessing no" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_realpath_works="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;; + # Guess 'nearly' on musl systems. + *-musl*) gl_cv_func_realpath_works="guessing nearly" ;; + # Guess no on Cygwin. + cygwin*) gl_cv_func_realpath_works="guessing no" ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_realpath_works="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;; esac ]) rm -rf conftest.a conftest.l conftest.d diff --git a/m4/chdir-long.m4 b/m4/chdir-long.m4 index 4a92b30..62c7a79 100644 --- a/m4/chdir-long.m4 +++ b/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-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2007, 2009-2024 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/m4/clock_time.m4 b/m4/clock_time.m4 index d624a73..c016575 100644 --- a/m4/clock_time.m4 +++ b/m4/clock_time.m4 @@ -1,5 +1,5 @@ -# clock_time.m4 serial 12 -dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc. +# clock_time.m4 serial 14 +dnl Copyright (C) 2002-2006, 2009-2024 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,17 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_CLOCK_TIME], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + dnl Persuade glibc and Solaris to declare these functions. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + # On mingw, these functions are defined in the libwinpthread library, + # which is better avoided. In fact, the clock_gettime function is buggy + # in 32-bit mingw, when -D__MINGW_USE_VC2005_COMPAT is used (which Gnulib's + # year2038 module does): It leaves the upper 32 bits of the tv_sec field + # of the result uninitialized. + # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. @@ -23,12 +31,22 @@ AC_DEFUN([gl_CLOCK_TIME], # library, inducing unnecessary run-time overhead. 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" || - CLOCK_TIME_LIB=$ac_cv_search_clock_gettime]) - AC_CHECK_FUNCS([clock_getres clock_gettime clock_settime]) - LIBS=$gl_saved_libs + case "$host_os" in + mingw* | windows*) + ac_cv_func_clock_getres=no + ac_cv_func_clock_gettime=no + ac_cv_func_clock_settime=no + ;; + *) + gl_saved_libs=$LIBS + AC_SEARCH_LIBS([clock_gettime], [rt posix4], + [test "$ac_cv_search_clock_gettime" = "none required" || + CLOCK_TIME_LIB=$ac_cv_search_clock_gettime]) + AC_CHECK_FUNCS([clock_getres clock_gettime clock_settime]) + LIBS=$gl_saved_libs + ;; + esac + # For backward compatibility. LIB_CLOCK_GETTIME="$CLOCK_TIME_LIB" AC_SUBST([LIB_CLOCK_GETTIME]) diff --git a/m4/close.m4 b/m4/close.m4 index 0feabd6..6b6d382 100644 --- a/m4/close.m4 +++ b/m4/close.m4 @@ -1,5 +1,5 @@ # close.m4 serial 10 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/closedir.m4 b/m4/closedir.m4 index 7e702de..3774806 100644 --- a/m4/closedir.m4 +++ b/m4/closedir.m4 @@ -1,5 +1,5 @@ -# closedir.m4 serial 7 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +# closedir.m4 serial 8 +dnl Copyright (C) 2011-2024 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,15 +13,12 @@ AC_DEFUN([gl_FUNC_CLOSEDIR], if test $ac_cv_func_closedir = no; then HAVE_CLOSEDIR=0 else - dnl Replace closedir() on native Windows, to support fdopendir(). + dnl Replace closedir() on native Windows and OS/2 kLIBC, + dnl 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], [ diff --git a/m4/codeset.m4 b/m4/codeset.m4 index 5804f47..94dccce 100644 --- a/m4/codeset.m4 +++ b/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-2023 Free Software +dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2024 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/m4/ctype_h.m4 b/m4/ctype_h.m4 index 219f2ed..ef0ee7f 100644 --- a/m4/ctype_h.m4 +++ b/m4/ctype_h.m4 @@ -1,5 +1,5 @@ # ctype_h.m4 serial 9 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/d-ino.m4 b/m4/d-ino.m4 index 58f3311..b127ab2 100644 --- a/m4/d-ino.m4 +++ b/m4/d-ino.m4 @@ -1,11 +1,11 @@ -# serial 21 +# serial 22 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-2023 Free Software +# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2024 Free Software # Foundation, Inc. # This file is free software; the Free Software Foundation @@ -40,16 +40,16 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO], [gl_cv_struct_dirent_d_ino=yes], [gl_cv_struct_dirent_d_ino=no], [case "$host_os" in - # Guess yes on glibc systems with Linux kernel. - 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. - *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;; + # Guess yes on glibc systems with Linux kernel. + 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* | windows*) gl_cv_struct_dirent_d_ino="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;; esac ])]) case "$gl_cv_struct_dirent_d_ino" in diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4 index b6c189c..3e3d967 100644 --- a/m4/dirent_h.m4 +++ b/m4/dirent_h.m4 @@ -1,5 +1,5 @@ -# dirent_h.m4 serial 20 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +# dirent_h.m4 serial 22 +dnl Copyright (C) 2008-2024 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,14 +32,13 @@ AC_DEFUN_ONCE([gl_DIRENT_H], dnl Determine whether 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 Set DIR_HAS_FD_MEMBER if dirfd() works, i.e. not always returns -1. 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 ;; + mingw* | windows* | os2*) DIR_HAS_FD_MEMBER=0 ;; + *) DIR_HAS_FD_MEMBER=1 ;; esac AC_SUBST([DIR_HAS_FD_MEMBER]) ]) diff --git a/m4/dirfd.m4 b/m4/dirfd.m4 index 7968b12..e58582e 100644 --- a/m4/dirfd.m4 +++ b/m4/dirfd.m4 @@ -1,8 +1,8 @@ -# serial 28 -*- Autoconf -*- +# serial 30 -*- Autoconf -*- dnl Find out how to get the file descriptor associated with an open DIR*. -# Copyright (C) 2001-2006, 2008-2023 Free Software Foundation, Inc. +# Copyright (C) 2001-2006, 2008-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -40,15 +40,12 @@ AC_DEFUN([gl_FUNC_DIRFD], HAVE_DIRFD=0 else HAVE_DIRFD=1 - dnl Replace dirfd() on native Windows, to support fdopendir(). + dnl Replace dirfd() on native Windows and OS/2 kLIBC, + dnl to support fdopendir(). AC_REQUIRE([gl_DIRENT_DIR]) if test $DIR_HAS_FD_MEMBER = 0; then REPLACE_DIRFD=1 fi - dnl OS/2 kLIBC dirfd() does not work. - case "$host_os" in - os2*) REPLACE_DIRFD=1 ;; - esac fi ]) @@ -58,7 +55,7 @@ AC_DEFUN([gl_PREREQ_DIRFD], AC_CACHE_CHECK([how to get the file descriptor associated with an open DIR*], [gl_cv_sys_dir_fd_member_name], [ - dirfd_save_CFLAGS=$CFLAGS + gl_saved_CFLAGS=$CFLAGS for ac_expr in d_fd dd_fd; do CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr" @@ -68,7 +65,7 @@ AC_DEFUN([gl_PREREQ_DIRFD], [[DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;]])], [dir_fd_found=yes] ) - CFLAGS=$dirfd_save_CFLAGS + CFLAGS=$gl_saved_CFLAGS test "$dir_fd_found" = yes && break done test "$dir_fd_found" = yes || ac_expr=no_such_member diff --git a/m4/double-slash-root.m4 b/m4/double-slash-root.m4 index 1776e5e..00f23a7 100644 --- a/m4/double-slash-root.m4 +++ b/m4/double-slash-root.m4 @@ -1,5 +1,5 @@ # double-slash-root.m4 serial 4 -*- Autoconf -*- -dnl Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2024 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/m4/dup.m4 b/m4/dup.m4 index fc41c99..eafef02 100644 --- a/m4/dup.m4 +++ b/m4/dup.m4 @@ -1,5 +1,5 @@ -# dup.m4 serial 7 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +# dup.m4 serial 8 +dnl Copyright (C) 2011-2024 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,9 +36,9 @@ AC_DEFUN([gl_FUNC_DUP], [gl_cv_func_dup_works=yes], [gl_cv_func_dup_works=no], [case "$host_os" in - # Guess no on native Windows. - mingw*) gl_cv_func_dup_works="guessing no" ;; - *) gl_cv_func_dup_works="guessing yes" ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_dup_works="guessing no" ;; + *) gl_cv_func_dup_works="guessing yes" ;; esac ]) ]) diff --git a/m4/dup2.m4 b/m4/dup2.m4 index e1cc73e..f6759b6 100644 --- a/m4/dup2.m4 +++ b/m4/dup2.m4 @@ -1,5 +1,5 @@ -#serial 27 -dnl Copyright (C) 2002, 2005, 2007, 2009-2023 Free Software Foundation, Inc. +#serial 28 +dnl Copyright (C) 2002, 2005, 2007, 2009-2024 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. @@ -67,7 +67,7 @@ AC_DEFUN([gl_FUNC_DUP2], ], [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no], [case "$host_os" in - mingw*) # on this platform, dup2 always returns 0 for success + mingw* | windows*) # on this platform, dup2 always returns 0 for success gl_cv_func_dup2_works="guessing no" ;; cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 gl_cv_func_dup2_works="guessing no" ;; diff --git a/m4/eaccess.m4 b/m4/eaccess.m4 index 19134c0..e1cbcd1 100644 --- a/m4/eaccess.m4 +++ b/m4/eaccess.m4 @@ -1,5 +1,5 @@ # eaccess.m4 serial 2 -dnl Copyright (C) 2003, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2024 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/m4/eealloc.m4 b/m4/eealloc.m4 index cb3e08f..d8862a1 100644 --- a/m4/eealloc.m4 +++ b/m4/eealloc.m4 @@ -1,5 +1,5 @@ # eealloc.m4 serial 3 -dnl Copyright (C) 2003, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2024 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/m4/environ.m4 b/m4/environ.m4 index 741dfc5..5b9e06b 100644 --- a/m4/environ.m4 +++ b/m4/environ.m4 @@ -1,5 +1,5 @@ # environ.m4 serial 8 -dnl Copyright (C) 2001-2004, 2006-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2004, 2006-2024 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/m4/errno_h.m4 b/m4/errno_h.m4 index 4c70d22..8900d6c 100644 --- a/m4/errno_h.m4 +++ b/m4/errno_h.m4 @@ -1,5 +1,5 @@ # errno_h.m4 serial 14 -dnl Copyright (C) 2004, 2006, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2008-2024 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/m4/error.m4 b/m4/error.m4 index 93a7558..5688afc 100644 --- a/m4/error.m4 +++ b/m4/error.m4 @@ -1,6 +1,6 @@ #serial 16 -# Copyright (C) 1996-1998, 2001-2004, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 1996-1998, 2001-2004, 2009-2024 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/m4/error_h.m4 b/m4/error_h.m4 index f38e4ea..006770c 100644 --- a/m4/error_h.m4 +++ b/m4/error_h.m4 @@ -1,11 +1,11 @@ -# error_h.m4 serial 3 -dnl Copyright (C) 1996-2023 Free Software Foundation, Inc. +# error_h.m4 serial 4 +dnl Copyright (C) 1996-2024 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". +dnl Provide a working . AC_DEFUN_ONCE([gl_ERROR_H], [ @@ -112,10 +112,9 @@ AC_DEFUN_ONCE([gl_ERROR_H], if test $HAVE_ERROR = 0 || test $REPLACE_ERROR = 1 \ || test $HAVE_ERROR_AT_LINE = 0 || test $REPLACE_ERROR_AT_LINE = 1; then - dnl Provide a substitute file. - GL_GENERATE_ERROR_H=true + COMPILE_ERROR_C=1 else - GL_GENERATE_ERROR_H=false + COMPILE_ERROR_C=0 fi AC_SUBST([HAVE_ERROR]) diff --git a/m4/exponentd.m4 b/m4/exponentd.m4 index 163114b..0a4b1b6 100644 --- a/m4/exponentd.m4 +++ b/m4/exponentd.m4 @@ -1,5 +1,5 @@ # exponentd.m4 serial 4 -dnl Copyright (C) 2007-2008, 2010-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2008, 2010-2024 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/m4/extensions.m4 b/m4/extensions.m4 index 5336b8d..6fc2e30 100644 --- a/m4/extensions.m4 +++ b/m4/extensions.m4 @@ -1,7 +1,7 @@ # serial 23 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2023 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4 index f9894d7..680250e 100644 --- a/m4/extern-inline.m4 +++ b/m4/extern-inline.m4 @@ -1,6 +1,6 @@ dnl 'extern inline' a la ISO C99. -dnl Copyright 2012-2023 Free Software Foundation, Inc. +dnl Copyright 2012-2024 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/m4/fatal-signal.m4 b/m4/fatal-signal.m4 index 0c29bd4..720ff1a 100644 --- a/m4/fatal-signal.m4 +++ b/m4/fatal-signal.m4 @@ -1,5 +1,5 @@ # fatal-signal.m4 serial 9 -dnl Copyright (C) 2003-2004, 2006, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2004, 2006, 2008-2024 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/m4/fchdir.m4 b/m4/fchdir.m4 index b587e0e..fc0ed33 100644 --- a/m4/fchdir.m4 +++ b/m4/fchdir.m4 @@ -1,5 +1,5 @@ -# fchdir.m4 serial 28 -dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. +# fchdir.m4 serial 32 +dnl Copyright (C) 2006-2024 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. @@ -16,7 +16,15 @@ AC_DEFUN([gl_FUNC_FCHDIR], fi AC_REQUIRE([gl_TEST_FCHDIR]) - if test $HAVE_FCHDIR = 0; then + if test $HAVE_FCHDIR = 1; then + AC_REQUIRE([gl_DIRENT_DIR]) + if test $DIR_HAS_FD_MEMBER = 0; then + dnl fchdir() should be replaced if dirfd() does not work. + REPLACE_FCHDIR=1 + fi + fi + + if test $HAVE_FCHDIR = 0 || test $REPLACE_FCHDIR = 1; then AC_DEFINE([REPLACE_FCHDIR], [1], [Define to 1 if gnulib's fchdir() replacement is used.]) dnl We must also replace anything that can manipulate a directory fd, @@ -32,16 +40,16 @@ AC_DEFUN([gl_FUNC_FCHDIR], [gl_cv_func_open_directory_works=yes], [gl_cv_func_open_directory_works=no], [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. - mingw*) gl_cv_func_open_directory_works="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;; + # 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. + mingw* | windows*) gl_cv_func_open_directory_works="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;; esac ])]) case "$gl_cv_func_open_directory_works" in diff --git a/m4/fclose.m4 b/m4/fclose.m4 index e9291f0..9547f03 100644 --- a/m4/fclose.m4 +++ b/m4/fclose.m4 @@ -1,5 +1,5 @@ -# fclose.m4 serial 11 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +# fclose.m4 serial 12 +dnl Copyright (C) 2008-2024 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,7 +88,7 @@ AC_DEFUN([gl_FUNC_FCLOSE_STDIN], # Guess yes on musl systems. *-musl* | midipix*) gl_cv_func_fclose_stdin="guessing yes" ;; # Guess no on native Windows. - mingw*) gl_cv_func_fclose_stdin="guessing no" ;; + mingw* | windows*) gl_cv_func_fclose_stdin="guessing no" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_fclose_stdin="$gl_cross_guess_normal" ;; esac diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4 index 59d558b..49ab34d 100644 --- a/m4/fcntl-o.m4 +++ b/m4/fcntl-o.m4 @@ -1,5 +1,5 @@ -# fcntl-o.m4 serial 7 -dnl Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc. +# fcntl-o.m4 serial 8 +dnl Copyright (C) 2006, 2009-2024 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. @@ -117,9 +117,9 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], *) gl_cv_header_working_fcntl_h='no';; esac], [case "$host_os" in - # Guess 'no' on native Windows. - mingw*) gl_cv_header_working_fcntl_h='no' ;; - *) gl_cv_header_working_fcntl_h=cross-compiling ;; + # Guess 'no' on native Windows. + mingw* | windows*) gl_cv_header_working_fcntl_h='no' ;; + *) gl_cv_header_working_fcntl_h=cross-compiling ;; esac ]) ]) diff --git a/m4/fcntl.m4 b/m4/fcntl.m4 index 524a99a..02b93f8 100644 --- a/m4/fcntl.m4 +++ b/m4/fcntl.m4 @@ -1,5 +1,5 @@ # fcntl.m4 serial 11 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/fcntl_h.m4 b/m4/fcntl_h.m4 index 68f4e64..ba4eb44 100644 --- a/m4/fcntl_h.m4 +++ b/m4/fcntl_h.m4 @@ -1,6 +1,6 @@ # serial 20 # Configure fcntl.h. -dnl Copyright (C) 2006-2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2007, 2009-2024 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/m4/fdopendir.m4 b/m4/fdopendir.m4 index dfcc46c..bf361ff 100644 --- a/m4/fdopendir.m4 +++ b/m4/fdopendir.m4 @@ -1,7 +1,7 @@ # serial 15 # See if we need to provide fdopendir. -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/fflush.m4 b/m4/fflush.m4 index 3e3c890..85cf3be 100644 --- a/m4/fflush.m4 +++ b/m4/fflush.m4 @@ -1,6 +1,6 @@ -# fflush.m4 serial 18 +# fflush.m4 serial 19 -# Copyright (C) 2007-2023 Free Software Foundation, Inc. +# Copyright (C) 2007-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -79,9 +79,9 @@ AC_DEFUN([gl_FUNC_FFLUSH_STDIN], [gl_cv_func_fflush_stdin=yes], [gl_cv_func_fflush_stdin=no], [case "$host_os" in - # Guess no on native Windows. - mingw*) gl_cv_func_fflush_stdin="guessing no" ;; - *) gl_cv_func_fflush_stdin=cross ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_fflush_stdin="guessing no" ;; + *) gl_cv_func_fflush_stdin=cross ;; esac ]) rm conftest.txt diff --git a/m4/filenamecat.m4 b/m4/filenamecat.m4 index 3dab236..7feb7f8 100644 --- a/m4/filenamecat.m4 +++ b/m4/filenamecat.m4 @@ -1,5 +1,5 @@ # filenamecat.m4 serial 12 -dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2024 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/m4/findprog-in.m4 b/m4/findprog-in.m4 index 394f79a..4979125 100644 --- a/m4/findprog-in.m4 +++ b/m4/findprog-in.m4 @@ -1,5 +1,5 @@ # findprog-in.m4 serial 1 -dnl Copyright (C) 2003, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2024 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/m4/flexmember.m4 b/m4/flexmember.m4 index 13f7e87..9df6c03 100644 --- a/m4/flexmember.m4 +++ b/m4/flexmember.m4 @@ -1,7 +1,7 @@ # serial 5 # Check for flexible array member support. -# Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/float_h.m4 b/m4/float_h.m4 index 2f0c9c4..60e8144 100644 --- a/m4/float_h.m4 +++ b/m4/float_h.m4 @@ -1,5 +1,5 @@ -# float_h.m4 serial 13 -dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. +# float_h.m4 serial 14 +dnl Copyright (C) 2007, 2009-2024 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. @@ -84,9 +84,11 @@ int main () [gl_cv_func_itold_works="guessing no"], [gl_cv_func_itold_works="guessing yes"]) ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_itold_works="guessing yes" ;; - *) gl_cv_func_itold_works="guessing yes" ;; + # Guess yes on native Windows. + mingw* | windows*) + gl_cv_func_itold_works="guessing yes" ;; + *) + gl_cv_func_itold_works="guessing yes" ;; esac ]) ]) diff --git a/m4/flock.m4 b/m4/flock.m4 index e547876..72f52bb 100644 --- a/m4/flock.m4 +++ b/m4/flock.m4 @@ -1,5 +1,5 @@ # flock.m4 serial 4 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/fnmatch.m4 b/m4/fnmatch.m4 index 895db13..54d5c7b 100644 --- a/m4/fnmatch.m4 +++ b/m4/fnmatch.m4 @@ -1,6 +1,6 @@ -# Check for fnmatch - serial 16. -*- coding: utf-8 -*- +# Check for fnmatch - serial 20 -*- coding: utf-8 -*- -# Copyright (C) 2000-2007, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2000-2007, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], m4_divert_text([DEFAULTS], [gl_fnmatch_required=POSIX]) AC_REQUIRE([gl_FNMATCH_H]) - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([AC_CANONICAL_HOST]) gl_fnmatch_required_lowercase=` echo $gl_fnmatch_required | LC_ALL=C tr '[[A-Z]]' '[[a-z]]' ` @@ -40,6 +40,8 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include + #include + #include static int y (char const *pattern, char const *string, int flags) { @@ -60,60 +62,96 @@ 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 + 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 + exists in glibc 2.12, fixed in glibc 2.13. */ + if (!y ("[/b", "[/b", 0)) /*"]]"*/ + result |= 4; + /* glibc bug + is fixed in glibc 2.20. + glibc bugs + + are fixed in glibc 2.22. + These bugs are not easy to test for reliably (without mmap), + therefore test the glibc version. */ + #if defined __GLIBC__ + if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 22) + result |= 4; + #endif + /* 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"], @@ -131,6 +169,24 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], *yes) ;; *) REPLACE_FNMATCH=1 ;; esac + dnl On AIX 7.2 in 32-bit mode, fnmatch()'s only POSIX compliance problem is + dnl that is does not support characters outside the Unicode BMP correctly. + dnl Test case: fnmatch ("x?y", "x\360\237\230\213y", 0) == 0 + dnl This is due to wchar_t being only 16 bits wide. + AC_REQUIRE([gl_UCHAR_H]) + if test $SMALL_WCHAR_T = 1; then + case "$host_os" in + cygwin*) + dnl On Cygwin < 3.5.0, the above $gl_fnmatch_result came out as 'no', + dnl On Cygwin >= 3.5.0, fnmatch supports all Unicode characters, + dnl despite wchar_t being only 16 bits wide (because internally it + dnl works on wint_t values). + ;; + *) + REPLACE_FNMATCH=1 + ;; + esac + fi fi if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then gl_REPLACE_FNMATCH_H diff --git a/m4/fnmatch_h.m4 b/m4/fnmatch_h.m4 index 40a62b6..58cd7dc 100644 --- a/m4/fnmatch_h.m4 +++ b/m4/fnmatch_h.m4 @@ -1,5 +1,5 @@ # fnmatch_h.m4 serial 8 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/fopen.m4 b/m4/fopen.m4 index 7daa4ca..1fcffa4 100644 --- a/m4/fopen.m4 +++ b/m4/fopen.m4 @@ -1,5 +1,5 @@ -# fopen.m4 serial 15 -dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. +# fopen.m4 serial 16 +dnl Copyright (C) 2007-2024 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,7 @@ AC_DEFUN([gl_FUNC_FOPEN_ITSELF], AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in - mingw* | pw*) + mingw* | windows* | pw*) dnl Replace fopen, for handling of "/dev/null". REPLACE_FOPEN=1 dnl fopen on mingw also has the trailing slash bug. @@ -136,7 +136,7 @@ int main () linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl* | midipix*) gl_cv_func_fopen_mode_e="guessing yes" ;; # Guess no on native Windows. - mingw*) + mingw* | windows*) gl_cv_func_fopen_mode_e="guessing no" ;; # If we don't know, obey --enable-cross-guesses. *) diff --git a/m4/fpurge.m4 b/m4/fpurge.m4 index fe25596..e9b7050 100644 --- a/m4/fpurge.m4 +++ b/m4/fpurge.m4 @@ -1,5 +1,5 @@ # fpurge.m4 serial 14 -dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2024 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/m4/freading.m4 b/m4/freading.m4 index f0f4893..9a95cba 100644 --- a/m4/freading.m4 +++ b/m4/freading.m4 @@ -1,5 +1,5 @@ # freading.m4 serial 3 -dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2024 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/m4/free.m4 b/m4/free.m4 index 0389dea..4f6dc2e 100644 --- a/m4/free.m4 +++ b/m4/free.m4 @@ -1,5 +1,5 @@ # free.m4 serial 6 -# Copyright (C) 2003-2005, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-2005, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/fseek.m4 b/m4/fseek.m4 index c5fe688..4d72ac5 100644 --- a/m4/fseek.m4 +++ b/m4/fseek.m4 @@ -1,5 +1,5 @@ # fseek.m4 serial 4 -dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2024 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/m4/fseeko.m4 b/m4/fseeko.m4 index 05ee06b..cf11a9c 100644 --- a/m4/fseeko.m4 +++ b/m4/fseeko.m4 @@ -1,5 +1,5 @@ # fseeko.m4 serial 20 -dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2024 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/m4/fstat.m4 b/m4/fstat.m4 index 7cb2edb..5e73b4e 100644 --- a/m4/fstat.m4 +++ b/m4/fstat.m4 @@ -1,5 +1,5 @@ -# fstat.m4 serial 8 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +# fstat.m4 serial 10 +dnl Copyright (C) 2011-2024 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,10 +10,10 @@ AC_DEFUN([gl_FUNC_FSTAT], AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) case "$host_os" in - mingw* | solaris*) + darwin* | mingw* | windows* | solaris*) + dnl macOS and Solaris stat can return a negative tv_nsec. dnl On MinGW, the original stat() returns st_atime, st_mtime, dnl st_ctime values that are affected by the time zone. - dnl Solaris stat can return a negative tv_nsec. REPLACE_FSTAT=1 ;; esac diff --git a/m4/fstatat.m4 b/m4/fstatat.m4 index 0830769..c22569b 100644 --- a/m4/fstatat.m4 +++ b/m4/fstatat.m4 @@ -1,5 +1,5 @@ -# fstatat.m4 serial 4 -dnl Copyright (C) 2004-2023 Free Software Foundation, Inc. +# fstatat.m4 serial 5 +dnl Copyright (C) 2004-2024 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,7 +50,7 @@ AC_DEFUN([gl_FUNC_FSTATAT], esac case $host_os in - solaris*) + darwin* | solaris*) REPLACE_FSTATAT=1 ;; esac diff --git a/m4/ftell.m4 b/m4/ftell.m4 index 79f1aaf..a38ec5f 100644 --- a/m4/ftell.m4 +++ b/m4/ftell.m4 @@ -1,5 +1,5 @@ # ftell.m4 serial 3 -dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2024 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/m4/ftello.m4 b/m4/ftello.m4 index e13fcd9..bda8d6a 100644 --- a/m4/ftello.m4 +++ b/m4/ftello.m4 @@ -1,5 +1,5 @@ -# ftello.m4 serial 15 -dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. +# ftello.m4 serial 16 +dnl Copyright (C) 2007-2024 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. @@ -46,7 +46,7 @@ AC_DEFUN([gl_FUNC_FTELLO], dnl designates a pipe. See also dnl https://github.com/python/cpython/issues/78961#issuecomment-1093800325 case "$host_os" in - mingw*) REPLACE_FTELLO=1 ;; + mingw* | windows*) REPLACE_FTELLO=1 ;; esac fi if test $REPLACE_FTELLO = 0; then @@ -62,12 +62,12 @@ AC_DEFUN([gl_FUNC_FTELLO], dnl be opened. changequote(,)dnl case "$host_os" in - # Guess no on Solaris. - solaris*) gl_cv_func_ftello_works="guessing no" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_ftello_works="guessing yes" ;; - # Guess yes otherwise. - *) gl_cv_func_ftello_works="guessing yes" ;; + # Guess no on Solaris. + solaris*) gl_cv_func_ftello_works="guessing no" ;; + # Guess yes on native Windows. + mingw* | windows*) gl_cv_func_ftello_works="guessing yes" ;; + # Guess yes otherwise. + *) gl_cv_func_ftello_works="guessing yes" ;; esac changequote([,])dnl AC_RUN_IFELSE( diff --git a/m4/futimens.m4 b/m4/futimens.m4 index dc0b21b..ac961e7 100644 --- a/m4/futimens.m4 +++ b/m4/futimens.m4 @@ -1,7 +1,7 @@ # serial 11 # See if we need to provide futimens replacement. -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/getaddrinfo.m4 b/m4/getaddrinfo.m4 index 15f09ff..371136c 100644 --- a/m4/getaddrinfo.m4 +++ b/m4/getaddrinfo.m4 @@ -1,5 +1,5 @@ -# getaddrinfo.m4 serial 34 -dnl Copyright (C) 2004-2023 Free Software Foundation, Inc. +# getaddrinfo.m4 serial 35 +dnl Copyright (C) 2004-2024 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. @@ -41,7 +41,7 @@ AC_DEFUN([gl_GETADDRINFO], AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32], gl_cv_w32_getaddrinfo, [ gl_cv_w32_getaddrinfo=no - am_save_LIBS="$LIBS" + gl_saved_LIBS="$LIBS" LIBS="$LIBS -lws2_32" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_WS2TCPIP_H @@ -49,7 +49,7 @@ AC_DEFUN([gl_GETADDRINFO], #endif #include ]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], [gl_cv_w32_getaddrinfo=yes]) - LIBS="$am_save_LIBS" + LIBS="$gl_saved_LIBS" ]) if test "$gl_cv_w32_getaddrinfo" = "yes"; then GETADDRINFO_LIB="-lws2_32" diff --git a/m4/getcwd-abort-bug.m4 b/m4/getcwd-abort-bug.m4 index cd1240c..11f6a8a 100644 --- a/m4/getcwd-abort-bug.m4 +++ b/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-2023 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/getcwd-path-max.m4 b/m4/getcwd-path-max.m4 index 516c078..d30e75a 100644 --- a/m4/getcwd-path-max.m4 +++ b/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-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-2007, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/getcwd.m4 b/m4/getcwd.m4 index e95db05..ed3d7b6 100644 --- a/m4/getcwd.m4 +++ b/m4/getcwd.m4 @@ -1,12 +1,12 @@ # getcwd.m4 - check for working getcwd that is compatible with glibc -# Copyright (C) 2001, 2003-2007, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Paul Eggert. -# serial 20 +# serial 22 AC_DEFUN([gl_FUNC_GETCWD_NULL], [ @@ -21,11 +21,8 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL], # else /* on Windows with MSVC */ # include # endif - ]GL_MDA_DEFINES[ -# ifndef getcwd - char *getcwd (); -# endif -]], [[ + ]GL_MDA_DEFINES], + [[ #if defined _WIN32 && ! defined __CYGWIN__ /* mingw cwd does not start with '/', but _getcwd does allocate. However, mingw fails to honor non-zero size. */ @@ -116,7 +113,7 @@ AC_DEFUN([gl_FUNC_GETCWD], gl_abort_bug=no case "$host_os" in - mingw*) + mingw* | windows*) gl_cv_func_getcwd_path_max=yes ;; *) diff --git a/m4/getdelim.m4 b/m4/getdelim.m4 index 60555b9..0dbd8bc 100644 --- a/m4/getdelim.m4 +++ b/m4/getdelim.m4 @@ -1,6 +1,6 @@ # getdelim.m4 serial 19 -dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2024 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, diff --git a/m4/getdtablesize.m4 b/m4/getdtablesize.m4 index 8bcda90..3b89456 100644 --- a/m4/getdtablesize.m4 +++ b/m4/getdtablesize.m4 @@ -1,5 +1,5 @@ # getdtablesize.m4 serial 8 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/getgroups.m4 b/m4/getgroups.m4 index 241fec8..f6e0cbd 100644 --- a/m4/getgroups.m4 +++ b/m4/getgroups.m4 @@ -1,9 +1,9 @@ -# serial 24 +# serial 25 dnl From Jim Meyering. dnl A wrapper around AC_FUNC_GETGROUPS. -# Copyright (C) 1996-1997, 1999-2004, 2008-2023 Free Software Foundation, Inc. +# Copyright (C) 1996-1997, 1999-2004, 2008-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ AC_DEFUN([AC_FUNC_GETGROUPS], # If we don't yet have getgroups, see if it's in -lbsd. # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1. - ac_save_LIBS=$LIBS + gl_saved_LIBS=$LIBS if test $ac_cv_func_getgroups = no; then AC_CHECK_LIB(bsd, getgroups, [GETGROUPS_LIB=-lbsd]) fi @@ -56,7 +56,7 @@ AC_DEFUN([AC_FUNC_GETGROUPS], [Define to 1 if your system has a working `getgroups' function.]) ;; esac - LIBS=$ac_save_LIBS + LIBS=$gl_saved_LIBS ])# AC_FUNC_GETGROUPS AC_DEFUN([gl_FUNC_GETGROUPS], diff --git a/m4/getline.m4 b/m4/getline.m4 index 83e7e93..1a7e890 100644 --- a/m4/getline.m4 +++ b/m4/getline.m4 @@ -1,6 +1,6 @@ # getline.m4 serial 33 -dnl Copyright (C) 1998-2003, 2005-2007, 2009-2023 Free Software Foundation, +dnl Copyright (C) 1998-2003, 2005-2007, 2009-2024 Free Software Foundation, dnl Inc. dnl dnl This file is free software; the Free Software Foundation diff --git a/m4/getopt.m4 b/m4/getopt.m4 index 7981a09..be812d8 100644 --- a/m4/getopt.m4 +++ b/m4/getopt.m4 @@ -1,5 +1,5 @@ -# getopt.m4 serial 48 -dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc. +# getopt.m4 serial 49 +dnl Copyright (C) 2002-2006, 2008-2024 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. @@ -197,8 +197,8 @@ main () fi else case "$host_os" in - darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; - *) gl_cv_func_getopt_posix="guessing yes";; + darwin* | aix* | mingw* | windows*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; esac fi ]) diff --git a/m4/getpagesize.m4 b/m4/getpagesize.m4 index 79925a7..35dc257 100644 --- a/m4/getpagesize.m4 +++ b/m4/getpagesize.m4 @@ -1,5 +1,5 @@ -# getpagesize.m4 serial 10 -dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2023 Free Software Foundation, +# getpagesize.m4 serial 11 +dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2024 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, @@ -22,7 +22,7 @@ AC_DEFUN([gl_FUNC_GETPAGESIZE], fi fi case "$host_os" in - mingw*) + mingw* | windows*) REPLACE_GETPAGESIZE=1 ;; esac diff --git a/m4/getpass.m4 b/m4/getpass.m4 index 27a31f8..79afe08 100644 --- a/m4/getpass.m4 +++ b/m4/getpass.m4 @@ -1,5 +1,5 @@ # getpass.m4 serial 20 -dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2024 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/m4/getprogname.m4 b/m4/getprogname.m4 index 2b741f5..b8f9f23 100644 --- a/m4/getprogname.m4 +++ b/m4/getprogname.m4 @@ -1,6 +1,6 @@ # getprogname.m4 - check for getprogname or replacements for it -# Copyright (C) 2016-2023 Free Software Foundation, Inc. +# Copyright (C) 2016-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/getrandom.m4 b/m4/getrandom.m4 index 7b7f9ce..55be445 100644 --- a/m4/getrandom.m4 +++ b/m4/getrandom.m4 @@ -1,5 +1,5 @@ -# getrandom.m4 serial 11 -dnl Copyright 2020-2023 Free Software Foundation, Inc. +# getrandom.m4 serial 13 +dnl Copyright 2020-2024 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,6 +9,8 @@ dnl Written by Paul Eggert. AC_DEFUN([gl_FUNC_GETRANDOM], [ AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + gl_CHECK_FUNCS_ANDROID([getrandom], [[/* Additional includes are needed before on uClibc and Mac OS X. */ @@ -45,7 +47,7 @@ AC_DEFUN([gl_FUNC_GETRANDOM], fi case "$host_os" in - mingw*) + mingw* | windows*) AC_CHECK_HEADERS([bcrypt.h], [], [], [[#include ]]) diff --git a/m4/gettext.m4 b/m4/gettext.m4 index f449240..16f9db1 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -1,5 +1,5 @@ -# gettext.m4 serial 72 (gettext-0.21.1) -dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc. +# gettext.m4 serial 78 (gettext-0.22.4) +dnl Copyright (C) 1995-2014, 2016, 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. @@ -20,11 +20,13 @@ dnl Bruno Haible , 2000-2006, 2008-2010. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). -dnl INTLSYMBOL must be one of 'external', 'use-libtool'. -dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and -dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'. -dnl If INTLSYMBOL is 'use-libtool', then a libtool library -dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, +dnl INTLSYMBOL must be one of 'external', 'use-libtool', 'here'. +dnl INTLSYMBOL should be 'external' for packages other than GNU gettext. +dnl It should be 'use-libtool' for the packages 'gettext-runtime' and +dnl 'gettext-tools'. +dnl It should be 'here' for the package 'gettext-runtime/intl'. +dnl If INTLSYMBOL is 'here', then a libtool library +dnl $(top_builddir)/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext @@ -55,24 +57,21 @@ dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. - m4_if([$1], [], , [m4_if([$1], [external], , [m4_if([$1], [use-libtool], , + m4_if([$1], [], , [m4_if([$1], [external], , [m4_if([$1], [use-libtool], , [m4_if([$1], [here], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT -])])])]) +])])])])]) m4_if(m4_if([$1], [], [old])[]m4_if([$1], [no-libtool], [old]), [old], [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported. ])]) m4_if([$2], [], , [m4_if([$2], [need-ngettext], , [m4_if([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) - define([gt_included_intl], - m4_if([$1], [external], [no], [yes])) + define([gt_building_libintl_in_same_build_tree], + m4_if([$1], [use-libtool], [yes], [m4_if([$1], [here], [yes], [no])])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl - m4_if(gt_included_intl, yes, [ - AC_REQUIRE([AM_INTL_SUBDIR])dnl - ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) @@ -82,13 +81,13 @@ AC_DEFUN([AM_GNU_GETTEXT], dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then - dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT + dnl tests. But if configure.ac invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it. - m4_if(gt_included_intl, yes, , [ + m4_if(gt_building_libintl_in_same_build_tree, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) @@ -98,8 +97,7 @@ AC_DEFUN([AM_GNU_GETTEXT], dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) - m4_if(gt_included_intl, yes, [ - BUILD_INCLUDED_LIBINTL=no + m4_if(gt_building_libintl_in_same_build_tree, yes, [ USE_INCLUDED_LIBINTL=no ]) LIBINTL= @@ -118,7 +116,7 @@ AC_DEFUN([AM_GNU_GETTEXT], dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no - m4_if(gt_included_intl, yes, [ + m4_if(gt_building_libintl_in_same_build_tree, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], @@ -174,7 +172,7 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. - m4_if(gt_included_intl, yes, , [ + m4_if(gt_building_libintl_in_same_build_tree, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL @@ -212,9 +210,16 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) - dnl Now see whether libintl exists and depends on libiconv. - if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then - LIBS="$LIBS $LIBICONV" + dnl Now see whether libintl exists and depends on libiconv or other + dnl OS dependent libraries, specifically on macOS and AIX. + gt_LIBINTL_EXTRA="$INTL_MACOSX_LIBS" + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + aix*) gt_LIBINTL_EXTRA="-lpthread" ;; + esac + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } \ + && { test -n "$LIBICONV" || test -n "$gt_LIBINTL_EXTRA"; }; then + LIBS="$LIBS $LIBICONV $gt_LIBINTL_EXTRA" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ @@ -236,8 +241,8 @@ $gt_revision_test_code bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], - [LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" + [LIBINTL="$LIBINTL $LIBICONV $gt_LIBINTL_EXTRA" + LTLIBINTL="$LTLIBINTL $LTLIBICONV $gt_LIBINTL_EXTRA" eval "$gt_func_gnugettext_libintl=yes" ]) fi @@ -252,7 +257,8 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ - && test "$PACKAGE" != gettext-tools; }; then + && test "$PACKAGE" != gettext-tools \ + && test "$PACKAGE" != libintl; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. @@ -261,7 +267,7 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION INCINTL= fi - m4_if(gt_included_intl, yes, [ + m4_if(gt_building_libintl_in_same_build_tree, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. @@ -271,7 +277,6 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. - BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD" LTLIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD" @@ -341,25 +346,39 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION POSUB=po fi - m4_if(gt_included_intl, yes, [ - dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes' - dnl because some of the testsuite requires it. - BUILD_INCLUDED_LIBINTL=yes - + m4_if(gt_building_libintl_in_same_build_tree, yes, [ dnl Make all variables we use known to autoconf. - AC_SUBST([BUILD_INCLUDED_LIBINTL]) AC_SUBST([USE_INCLUDED_LIBINTL]) AC_SUBST([CATOBJEXT]) ]) - dnl For backward compatibility. Some Makefiles may be using this. - INTLLIBS="$LIBINTL" - AC_SUBST([INTLLIBS]) + m4_if(gt_building_libintl_in_same_build_tree, yes, [], [ + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST([INTLLIBS]) + ]) dnl Make all documented variables known to autoconf. AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) AC_SUBST([POSUB]) + + dnl Define localedir_c and localedir_c_make. + dnl Find the final value of localedir. + gt_save_prefix="${prefix}" + gt_save_datarootdir="${datarootdir}" + gt_save_localedir="${localedir}" + dnl Unfortunately, prefix gets only finally determined at the end of + dnl configure. + if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" + fi + eval datarootdir="$datarootdir" + eval localedir="$localedir" + gl_BUILD_TO_HOST([localedir]) + localedir="${gt_save_localedir}" + datarootdir="${gt_save_datarootdir}" + prefix="${gt_save_prefix}" ]) diff --git a/m4/gettime.m4 b/m4/gettime.m4 index ec1f97e..1ec018d 100644 --- a/m4/gettime.m4 +++ b/m4/gettime.m4 @@ -1,5 +1,5 @@ -# gettime.m4 serial 14 -dnl Copyright (C) 2002, 2004-2006, 2009-2023 Free Software Foundation, Inc. +# gettime.m4 serial 15 +dnl Copyright (C) 2002, 2004-2006, 2009-2024 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. @@ -64,5 +64,5 @@ AC_DEFUN([gl_GETTIME_RES], dnl Prerequisites of lib/gettime-res.c. AC_REQUIRE([gl_CLOCK_TIME]) AC_REQUIRE([gl_TIMESPEC]) - AC_CHECK_FUNCS_ONCE([timespec_getres]) + gl_CHECK_FUNCS_ANDROID([timespec_getres], [[#include ]]) ]) diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 index 5051d61..3526991 100644 --- a/m4/gettimeofday.m4 +++ b/m4/gettimeofday.m4 @@ -1,6 +1,6 @@ -# serial 29 +# serial 30 -# Copyright (C) 2001-2003, 2005, 2007, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2001-2003, 2005, 2007, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -57,7 +57,7 @@ int gettimeofday (struct timeval *restrict, struct timezone *restrict); dnl On mingw, the original gettimeofday has only a precision of 15.6 dnl milliseconds. So override it. case "$host_os" in - mingw*) REPLACE_GETTIMEOFDAY=1 ;; + mingw* | windows*) REPLACE_GETTIMEOFDAY=1 ;; esac fi AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], diff --git a/m4/gl-openssl.m4 b/m4/gl-openssl.m4 index 7eab4e1..7f38955 100644 --- a/m4/gl-openssl.m4 +++ b/m4/gl-openssl.m4 @@ -1,5 +1,5 @@ -# gl-openssl.m4 serial 6 -dnl Copyright (C) 2013-2023 Free Software Foundation, Inc. +# gl-openssl.m4 serial 7 +dnl Copyright (C) 2013-2024 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. @@ -39,6 +39,9 @@ AC_DEFUN([gl_CRYPTO_CHECK], AC_SUBST([LIB_CRYPTO]) if test "x$with_openssl" != xno; then if test "x$with_openssl" = xauto-gpl-compat; then + dnl OpenSSL versions < 3 are under the OpenSSL license, which is not + dnl GPL compatible. + dnl See . AC_CACHE_CHECK([whether openssl is GPL compatible], [gl_cv_openssl_gpl_compat], [AC_COMPILE_IFELSE( diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index edb8572..d8d0904 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 86 -dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. +# gnulib-common.m4 serial 92 +dnl Copyright (C) 2007-2024 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. @@ -76,48 +76,58 @@ AC_DEFUN([gl_COMMON_BODY], [ #endif]) AH_VERBATIM([attribute], [/* Attributes. */ -#if (defined __has_attribute \ - && (!defined __clang_minor__ \ - || (defined __apple_build_version__ \ - ? 6000000 <= __apple_build_version__ \ - : 5 <= __clang_major__))) -# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__) -#else -# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr -# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3) -# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2) -# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3) -# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3) -# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95) -# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1) -# define _GL_ATTR_diagnose_if 0 -# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3) -# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1) -# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0) -# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7) -# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6) -# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0) -# ifdef _ICC -# define _GL_ATTR_may_alias 0 +/* Define _GL_HAS_ATTRIBUTE only once, because on FreeBSD, with gcc < 5, if + gets included once again after , __has_attribute(x) + expands to 0 always, and redefining _GL_HAS_ATTRIBUTE would turn off all + attributes. */ +#ifndef _GL_HAS_ATTRIBUTE +# if (defined __has_attribute \ + && (!defined __clang_minor__ \ + || (defined __apple_build_version__ \ + ? 7000000 <= __apple_build_version__ \ + : 5 <= __clang_major__))) +# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__) # else -# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3) +# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr +# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2) +# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95) +# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1) +# define _GL_ATTR_diagnose_if 0 +# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1) +# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0) +# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7) +# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6) +# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0) +# ifdef _ICC +# define _GL_ATTR_may_alias 0 +# else +# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3) +# endif +# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1) +# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3) +# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0) +# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3) +# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7) +# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96) +# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9) +# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0) +# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7) +# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4) # endif -# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1) -# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3) -# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0) -# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3) -# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7) -# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96) -# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9) -# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0) -# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7) -# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4) #endif -/* 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" +/* Use __has_c_attribute if available. However, do not use with + pre-C23 GCC, which can issue false positives if -Wpedantic. */ +#if (defined __has_c_attribute \ + && ! (_GL_GNUC_PREREQ (4, 6) \ + && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710)) +# define _GL_HAVE___HAS_C_ATTRIBUTE 1 +#else +# define _GL_HAVE___HAS_C_ATTRIBUTE 0 #endif /* Define if, in a function declaration, the attributes in bracket syntax @@ -242,7 +252,7 @@ AC_DEFUN([gl_COMMON_BODY], [ in C++ also: namespace, class, template specialization. */ #ifndef _GL_ATTRIBUTE_DEPRECATED # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE -# ifdef __has_c_attribute +# if _GL_HAVE___HAS_C_ATTRIBUTE # if __has_c_attribute (__deprecated__) # define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]] # endif @@ -291,7 +301,7 @@ AC_DEFUN([gl_COMMON_BODY], [ /* Applies to: Empty statement (;), inside a 'switch' statement. */ /* Always expands to something. */ #ifndef _GL_ATTRIBUTE_FALLTHROUGH -# ifdef __has_c_attribute +# if _GL_HAVE___HAS_C_ATTRIBUTE # if __has_c_attribute (__fallthrough__) # define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]] # endif @@ -380,7 +390,7 @@ AC_DEFUN([gl_COMMON_BODY], [ # if !defined __apple_build_version__ && __clang_major__ >= 10 # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] # endif -# elif defined __has_c_attribute +# elif _GL_HAVE___HAS_C_ATTRIBUTE # if __has_c_attribute (__maybe_unused__) # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] # endif @@ -411,7 +421,7 @@ AC_DEFUN([gl_COMMON_BODY], [ # if __clang_major__ >= 1000 # define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] # endif -# elif defined __has_c_attribute +# elif _GL_HAVE___HAS_C_ATTRIBUTE # if __has_c_attribute (__nodiscard__) # define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] # endif @@ -466,11 +476,25 @@ AC_DEFUN([gl_COMMON_BODY], [ /* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. */ /* Applies to: functions. */ +/* After a function's parameter list, this attribute must come first, before + other attributes. */ #ifndef _GL_ATTRIBUTE_NOTHROW -# if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus -# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__)) +# if defined __cplusplus +# if _GL_GNUC_PREREQ (2, 8) || __clang_major >= 4 +# if __cplusplus >= 201103L +# define _GL_ATTRIBUTE_NOTHROW noexcept (true) +# else +# define _GL_ATTRIBUTE_NOTHROW throw () +# endif +# else +# define _GL_ATTRIBUTE_NOTHROW +# endif # else -# define _GL_ATTRIBUTE_NOTHROW +# if _GL_HAS_ATTRIBUTE (nothrow) +# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__)) +# else +# define _GL_ATTRIBUTE_NOTHROW +# endif # endif #endif @@ -1056,6 +1080,7 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS], dnl -Wno-pedantic >= 4.8 >= 3.9 dnl -Wno-sign-compare >= 3 >= 3.9 dnl -Wno-sign-conversion >= 4.3 >= 3.9 + dnl -Wno-tautological-out-of-range-compare - >= 3.9 dnl -Wno-type-limits >= 4.3 >= 3.9 dnl -Wno-undef >= 3 >= 3.9 dnl -Wno-unsuffixed-float-constants >= 4.5 @@ -1081,6 +1106,9 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS], #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wno-pedantic #endif + #if 3 < __clang_major__ + (9 <= __clang_minor__) + -Wno-tautological-constant-out-of-range-compare + #endif #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wno-sign-conversion -Wno-type-limits @@ -1144,12 +1172,12 @@ AC_DEFUN([gl_PREPARE_CHECK_FUNCS_MACOS], 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" + saved_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" + ac_compile="$saved_ac_compile" else gl_cv_compiler_check_future_option=none fi @@ -1197,14 +1225,14 @@ 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" + saved_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" + saved_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_compile="$saved_ac_compile" + ac_compile_for_check_decl="$saved_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 diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index d0c35e8..96bbdc2 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2023 Free Software Foundation, Inc. +# Copyright (C) 2002-2024 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 @@ -60,6 +60,7 @@ AC_DEFUN([gl_EARLY], # Code from module binary-io: # Code from module bind: # Code from module bitrotate: + # Code from module btoc32: # Code from module btowc: # Code from module builtin-expect: # Code from module byteswap: @@ -67,6 +68,22 @@ AC_DEFUN([gl_EARLY], # Code from module c-strcase: # Code from module c-strcaseeq: # Code from module c-strcasestr: + # Code from module c32_apply_type_test: + # Code from module c32_get_type_test: + # Code from module c32isalnum: + # Code from module c32isalpha: + # Code from module c32isblank: + # Code from module c32iscntrl: + # Code from module c32isdigit: + # Code from module c32isgraph: + # Code from module c32islower: + # Code from module c32isprint: + # Code from module c32ispunct: + # Code from module c32isspace: + # Code from module c32isupper: + # Code from module c32isxdigit: + # Code from module c32tolower: + # Code from module c32width: # Code from module c99: # Code from module calloc-gnu: # Code from module calloc-posix: @@ -99,6 +116,7 @@ AC_DEFUN([gl_EARLY], # Code from module dirfd: # Code from module dirname: # Code from module dirname-lgpl: + # Code from module do-release-commit-and-tag: # Code from module double-slash-root: # Code from module dup: # Code from module dup2: @@ -191,7 +209,9 @@ AC_DEFUN([gl_EARLY], # Code from module ioctl: # Code from module isblank: # Code from module iswblank: + # Code from module iswctype: # Code from module iswdigit: + # Code from module iswpunct: # Code from module iswxdigit: # Code from module langinfo: # Code from module largefile: @@ -213,9 +233,12 @@ AC_DEFUN([gl_EARLY], # Code from module malloca: # Code from module mbchar: # Code from module mbiter: + # Code from module mbrtoc32: # Code from module mbrtowc: # Code from module mbsinit: + # Code from module mbsrtoc32s: # Code from module mbsrtowcs: + # Code from module mbszero: # Code from module mbtowc: # Code from module memchr: # Code from module mempcpy: @@ -282,6 +305,7 @@ AC_DEFUN([gl_EARLY], # Code from module send: # Code from module servent: # Code from module setlocale-null: + # Code from module setlocale-null-unlocked: # Code from module setsockopt: # Code from module sh-filename: # Code from module sigaction: @@ -350,6 +374,7 @@ AC_DEFUN([gl_EARLY], # Code from module timespec: # Code from module tmpdir: # Code from module u64: + # Code from module uchar: # Code from module unicase/base: # Code from module unicase/cased: # Code from module unicase/empty-prefix-context: @@ -361,6 +386,18 @@ AC_DEFUN([gl_EARLY], # Code from module unicase/u8-tolower: # Code from module unictype/base: # Code from module unictype/combining-class: + # Code from module unictype/ctype-alnum: + # Code from module unictype/ctype-alpha: + # Code from module unictype/ctype-blank: + # Code from module unictype/ctype-cntrl: + # Code from module unictype/ctype-digit: + # Code from module unictype/ctype-graph: + # Code from module unictype/ctype-lower: + # Code from module unictype/ctype-print: + # Code from module unictype/ctype-punct: + # Code from module unictype/ctype-space: + # Code from module unictype/ctype-upper: + # Code from module unictype/ctype-xdigit: # Code from module unictype/property-soft-dotted: # Code from module uninorm/base: # Code from module uninorm/decompose-internal: @@ -368,6 +405,11 @@ AC_DEFUN([gl_EARLY], # Code from module unistd: # Code from module unistd-safer: # Code from module unistr/base: + # Code from module unistr/u32-chr: + # Code from module unistr/u32-cpy: + # Code from module unistr/u32-pcpy: + # Code from module unistr/u32-strcat: + # Code from module unistr/u32-strlen: # Code from module unistr/u8-cpy: # Code from module unistr/u8-mbtouc-unsafe: # Code from module unistr/u8-strlen: @@ -394,6 +436,7 @@ AC_DEFUN([gl_EARLY], # Code from module warnings: # Code from module wchar: # Code from module wcrtomb: + # Code from module wctype: # Code from module wctype-h: # Code from module wcwidth: # Code from module windows-mutex: @@ -453,6 +496,7 @@ AC_DEFUN([gl_INIT], AC_REQUIRE([gl_SYS_SOCKET_H]) gl_CONDITIONAL([GL_COND_OBJ_BIND], [test "$ac_cv_header_winsock2_h" = yes]) gl_SYS_SOCKET_MODULE_INDICATOR([bind]) + gl_UCHAR_MODULE_INDICATOR([btoc32]) gl_FUNC_BTOWC gl_CONDITIONAL([GL_COND_OBJ_BTOWC], [test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1]) @@ -464,6 +508,92 @@ AC_DEFUN([gl_INIT], gl_BYTESWAP gl_CONDITIONAL_HEADER([byteswap.h]) AC_PROG_MKDIR_P + gl_UCHAR_MODULE_INDICATOR([c32_apply_type_test]) + gl_UCHAR_MODULE_INDICATOR([c32_get_type_test]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32isalnum]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32isalpha]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32isblank]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32iscntrl]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32isdigit]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32isgraph]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32islower]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32isprint]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32ispunct]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32isspace]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32isupper]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32isxdigit]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32tolower]) + AC_REQUIRE([gl_UCHAR_H]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how mbrtoc32 is implemented. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + gl_UCHAR_MODULE_INDICATOR([c32width]) gl_FUNC_CALLOC_GNU if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 1; then AC_LIBOBJ([calloc]) @@ -550,7 +680,7 @@ AC_DEFUN([gl_INIT], AC_PROG_MKDIR_P AC_REQUIRE([gl_ERROR_H]) gl_ERROR - gl_CONDITIONAL([GL_COND_OBJ_ERROR], [test $GL_GENERATE_ERROR_H = true]) + gl_CONDITIONAL([GL_COND_OBJ_ERROR], [test $COMPILE_ERROR_C = 1]) AM_COND_IF([GL_COND_OBJ_ERROR], [ gl_PREREQ_ERROR ]) @@ -558,12 +688,12 @@ AC_DEFUN([gl_INIT], [AM_][XGETTEXT_OPTION([--flag=error:3:c-format]) AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) gl_ERROR_H - gl_CONDITIONAL_HEADER([error.h]) AC_PROG_MKDIR_P AC_REQUIRE([gl_EXTERN_INLINE]) gl_FATAL_SIGNAL gl_FUNC_FCHDIR - gl_CONDITIONAL([GL_COND_OBJ_FCHDIR], [test $HAVE_FCHDIR = 0]) + gl_CONDITIONAL([GL_COND_OBJ_FCHDIR], + [test $HAVE_FCHDIR = 0 || test $REPLACE_FCHDIR = 1]) AM_COND_IF([GL_COND_OBJ_FCHDIR], [ gl_PREREQ_FCHDIR ]) @@ -658,7 +788,7 @@ AC_DEFUN([gl_INIT], gl_CONDITIONAL([GL_COND_OBJ_FSTAT], [test $REPLACE_FSTAT = 1]) AM_COND_IF([GL_COND_OBJ_FSTAT], [ case "$host_os" in - mingw*) + mingw* | windows*) AC_LIBOBJ([stat-w32]) ;; esac @@ -837,10 +967,18 @@ AC_DEFUN([gl_INIT], gl_CONDITIONAL([GL_COND_OBJ_ISWBLANK], [! { test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; } && { test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; }]) gl_WCTYPE_MODULE_INDICATOR([iswblank]) + gl_FUNC_ISWCTYPE + gl_CONDITIONAL([GL_COND_OBJ_ISWCTYPE], + [test $HAVE_WCTYPE_T = 0 || test $GNULIBHEADERS_OVERRIDE_WINT_T = 1 || test $REPLACE_WCTYPE = 1]) + gl_WCTYPE_MODULE_INDICATOR([iswctype]) gl_FUNC_ISWDIGIT gl_CONDITIONAL([GL_COND_OBJ_ISWDIGIT], [! { test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; } && test $REPLACE_ISWDIGIT = 1]) gl_WCTYPE_MODULE_INDICATOR([iswdigit]) + gl_FUNC_ISWPUNCT + gl_CONDITIONAL([GL_COND_OBJ_ISWPUNCT], + [! { test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; } && test $REPLACE_ISWPUNCT = 1]) + gl_WCTYPE_MODULE_INDICATOR([iswpunct]) gl_FUNC_ISWXDIGIT gl_CONDITIONAL([GL_COND_OBJ_ISWXDIGIT], [! { test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; } && test $REPLACE_ISWXDIGIT = 1]) @@ -902,6 +1040,18 @@ AC_DEFUN([gl_INIT], gl_MALLOCA gl_MBCHAR gl_MBITER + gl_FUNC_MBRTOC32 + gl_CONDITIONAL([GL_COND_OBJ_MBRTOC32], + [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1]) + AM_COND_IF([GL_COND_OBJ_MBRTOC32], [ + if test $REPLACE_MBSTATE_T = 1; then + AC_LIBOBJ([lc-charset-dispatch]) + AC_LIBOBJ([mbtowc-lock]) + gl_PREREQ_MBTOWC_LOCK + fi + gl_PREREQ_MBRTOC32 + ]) + gl_UCHAR_MODULE_INDICATOR([mbrtoc32]) gl_FUNC_MBRTOWC gl_CONDITIONAL([GL_COND_OBJ_MBRTOWC], [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]) @@ -921,6 +1071,9 @@ AC_DEFUN([gl_INIT], gl_PREREQ_MBSINIT ]) gl_WCHAR_MODULE_INDICATOR([mbsinit]) + AC_REQUIRE([gl_UCHAR_H]) + AC_LIBOBJ([mbsrtoc32s-state]) + gl_UCHAR_MODULE_INDICATOR([mbsrtoc32s]) gl_FUNC_MBSRTOWCS gl_CONDITIONAL([GL_COND_OBJ_MBSRTOWCS], [test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1]) @@ -929,6 +1082,10 @@ AC_DEFUN([gl_INIT], gl_PREREQ_MBSRTOWCS ]) gl_WCHAR_MODULE_INDICATOR([mbsrtowcs]) + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + gl_MBSTATE_T_BROKEN + gl_MUSL_LIBC + gl_WCHAR_MODULE_INDICATOR([mbszero]) gl_FUNC_MBTOWC gl_CONDITIONAL([GL_COND_OBJ_MBTOWC], [test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1]) @@ -1256,7 +1413,7 @@ AC_DEFUN([gl_INIT], gl_CONDITIONAL([GL_COND_OBJ_STAT], [test $REPLACE_STAT = 1]) AM_COND_IF([GL_COND_OBJ_STAT], [ case "$host_os" in - mingw*) + mingw* | windows*) AC_LIBOBJ([stat-w32]) ;; esac @@ -1360,7 +1517,7 @@ AC_DEFUN([gl_INIT], gl_PREREQ_STRERROR_R ]) gl_STRING_MODULE_INDICATOR([strerror_r]) - dnl For the modules argp, error. + dnl For the modules argp, error, xstrerror. gl_MODULE_INDICATOR([strerror_r-posix]) gl_STRING_H gl_STRING_H_REQUIRE_DEFAULTS @@ -1466,6 +1623,9 @@ AC_DEFUN([gl_INIT], gl_TIME_MODULE_INDICATOR([timegm]) gl_TIMESPEC gt_TMPDIR + gl_UCHAR_H + gl_UCHAR_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_LIBUNISTRING_LIBHEADER([1.2], [unicase.h]) gl_UNICASE_H gl_UNICASE_H_REQUIRE_DEFAULTS @@ -1485,6 +1645,30 @@ AC_DEFUN([gl_INIT], AC_PROG_MKDIR_P gl_LIBUNISTRING_MODULE([1.1], [unictype/combining-class]) AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([1.2], [unictype/ctype-alnum]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([1.2], [unictype/ctype-alpha]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-blank]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-cntrl]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-digit]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([1.2], [unictype/ctype-graph]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.11], [unictype/ctype-lower]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([1.2], [unictype/ctype-print]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([1.2], [unictype/ctype-punct]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-space]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.11], [unictype/ctype-upper]) + AC_REQUIRE([AC_C_INLINE]) + gl_LIBUNISTRING_MODULE([0.9.8], [unictype/ctype-xdigit]) + AC_REQUIRE([AC_C_INLINE]) gl_UNICTYPE_H_REQUIRE_DEFAULTS gl_LIBUNISTRING_MODULE_WITH_VARIABLE([1.1], [unictype/property-soft-dotted]) gl_LIBUNISTRING_LIBHEADER([1.2], [uninorm.h]) @@ -1497,8 +1681,13 @@ AC_DEFUN([gl_INIT], gl_UNISTD_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_UNISTD_SAFER - gl_LIBUNISTRING_LIBHEADER([0.9.11], [unistr.h]) + gl_LIBUNISTRING_LIBHEADER([1.2], [unistr.h]) AC_PROG_MKDIR_P + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-chr]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-cpy]) + gl_LIBUNISTRING_MODULE([1.2], [unistr/u32-pcpy]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strcat]) + gl_LIBUNISTRING_MODULE([0.9], [unistr/u32-strlen]) gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-cpy]) gl_MODULE_INDICATOR([unistr/u8-mbtouc-unsafe]) gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u8-mbtouc-unsafe]) @@ -1524,7 +1713,7 @@ AC_DEFUN([gl_INIT], ]) gl_LIBUNISTRING_LIBHEADER([0.9.11], [uniwidth.h]) AC_PROG_MKDIR_P - gl_LIBUNISTRING_MODULE([1.1], [uniwidth/width]) + gl_LIBUNISTRING_MODULE([1.2], [uniwidth/width]) gl_FUNC_UNLINK gl_CONDITIONAL([GL_COND_OBJ_UNLINK], [test $REPLACE_UNLINK = 1]) gl_UNISTD_MODULE_INDICATOR([unlink]) @@ -1574,6 +1763,9 @@ AC_DEFUN([gl_INIT], gl_PREREQ_WCRTOMB ]) gl_WCHAR_MODULE_INDICATOR([wcrtomb]) + gl_FUNC_WCTYPE + gl_CONDITIONAL([GL_COND_OBJ_WCTYPE], [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]) + gl_WCTYPE_MODULE_INDICATOR([wctype]) gl_WCTYPE_H gl_WCTYPE_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P @@ -1586,19 +1778,19 @@ AC_DEFUN([gl_INIT], gl_WCHAR_MODULE_INDICATOR([wcwidth]) AC_REQUIRE([AC_CANONICAL_HOST]) gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_MUTEX], - [case "$host_os" in mingw*) true;; *) false;; esac]) + [case "$host_os" in mingw* | windows*) true;; *) false;; esac]) AC_REQUIRE([AC_CANONICAL_HOST]) gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_ONCE], - [case "$host_os" in mingw*) true;; *) false;; esac]) + [case "$host_os" in mingw* | windows*) true;; *) false;; esac]) AC_REQUIRE([AC_CANONICAL_HOST]) gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_RECMUTEX], - [case "$host_os" in mingw*) true;; *) false;; esac]) + [case "$host_os" in mingw* | windows*) true;; *) false;; esac]) AC_REQUIRE([AC_CANONICAL_HOST]) gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_RWLOCK], - [case "$host_os" in mingw*) true;; *) false;; esac]) + [case "$host_os" in mingw* | windows*) true;; *) false;; esac]) AC_REQUIRE([AC_CANONICAL_HOST]) gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_SPAWN], - [case "$host_os" in mingw*) true;; *) false;; esac]) + [case "$host_os" in mingw* | windows*) true;; *) false;; esac]) gl_FUNC_WMEMCHR gl_CONDITIONAL([GL_COND_OBJ_WMEMCHR], [test $HAVE_WMEMCHR = 0]) gl_WCHAR_MODULE_INDICATOR([wmemchr]) @@ -1791,6 +1983,7 @@ AC_DEFUN([gltests_LIBSOURCES], [ AC_DEFUN([gl_FILE_LIST], [ build-aux/announce-gen build-aux/config.rpath + build-aux/do-release-commit-and-tag build-aux/gendocs.sh build-aux/git-version-gen build-aux/gitlog-to-changelog @@ -1827,6 +2020,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/bind.c lib/bitrotate.c lib/bitrotate.h + lib/btoc32.c lib/btowc.c lib/byteswap.in.h lib/c++defs.h @@ -1838,6 +2032,24 @@ AC_DEFUN([gl_FILE_LIST], [ lib/c-strcasestr.c lib/c-strcasestr.h lib/c-strncasecmp.c + lib/c32_apply_type_test.c + lib/c32_get_type_test.c + lib/c32is-impl.h + lib/c32isalnum.c + lib/c32isalpha.c + lib/c32isblank.c + lib/c32iscntrl.c + lib/c32isdigit.c + lib/c32isgraph.c + lib/c32islower.c + lib/c32isprint.c + lib/c32ispunct.c + lib/c32isspace.c + lib/c32isupper.c + lib/c32isxdigit.c + lib/c32to-impl.h + lib/c32tolower.c + lib/c32width.c lib/calloc.c lib/canonicalize-lgpl.c lib/canonicalize.c @@ -1959,7 +2171,10 @@ AC_DEFUN([gl_FILE_LIST], [ lib/ioctl.c lib/isblank.c lib/iswblank.c + lib/iswctype-impl.h + lib/iswctype.c lib/iswdigit.c + lib/iswpunct.c lib/iswxdigit.c lib/itold.c lib/langinfo.in.h @@ -1994,13 +2209,17 @@ AC_DEFUN([gl_FILE_LIST], [ lib/mbchar.h lib/mbiter.c lib/mbiter.h + lib/mbrtoc32.c lib/mbrtowc-impl-utf8.h lib/mbrtowc-impl.h lib/mbrtowc.c lib/mbsinit.c + lib/mbsrtoc32s-state.c + lib/mbsrtoc32s.c lib/mbsrtowcs-impl.h lib/mbsrtowcs-state.c lib/mbsrtowcs.c + lib/mbszero.c lib/mbtowc-impl.h lib/mbtowc-lock.c lib/mbtowc-lock.h @@ -2073,6 +2292,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/rename.c lib/rewinddir.c lib/rmdir.c + lib/same-inode.c lib/same-inode.h lib/save-cwd.c lib/save-cwd.h @@ -2082,6 +2302,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/select.c lib/send.c lib/setlocale-lock.c + lib/setlocale_null-unlocked.c lib/setlocale_null.c lib/setlocale_null.h lib/setsockopt.c @@ -2184,6 +2405,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/tmpdir.h lib/u64.c lib/u64.h + lib/uchar.in.h lib/unicase.in.h lib/unicase/cased.c lib/unicase/cased.h @@ -2207,6 +2429,30 @@ AC_DEFUN([gl_FILE_LIST], [ lib/unictype/bitmap.h lib/unictype/combiningclass.c lib/unictype/combiningclass.h + lib/unictype/ctype_alnum.c + lib/unictype/ctype_alnum.h + lib/unictype/ctype_alpha.c + lib/unictype/ctype_alpha.h + lib/unictype/ctype_blank.c + lib/unictype/ctype_blank.h + lib/unictype/ctype_cntrl.c + lib/unictype/ctype_cntrl.h + lib/unictype/ctype_digit.c + lib/unictype/ctype_digit.h + lib/unictype/ctype_graph.c + lib/unictype/ctype_graph.h + lib/unictype/ctype_lower.c + lib/unictype/ctype_lower.h + lib/unictype/ctype_print.c + lib/unictype/ctype_print.h + lib/unictype/ctype_punct.c + lib/unictype/ctype_punct.h + lib/unictype/ctype_space.c + lib/unictype/ctype_space.h + lib/unictype/ctype_upper.c + lib/unictype/ctype_upper.h + lib/unictype/ctype_xdigit.c + lib/unictype/ctype_xdigit.h lib/unictype/pr_soft_dotted.c lib/unictype/pr_soft_dotted.h lib/uninorm.in.h @@ -2221,6 +2467,14 @@ AC_DEFUN([gl_FILE_LIST], [ lib/unistd.in.h lib/unistr.in.h lib/unistr/u-cpy.h + lib/unistr/u-pcpy.h + lib/unistr/u-strcat.h + lib/unistr/u-strlen.h + lib/unistr/u32-chr.c + lib/unistr/u32-cpy.c + lib/unistr/u32-pcpy.c + lib/unistr/u32-strcat.c + lib/unistr/u32-strlen.c lib/unistr/u8-cpy.c lib/unistr/u8-mbtouc-unsafe-aux.c lib/unistr/u8-mbtouc-unsafe.c @@ -2252,6 +2506,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/wchar.in.h lib/wcrtomb.c lib/wctype-h.c + lib/wctype-impl.h + lib/wctype.c lib/wctype.in.h lib/wcwidth.c lib/windows-initguard.h @@ -2373,7 +2629,9 @@ AC_DEFUN([gl_FILE_LIST], [ m4/ioctl.m4 m4/isblank.m4 m4/iswblank.m4 + m4/iswctype.m4 m4/iswdigit.m4 + m4/iswpunct.m4 m4/iswxdigit.m4 m4/langinfo_h.m4 m4/largefile.m4 @@ -2399,6 +2657,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/math_h.m4 m4/mbchar.m4 m4/mbiter.m4 + m4/mbrtoc32.m4 m4/mbrtowc.m4 m4/mbsinit.m4 m4/mbsrtowcs.m4 @@ -2521,6 +2780,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/timespec.m4 m4/tm_gmtoff.m4 m4/tmpdir.m4 + m4/uchar_h.m4 m4/ungetc.m4 m4/unicase_h.m4 m4/unictype_h.m4 @@ -2545,6 +2805,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/wchar_h.m4 m4/wchar_t.m4 m4/wcrtomb.m4 + m4/wctype.m4 m4/wctype_h.m4 m4/wcwidth.m4 m4/wint_t.m4 diff --git a/m4/group-member.m4 b/m4/group-member.m4 index 7c56ee3..60b3d52 100644 --- a/m4/group-member.m4 +++ b/m4/group-member.m4 @@ -1,6 +1,6 @@ # serial 14 -# Copyright (C) 1999-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 1999-2001, 2003-2007, 2009-2024 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/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4 index 134f228..e860a19 100644 --- a/m4/host-cpu-c-abi.m4 +++ b/m4/host-cpu-c-abi.m4 @@ -1,5 +1,5 @@ -# host-cpu-c-abi.m4 serial 15 -dnl Copyright (C) 2002-2023 Free Software Foundation, Inc. +# host-cpu-c-abi.m4 serial 17 +dnl Copyright (C) 2002-2024 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. @@ -461,217 +461,66 @@ EOF dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit -dnl one, or to 'unknown' if unknown. +dnl one. dnl This is a simplified variant of gl_HOST_CPU_C_ABI. AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit], - [if test -n "$gl_cv_host_cpu_c_abi"; then - case "$gl_cv_host_cpu_c_abi" in - i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) - gl_cv_host_cpu_c_abi_32bit=yes ;; - x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) - gl_cv_host_cpu_c_abi_32bit=no ;; - *) - gl_cv_host_cpu_c_abi_32bit=unknown ;; - esac - else - case "$host_cpu" in - - # CPUs that only support a 32-bit ABI. - arc \ - | bfin \ - | cris* \ - | csky \ - | epiphany \ - | ft32 \ - | h8300 \ - | m68k \ - | microblaze | microblazeel \ - | nds32 | nds32le | nds32be \ - | nios2 | nios2eb | nios2el \ - | or1k* \ - | or32 \ - | sh | sh[1234] | sh[1234]e[lb] \ - | tic6x \ - | xtensa* ) - gl_cv_host_cpu_c_abi_32bit=yes - ;; + [case "$host_cpu" in - # CPUs that only support a 64-bit ABI. -changequote(,)dnl - alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ - | mmix ) -changequote([,])dnl - gl_cv_host_cpu_c_abi_32bit=no - ;; + # CPUs that only support a 32-bit ABI. + arc \ + | bfin \ + | cris* \ + | csky \ + | epiphany \ + | ft32 \ + | h8300 \ + | m68k \ + | microblaze | microblazeel \ + | nds32 | nds32le | nds32be \ + | nios2 | nios2eb | nios2el \ + | or1k* \ + | or32 \ + | sh | sh[1234] | sh[1234]e[lb] \ + | tic6x \ + | xtensa* ) + gl_cv_host_cpu_c_abi_32bit=yes + ;; + # CPUs that only support a 64-bit ABI. changequote(,)dnl - i[34567]86 ) + alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ + | mmix ) changequote([,])dnl - gl_cv_host_cpu_c_abi_32bit=yes - ;; - - x86_64 ) - # On x86_64 systems, the C compiler may be generating code in one of - # these ABIs: - # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. - # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 - # with native Windows (mingw, MSVC). - # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. - # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE( - [[#if (defined __x86_64__ || defined __amd64__ \ - || defined _M_X64 || defined _M_AMD64) \ - && !(defined __ILP32__ || defined _ILP32) - int ok; - #else - error fail - #endif - ]])], - [gl_cv_host_cpu_c_abi_32bit=no], - [gl_cv_host_cpu_c_abi_32bit=yes]) - ;; - - arm* | aarch64 ) - # Assume arm with EABI. - # On arm64 systems, the C compiler may be generating code in one of - # these ABIs: - # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. - # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. - # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE( - [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32) - int ok; - #else - error fail - #endif - ]])], - [gl_cv_host_cpu_c_abi_32bit=no], - [gl_cv_host_cpu_c_abi_32bit=yes]) - ;; - - hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) - # On hppa, the C compiler may be generating 32-bit code or 64-bit - # code. In the latter case, it defines _LP64 and __LP64__. - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE( - [[#ifdef __LP64__ - int ok; - #else - error fail - #endif - ]])], - [gl_cv_host_cpu_c_abi_32bit=no], - [gl_cv_host_cpu_c_abi_32bit=yes]) - ;; - - ia64* ) - # On ia64 on HP-UX, the C compiler may be generating 64-bit code or - # 32-bit code. In the latter case, it defines _ILP32. - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE( - [[#ifdef _ILP32 - int ok; - #else - error fail - #endif - ]])], - [gl_cv_host_cpu_c_abi_32bit=yes], - [gl_cv_host_cpu_c_abi_32bit=no]) - ;; - - mips* ) - # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this - # at 32. - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE( - [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) - int ok; - #else - error fail - #endif - ]])], - [gl_cv_host_cpu_c_abi_32bit=no], - [gl_cv_host_cpu_c_abi_32bit=yes]) - ;; - - powerpc* ) - # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. - # No need to distinguish them here; the caller may distinguish - # them based on the OS. - # On powerpc64 systems, the C compiler may still be generating - # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may - # be generating 64-bit code. - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE( - [[#if defined __powerpc64__ || defined __LP64__ - int ok; - #else - error fail - #endif - ]])], - [gl_cv_host_cpu_c_abi_32bit=no], - [gl_cv_host_cpu_c_abi_32bit=yes]) - ;; - - rs6000 ) - gl_cv_host_cpu_c_abi_32bit=yes - ;; - - riscv32 | riscv64 ) - # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. - # Size of 'long' and 'void *': - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE( - [[#if defined __LP64__ - int ok; - #else - error fail - #endif - ]])], - [gl_cv_host_cpu_c_abi_32bit=no], - [gl_cv_host_cpu_c_abi_32bit=yes]) - ;; - - s390* ) - # On s390x, the C compiler may be generating 64-bit (= s390x) code - # or 31-bit (= s390) code. - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE( - [[#if defined __LP64__ || defined __s390x__ - int ok; - #else - error fail - #endif - ]])], - [gl_cv_host_cpu_c_abi_32bit=no], - [gl_cv_host_cpu_c_abi_32bit=yes]) - ;; + gl_cv_host_cpu_c_abi_32bit=no + ;; - sparc | sparc64 ) - # UltraSPARCs running Linux have `uname -m` = "sparc64", but the - # C compiler still generates 32-bit code. + *) + if test -n "$gl_cv_host_cpu_c_abi"; then + dnl gl_HOST_CPU_C_ABI has already been run. Use its result. + case "$gl_cv_host_cpu_c_abi" in + i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) + gl_cv_host_cpu_c_abi_32bit=yes ;; + x86_64 | alpha | arm64 | aarch64c | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) + gl_cv_host_cpu_c_abi_32bit=no ;; + *) + gl_cv_host_cpu_c_abi_32bit=unknown ;; + esac + else + gl_cv_host_cpu_c_abi_32bit=unknown + fi + if test $gl_cv_host_cpu_c_abi_32bit = unknown; then AC_COMPILE_IFELSE( [AC_LANG_SOURCE( - [[#if defined __sparcv9 || defined __arch64__ - int ok; - #else - error fail - #endif + [[int test_pointer_size[sizeof (void *) - 5]; ]])], [gl_cv_host_cpu_c_abi_32bit=no], [gl_cv_host_cpu_c_abi_32bit=yes]) - ;; - - *) - gl_cv_host_cpu_c_abi_32bit=unknown - ;; - esac - fi + fi + ;; + esac ]) HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit" diff --git a/m4/hostent.m4 b/m4/hostent.m4 index 3b2cc2b..182189f 100644 --- a/m4/hostent.m4 +++ b/m4/hostent.m4 @@ -1,5 +1,5 @@ -# hostent.m4 serial 4 -dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc. +# hostent.m4 serial 5 +dnl Copyright (C) 2008, 2010-2024 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. @@ -26,7 +26,7 @@ AC_DEFUN([gl_HOSTENT], AC_CACHE_CHECK([for gethostbyname in winsock2.h and -lws2_32], [gl_cv_w32_gethostbyname], [gl_cv_w32_gethostbyname=no - gl_save_LIBS="$LIBS" + gl_saved_LIBS="$LIBS" LIBS="$LIBS -lws2_32" AC_LINK_IFELSE( [AC_LANG_PROGRAM( @@ -38,7 +38,7 @@ AC_DEFUN([gl_HOSTENT], ]], [[gethostbyname(NULL);]])], [gl_cv_w32_gethostbyname=yes]) - LIBS="$gl_save_LIBS" + LIBS="$gl_saved_LIBS" ]) if test "$gl_cv_w32_gethostbyname" = "yes"; then HOSTENT_LIB="-lws2_32" diff --git a/m4/iconv.m4 b/m4/iconv.m4 index ff5d526..2a7edd3 100644 --- a/m4/iconv.m4 +++ b/m4/iconv.m4 @@ -1,5 +1,5 @@ -# iconv.m4 serial 26 -dnl Copyright (C) 2000-2002, 2007-2014, 2016-2023 Free Software Foundation, +# iconv.m4 serial 27 +dnl Copyright (C) 2000-2002, 2007-2014, 2016-2024 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, @@ -38,7 +38,7 @@ AC_DEFUN([AM_ICONV_LINK], dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. - am_save_CPPFLAGS="$CPPFLAGS" + gl_saved_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ @@ -55,7 +55,7 @@ AC_DEFUN([AM_ICONV_LINK], iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" + gl_saved_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( @@ -68,14 +68,14 @@ AC_DEFUN([AM_ICONV_LINK], iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) - LIBS="$am_save_LIBS" + LIBS="$gl_saved_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. - am_save_LIBS="$LIBS" + gl_saved_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi @@ -205,7 +205,7 @@ AC_DEFUN([AM_ICONV_LINK], esac]) test "$am_cv_func_iconv_works" = no || break done - LIBS="$am_save_LIBS" + LIBS="$gl_saved_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; @@ -224,7 +224,7 @@ AC_DEFUN([AM_ICONV_LINK], else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. - CPPFLAGS="$am_save_CPPFLAGS" + CPPFLAGS="$gl_saved_CPPFLAGS" LIBICONV= LTLIBICONV= fi diff --git a/m4/iconv_h.m4 b/m4/iconv_h.m4 index 40c985e..7b56088 100644 --- a/m4/iconv_h.m4 +++ b/m4/iconv_h.m4 @@ -1,5 +1,5 @@ # iconv_h.m4 serial 16 -dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2024 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/m4/include_next.m4 b/m4/include_next.m4 index 9f19215..70cb746 100644 --- a/m4/include_next.m4 +++ b/m4/include_next.m4 @@ -1,5 +1,5 @@ -# include_next.m4 serial 26 -dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. +# include_next.m4 serial 27 +dnl Copyright (C) 2006-2024 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. @@ -74,17 +74,17 @@ EOF #endif #define DEFINED_IN_CONFTESTD2 EOF - gl_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" + gl_saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_saved_CPPFLAGS -Iconftestd1b -Iconftestd2" dnl We intentionally avoid using AC_LANG_SOURCE here. AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include ]], [gl_cv_have_include_next=yes], - [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + [CPPFLAGS="$gl_saved_CPPFLAGS -Iconftestd1a -Iconftestd2" AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include ]], [gl_cv_have_include_next=buggy], [gl_cv_have_include_next=no]) ]) - CPPFLAGS="$gl_save_CPPFLAGS" + CPPFLAGS="$gl_saved_CPPFLAGS" rm -rf conftestd1a conftestd1b conftestd2 ]) PRAGMA_SYSTEM_HEADER= diff --git a/m4/inet_ntop.m4 b/m4/inet_ntop.m4 index 48822d6..63a9dc7 100644 --- a/m4/inet_ntop.m4 +++ b/m4/inet_ntop.m4 @@ -1,5 +1,5 @@ -# inet_ntop.m4 serial 21 -dnl Copyright (C) 2005-2006, 2008-2023 Free Software Foundation, Inc. +# inet_ntop.m4 serial 22 +dnl Copyright (C) 2005-2006, 2008-2024 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,14 +36,14 @@ AC_DEFUN([gl_FUNC_INET_NTOP], HAVE_DECL_INET_NTOP=0 fi else - gl_save_LIBS=$LIBS + gl_saved_LIBS=$LIBS AC_SEARCH_LIBS([inet_ntop], [nsl resolv network], [], [AC_CHECK_FUNCS([inet_ntop]) if test $ac_cv_func_inet_ntop = no; then HAVE_INET_NTOP=0 fi ]) - LIBS=$gl_save_LIBS + LIBS=$gl_saved_LIBS if test "$ac_cv_search_inet_ntop" != "no" \ && test "$ac_cv_search_inet_ntop" != "none required"; then diff --git a/m4/inline.m4 b/m4/inline.m4 index dbbb811..208f742 100644 --- a/m4/inline.m4 +++ b/m4/inline.m4 @@ -1,5 +1,5 @@ # inline.m4 serial 4 -dnl Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2009-2024 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/m4/intlmacosx.m4 b/m4/intlmacosx.m4 index ecc88d6..3141bf8 100644 --- a/m4/intlmacosx.m4 +++ b/m4/intlmacosx.m4 @@ -1,5 +1,5 @@ -# intlmacosx.m4 serial 8 (gettext-0.20.2) -dnl Copyright (C) 2004-2014, 2016, 2019-2022 Free Software Foundation, Inc. +# intlmacosx.m4 serial 9 (gettext-0.22.3) +dnl Copyright (C) 2004-2014, 2016, 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. @@ -59,7 +59,11 @@ AC_DEFUN([gt_INTL_MACOSX], INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then - INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + dnl Starting with macOS version 14, CoreFoundation relies on CoreServices, + dnl and we have to link it in explicitly, otherwise an exception + dnl NSInvalidArgumentException "unrecognized selector sent to instance" + dnl occurs. + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation -Wl,-framework -Wl,CoreServices" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) diff --git a/m4/intmax_t.m4 b/m4/intmax_t.m4 index ef32e1b..d3d2120 100644 --- a/m4/intmax_t.m4 +++ b/m4/intmax_t.m4 @@ -1,5 +1,5 @@ # intmax_t.m4 serial 9 -dnl Copyright (C) 1997-2004, 2006-2007, 2009-2023 Free Software Foundation, +dnl Copyright (C) 1997-2004, 2006-2007, 2009-2024 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/m4/inttypes.m4 b/m4/inttypes.m4 index e7efbe9..6abf9db 100644 --- a/m4/inttypes.m4 +++ b/m4/inttypes.m4 @@ -1,5 +1,5 @@ # inttypes.m4 serial 37 -dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2024 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/m4/inttypes_h.m4 b/m4/inttypes_h.m4 index 68c60e9..ae0a00f 100644 --- a/m4/inttypes_h.m4 +++ b/m4/inttypes_h.m4 @@ -1,5 +1,5 @@ # inttypes_h.m4 serial 10 -dnl Copyright (C) 1997-2004, 2006, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2004, 2006, 2008-2024 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/m4/ioctl.m4 b/m4/ioctl.m4 index 83036c3..4278883 100644 --- a/m4/ioctl.m4 +++ b/m4/ioctl.m4 @@ -1,5 +1,5 @@ # ioctl.m4 serial 6 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/isblank.m4 b/m4/isblank.m4 index 809eab4..d07472c 100644 --- a/m4/isblank.m4 +++ b/m4/isblank.m4 @@ -1,5 +1,5 @@ # isblank.m4 serial 3 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/iswblank.m4 b/m4/iswblank.m4 index b1220b1..e450f0b 100644 --- a/m4/iswblank.m4 +++ b/m4/iswblank.m4 @@ -1,5 +1,5 @@ # iswblank.m4 serial 7 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2024 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/m4/iswctype.m4 b/m4/iswctype.m4 new file mode 100644 index 0000000..775f222 --- /dev/null +++ b/m4/iswctype.m4 @@ -0,0 +1,13 @@ +# iswctype.m4 serial 3 +dnl Copyright (C) 2011-2024 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_ISWCTYPE], +[ + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + AC_REQUIRE([gl_WCTYPE_H]) + dnl Determine REPLACE_WCTYPE. + AC_REQUIRE([gl_FUNC_WCTYPE]) +]) diff --git a/m4/iswdigit.m4 b/m4/iswdigit.m4 index 0df7b30..d13c1ae 100644 --- a/m4/iswdigit.m4 +++ b/m4/iswdigit.m4 @@ -1,5 +1,5 @@ -# iswdigit.m4 serial 3 -dnl Copyright (C) 2020-2023 Free Software Foundation, Inc. +# iswdigit.m4 serial 6 +dnl Copyright (C) 2020-2024 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,6 +12,7 @@ AC_DEFUN([gl_FUNC_ISWDIGIT], AC_REQUIRE([gt_LOCALE_JA]) AC_REQUIRE([gt_LOCALE_FR_UTF8]) AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then dnl redefines iswdigit already. @@ -25,7 +26,7 @@ AC_DEFUN([gl_FUNC_ISWDIGIT], changequote(,)dnl case "$host_os" in # Guess no on FreeBSD, NetBSD, Solaris, native Windows. - freebsd* | dragonfly* | netbsd* | solaris* | mingw*) + freebsd* | dragonfly* | netbsd* | solaris* | mingw* | windows*) gl_cv_func_iswdigit_works="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_iswdigit_works="guessing yes" ;; @@ -63,7 +64,8 @@ main (int argc, char *argv[]) int is; int result = 0; - if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) + if (strcmp ("$LOCALE_FR", "none") != 0 + && setlocale (LC_ALL, "$LOCALE_FR") != NULL) { /* This fails on mingw, MSVC 14. */ /* U+00B2 SUPERSCRIPT TWO */ @@ -71,7 +73,8 @@ main (int argc, char *argv[]) if (!(is == 0)) result |= 1; } - if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + if (strcmp ("$LOCALE_JA", "none") != 0 + && setlocale (LC_ALL, "$LOCALE_JA") != NULL) { /* This fails on NetBSD 8.0. */ /* U+FF11 FULLWIDTH DIGIT ONE */ @@ -79,7 +82,8 @@ main (int argc, char *argv[]) if (!(is == 0)) result |= 2; } - if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + if (strcmp ("$LOCALE_FR_UTF8", "none") != 0 + && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) { /* This fails on FreeBSD 13.0, NetBSD 8.0, MSVC 14. */ /* U+0663 ARABIC-INDIC DIGIT THREE */ @@ -92,7 +96,8 @@ main (int argc, char *argv[]) if (!(is == 0)) result |= 8; } - if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + if (strcmp ("$LOCALE_ZH_CN", "none") != 0 + && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { /* This fails on NetBSD 8.0, Solaris 10, Solaris 11.4. */ /* U+FF11 FULLWIDTH DIGIT ONE */ diff --git a/m4/iswpunct.m4 b/m4/iswpunct.m4 new file mode 100644 index 0000000..2be15ab --- /dev/null +++ b/m4/iswpunct.m4 @@ -0,0 +1,48 @@ +# iswpunct.m4 serial 2 +dnl Copyright (C) 2023-2024 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_ISWPUNCT], +[ + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + AC_REQUIRE([gl_WCTYPE_H]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + dnl redefines iswpunct already. + REPLACE_ISWPUNCT="$REPLACE_ISWCNTRL" + else + AC_CACHE_CHECK([whether iswpunct is consistent with ispunct], + [gl_cv_func_iswpunct_works], + [AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +int +main (int argc, char *argv[]) +{ + int result = 0; + /* This fails on Android 11. */ + if ((! iswpunct ('\`')) != (! ispunct ('\`'))) + result |= 1; + return result; +}]])], + [gl_cv_func_iswpunct_works=yes], + [gl_cv_func_iswpunct_works=no], + [case "$host_os" in + # Guess no on Android. + android*) gl_cv_func_iswpunct_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_iswpunct_works="guessing yes" ;; + esac + ]) + ]) + case "$gl_cv_func_iswpunct_works" in + *yes) ;; + *) REPLACE_ISWPUNCT=1 ;; + esac + fi +]) diff --git a/m4/iswxdigit.m4 b/m4/iswxdigit.m4 index 3f952f0..d42f0d1 100644 --- a/m4/iswxdigit.m4 +++ b/m4/iswxdigit.m4 @@ -1,5 +1,5 @@ -# iswxdigit.m4 serial 3 -dnl Copyright (C) 2020-2023 Free Software Foundation, Inc. +# iswxdigit.m4 serial 6 +dnl Copyright (C) 2020-2024 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,6 +11,7 @@ AC_DEFUN([gl_FUNC_ISWXDIGIT], AC_REQUIRE([gt_LOCALE_JA]) AC_REQUIRE([gt_LOCALE_FR_UTF8]) AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then dnl redefines iswxdigit already. @@ -24,7 +25,7 @@ AC_DEFUN([gl_FUNC_ISWXDIGIT], changequote(,)dnl case "$host_os" in # Guess no on FreeBSD, NetBSD, Solaris, native Windows. - freebsd* | dragonfly* | netbsd* | solaris* | mingw*) + freebsd* | dragonfly* | netbsd* | solaris* | mingw* | windows*) gl_cv_func_iswxdigit_works="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_iswxdigit_works="guessing yes" ;; @@ -62,7 +63,8 @@ main (int argc, char *argv[]) int is; int result = 0; - if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) + if (strcmp ("$LOCALE_JA", "none") != 0 + && setlocale (LC_ALL, "$LOCALE_JA") != NULL) { /* This fails on NetBSD 8.0. */ /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */ @@ -70,7 +72,8 @@ main (int argc, char *argv[]) if (!(is == 0)) result |= 1; } - if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + if (strcmp ("$LOCALE_FR_UTF8", "none") != 0 + && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) { /* This fails on FreeBSD 13.0. */ /* U+0663 ARABIC-INDIC DIGIT THREE */ @@ -83,7 +86,8 @@ main (int argc, char *argv[]) if (!(is == 0)) result |= 4; } - if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + if (strcmp ("$LOCALE_ZH_CN", "none") != 0 + && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) { /* This fails on Solaris 10, Solaris 11.4. */ /* U+FF11 FULLWIDTH DIGIT ONE */ diff --git a/m4/langinfo_h.m4 b/m4/langinfo_h.m4 index b17a526..888b161 100644 --- a/m4/langinfo_h.m4 +++ b/m4/langinfo_h.m4 @@ -1,5 +1,5 @@ # langinfo_h.m4 serial 12 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/largefile.m4 b/m4/largefile.m4 index 8d4bb7c..cbe9bc1 100644 --- a/m4/largefile.m4 +++ b/m4/largefile.m4 @@ -1,7 +1,7 @@ # Enable large files on systems where this is not the default. # Enable support for files on Linux file systems with 64-bit inode numbers. -# Copyright 1992-1996, 1998-2023 Free Software Foundation, Inc. +# Copyright 1992-1996, 1998-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -171,8 +171,9 @@ AC_DEFUN([AC_SYS_YEAR2038_RECOMMENDED], AS_IF([test "$enable_year2038,$ac_have_year2038" = yes,no], [AC_MSG_FAILURE(m4_text_wrap( [could not enable timestamps after mid-January 2038. - Did you mean to build a 64-bit binary? (E.g., 'CC="${CC} -m64"'.) - To proceed with 32-bit time_t, configure with '--disable-year2038'.], + This package recommends support for these later timestamps. + However, to proceed with signed 32-bit time_t even though it + will fail then, configure with '--disable-year2038'.], [], [], [55]))])]) # _AC_SYS_LARGEFILE_TEST_CODE @@ -180,13 +181,16 @@ AS_IF([test "$enable_year2038,$ac_have_year2038" = yes,no], # C code used to probe for large file support. m4_define([_AC_SYS_LARGEFILE_TEST_CODE], [@%:@include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, +@%:@ifndef FTYPE +@%:@ define FTYPE off_t +@%:@endif + /* Check that FTYPE can represent 2**63 - 1 correctly. + We can't simply define LARGE_FTYPE to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -@%:@define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) +@%:@define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) + int FTYPE_is_large[[(LARGE_FTYPE % 2147483629 == 721 + && LARGE_FTYPE % 2147483647 == 1) ? 1 : -1]];[]dnl ]) # Defined by Autoconf 2.71 and circa 2022 Gnulib unwisely depended on it. @@ -226,7 +230,13 @@ AC_DEFUN([_AC_SYS_LARGEFILE_PROBE], AS_IF([test x"$ac_opt" != x"none needed"], [CC="$ac_save_CC $ac_opt"]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_CODE])], - [ac_cv_sys_largefile_opts="$ac_opt" + [AS_IF([test x"$ac_opt" = x"none needed"], + [# GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. + CC="$CC -DFTYPE=ino_t" + AC_COMPILE_IFELSE([], [], + [CC="$CC -D_FILE_OFFSET_BITS=64" + AC_COMPILE_IFELSE([], [ac_opt='-D_FILE_OFFSET_BITS=64'])])]) + ac_cv_sys_largefile_opts=$ac_opt ac_opt_found=yes]) test $ac_opt_found = no || break done @@ -237,7 +247,7 @@ AC_DEFUN([_AC_SYS_LARGEFILE_PROBE], AC_REQUIRE([AC_CANONICAL_HOST]) if test $ac_opt_found != yes; then AS_CASE([$host_os], - [mingw*], + [mingw* | windows*], [ac_cv_sys_largefile_opts="supported through gnulib" ac_opt_found=yes] ) @@ -295,7 +305,7 @@ AC_DEFUN([gl_LARGEFILE], [ AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in - mingw*) + mingw* | windows*) dnl Native Windows. dnl mingw64 defines off_t to a 64-bit type already, if dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE. diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 index acc6127..b17e0fd 100644 --- a/m4/lib-ld.m4 +++ b/m4/lib-ld.m4 @@ -1,5 +1,5 @@ -# lib-ld.m4 serial 11 -dnl Copyright (C) 1996-2003, 2009-2023 Free Software Foundation, Inc. +# lib-ld.m4 serial 13 +dnl Copyright (C) 1996-2003, 2009-2024 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. @@ -67,7 +67,7 @@ else if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. case $host in - *-*-mingw*) + *-*-mingw* | windows*) # gcc leaves a trailing carriage return which upsets mingw acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -97,9 +97,9 @@ else fi if test -n "$ac_prog"; then # Search for $ac_prog in $PATH. - acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + acl_saved_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do - IFS="$acl_save_ifs" + IFS="$acl_saved_IFS" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" @@ -116,7 +116,7 @@ else esac fi done - IFS="$acl_save_ifs" + IFS="$acl_saved_IFS" fi case $host in *-*-aix*) diff --git a/m4/lib-link.m4 b/m4/lib-link.m4 index 653e34f..1a7c127 100644 --- a/m4/lib-link.m4 +++ b/m4/lib-link.m4 @@ -1,5 +1,5 @@ -# lib-link.m4 serial 33 -dnl Copyright (C) 2001-2023 Free Software Foundation, Inc. +# lib-link.m4 serial 34 +dnl Copyright (C) 2001-2024 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. @@ -69,11 +69,11 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. - ac_save_CPPFLAGS="$CPPFLAGS" + acl_saved_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ - ac_save_LIBS="$LIBS" + acl_saved_LIBS="$LIBS" dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, dnl because these -l options might require -L options that are present in dnl LIBS. -l options benefit only from the -L options listed before it. @@ -89,7 +89,7 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [AC_LANG_PROGRAM([[$3]], [[$4]])], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) - LIBS="$ac_save_LIBS" + LIBS="$acl_saved_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes @@ -100,7 +100,7 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. - CPPFLAGS="$ac_save_CPPFLAGS" + CPPFLAGS="$acl_saved_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= LIB[]NAME[]_PREFIX= @@ -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= @@ -537,12 +537,12 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. - save_libdir="$libdir" + saved_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac - libdir="$save_libdir" + libdir="$saved_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in @@ -682,18 +682,18 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY], alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. - acl_save_libdir="$libdir" + acl_saved_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" + libdir="$acl_saved_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" + acl_saved_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" + libdir="$acl_saved_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi @@ -790,18 +790,18 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done - acl_save_libdir="$libdir" + acl_saved_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" + libdir="$acl_saved_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do - acl_save_libdir="$libdir" + acl_saved_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" + libdir="$acl_saved_libdir" $1="${$1}${$1:+ }$flag" done fi diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 index aefe7f7..f327c6e 100644 --- a/m4/lib-prefix.m4 +++ b/m4/lib-prefix.m4 @@ -1,5 +1,5 @@ -# lib-prefix.m4 serial 20 -dnl Copyright (C) 2001-2005, 2008-2023 Free Software Foundation, Inc. +# lib-prefix.m4 serial 22 +dnl Copyright (C) 2001-2005, 2008-2024 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. @@ -126,10 +126,10 @@ AC_DEFUN([AC_LIB_PREPARE_PREFIX], else acl_final_exec_prefix="$exec_prefix" fi - acl_save_prefix="$prefix" + acl_saved_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" + prefix="$acl_saved_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the @@ -137,13 +137,13 @@ dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ - acl_save_prefix="$prefix" + acl_saved_prefix="$prefix" prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" + acl_saved_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" + exec_prefix="$acl_saved_exec_prefix" + prefix="$acl_saved_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates @@ -256,6 +256,15 @@ changequote([,])dnl esac fi ;; + netbsd*) + dnl On NetBSD/sparc64, there is a 'sparc' subdirectory that contains + dnl 32-bit libraries. + if test $HOST_CPU_C_ABI_32BIT != no; then + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparc ;; + esac + fi + ;; *) dnl If $CC generates code for a 32-bit ABI, the libraries are dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64. @@ -280,7 +289,7 @@ changequote([,])dnl fi fi if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" + acl_saved_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in @@ -297,7 +306,7 @@ changequote([,])dnl esac fi done - IFS="$acl_save_IFS" + IFS="$acl_saved_IFS" if test $HOST_CPU_C_ABI_32BIT = yes; then # 32-bit ABI. acl_libdirstem3= diff --git a/m4/libunistring-base.m4 b/m4/libunistring-base.m4 index 6dd184a..7c3f65e 100644 --- a/m4/libunistring-base.m4 +++ b/m4/libunistring-base.m4 @@ -1,5 +1,5 @@ # libunistring-base.m4 serial 8 -dnl Copyright (C) 2010-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2024 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/m4/libunistring-optional.m4 b/m4/libunistring-optional.m4 index 4ad0c7f..9807b61 100644 --- a/m4/libunistring-optional.m4 +++ b/m4/libunistring-optional.m4 @@ -1,5 +1,5 @@ # libunistring-optional.m4 serial 1 -dnl Copyright (C) 2010-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2024 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/m4/libunistring.m4 b/m4/libunistring.m4 index 1570281..1d35b33 100644 --- a/m4/libunistring.m4 +++ b/m4/libunistring.m4 @@ -1,5 +1,5 @@ -# libunistring.m4 serial 12 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +# libunistring.m4 serial 13 +dnl Copyright (C) 2009-2024 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. @@ -73,7 +73,7 @@ AC_DEFUN([gl_LIBUNISTRING_CORE], dnl We have to erase the cached result of the first AC_LIB_HAVE_LINKFLAGS dnl invocation, otherwise the second one will not be run. unset ac_cv_libunistring - glus_save_LIBS="$LIBS" + glus_saved_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LIB_HAVE_LINKFLAGS([unistring], [], [#include ], [u8_strconv_from_locale((char*)0);], @@ -82,7 +82,7 @@ AC_DEFUN([gl_LIBUNISTRING_CORE], LIBUNISTRING="$LIBUNISTRING $LIBICONV" LTLIBUNISTRING="$LTLIBUNISTRING $LTLIBICONV" fi - LIBS="$glus_save_LIBS" + LIBS="$glus_saved_LIBS" fi else AC_LIB_HAVE_LINKFLAGS([unistring], [], diff --git a/m4/limits-h.m4 b/m4/limits-h.m4 index ca0294e..1825328 100644 --- a/m4/limits-h.m4 +++ b/m4/limits-h.m4 @@ -1,6 +1,6 @@ dnl Check whether limits.h has needed features. -dnl Copyright 2016-2023 Free Software Foundation, Inc. +dnl Copyright 2016-2024 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. @@ -28,11 +28,22 @@ AC_DEFUN_ONCE([gl_LIMITS_H], ]])], [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 + #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 . diff --git a/m4/link.m4 b/m4/link.m4 index eb90e41..3bd242f 100644 --- a/m4/link.m4 +++ b/m4/link.m4 @@ -1,5 +1,5 @@ # link.m4 serial 12 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/localcharset.m4 b/m4/localcharset.m4 index 15b6b2a..abf07dc 100644 --- a/m4/localcharset.m4 +++ b/m4/localcharset.m4 @@ -1,5 +1,5 @@ # localcharset.m4 serial 8 -dnl Copyright (C) 2002, 2004, 2006, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004, 2006, 2009-2024 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/m4/locale-fr.m4 b/m4/locale-fr.m4 index 5e13f39..53750b5 100644 --- a/m4/locale-fr.m4 +++ b/m4/locale-fr.m4 @@ -1,5 +1,5 @@ -# locale-fr.m4 serial 21 -dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc. +# locale-fr.m4 serial 23 +dnl Copyright (C) 2003, 2005-2024 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. @@ -86,7 +86,7 @@ int main () { # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", # "ja" as "Japanese" or "Japanese_Japan.932", # and similar. - mingw*) + mingw* | windows*) # Test for the native Windows locale name. if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=French_France.1252 @@ -116,7 +116,7 @@ int main () { if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr_FR.iso88591 else - # Test for the Solaris 7 locale name. + # Test for the Solaris 10 locale name. if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_fr=fr else @@ -133,15 +133,31 @@ int main () { rm -fr conftest* ]) LOCALE_FR=$gt_cv_locale_fr + case $LOCALE_FR in #( + '' | *[[[:space:]\"\$\'*@<:@]]*) + dnl This locale name might cause trouble with sh or make. + AC_MSG_WARN([invalid locale "$LOCALE_FR"; assuming "none"]) + LOCALE_FR=none;; + esac AC_SUBST([LOCALE_FR]) ]) dnl Determine the name of a french locale with UTF-8 encoding. 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 #include #if HAVE_LANGINFO_CODESET @@ -203,51 +219,82 @@ 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* | windows*) + # 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 10 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 + case $LOCALE_FR_UTF8 in #( + '' | *[[[:space:]\"\$\'*@<:@]]*) + dnl This locale name might cause trouble with sh or make. + AC_MSG_WARN([invalid locale "$LOCALE_FR_UTF8"; assuming "none"]) + LOCALE_FR_UTF8=none;; + esac 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/m4/locale-ja.m4 b/m4/locale-ja.m4 index f6ca327..852ce94 100644 --- a/m4/locale-ja.m4 +++ b/m4/locale-ja.m4 @@ -1,5 +1,5 @@ -# locale-ja.m4 serial 16 -dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc. +# locale-ja.m4 serial 18 +dnl Copyright (C) 2003, 2005-2024 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. @@ -90,7 +90,7 @@ int main () # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", # "ja" as "Japanese" or "Japanese_Japan.932", # and similar. - mingw*) + mingw* | windows*) # Note that on native Windows, the Japanese locale is # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we # cannot use it here. @@ -117,7 +117,7 @@ int main () if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja_JP.EUC else - # Test for the Solaris 7 locale name. + # Test for the Solaris 10 locale name. if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_ja=ja else @@ -139,5 +139,11 @@ int main () rm -fr conftest* ]) LOCALE_JA=$gt_cv_locale_ja + case $LOCALE_JA in #( + '' | *[[[:space:]\"\$\'*@<:@]]*) + dnl This locale name might cause trouble with sh or make. + AC_MSG_WARN([invalid locale "$LOCALE_JA"; assuming "none"]) + LOCALE_JA=none;; + esac AC_SUBST([LOCALE_JA]) ]) diff --git a/m4/locale-zh.m4 b/m4/locale-zh.m4 index 94c5459..f1a58c6 100644 --- a/m4/locale-zh.m4 +++ b/m4/locale-zh.m4 @@ -1,5 +1,5 @@ -# locale-zh.m4 serial 16 -dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc. +# locale-zh.m4 serial 18 +dnl Copyright (C) 2003, 2005-2024 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. @@ -91,7 +91,7 @@ int main () # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", # "ja" as "Japanese" or "Japanese_Japan.932", # and similar. - mingw*) + mingw* | windows*) # Test for the hypothetical native Windows locale name. if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then gt_cv_locale_zh_CN=Chinese_China.54936 @@ -133,5 +133,11 @@ int main () rm -fr conftest* ]) LOCALE_ZH_CN=$gt_cv_locale_zh_CN + case $LOCALE_ZH_CN in #( + '' | *[[[:space:]\"\$\'*@<:@]]*) + dnl This locale name might cause trouble with sh or make. + AC_MSG_WARN([invalid locale "$LOCALE_ZH_CN"; assuming "none"]) + LOCALE_ZH_CN=none;; + esac AC_SUBST([LOCALE_ZH_CN]) ]) diff --git a/m4/locale_h.m4 b/m4/locale_h.m4 index a33a0a4..c47e3f6 100644 --- a/m4/locale_h.m4 +++ b/m4/locale_h.m4 @@ -1,5 +1,5 @@ -# locale_h.m4 serial 28 -dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. +# locale_h.m4 serial 31 +dnl Copyright (C) 2007, 2009-2024 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. @@ -59,7 +59,9 @@ AC_DEFUN_ONCE([gl_LOCALE_H], dnl On native Windows with MSVC, merely define these member names as macros. dnl This avoids trouble in C++ mode. case "$host_os" in - mingw*) + windows*-msvc*) + ;; + mingw* | windows*) AC_EGREP_CPP([Special], [ #ifdef _MSC_VER Special @@ -152,7 +154,7 @@ AC_DEFUN([gl_LOCALE_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE_NULL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUPLOCALE]) - gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME_UNSAFE]) ]) m4_require(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS]) AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) diff --git a/m4/localeconv.m4 b/m4/localeconv.m4 index 374dcbf..351b4e1 100644 --- a/m4/localeconv.m4 +++ b/m4/localeconv.m4 @@ -1,5 +1,5 @@ -# localeconv.m4 serial 2 -dnl Copyright (C) 2012-2023 Free Software Foundation, Inc. +# localeconv.m4 serial 3 +dnl Copyright (C) 2012-2024 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,7 +36,7 @@ AC_DEFUN([gl_FUNC_LOCALECONV], # 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" ;; + mingw* | windows*) 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 diff --git a/m4/lock.m4 b/m4/lock.m4 index 88cf557..2ca3bf2 100644 --- a/m4/lock.m4 +++ b/m4/lock.m4 @@ -1,5 +1,5 @@ # lock.m4 serial 14 -dnl Copyright (C) 2005-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2024 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/m4/lseek.m4 b/m4/lseek.m4 index 0da4588..bb30a47 100644 --- a/m4/lseek.m4 +++ b/m4/lseek.m4 @@ -1,5 +1,5 @@ -# lseek.m4 serial 14 -dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. +# lseek.m4 serial 15 +dnl Copyright (C) 2007, 2009-2024 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,7 +13,7 @@ AC_DEFUN([gl_FUNC_LSEEK], AC_CHECK_HEADERS_ONCE([unistd.h]) AC_CACHE_CHECK([whether lseek detects pipes], [gl_cv_func_lseek_pipe], [case "$host_os" in - mingw*) + mingw* | windows*) dnl Native Windows. dnl The result of lseek (fd, (off_t)0, SEEK_CUR) or dnl SetFilePointer(handle, 0, NULL, FILE_CURRENT) diff --git a/m4/lstat.m4 b/m4/lstat.m4 index 2bc4669..48cc865 100644 --- a/m4/lstat.m4 +++ b/m4/lstat.m4 @@ -1,6 +1,6 @@ -# serial 34 +# serial 36 -# Copyright (C) 1997-2001, 2003-2023 Free Software Foundation, Inc. +# Copyright (C) 1997-2001, 2003-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -18,7 +18,7 @@ AC_DEFUN([gl_FUNC_LSTAT], if test $ac_cv_func_lstat = yes; then AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in - solaris* | *no) + darwin* | solaris* | *no) REPLACE_LSTAT=1 ;; esac @@ -62,7 +62,7 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], *-gnu* | gnu*) # Guess yes on glibc systems. gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; - mingw*) + mingw* | windows*) # Guess no on native Windows. gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; *) diff --git a/m4/malloc.m4 b/m4/malloc.m4 index bc58017..635d672 100644 --- a/m4/malloc.m4 +++ b/m4/malloc.m4 @@ -1,5 +1,5 @@ -# malloc.m4 serial 29 -dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. +# malloc.m4 serial 31 +dnl Copyright (C) 2007, 2009-2024 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. @@ -16,7 +16,8 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF], [[#include ]], [[void *p = malloc (0); - int result = !p; + void * volatile vp = p; + int result = !vp; free (p); return result;]]) ], @@ -26,7 +27,7 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF], # Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ | gnu* | *-musl* | midipix* | midnightbsd* \ - | hpux* | solaris* | cygwin* | mingw* | msys* ) + | hpux* | solaris* | cygwin* | mingw* | windows* | msys* ) ac_cv_func_malloc_0_nonnull="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;; @@ -128,7 +129,7 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX], dnl except on those platforms where we have seen 'test-malloc-gnu', dnl 'test-realloc-gnu', 'test-calloc-gnu' fail. case "$host_os" in - mingw*) + mingw* | windows*) gl_cv_func_malloc_posix=no ;; irix* | solaris*) dnl On IRIX 6.5, the three functions return NULL with errno unset diff --git a/m4/malloca.m4 b/m4/malloca.m4 index 1d777eb..77e1595 100644 --- a/m4/malloca.m4 +++ b/m4/malloca.m4 @@ -1,5 +1,5 @@ # malloca.m4 serial 2 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2023 Free Software Foundation, +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2024 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/m4/mbchar.m4 b/m4/mbchar.m4 index aed40a5..471e8c4 100644 --- a/m4/mbchar.m4 +++ b/m4/mbchar.m4 @@ -1,5 +1,5 @@ # mbchar.m4 serial 9 -dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2024 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/m4/mbiter.m4 b/m4/mbiter.m4 index 8e879dc..2f7e788 100644 --- a/m4/mbiter.m4 +++ b/m4/mbiter.m4 @@ -1,5 +1,5 @@ # mbiter.m4 serial 7 -dnl Copyright (C) 2005, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008-2024 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/m4/mbrtoc32.m4 b/m4/mbrtoc32.m4 new file mode 100644 index 0000000..c1eb126 --- /dev/null +++ b/m4/mbrtoc32.m4 @@ -0,0 +1,266 @@ +# mbrtoc32.m4 serial 18 +dnl Copyright (C) 2014-2024 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_MBRTOC32], +[ + AC_REQUIRE([gl_UCHAR_H_DEFAULTS]) + + AC_REQUIRE([AC_TYPE_MBSTATE_T]) + dnl Determine REPLACE_MBSTATE_T, from which GNULIB_defined_mbstate_t is + dnl determined. It describes how our overridden mbrtowc is implemented. + dnl We then implement mbrtoc32 accordingly. + AC_REQUIRE([gl_MBSTATE_T_BROKEN]) + + AC_REQUIRE([gl_TYPE_CHAR32_T]) + AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) + + AC_REQUIRE([gl_CHECK_FUNC_MBRTOC32]) + if test $gl_cv_func_mbrtoc32 = no; then + HAVE_MBRTOC32=0 + else + if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBRTOC32=1 + else + gl_MBRTOC32_EMPTY_INPUT + gl_MBRTOC32_C_LOCALE + case "$gl_cv_func_mbrtoc32_empty_input" in + *yes) ;; + *) AC_DEFINE([MBRTOC32_EMPTY_INPUT_BUG], [1], + [Define if the mbrtoc32 function does not return (size_t) -2 for empty input.]) + REPLACE_MBRTOC32=1 + ;; + esac + case "$gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ" in + *yes) ;; + *) AC_DEFINE([MBRTOC32_IN_C_LOCALE_MAYBE_EILSEQ], [1], + [Define if the mbrtoc32 function may signal encoding errors in the C locale.]) + REPLACE_MBRTOC32=1 + ;; + esac + fi + if test $HAVE_WORKING_MBRTOC32 = 0; then + REPLACE_MBRTOC32=1 + fi + fi +]) + +AC_DEFUN([gl_CHECK_FUNC_MBRTOC32], +[ + dnl Cf. gl_CHECK_FUNCS_ANDROID + AC_CHECK_DECL([mbrtoc32], , , + [[#ifdef __HAIKU__ + #include + #endif + #include + ]]) + if test $ac_cv_have_decl_mbrtoc32 = yes; then + dnl We can't use AC_CHECK_FUNC here, because mbrtoc32() is defined as a + dnl static inline function on Haiku 2020. + AC_CACHE_CHECK([for mbrtoc32], [gl_cv_func_mbrtoc32], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #ifdef __HAIKU__ + #include + #endif + #include + ]], + [[char32_t c; + return mbrtoc32 (&c, "", 1, NULL) == 0; + ]]) + ], + [gl_cv_func_mbrtoc32=yes], + [gl_cv_func_mbrtoc32=no]) + ]) + else + gl_cv_func_mbrtoc32=no + fi +]) + +dnl Test whether mbrtoc32 returns the correct value on empty input. + +AC_DEFUN([gl_MBRTOC32_EMPTY_INPUT], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether mbrtoc32 works on empty input], + [gl_cv_func_mbrtoc32_empty_input], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + #ifdef __HAIKU__ + #include + #endif + #include + static char32_t wc; + static mbstate_t mbs; + int + main (void) + { + return mbrtoc32 (&wc, "", 0, &mbs) != (size_t) -2; + }]])], + [gl_cv_func_mbrtoc32_empty_input=yes], + [gl_cv_func_mbrtoc32_empty_input=no], + [case "$host_os" in + # Guess no on glibc systems. + *-gnu* | gnu*) gl_cv_func_mbrtoc32_empty_input="guessing no" ;; + # Guess no on Android. + linux*-android*) gl_cv_func_mbrtoc32_empty_input="guessing no" ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_mbrtoc32_empty_input="guessing no" ;; + *) gl_cv_func_mbrtoc32_empty_input="guessing yes" ;; + esac + ]) + ]) +]) + +dnl +dnl POSIX:2018 says regarding mbrtowc: "In the POSIX locale an [EILSEQ] error +dnl cannot occur since all byte values are valid characters." It is reasonable +dnl to expect mbrtoc32 to behave in the same way. + +AC_DEFUN([gl_MBRTOC32_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_mbrtoc32_C_locale_sans_EILSEQ], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #ifdef __HAIKU__ + #include + #endif + #include + ]], [[ + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + char32_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtoc32 (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + ]])], + [gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ=yes], + [gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ=no], + [case "$host_os" in + # Guess yes on native Windows. + mingw* | windows*) gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ="guessing yes" ;; + *) gl_cv_func_mbrtoc32_C_locale_sans_EILSEQ="$gl_cross_guess_normal" ;; + esac + ]) + ]) +]) + +dnl Test whether mbrtoc32 works not worse than mbrtowc. +dnl Result is HAVE_WORKING_MBRTOC32. + +AC_DEFUN([gl_MBRTOC32_SANITYCHECK], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_TYPE_CHAR32_T]) + AC_REQUIRE([gl_CHECK_FUNC_MBRTOC32]) + AC_REQUIRE([gt_LOCALE_FR]) + AC_REQUIRE([gt_LOCALE_ZH_CN]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + if test $GNULIBHEADERS_OVERRIDE_CHAR32_T = 1 || test $gl_cv_func_mbrtoc32 = no; then + HAVE_WORKING_MBRTOC32=0 + else + AC_CACHE_CHECK([whether mbrtoc32 works as well as mbrtowc], + [gl_cv_func_mbrtoc32_sanitycheck], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on FreeBSD, Solaris, native Windows. + freebsd* | midnightbsd* | solaris* | mingw* | windows*) + gl_cv_func_mbrtoc32_sanitycheck="guessing no" + ;; + # Guess yes otherwise. + *) + gl_cv_func_mbrtoc32_sanitycheck="guessing yes" + ;; + esac +changequote([,])dnl + if test $LOCALE_FR != none || test $LOCALE_ZH_CN != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +#include +#ifdef __HAIKU__ + #include +#endif +#include +int main () +{ + int result = 0; + /* This fails on native Windows: + mbrtoc32 returns (size_t)-1. + mbrtowc returns 1 (correct). */ + if (strcmp ("$LOCALE_FR", "none") != 0 + && setlocale (LC_ALL, "$LOCALE_FR") != NULL) + { + mbstate_t state; + wchar_t wc = (wchar_t) 0xBADFACE; + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "\374", 1, &state) == 1) + { + char32_t c32 = (wchar_t) 0xBADFACE; + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtoc32 (&c32, "\374", 1, &state) != 1) + result |= 1; + } + } + /* This fails on FreeBSD 13.0 and Solaris 11.4: + mbrtoc32 returns (size_t)-2 or (size_t)-1. + mbrtowc returns 4 (correct). */ + if (strcmp ("$LOCALE_ZH_CN", "none") != 0 + && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) + { + mbstate_t state; + wchar_t wc = (wchar_t) 0xBADFACE; + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (&wc, "\224\071\375\067", 4, &state) == 4) + { + char32_t c32 = (wchar_t) 0xBADFACE; + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtoc32 (&c32, "\224\071\375\067", 4, &state) != 4) + result |= 2; + } + } + return result; +}]])], + [gl_cv_func_mbrtoc32_sanitycheck=yes], + [gl_cv_func_mbrtoc32_sanitycheck=no], + [:]) + fi + ]) + case "$gl_cv_func_mbrtoc32_sanitycheck" in + *yes) + HAVE_WORKING_MBRTOC32=1 + AC_DEFINE([HAVE_WORKING_MBRTOC32], [1], + [Define if the mbrtoc32 function basically works.]) + ;; + *) HAVE_WORKING_MBRTOC32=0 ;; + esac + fi + AC_SUBST([HAVE_WORKING_MBRTOC32]) +]) + +# Prerequisites of lib/mbrtoc32.c and lib/lc-charset-dispatch.c. +AC_DEFUN([gl_PREREQ_MBRTOC32], [ + : +]) diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4 index 893faff..6ff5182 100644 --- a/m4/mbrtowc.m4 +++ b/m4/mbrtowc.m4 @@ -1,5 +1,5 @@ -# mbrtowc.m4 serial 40 -*- coding: utf-8 -*- -dnl Copyright (C) 2001-2002, 2004-2005, 2008-2023 Free Software Foundation, +# mbrtowc.m4 serial 44 -*- coding: utf-8 -*- +dnl Copyright (C) 2001-2002, 2004-2005, 2008-2024 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,7 +91,9 @@ AC_DEFUN([gl_FUNC_MBRTOWC], fi if test $REPLACE_MBSTATE_T = 1; then case "$host_os" in - mingw*) MBRTOWC_LIB= ;; + mingw* | windows*) + MBRTOWC_LIB= + ;; *) gl_WEAK_SYMBOLS case "$gl_cv_have_weak" in @@ -129,7 +131,7 @@ AC_DEFUN_ONCE([gl_MBSTATE_T_BROKEN], dnl to override it, even if - like on MSVC - mbsinit() is only defined as dnl an inline function, not as a global function. if case "$host_os" in - mingw*) true ;; + mingw* | windows*) true ;; *) test $ac_cv_func_mbsinit = yes ;; esac \ && test $ac_cv_func_mbrtowc = yes; then @@ -411,14 +413,16 @@ AC_DEFUN([gl_MBRTOWC_RETVAL], dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on HP-UX, Solaris, native Windows. - hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_retval="guessing yes" ;; + # Guess no on HP-UX, Solaris, native Windows. + hpux* | solaris* | mingw* | windows*) + gl_cv_func_mbrtowc_retval="guessing no" ;; + # Guess yes otherwise. + *) + gl_cv_func_mbrtowc_retval="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ - || { case "$host_os" in mingw*) true;; *) false;; esac; }; then + || { case "$host_os" in mingw* | windows*) true;; *) false;; esac; }; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include @@ -429,7 +433,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; @@ -445,7 +450,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; @@ -580,13 +586,13 @@ AC_DEFUN([gl_MBRTOWC_STORES_INCOMPLETE], dnl is present. changequote(,)dnl case "$host_os" in - # Guess yes on native Windows. - mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;; - *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;; + # Guess yes on native Windows. + mingw* | windows*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;; + *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;; esac changequote([,])dnl case "$host_os" in - mingw*) + mingw* | windows*) AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include @@ -680,31 +686,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 - 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 + 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* | windows*) gl_cv_func_mbrtowc_empty_input="guessing no" ;; + *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + esac + ]) ]) ]) @@ -722,12 +725,7 @@ 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 #include @@ -748,13 +746,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* | windows*) 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/m4/mbsinit.m4 b/m4/mbsinit.m4 index c388a8b..10a5b61 100644 --- a/m4/mbsinit.m4 +++ b/m4/mbsinit.m4 @@ -1,5 +1,5 @@ -# mbsinit.m4 serial 9 -dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc. +# mbsinit.m4 serial 10 +dnl Copyright (C) 2008, 2010-2024 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,7 +32,7 @@ AC_DEFUN([gl_FUNC_MBSINIT], dnl states produced by mbrtowc() for an incomplete multibyte character dnl in multibyte locales. case "$host_os" in - mingw*) REPLACE_MBSINIT=1 ;; + mingw* | windows*) REPLACE_MBSINIT=1 ;; esac fi fi diff --git a/m4/mbsrtowcs.m4 b/m4/mbsrtowcs.m4 index 4f2e88c..84ac0b7 100644 --- a/m4/mbsrtowcs.m4 +++ b/m4/mbsrtowcs.m4 @@ -1,5 +1,5 @@ -# mbsrtowcs.m4 serial 15 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +# mbsrtowcs.m4 serial 17 +dnl Copyright (C) 2008-2024 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. @@ -61,10 +61,12 @@ AC_DEFUN([gl_MBSRTOWCS_WORKS], dnl is present. changequote(,)dnl case "$host_os" in - # Guess no on HP-UX, Solaris, mingw. - hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; + # Guess no on HP-UX, Solaris, mingw. + hpux* | solaris* | mingw* | windows*) + gl_cv_func_mbsrtowcs_works="guessing no" ;; + # Guess yes otherwise. + *) + gl_cv_func_mbsrtowcs_works="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then @@ -78,7 +80,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; @@ -91,7 +94,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; @@ -105,7 +109,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; @@ -119,7 +124,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/m4/mbstate_t.m4 b/m4/mbstate_t.m4 index dcd66b9..b2bcba4 100644 --- a/m4/mbstate_t.m4 +++ b/m4/mbstate_t.m4 @@ -1,5 +1,5 @@ # mbstate_t.m4 serial 14 -dnl Copyright (C) 2000-2002, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2000-2002, 2008-2024 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/m4/mbtowc.m4 b/m4/mbtowc.m4 index 02ed6eb..2bdc879 100644 --- a/m4/mbtowc.m4 +++ b/m4/mbtowc.m4 @@ -1,5 +1,5 @@ # mbtowc.m4 serial 5 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2024 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/m4/md4.m4 b/m4/md4.m4 index 8c3589f..ce282a0 100644 --- a/m4/md4.m4 +++ b/m4/md4.m4 @@ -1,5 +1,5 @@ # md4.m4 serial 7 -dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2008-2024 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/m4/md5.m4 b/m4/md5.m4 index 678489e..7af56a8 100644 --- a/m4/md5.m4 +++ b/m4/md5.m4 @@ -1,5 +1,5 @@ # md5.m4 serial 14 -dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2008-2024 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/m4/memchr.m4 b/m4/memchr.m4 index 4f1aed0..6184ddc 100644 --- a/m4/memchr.m4 +++ b/m4/memchr.m4 @@ -1,5 +1,5 @@ -# memchr.m4 serial 18 -dnl Copyright (C) 2002-2004, 2009-2023 Free Software Foundation, Inc. +# memchr.m4 serial 19 +dnl Copyright (C) 2002-2004, 2009-2024 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,12 +85,12 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no], [case "$host_os" in - # Guess no on Android. - linux*-android*) gl_cv_func_memchr_works="guessing no" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_memchr_works="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; + # Guess no on Android. + linux*-android*) gl_cv_func_memchr_works="guessing no" ;; + # Guess yes on native Windows. + mingw* | windows*) gl_cv_func_memchr_works="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; esac ]) ]) diff --git a/m4/mempcpy.m4 b/m4/mempcpy.m4 index 612b77b..94ce05d 100644 --- a/m4/mempcpy.m4 +++ b/m4/mempcpy.m4 @@ -1,5 +1,5 @@ # mempcpy.m4 serial 14 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2023 Free Software Foundation, +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2024 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/m4/memrchr.m4 b/m4/memrchr.m4 index 7611ac7..b4ccdfa 100644 --- a/m4/memrchr.m4 +++ b/m4/memrchr.m4 @@ -1,5 +1,5 @@ # memrchr.m4 serial 11 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 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/m4/minmax.m4 b/m4/minmax.m4 index fd09846..5c0a927 100644 --- a/m4/minmax.m4 +++ b/m4/minmax.m4 @@ -1,5 +1,5 @@ # minmax.m4 serial 4 -dnl Copyright (C) 2005, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2024 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/m4/mkdir.m4 b/m4/mkdir.m4 index c2bc4da..48297f9 100644 --- a/m4/mkdir.m4 +++ b/m4/mkdir.m4 @@ -1,6 +1,6 @@ -# serial 18 +# serial 20 -# Copyright (C) 2001, 2003-2004, 2006, 2008-2023 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003-2004, 2006, 2008-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -25,23 +25,24 @@ AC_DEFUN([gl_FUNC_MKDIR], [gl_cv_func_mkdir_trailing_slash_works=yes], [gl_cv_func_mkdir_trailing_slash_works=no], [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. - mingw*) AC_EGREP_CPP([Known], [ + # 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. + windows*-msvc*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; + mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif - ], - [gl_cv_func_mkdir_trailing_slash_works="guessing yes"], - [gl_cv_func_mkdir_trailing_slash_works="guessing no"]) - ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;; + ], + [gl_cv_func_mkdir_trailing_slash_works="guessing yes"], + [gl_cv_func_mkdir_trailing_slash_works="guessing no"]) + ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;; esac ]) rm -rf conftest.dir @@ -65,16 +66,16 @@ AC_DEFUN([gl_FUNC_MKDIR], [gl_cv_func_mkdir_trailing_dot_works=yes], [gl_cv_func_mkdir_trailing_dot_works=no], [case "$host_os" in - # Guess yes on glibc systems. - *-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. - *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;; + # Guess yes on glibc systems. + *-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* | windows*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;; esac ]) rm -rf conftest.dir diff --git a/m4/mkostemp.m4 b/m4/mkostemp.m4 index 1b0d0d5..1c22b8d 100644 --- a/m4/mkostemp.m4 +++ b/m4/mkostemp.m4 @@ -1,5 +1,5 @@ # mkostemp.m4 serial 4 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/mkstemp.m4 b/m4/mkstemp.m4 index d4a15ea..106a6b8 100644 --- a/m4/mkstemp.m4 +++ b/m4/mkstemp.m4 @@ -1,6 +1,6 @@ -#serial 29 +#serial 30 -# Copyright (C) 2001, 2003-2007, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -63,7 +63,7 @@ AC_DEFUN([gl_FUNC_MKSTEMP], # 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" ;; + mingw* | windows*) 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 diff --git a/m4/mktime.m4 b/m4/mktime.m4 index e9d31f3..0565e5e 100644 --- a/m4/mktime.m4 +++ b/m4/mktime.m4 @@ -1,5 +1,5 @@ -# serial 37 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, +# serial 39 +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 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, @@ -264,9 +264,9 @@ main () [gl_cv_func_working_mktime=yes], [gl_cv_func_working_mktime=no], [case "$host_os" in - # Guess no on native Windows. - mingw*) gl_cv_func_working_mktime="guessing no" ;; - *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_working_mktime="guessing no" ;; + *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;; esac ]) fi @@ -280,7 +280,6 @@ AC_DEFUN([gl_FUNC_MKTIME], AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) - REPLACE_MKTIME=0 if test "$gl_cv_func_working_mktime" != yes; then REPLACE_MKTIME=1 AC_DEFINE([NEED_MKTIME_WORKING], [1], @@ -288,7 +287,7 @@ AC_DEFUN([gl_FUNC_MKTIME], with the algorithmic workarounds.]) fi case "$host_os" in - mingw*) + mingw* | windows*) REPLACE_MKTIME=1 AC_DEFINE([NEED_MKTIME_WINDOWS], [1], [Define if the compilation of mktime.c should define 'mktime' diff --git a/m4/mmap-anon.m4 b/m4/mmap-anon.m4 index d07d26e..642f07d 100644 --- a/m4/mmap-anon.m4 +++ b/m4/mmap-anon.m4 @@ -1,5 +1,5 @@ # mmap-anon.m4 serial 12 -dnl Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2007, 2009-2024 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/m4/mode_t.m4 b/m4/mode_t.m4 index 82197c0..af88da5 100644 --- a/m4/mode_t.m4 +++ b/m4/mode_t.m4 @@ -1,5 +1,5 @@ # mode_t.m4 serial 2 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/msvc-inval.m4 b/m4/msvc-inval.m4 index 8d9d21b..b8ba598 100644 --- a/m4/msvc-inval.m4 +++ b/m4/msvc-inval.m4 @@ -1,5 +1,5 @@ # msvc-inval.m4 serial 1 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2024 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/m4/msvc-nothrow.m4 b/m4/msvc-nothrow.m4 index 0263e49..3e332a0 100644 --- a/m4/msvc-nothrow.m4 +++ b/m4/msvc-nothrow.m4 @@ -1,5 +1,5 @@ # msvc-nothrow.m4 serial 1 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2024 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/m4/multiarch.m4 b/m4/multiarch.m4 index 3ba5b0f..5f8339f 100644 --- a/m4/multiarch.m4 +++ b/m4/multiarch.m4 @@ -1,5 +1,5 @@ # multiarch.m4 serial 9 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/musl.m4 b/m4/musl.m4 index e28a3fe..34d2c1f 100644 --- a/m4/musl.m4 +++ b/m4/musl.m4 @@ -1,5 +1,5 @@ # musl.m4 serial 4 -dnl Copyright (C) 2019-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2019-2024 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/m4/nanosleep.m4 b/m4/nanosleep.m4 index e21a3e3..ff730b6 100644 --- a/m4/nanosleep.m4 +++ b/m4/nanosleep.m4 @@ -1,11 +1,11 @@ -# serial 43 +# serial 47 dnl From Jim Meyering. dnl Check for the nanosleep function. dnl If not found, use the supplied replacement. dnl -# Copyright (C) 1999-2001, 2003-2023 Free Software Foundation, Inc. +# Copyright (C) 1999-2001, 2003-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -21,7 +21,7 @@ AC_DEFUN([gl_FUNC_NANOSLEEP], AC_CHECK_DECLS_ONCE([alarm]) - nanosleep_save_libs=$LIBS + gl_saved_LIBS=$LIBS # Solaris 2.5.1 needs -lposix4 to get the nanosleep function. # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. @@ -116,19 +116,24 @@ AC_DEFUN([gl_FUNC_NANOSLEEP], *) gl_cv_func_nanosleep=no ;; esac], [case "$host_os" in - linux*) # Guess it halfway works when the kernel is Linux. + # Guess it halfway works when the kernel is Linux. + linux*) gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;; - mingw*) # Guess no on native Windows. + # Midipix generally emulates the Linux system calls, + # but here it handles large arguments correctly. + midipix*) + gl_cv_func_nanosleep='guessing yes' ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_nanosleep='guessing no' ;; - *) # If we don't know, obey --enable-cross-guesses. + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_nanosleep="$gl_cross_guess_normal" ;; esac ]) ]) case "$gl_cv_func_nanosleep" in - *yes) - REPLACE_NANOSLEEP=0 - ;; + *yes) ;; *) REPLACE_NANOSLEEP=1 case "$gl_cv_func_nanosleep" in @@ -142,7 +147,7 @@ AC_DEFUN([gl_FUNC_NANOSLEEP], else HAVE_NANOSLEEP=0 fi - LIBS=$nanosleep_save_libs + LIBS=$gl_saved_LIBS # For backward compatibility. LIB_NANOSLEEP="$NANOSLEEP_LIB" diff --git a/m4/netdb_h.m4 b/m4/netdb_h.m4 index e6aa892..dc65398 100644 --- a/m4/netdb_h.m4 +++ b/m4/netdb_h.m4 @@ -1,5 +1,5 @@ # netdb_h.m4 serial 15 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/netinet_in_h.m4 b/m4/netinet_in_h.m4 index 7115419..9618c0c 100644 --- a/m4/netinet_in_h.m4 +++ b/m4/netinet_in_h.m4 @@ -1,5 +1,5 @@ # netinet_in_h.m4 serial 6 -dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2024 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/m4/nl_langinfo.m4 b/m4/nl_langinfo.m4 index 7648d52..3ffefe3 100644 --- a/m4/nl_langinfo.m4 +++ b/m4/nl_langinfo.m4 @@ -1,5 +1,5 @@ # nl_langinfo.m4 serial 11 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/nls.m4 b/m4/nls.m4 index 7c11c90..6572448 100644 --- a/m4/nls.m4 +++ b/m4/nls.m4 @@ -1,5 +1,5 @@ # nls.m4 serial 6 (gettext-0.20.2) -dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2022 Free +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2023 Free dnl 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/m4/nocrash.m4 b/m4/nocrash.m4 index 6a76638..9730fc0 100644 --- a/m4/nocrash.m4 +++ b/m4/nocrash.m4 @@ -1,5 +1,5 @@ # nocrash.m4 serial 5 -dnl Copyright (C) 2005, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2024 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/m4/off_t.m4 b/m4/off_t.m4 index 880f347..f3259f9 100644 --- a/m4/off_t.m4 +++ b/m4/off_t.m4 @@ -1,5 +1,5 @@ # off_t.m4 serial 1 -dnl Copyright (C) 2012-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2024 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/m4/open-cloexec.m4 b/m4/open-cloexec.m4 index fd572fc..a2d5032 100644 --- a/m4/open-cloexec.m4 +++ b/m4/open-cloexec.m4 @@ -1,6 +1,6 @@ # Test whether O_CLOEXEC is defined. -dnl Copyright 2017-2023 Free Software Foundation, Inc. +dnl Copyright 2017-2024 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/m4/open-slash.m4 b/m4/open-slash.m4 index 1f731f8..45310c0 100644 --- a/m4/open-slash.m4 +++ b/m4/open-slash.m4 @@ -1,5 +1,5 @@ # open-slash.m4 serial 2 -dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2024 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/m4/open.m4 b/m4/open.m4 index 94fa2bb..91e5c31 100644 --- a/m4/open.m4 +++ b/m4/open.m4 @@ -1,5 +1,5 @@ -# open.m4 serial 15 -dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. +# open.m4 serial 16 +dnl Copyright (C) 2007-2024 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,7 @@ AC_DEFUN([gl_FUNC_OPEN], AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_PREPROC_O_CLOEXEC]) case "$host_os" in - mingw* | pw*) + mingw* | windows* | pw*) REPLACE_OPEN=1 ;; *) diff --git a/m4/openat.m4 b/m4/openat.m4 index bbbcad8..47cd93c 100644 --- a/m4/openat.m4 +++ b/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-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2024 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/m4/opendir.m4 b/m4/opendir.m4 index 2e9be76..7cc8632 100644 --- a/m4/opendir.m4 +++ b/m4/opendir.m4 @@ -1,5 +1,5 @@ -# opendir.m4 serial 6 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +# opendir.m4 serial 7 +dnl Copyright (C) 2011-2024 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,16 +13,12 @@ AC_DEFUN([gl_FUNC_OPENDIR], if test $ac_cv_func_opendir = no; then HAVE_OPENDIR=0 else - dnl Replace opendir() on native Windows, to support fdopendir(). + dnl Replace opendir() on native Windows and OS/2 kLIBC, + dnl 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], [ diff --git a/m4/pathmax.m4 b/m4/pathmax.m4 index 6d47d2c..a0fc296 100644 --- a/m4/pathmax.m4 +++ b/m4/pathmax.m4 @@ -1,5 +1,5 @@ # pathmax.m4 serial 11 -dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2024 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/m4/pipe.m4 b/m4/pipe.m4 index 1ad6688..1d3742e 100644 --- a/m4/pipe.m4 +++ b/m4/pipe.m4 @@ -1,5 +1,5 @@ # pipe.m4 serial 2 -dnl Copyright (C) 2010-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2024 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/m4/pipe2.m4 b/m4/pipe2.m4 index 79de69c..74b7b28 100644 --- a/m4/pipe2.m4 +++ b/m4/pipe2.m4 @@ -1,5 +1,5 @@ # pipe2.m4 serial 4 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/posix_spawn.m4 b/m4/posix_spawn.m4 index 0a0dfe7..0066a45 100644 --- a/m4/posix_spawn.m4 +++ b/m4/posix_spawn.m4 @@ -1,5 +1,5 @@ -# posix_spawn.m4 serial 23 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +# posix_spawn.m4 serial 25 +dnl Copyright (C) 2008-2024 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,7 +36,8 @@ AC_DEFUN([gl_POSIX_SPAWN_BODY], if test $ac_cv_func_posix_spawn = yes; then m4_ifdef([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR], [dnl Module 'posix_spawn_file_actions_addchdir' is present. - AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addchdir_np]) + gl_CHECK_FUNCS_ANDROID([posix_spawn_file_actions_addchdir_np], + [[#include ]]) if test $ac_cv_func_posix_spawn_file_actions_addchdir_np = no; then dnl In order to implement the posix_spawn_file_actions_addchdir dnl function, we need to replace the entire posix_spawn facility. @@ -45,7 +46,8 @@ AC_DEFUN([gl_POSIX_SPAWN_BODY], ]) m4_ifdef([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR], [dnl Module 'posix_spawn_file_actions_addfchdir' is present. - AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addfchdir_np]) + gl_CHECK_FUNCS_ANDROID([posix_spawn_file_actions_addfchdir_np], + [[#include ]]) if test $ac_cv_func_posix_spawn_file_actions_addfchdir_np = no; then dnl In order to implement the posix_spawn_file_actions_addfchdir dnl function, we need to replace the entire posix_spawn facility. @@ -588,7 +590,7 @@ int main () *-musl* | midipix*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;; solaris*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;; # Guess no on native Windows. - mingw*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;; + mingw* | windows*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;; *) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing yes" ;; esac ]) @@ -632,7 +634,7 @@ int main () *-musl* | midipix*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";; solaris*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";; # Guess no on native Windows. - mingw*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no" ;; + mingw* | windows*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no" ;; *) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing yes";; esac ]) @@ -678,7 +680,7 @@ int main () *-musl* | midipix*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";; solaris*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";; # Guess no on native Windows. - mingw*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no" ;; + mingw* | windows*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no" ;; *) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing yes";; esac ]) diff --git a/m4/posix_spawn_faction_addchdir.m4 b/m4/posix_spawn_faction_addchdir.m4 index 6116a8e..a22e3a5 100644 --- a/m4/posix_spawn_faction_addchdir.m4 +++ b/m4/posix_spawn_faction_addchdir.m4 @@ -1,5 +1,5 @@ -# posix_spawn_faction_addchdir.m4 serial 1 -dnl Copyright (C) 2018-2023 Free Software Foundation, Inc. +# posix_spawn_faction_addchdir.m4 serial 2 +dnl Copyright (C) 2018-2024 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,9 @@ AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR], AC_REQUIRE([gl_SPAWN_H_DEFAULTS]) AC_REQUIRE([AC_PROG_CC]) gl_POSIX_SPAWN - AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addchdir posix_spawn_file_actions_addchdir_np]) + AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addchdir]) + gl_CHECK_FUNCS_ANDROID([posix_spawn_file_actions_addchdir_np], + [[#include ]]) if test $ac_cv_func_posix_spawn_file_actions_addchdir = yes; then dnl This function is not yet standardized. Therefore override the dnl system's implementation always. diff --git a/m4/printf.m4 b/m4/printf.m4 index efb85a5..6f91777 100644 --- a/m4/printf.m4 +++ b/m4/printf.m4 @@ -1,5 +1,5 @@ -# printf.m4 serial 82 -dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc. +# printf.m4 serial 90 +dnl Copyright (C) 2003, 2007-2024 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. @@ -86,7 +86,8 @@ changequote(,)dnl linux*-android*) gl_cv_func_printf_sizes_c99="guessing yes";; changequote([,])dnl # Guess yes on MSVC, no on mingw. - mingw*) AC_EGREP_CPP([Known], [ + windows*-msvc*) gl_cv_func_printf_sizes_c99="guessing yes" ;; + mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif @@ -179,7 +180,7 @@ int main () # 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";; + mingw* | windows*) 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 @@ -223,20 +224,21 @@ int main () [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no], [case "$host_os" in - # Guess no on BeOS. - beos*) gl_cv_func_printf_long_double="guessing no";; - # Guess yes on Android. - linux*-android*) gl_cv_func_printf_long_double="guessing yes";; - # Guess yes on MSVC, no on mingw. - mingw*) AC_EGREP_CPP([Known], [ + # Guess no on BeOS. + beos*) gl_cv_func_printf_long_double="guessing no";; + # Guess yes on Android. + linux*-android*) gl_cv_func_printf_long_double="guessing yes";; + # Guess yes on MSVC, no on mingw. + windows*-msvc*) gl_cv_func_printf_long_double="guessing yes" ;; + mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif - ], - [gl_cv_func_printf_long_double="guessing yes"], - [gl_cv_func_printf_long_double="guessing no"]) - ;; - *) gl_cv_func_printf_long_double="guessing yes";; + ], + [gl_cv_func_printf_long_double="guessing yes"], + [gl_cv_func_printf_long_double="guessing no"]) + ;; + *) gl_cv_func_printf_long_double="guessing yes";; esac ]) ]) @@ -354,7 +356,8 @@ changequote(,)dnl linux*-android*) gl_cv_func_printf_infinite="guessing no";; changequote([,])dnl # Guess yes on MSVC, no on mingw. - mingw*) AC_EGREP_CPP([Known], [ + windows*-msvc*) gl_cv_func_printf_infinite="guessing yes" ;; + mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif @@ -568,7 +571,8 @@ changequote(,)dnl linux*-android*) gl_cv_func_printf_infinite_long_double="guessing no";; changequote([,])dnl # Guess yes on MSVC, no on mingw. - mingw*) AC_EGREP_CPP([Known], [ + windows*-msvc*) gl_cv_func_printf_infinite_long_double="guessing yes" ;; + mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif @@ -681,7 +685,7 @@ int main () # Guess no on Android. linux*-android*) gl_cv_func_printf_directive_a="guessing no";; # Guess no on native Windows. - mingw*) gl_cv_func_printf_directive_a="guessing no";; + mingw* | windows*) gl_cv_func_printf_directive_a="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_printf_directive_a="$gl_cross_guess_normal";; esac @@ -736,7 +740,7 @@ int main () # 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";; + mingw* | windows*) 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 @@ -791,7 +795,7 @@ int main () # 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";; + mingw* | windows*) 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 @@ -857,7 +861,8 @@ changequote(,)dnl linux*-android*) gl_cv_func_printf_directive_f="guessing no";; changequote([,])dnl # Guess yes on MSVC, no on mingw. - mingw*) AC_EGREP_CPP([Known], [ + windows*-msvc*) gl_cv_func_printf_directive_f="guessing yes" ;; + mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif @@ -885,6 +890,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ +#include #include #include #include @@ -902,6 +908,12 @@ invalid_parameter_handler (const wchar_t *expression, exit (1); } #endif +static void +abort_handler (int sig) +{ + (void) sig; + _exit (1); +} static char fmtstring[10]; static char buf[100]; int main () @@ -910,6 +922,7 @@ int main () #ifdef _MSC_VER _set_invalid_parameter_handler (invalid_parameter_handler); #endif + signal (SIGABRT, abort_handler); /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) support %n in format strings in read-only memory but not in writable memory. */ @@ -923,21 +936,21 @@ int main () [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no], [case "$host_os" in - # Guess no on glibc when _FORTIFY_SOURCE >= 2. - *-gnu* | gnu*) AC_COMPILE_IFELSE( - [AC_LANG_SOURCE( - [[#if _FORTIFY_SOURCE >= 2 - error fail - #endif - ]])], - [gl_cv_func_printf_directive_n="guessing yes"], - [gl_cv_func_printf_directive_n="guessing no"]) - ;; - # Guess no on Android. - linux*-android*) gl_cv_func_printf_directive_n="guessing no";; - # Guess no on native Windows. - mingw*) gl_cv_func_printf_directive_n="guessing no";; - *) gl_cv_func_printf_directive_n="guessing yes";; + # Guess no on glibc when _FORTIFY_SOURCE >= 2. + *-gnu* | gnu*) AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if _FORTIFY_SOURCE >= 2 + error fail + #endif + ]])], + [gl_cv_func_printf_directive_n="guessing yes"], + [gl_cv_func_printf_directive_n="guessing no"]) + ;; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_directive_n="guessing no";; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_printf_directive_n="guessing no";; + *) gl_cv_func_printf_directive_n="guessing yes";; esac ]) ]) @@ -1007,18 +1020,18 @@ int main () [ changequote(,)dnl case "$host_os" in - # Guess yes on OpenBSD >= 6.0. - openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";; - openbsd*) gl_cv_func_printf_directive_ls="guessing yes";; - irix*) gl_cv_func_printf_directive_ls="guessing no";; - solaris*) gl_cv_func_printf_directive_ls="guessing no";; - cygwin*) gl_cv_func_printf_directive_ls="guessing no";; - beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; - # Guess no on Android. - linux*-android*) gl_cv_func_printf_directive_ls="guessing no";; - # Guess yes on native Windows. - mingw*) gl_cv_func_printf_directive_ls="guessing yes";; - *) gl_cv_func_printf_directive_ls="guessing yes";; + # Guess yes on OpenBSD >= 6.0. + openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";; + openbsd*) gl_cv_func_printf_directive_ls="guessing yes";; + irix*) gl_cv_func_printf_directive_ls="guessing no";; + solaris*) gl_cv_func_printf_directive_ls="guessing no";; + cygwin*) gl_cv_func_printf_directive_ls="guessing no";; + beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_directive_ls="guessing no";; + # Guess yes on native Windows. + mingw* | windows*) gl_cv_func_printf_directive_ls="guessing yes";; + *) gl_cv_func_printf_directive_ls="guessing yes";; esac changequote([,])dnl ]) @@ -1027,7 +1040,8 @@ 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 whether the functions produce a NUL byte, as specified in ISO C 23 +dnl after the issue GB-141 was fixed. dnl Result is gl_cv_func_printf_directive_lc. AC_DEFUN([gl_PRINTF_DIRECTIVE_LC], @@ -1046,13 +1060,11 @@ 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: */ + /* This test fails on musl libc 1.2.4. */ { buf[0] = '\0'; if (sprintf (buf, "%lc%lc%lc", (wint_t) 'a', (wint_t) 0, (wint_t) 'z') < 0 - || strcmp (buf, "az") != 0) + || memcmp (buf, "a\0z", 4) != 0) result |= 1; } return result; @@ -1062,10 +1074,10 @@ int main () [ 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";; + # Guess no on musl libc. + *-musl* | midipix*) gl_cv_func_printf_directive_lc="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_printf_directive_lc="guessing yes";; esac changequote([,])dnl ]) @@ -1102,13 +1114,17 @@ int main () changequote(,)dnl case "$host_os" in netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) - gl_cv_func_printf_positions="guessing no";; - beos*) gl_cv_func_printf_positions="guessing no";; - # Guess yes on Android. - linux*-android*) gl_cv_func_printf_positions="guessing yes";; - # Guess no on native Windows. - mingw* | pw*) gl_cv_func_printf_positions="guessing no";; - *) gl_cv_func_printf_positions="guessing yes";; + gl_cv_func_printf_positions="guessing no";; + beos*) + gl_cv_func_printf_positions="guessing no";; + # Guess yes on Android. + linux*-android*) + gl_cv_func_printf_positions="guessing yes";; + # Guess no on native Windows. + mingw* | windows* | pw*) + gl_cv_func_printf_positions="guessing no";; + *) + gl_cv_func_printf_positions="guessing yes";; esac changequote([,])dnl ]) @@ -1143,13 +1159,13 @@ int main () [ changequote(,)dnl case "$host_os" in - cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; - netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; - # Guess no on Android. - linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";; - # Guess no on native Windows. - mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; - *) gl_cv_func_printf_flag_grouping="guessing yes";; + cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; + netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";; + # Guess no on native Windows. + mingw* | windows* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; + *) gl_cv_func_printf_flag_grouping="guessing yes";; esac changequote([,])dnl ]) @@ -1186,16 +1202,16 @@ int main () [ changequote(,)dnl case "$host_os" in - # Guess yes on HP-UX 11. - hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; - # Guess no on HP-UX 10 and older. - hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; - # Guess yes on Android. - linux*-android*) gl_cv_func_printf_flag_leftadjust="guessing yes";; - # Guess yes on native Windows. - mingw*) gl_cv_func_printf_flag_leftadjust="guessing yes";; - # Guess yes otherwise. - *) gl_cv_func_printf_flag_leftadjust="guessing yes";; + # Guess yes on HP-UX 11. + hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; + # Guess no on HP-UX 10 and older. + hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; + # Guess yes on Android. + linux*-android*) gl_cv_func_printf_flag_leftadjust="guessing yes";; + # Guess yes on native Windows. + mingw* | windows*) gl_cv_func_printf_flag_leftadjust="guessing yes";; + # Guess yes otherwise. + *) gl_cv_func_printf_flag_leftadjust="guessing yes";; esac changequote([,])dnl ]) @@ -1242,7 +1258,7 @@ changequote(,)dnl # 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";; + mingw* | windows*) 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 @@ -1251,6 +1267,50 @@ changequote([,])dnl ]) ]) +dnl Test whether the *printf family of functions supports the # flag with a +dnl zero precision and a zero value in the 'x' and 'X' directives correctly. +dnl ISO C and POSIX specify that for the 'd', 'i', 'b', 'o', 'u', 'x', 'X' +dnl directives: "The result of converting a zero value with a precision of +dnl zero is no characters." But on Mac OS X 10.5, for the 'x', 'X' directives, +dnl when a # flag is present, the output is "0" instead of "". +dnl Result is gl_cv_func_printf_flag_alt_precision_zero. + +AC_DEFUN([gl_PRINTF_FLAG_ALT_PRECISION_ZERO], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the alternative flag with a zero precision], + [gl_cv_func_printf_flag_alt_precision_zero], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +static char buf[10]; +int main () +{ + int result = 0; + if (sprintf (buf, "%#.0x %d", 0, 33, 44) > 0 + 3) + result |= 1; + return result; +}]])], + [gl_cv_func_printf_flag_alt_precision_zero=yes], + [gl_cv_func_printf_flag_alt_precision_zero=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess no only on macOS 10..12 systems. + darwin[0-9] | darwin[0-9].* | \ + darwin1[0-9] | darwin1[0-9].* | \ + darwin2[0-1] | darwin2[0-1].*) + gl_cv_func_printf_flag_alt_precision_zero="guessing no" ;; + darwin*) gl_cv_func_printf_flag_alt_precision_zero="guessing yes" ;; + *) gl_cv_func_printf_flag_alt_precision_zero="guessing yes" ;; + esac +changequote([,])dnl + ]) + ]) +]) + dnl Test whether the *printf family of functions supports large precisions. dnl On mingw, precisions larger than 512 are treated like 512, in integer, dnl floating-point or pointer output. On Solaris 10/x86, precisions larger @@ -1297,12 +1357,12 @@ int main () changequote(,)dnl case "$host_os" in # Guess no only on Solaris, native Windows, and BeOS systems. - solaris*) gl_cv_func_printf_precision="guessing no" ;; - mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; - beos*) gl_cv_func_printf_precision="guessing no" ;; - # Guess yes on Android. - linux*-android*) gl_cv_func_printf_precision="guessing yes" ;; - *) gl_cv_func_printf_precision="guessing yes" ;; + solaris*) gl_cv_func_printf_precision="guessing no" ;; + mingw* | windows* | pw*) gl_cv_func_printf_precision="guessing no" ;; + beos*) gl_cv_func_printf_precision="guessing no" ;; + # Guess yes on Android. + linux*-android*) gl_cv_func_printf_precision="guessing yes" ;; + *) gl_cv_func_printf_precision="guessing yes" ;; esac changequote([,])dnl ]) @@ -1518,7 +1578,7 @@ changequote(,)dnl # Guess yes on Android. linux*-android*) gl_cv_func_snprintf_truncation_c99="guessing yes";; # Guess no on native Windows. - mingw*) gl_cv_func_snprintf_truncation_c99="guessing no";; + mingw* | windows*) gl_cv_func_snprintf_truncation_c99="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";; esac @@ -1615,7 +1675,8 @@ changequote(,)dnl linux*-android*) gl_cv_func_snprintf_retval_c99="guessing yes";; changequote([,])dnl # Guess yes on MSVC, no on mingw. - mingw*) AC_EGREP_CPP([Known], [ + windows*-msvc*) gl_cv_func_snprintf_retval_c99="guessing yes" ;; + mingw* | windows*) AC_EGREP_CPP([Known], [ #ifdef _MSC_VER Known #endif @@ -1644,6 +1705,7 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ +#include #include #include #if HAVE_SNPRINTF @@ -1660,11 +1722,18 @@ static int my_snprintf (char *buf, int size, const char *format, ...) return ret; } #endif +static void +abort_handler (int sig) +{ + (void) sig; + _exit (1); +} static char fmtstring[10]; static char buf[100]; int main () { int count = -1; + signal (SIGABRT, abort_handler); /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) support %n in format strings in read-only memory but not in writable memory. */ @@ -1719,7 +1788,7 @@ changequote(,)dnl # Guess no on Android. linux*-android*) gl_cv_func_snprintf_directive_n="guessing no";; # Guess no on native Windows. - mingw*) gl_cv_func_snprintf_directive_n="guessing no";; + mingw* | windows*) gl_cv_func_snprintf_directive_n="guessing no";; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_snprintf_directive_n="$gl_cross_guess_normal";; changequote([,])dnl @@ -1767,11 +1836,11 @@ int main() [gl_cv_func_snprintf_size1=yes], [gl_cv_func_snprintf_size1=no], [case "$host_os" in - # Guess yes on Android. - linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_snprintf_size1="guessing yes" ;; - *) gl_cv_func_snprintf_size1="guessing yes" ;; + # Guess yes on Android. + linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;; + # Guess yes on native Windows. + mingw* | windows*) gl_cv_func_snprintf_size1="guessing yes" ;; + *) gl_cv_func_snprintf_size1="guessing yes" ;; esac ]) ]) @@ -1844,40 +1913,40 @@ int main() [ changequote(,)dnl case "$host_os" in - # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on musl systems. - *-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";; - midnightbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on Mac OS X >= 10.3. - darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on Cygwin. - cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on Solaris >= 2.6. + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on musl systems. + *-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";; + midnightbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. solaris2.[0-5] | solaris2.[0-5].*) - gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on AIX >= 4. - aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on IRIX >= 6.5. - irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on NetBSD >= 3. + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on NetBSD >= 3. netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) - gl_cv_func_vsnprintf_zerosize_c99="guessing no";; - netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on BeOS. - beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on Android. - linux*-android*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # Guess yes on native Windows. - mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_vsnprintf_zerosize_c99="$gl_cross_guess_normal";; + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Android. + linux*-android*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on native Windows. + mingw* | windows* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_vsnprintf_zerosize_c99="$gl_cross_guess_normal";; esac changequote([,])dnl ]) @@ -1906,7 +1975,7 @@ AC_DEFUN([gl_SWPRINTF_WORKS], int main() { int result = 0; - { /* This test fails on musl, FreeBSD, NetBSD, OpenBSD, macOS, AIX. */ + { /* 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: @@ -1934,17 +2003,17 @@ int main() [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 yes";; - # Guess no on FreeBSD, NetBSD, OpenBSD, macOS, AIX. + # 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";; + gl_cv_func_swprintf_works="guessing no";; + # Guess no on native Windows. + mingw* | windows* | 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 ]) ]) @@ -1983,7 +2052,7 @@ int main () [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. + # Guess yes on glibc >= 2.17 systems. *-gnu* | gnu*) AC_EGREP_CPP([Unlucky], [ #include @@ -1996,14 +2065,60 @@ int main () [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 no";; - # Guess yes 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";; + # 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* | windows*) 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 +#include +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 . */ + 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* | windows*) 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 ]) ]) @@ -2027,16 +2142,18 @@ 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 17 = gl_PRINTF_FLAG_ALT_PRECISION_ZERO +dnl 18 = gl_PRINTF_PRECISION +dnl 19 = gl_PRINTF_ENOMEM +dnl 20 = gl_SNPRINTF_PRESENCE +dnl 21 = gl_SNPRINTF_TRUNCATION_C99 +dnl 22 = gl_SNPRINTF_RETVAL_C99 +dnl 23 = gl_SNPRINTF_DIRECTIVE_N +dnl 24 = gl_SNPRINTF_SIZE1 +dnl 25 = gl_VSNPRINTF_ZEROSIZE_C99 +dnl 26 = gl_SWPRINTF_WORKS +dnl 27 = gl_SWPRINTF_DIRECTIVE_LA +dnl 28 = gl_SWPRINTF_DIRECTIVE_LC dnl dnl 1 = checking whether printf supports size specifiers as in C99... dnl 2 = checking whether printf supports size specifiers as in C23... @@ -2054,57 +2171,60 @@ dnl 13 = checking whether printf supports POSIX/XSI format strings with position 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 17 = checking whether printf supports the alternative flag with a zero precision... +dnl 18 = checking whether printf supports large precisions... +dnl 19 = checking whether printf survives out-of-memory conditions... +dnl 20 = checking for snprintf... +dnl 21 = checking whether snprintf truncates the result as in C99... +dnl 22 = checking whether snprintf returns a byte count as in C99... +dnl 23 = checking whether snprintf fully supports the 'n' directive... +dnl 24 = checking whether snprintf respects a size of 1... +dnl 25 = checking whether vsnprintf respects a zero size as in C99... +dnl 26 = checking whether swprintf works... +dnl 27 = checking whether swprintf supports the 'La' and 'LA' directives... +dnl 28 = 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 21 22 23 24 25 26 -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 # # # # # # # # # . . ? # # . # # ? . # # # . . # ? +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 28 +dnl musl libc 1.2.3 . # . . . . # # . . . # . . . . ? . . . . . . . . # . # +dnl glibc 2.35 . # . . . . . . . . . . . . . . . . . . . . . . . . . . +dnl glibc 2.5 . # . . . . # # . . . . . . . . . . . . . . . . . . # . +dnl glibc 2.3.6 . # . . . # # # . . . . . . . . . . . . . . . . . . # . +dnl FreeBSD 14.0 . . . . . # . . . . . . . . . . . . # . . . . . . # . # +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/m4/pselect.m4 b/m4/pselect.m4 index 6c3d1b8..005b722 100644 --- a/m4/pselect.m4 +++ b/m4/pselect.m4 @@ -1,5 +1,5 @@ # pselect.m4 serial 11 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2024 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/m4/pthread_rwlock_rdlock.m4 b/m4/pthread_rwlock_rdlock.m4 index 66b29f8..ddb5831 100644 --- a/m4/pthread_rwlock_rdlock.m4 +++ b/m4/pthread_rwlock_rdlock.m4 @@ -1,5 +1,5 @@ -# pthread_rwlock_rdlock.m4 serial 5 -dnl Copyright (C) 2017-2023 Free Software Foundation, Inc. +# pthread_rwlock_rdlock.m4 serial 8 +dnl Copyright (C) 2017-2024 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,11 +34,11 @@ dnl https://sourceware.org/bugzilla/show_bug.cgi?id=13701 dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052 AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER], [ - AC_REQUIRE([gl_THREADLIB_EARLY]) + AC_REQUIRE([gl_THREADLIB]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader], [gl_cv_pthread_rwlock_rdlock_prefer_writer], - [save_LIBS="$LIBS" + [saved_LIBS="$LIBS" LIBS="$LIBS $LIBMULTITHREAD" AC_RUN_IFELSE( [AC_LANG_SOURCE([[ @@ -164,7 +164,7 @@ main () *-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 + mingw* | windows*) 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" @@ -174,7 +174,7 @@ main () *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;; esac ]) - LIBS="$save_LIBS" + LIBS="$saved_LIBS" ]) case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in *yes) diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4 index 2779528..cb2ee90 100644 --- a/m4/pthread_sigmask.m4 +++ b/m4/pthread_sigmask.m4 @@ -1,5 +1,5 @@ -# pthread_sigmask.m4 serial 22 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +# pthread_sigmask.m4 serial 23 +dnl Copyright (C) 2011-2024 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. @@ -47,7 +47,7 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK], if test -n "$LIBMULTITHREAD"; then AC_CACHE_CHECK([for pthread_sigmask in $LIBMULTITHREAD], [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD], - [gl_save_LIBS="$LIBS" + [gl_saved_LIBS="$LIBS" LIBS="$LIBS $LIBMULTITHREAD" AC_LINK_IFELSE( [AC_LANG_PROGRAM( @@ -58,7 +58,7 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK], ], [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes], [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no]) - LIBS="$gl_save_LIBS" + LIBS="$gl_saved_LIBS" ]) if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then dnl pthread_sigmask is available with -pthread or -lpthread. @@ -164,7 +164,7 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK], AC_CACHE_CHECK([whether pthread_sigmask returns error numbers], [gl_cv_func_pthread_sigmask_return_works], [ - gl_save_LIBS="$LIBS" + gl_saved_LIBS="$LIBS" LIBS="$LIBS $PTHREAD_SIGMASK_LIB" AC_RUN_IFELSE( [AC_LANG_SOURCE([[ @@ -188,7 +188,7 @@ int main () gl_cv_func_pthread_sigmask_return_works="guessing yes";; esac ]) - LIBS="$gl_save_LIBS" + LIBS="$gl_saved_LIBS" ]) case "$gl_cv_func_pthread_sigmask_return_works" in *no) @@ -214,7 +214,7 @@ int main () [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 + gl_saved_LIBS=$LIBS LIBS="$LIBS $LIBMULTITHREAD"]) AC_RUN_IFELSE( [AC_LANG_SOURCE([[ @@ -258,7 +258,7 @@ int main () [:], [gl_cv_func_pthread_sigmask_unblock_works=no], [:]) - m4_ifdef([gl_][THREADLIB], [LIBS=$gl_save_LIBS]) + m4_ifdef([gl_][THREADLIB], [LIBS=$gl_saved_LIBS]) ]) case "$gl_cv_func_pthread_sigmask_unblock_works" in *no) diff --git a/m4/quote.m4 b/m4/quote.m4 index 551437f..e44c674 100644 --- a/m4/quote.m4 +++ b/m4/quote.m4 @@ -1,5 +1,5 @@ # quote.m4 serial 6 -dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2024 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/m4/quotearg.m4 b/m4/quotearg.m4 index 15e4aa6..3ea7eb5 100644 --- a/m4/quotearg.m4 +++ b/m4/quotearg.m4 @@ -1,5 +1,5 @@ # quotearg.m4 serial 10 -dnl Copyright (C) 2002, 2004-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004-2024 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/m4/raise.m4 b/m4/raise.m4 index f20c439..08b9545 100644 --- a/m4/raise.m4 +++ b/m4/raise.m4 @@ -1,5 +1,5 @@ # raise.m4 serial 4 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2024 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/m4/rawmemchr.m4 b/m4/rawmemchr.m4 index a48d829..57d1c29 100644 --- a/m4/rawmemchr.m4 +++ b/m4/rawmemchr.m4 @@ -1,5 +1,5 @@ # rawmemchr.m4 serial 3 -dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007-2024 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/m4/readdir.m4 b/m4/readdir.m4 index 81337e2..2205f13 100644 --- a/m4/readdir.m4 +++ b/m4/readdir.m4 @@ -1,5 +1,5 @@ -# readdir.m4 serial 2 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +# readdir.m4 serial 3 +dnl Copyright (C) 2011-2024 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,7 +12,8 @@ AC_DEFUN([gl_FUNC_READDIR], if test $ac_cv_func_readdir = no; then HAVE_READDIR=0 else - dnl Replace readdir() on native Windows, to support fdopendir(). + dnl Replace readdir() on native Windows and OS/2 kLIBC, + dnl to support fdopendir(). AC_REQUIRE([gl_DIRENT_DIR]) if test $DIR_HAS_FD_MEMBER = 0; then REPLACE_READDIR=1 diff --git a/m4/readlink.m4 b/m4/readlink.m4 index f1d41d2..6d78ec8 100644 --- a/m4/readlink.m4 +++ b/m4/readlink.m4 @@ -1,5 +1,5 @@ # readlink.m4 serial 17 -dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007, 2009-2024 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/m4/realloc.m4 b/m4/realloc.m4 index 2605391..a59af28 100644 --- a/m4/realloc.m4 +++ b/m4/realloc.m4 @@ -1,5 +1,5 @@ -# realloc.m4 serial 27 -dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. +# realloc.m4 serial 29 +dnl Copyright (C) 2007, 2009-2024 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. @@ -16,7 +16,8 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF], [[#include ]], [[void *p = realloc (0, 0); - int result = !p; + void * volatile vp = p; + int result = !vp; free (p); return result;]]) ], @@ -26,7 +27,7 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF], # Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ | gnu* | *-musl* | midipix* | midnightbsd* \ - | hpux* | solaris* | cygwin* | mingw* | msys* ) + | hpux* | solaris* | cygwin* | mingw* | windows* | msys* ) ac_cv_func_realloc_0_nonnull="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) ac_cv_func_realloc_0_nonnull="$gl_cross_guess_normal" ;; diff --git a/m4/reallocarray.m4 b/m4/reallocarray.m4 index 6a5b5ab..20c4601 100644 --- a/m4/reallocarray.m4 +++ b/m4/reallocarray.m4 @@ -1,5 +1,5 @@ # reallocarray.m4 serial 5 -dnl Copyright (C) 2017-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2017-2024 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/m4/regex.m4 b/m4/regex.m4 index 7acadc4..3dfeabe 100644 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -1,6 +1,6 @@ -# serial 74 +# serial 75 -# Copyright (C) 1996-2001, 2003-2023 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -327,10 +327,10 @@ AC_DEFUN([gl_REGEX], [gl_cv_func_re_compile_pattern_working=yes], [gl_cv_func_re_compile_pattern_working=no], [case "$host_os" in - # Guess no on native Windows. - mingw*) gl_cv_func_re_compile_pattern_working="guessing no" ;; - # Otherwise obey --enable-cross-guesses. - *) gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_re_compile_pattern_working="guessing no" ;; + # Otherwise obey --enable-cross-guesses. + *) gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;; esac ]) ]) diff --git a/m4/rename.m4 b/m4/rename.m4 index efabf1a..757cc27 100644 --- a/m4/rename.m4 +++ b/m4/rename.m4 @@ -1,6 +1,6 @@ -# serial 34 +# serial 37 -# Copyright (C) 2001, 2003, 2005-2006, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005-2006, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -9,8 +9,8 @@ dnl From Volker Borchert. dnl Determine whether rename works for source file names with a trailing slash. dnl The rename from SunOS 4.1.1_U1 doesn't. dnl -dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange -dnl to compile the wrapper function. +dnl If it doesn't, arrange to compile the wrapper function and define +dnl macros for use by that function. dnl AC_DEFUN([gl_FUNC_RENAME], @@ -55,16 +55,15 @@ AC_DEFUN([gl_FUNC_RENAME], [gl_cv_func_rename_slash_dst_works=no], dnl When crosscompiling, assume rename is broken. [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. - mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;; + # Guess yes on Linux systems + # and on systems that emulate the Linux system calls. + linux* | 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. + mingw* | windows*) gl_cv_func_rename_slash_dst_works="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;; esac ]) rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk @@ -113,16 +112,15 @@ AC_DEFUN([gl_FUNC_RENAME], [gl_cv_func_rename_slash_src_works=no], dnl When crosscompiling, assume rename is broken. [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. - mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;; + # Guess yes on Linux systems + # and on systems that emulate the Linux system calls. + linux* | 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. + mingw* | windows*) gl_cv_func_rename_slash_src_works="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;; esac ]) rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk @@ -186,16 +184,15 @@ AC_DEFUN([gl_FUNC_RENAME], else dnl When crosscompiling, assume rename is broken. 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. - mingw*) gl_cv_func_rename_link_works="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;; + # Guess yes on Linux systems + # and on systems that emulate the Linux system calls. + linux* | 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. + mingw* | windows*) gl_cv_func_rename_link_works="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;; esac fi else @@ -237,14 +234,15 @@ AC_DEFUN([gl_FUNC_RENAME], [gl_cv_func_rename_dest_works=no], dnl When crosscompiling, assume rename is broken. [case "$host_os" in - # Guess yes on Linux systems. - linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;; - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_rename_dest_works="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;; + # Guess yes on Linux systems + # and on systems that emulate the Linux system calls. + linux* | midipix*) gl_cv_func_rename_dest_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_rename_dest_works="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;; esac ]) rm -rf conftest.f conftest.d1 conftest.d2 diff --git a/m4/rewinddir.m4 b/m4/rewinddir.m4 index d0d24de..a5ee4e1 100644 --- a/m4/rewinddir.m4 +++ b/m4/rewinddir.m4 @@ -1,5 +1,5 @@ -# rewinddir.m4 serial 2 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +# rewinddir.m4 serial 3 +dnl Copyright (C) 2011-2024 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,7 +12,8 @@ AC_DEFUN([gl_FUNC_REWINDDIR], if test $ac_cv_func_rewinddir = no; then HAVE_REWINDDIR=0 else - dnl Replace rewinddir() on native Windows, to support fdopendir(). + dnl Replace rewinddir() on native Windows and OS/2 kLIBC, + dnl to support fdopendir(). AC_REQUIRE([gl_DIRENT_DIR]) if test $DIR_HAS_FD_MEMBER = 0; then REPLACE_REWINDDIR=1 diff --git a/m4/rmdir.m4 b/m4/rmdir.m4 index b19c890..50156e0 100644 --- a/m4/rmdir.m4 +++ b/m4/rmdir.m4 @@ -1,5 +1,5 @@ -# rmdir.m4 serial 18 -dnl Copyright (C) 2002, 2005, 2009-2023 Free Software Foundation, Inc. +# rmdir.m4 serial 19 +dnl Copyright (C) 2002, 2005, 2009-2024 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,16 +34,16 @@ AC_DEFUN([gl_FUNC_RMDIR], ]])], [gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no], [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. - mingw*) gl_cv_func_rmdir_works="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;; + # 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. + mingw* | windows*) gl_cv_func_rmdir_works="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;; esac ]) rm -rf conftest.dir conftest.file]) diff --git a/m4/save-cwd.m4 b/m4/save-cwd.m4 index 2e6cf58..f1ac345 100644 --- a/m4/save-cwd.m4 +++ b/m4/save-cwd.m4 @@ -1,5 +1,5 @@ # serial 10 -dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2024 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/m4/sched_h.m4 b/m4/sched_h.m4 index 980d256..2ff821e 100644 --- a/m4/sched_h.m4 +++ b/m4/sched_h.m4 @@ -1,5 +1,5 @@ # sched_h.m4 serial 15 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/secure_getenv.m4 b/m4/secure_getenv.m4 index acb0650..ce06595 100644 --- a/m4/secure_getenv.m4 +++ b/m4/secure_getenv.m4 @@ -1,5 +1,5 @@ # secure_getenv.m4 serial 2 -dnl Copyright 2013-2023 Free Software Foundation, Inc. +dnl Copyright 2013-2024 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/m4/select.m4 b/m4/select.m4 index 88861af..f3f9dcc 100644 --- a/m4/select.m4 +++ b/m4/select.m4 @@ -1,5 +1,5 @@ -# select.m4 serial 15 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +# select.m4 serial 16 +dnl Copyright (C) 2009-2024 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. @@ -96,7 +96,7 @@ changequote([,])dnl SELECT_LIB="$LIBSOCKET" if test $REPLACE_SELECT = 1; then case "$host_os" in - mingw*) + mingw* | windows*) dnl On the MSVC platform, the function MsgWaitForMultipleObjects dnl (used in lib/select.c) requires linking with -luser32. On mingw, dnl it is implicit. diff --git a/m4/servent.m4 b/m4/servent.m4 index 0f35b8b..fffb951 100644 --- a/m4/servent.m4 +++ b/m4/servent.m4 @@ -1,5 +1,5 @@ -# servent.m4 serial 4 -dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc. +# servent.m4 serial 5 +dnl Copyright (C) 2008, 2010-2024 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. @@ -28,7 +28,7 @@ AC_DEFUN([gl_SERVENT], AC_CACHE_CHECK([for getservbyname in winsock2.h and -lws2_32], [gl_cv_w32_getservbyname], [gl_cv_w32_getservbyname=no - gl_save_LIBS="$LIBS" + gl_saved_LIBS="$LIBS" LIBS="$LIBS -lws2_32" AC_LINK_IFELSE( [AC_LANG_PROGRAM( @@ -40,7 +40,7 @@ AC_DEFUN([gl_SERVENT], ]], [[getservbyname(NULL,NULL);]])], [gl_cv_w32_getservbyname=yes]) - LIBS="$gl_save_LIBS" + LIBS="$gl_saved_LIBS" ]) if test "$gl_cv_w32_getservbyname" = "yes"; then SERVENT_LIB="-lws2_32" diff --git a/m4/setlocale_null.m4 b/m4/setlocale_null.m4 index 1105d69..54d3d46 100644 --- a/m4/setlocale_null.m4 +++ b/m4/setlocale_null.m4 @@ -1,5 +1,5 @@ -# setlocale_null.m4 serial 8 -dnl Copyright (C) 2019-2023 Free Software Foundation, Inc. +# setlocale_null.m4 serial 9 +dnl Copyright (C) 2019-2024 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. @@ -31,7 +31,7 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL], [gl_cv_func_setlocale_null_all_mtsafe=no]) ;; # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. - *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*) + *-gnu* | gnu* | hpux* | irix* | solaris* | mingw* | windows*) gl_cv_func_setlocale_null_all_mtsafe=yes ;; # If we don't know, obey --enable-cross-guesses. *) @@ -40,7 +40,7 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL], ]) dnl On platforms without multithreading, there is no issue. case "$host_os" in - mingw*) ;; + mingw* | windows*) ;; *) if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then gl_cv_func_setlocale_null_all_mtsafe="trivially yes" @@ -62,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* | midipix* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*) + *-gnu* | gnu* | *-musl* | midipix* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw* | windows*) gl_cv_func_setlocale_null_one_mtsafe=yes ;; # If we don't know, obey --enable-cross-guesses. *) @@ -71,7 +71,7 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL], ]) dnl On platforms without multithreading, there is no issue. case "$host_os" in - mingw*) ;; + mingw* | windows*) ;; *) if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then gl_cv_func_setlocale_null_one_mtsafe="trivially yes" @@ -88,7 +88,9 @@ 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*) SETLOCALE_NULL_LIB= ;; + mingw* | windows*) + SETLOCALE_NULL_LIB= + ;; *) gl_WEAK_SYMBOLS case "$gl_cv_have_weak" in diff --git a/m4/sh-filename.m4 b/m4/sh-filename.m4 index f30a620..c0d3937 100644 --- a/m4/sh-filename.m4 +++ b/m4/sh-filename.m4 @@ -1,5 +1,5 @@ # sh-filename.m4 serial 3 -dnl Copyright (C) 2018-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2018-2024 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/m4/sha1.m4 b/m4/sha1.m4 index 16b79c0..c0a8753 100644 --- a/m4/sha1.m4 +++ b/m4/sha1.m4 @@ -1,5 +1,5 @@ # sha1.m4 serial 12 -dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2008-2024 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/m4/sha256.m4 b/m4/sha256.m4 index 4d1d1dd..2dd754c 100644 --- a/m4/sha256.m4 +++ b/m4/sha256.m4 @@ -1,5 +1,5 @@ # sha256.m4 serial 8 -dnl Copyright (C) 2005, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008-2024 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/m4/sha512.m4 b/m4/sha512.m4 index b66dc72..19d03b5 100644 --- a/m4/sha512.m4 +++ b/m4/sha512.m4 @@ -1,5 +1,5 @@ # sha512.m4 serial 9 -dnl Copyright (C) 2005-2006, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2006, 2008-2024 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/m4/sig_atomic_t.m4 b/m4/sig_atomic_t.m4 index 268f131..ad62134 100644 --- a/m4/sig_atomic_t.m4 +++ b/m4/sig_atomic_t.m4 @@ -1,5 +1,5 @@ # sig_atomic_t.m4 serial 3 -dnl Copyright (C) 2003, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2024 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/m4/sigaction.m4 b/m4/sigaction.m4 index e981a74..926bb9c 100644 --- a/m4/sigaction.m4 +++ b/m4/sigaction.m4 @@ -1,5 +1,5 @@ # sigaction.m4 serial 7 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/signal_h.m4 b/m4/signal_h.m4 index cdd6812..6f7dcc7 100644 --- a/m4/signal_h.m4 +++ b/m4/signal_h.m4 @@ -1,5 +1,5 @@ # signal_h.m4 serial 22 -dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2024 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/m4/signalblocking.m4 b/m4/signalblocking.m4 index 81cc91a..f818d5d 100644 --- a/m4/signalblocking.m4 +++ b/m4/signalblocking.m4 @@ -1,5 +1,5 @@ # signalblocking.m4 serial 17 -dnl Copyright (C) 2001-2002, 2006-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2002, 2006-2024 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/m4/sigpipe.m4 b/m4/sigpipe.m4 index 1b6ec42..da8f03b 100644 --- a/m4/sigpipe.m4 +++ b/m4/sigpipe.m4 @@ -1,5 +1,5 @@ # sigpipe.m4 serial 3 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/size_max.m4 b/m4/size_max.m4 index 0763366..b3f7624 100644 --- a/m4/size_max.m4 +++ b/m4/size_max.m4 @@ -1,5 +1,5 @@ # size_max.m4 serial 12 -dnl Copyright (C) 2003, 2005-2006, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2006, 2008-2024 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/m4/snprintf.m4 b/m4/snprintf.m4 index 4b5fbdb..96f9c4e 100644 --- a/m4/snprintf.m4 +++ b/m4/snprintf.m4 @@ -1,5 +1,5 @@ # snprintf.m4 serial 7 -dnl Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2007-2024 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/m4/socketlib.m4 b/m4/socketlib.m4 index a556af1..0633969 100644 --- a/m4/socketlib.m4 +++ b/m4/socketlib.m4 @@ -1,5 +1,5 @@ -# socketlib.m4 serial 3 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +# socketlib.m4 serial 4 +dnl Copyright (C) 2008-2024 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. @@ -18,7 +18,7 @@ AC_DEFUN([gl_SOCKETLIB], dnl defined through -lws2_32), we need to call it. AC_CACHE_CHECK([for WSAStartup], [gl_cv_func_wsastartup], [ - gl_save_LIBS="$LIBS" + gl_saved_LIBS="$LIBS" LIBS="$LIBS -lws2_32" AC_LINK_IFELSE( [AC_LANG_PROGRAM([[ @@ -33,7 +33,7 @@ AC_DEFUN([gl_SOCKETLIB], ], [gl_cv_func_wsastartup=yes], [gl_cv_func_wsastartup=no]) - LIBS="$gl_save_LIBS" + LIBS="$gl_saved_LIBS" ]) if test "$gl_cv_func_wsastartup" = "yes"; then AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.]) @@ -56,8 +56,8 @@ AC_DEFUN([gl_SOCKETLIB], #endif char setsockopt();]], [[setsockopt();]])], [], - [gl_save_LIBS="$LIBS" - LIBS="$gl_save_LIBS -lsocket" + [gl_saved_LIBS="$LIBS" + LIBS="$gl_saved_LIBS -lsocket" AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern #ifdef __cplusplus "C" @@ -65,7 +65,7 @@ char setsockopt();]], [[setsockopt();]])], char setsockopt();]], [[setsockopt();]])], [gl_cv_lib_socket="-lsocket"]) if test -z "$gl_cv_lib_socket"; then - LIBS="$gl_save_LIBS -lnetwork" + LIBS="$gl_saved_LIBS -lnetwork" AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern #ifdef __cplusplus "C" @@ -73,7 +73,7 @@ char setsockopt();]], [[setsockopt();]])], char setsockopt();]], [[setsockopt();]])], [gl_cv_lib_socket="-lnetwork"]) if test -z "$gl_cv_lib_socket"; then - LIBS="$gl_save_LIBS -lnet" + LIBS="$gl_saved_LIBS -lnet" AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern #ifdef __cplusplus "C" @@ -82,7 +82,7 @@ char setsockopt();]], [[setsockopt();]])], [gl_cv_lib_socket="-lnet"]) fi fi - LIBS="$gl_save_LIBS" + LIBS="$gl_saved_LIBS" ]) if test -z "$gl_cv_lib_socket"; then gl_cv_lib_socket="none needed" diff --git a/m4/sockets.m4 b/m4/sockets.m4 index ed9cb87..7be4dc9 100644 --- a/m4/sockets.m4 +++ b/m4/sockets.m4 @@ -1,5 +1,5 @@ # sockets.m4 serial 7 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/socklen.m4 b/m4/socklen.m4 index 1c63a85..9c46db1 100644 --- a/m4/socklen.m4 +++ b/m4/socklen.m4 @@ -1,5 +1,5 @@ # socklen.m4 serial 11 -dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2024 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/m4/sockpfaf.m4 b/m4/sockpfaf.m4 index 6c6dc2f..390abfe 100644 --- a/m4/sockpfaf.m4 +++ b/m4/sockpfaf.m4 @@ -1,5 +1,5 @@ # sockpfaf.m4 serial 10 -dnl Copyright (C) 2004, 2006, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2009-2024 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/m4/spawn-pipe.m4 b/m4/spawn-pipe.m4 index bf69078..54706ce 100644 --- a/m4/spawn-pipe.m4 +++ b/m4/spawn-pipe.m4 @@ -1,5 +1,5 @@ # spawn-pipe.m4 serial 2 -dnl Copyright (C) 2004, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2008-2024 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/m4/spawn_h.m4 b/m4/spawn_h.m4 index b7b9a61..226a683 100644 --- a/m4/spawn_h.m4 +++ b/m4/spawn_h.m4 @@ -1,5 +1,5 @@ # spawn_h.m4 serial 24 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/ssize_t.m4 b/m4/ssize_t.m4 index 1c12c33..25b28d7 100644 --- a/m4/ssize_t.m4 +++ b/m4/ssize_t.m4 @@ -1,23 +1,37 @@ -# ssize_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2001-2003, 2006, 2010-2023 Free Software Foundation, Inc. +# ssize_t.m4 serial 6 +dnl Copyright (C) 2001-2003, 2006, 2010-2024 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 ]], [[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 + 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/m4/stat-time.m4 b/m4/stat-time.m4 index 40993d5..8bec2f5 100644 --- a/m4/stat-time.m4 +++ b/m4/stat-time.m4 @@ -1,6 +1,6 @@ # Checks for stat-related time functions. -# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2023 Free Software +# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2024 Free Software # Foundation, Inc. # This file is free software; the Free Software Foundation diff --git a/m4/stat.m4 b/m4/stat.m4 index 6d1628c..1d2a9e2 100644 --- a/m4/stat.m4 +++ b/m4/stat.m4 @@ -1,6 +1,6 @@ -# serial 19 +# serial 21 -# Copyright (C) 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2009-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -12,7 +12,7 @@ AC_DEFUN([gl_FUNC_STAT], AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) AC_CHECK_FUNCS_ONCE([lstat]) case "$host_os" in - mingw*) + mingw* | windows*) dnl On this platform, the original stat() returns st_atime, st_mtime, dnl st_ctime values that are affected by the time zone. REPLACE_STAT=1 @@ -61,8 +61,8 @@ AC_DEFUN([gl_FUNC_STAT], help when passed a file name with a trailing slash]);; esac case $host_os in - dnl Solaris stat can return a negative tv_nsec. - solaris*) + dnl macOS and Solaris stat can return a negative tv_nsec. + darwin* | solaris*) REPLACE_FSTAT=1 ;; esac ;; @@ -80,7 +80,7 @@ AC_DEFUN([gl_PREREQ_STAT], [ AC_DEFUN([gl_PREREQ_STAT_W32], [ AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in - mingw*) + mingw* | windows*) AC_CHECK_HEADERS([sdkddkver.h]) ;; esac diff --git a/m4/stdalign.m4 b/m4/stdalign.m4 index 1a236d6..e3c1e60 100644 --- a/m4/stdalign.m4 +++ b/m4/stdalign.m4 @@ -1,6 +1,6 @@ # Check for alignas and alignof that conform to C23. -dnl Copyright 2011-2023 Free Software Foundation, Inc. +dnl Copyright 2011-2024 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,10 +13,10 @@ AC_DEFUN([gl_ALIGNASOF], [ AC_CACHE_CHECK([for alignas and alignof], [gl_cv_header_working_stdalign_h], - [gl_save_CFLAGS=$CFLAGS + [gl_saved_CFLAGS=$CFLAGS for gl_working in "yes, keywords" "yes, macros"; do AS_CASE([$gl_working], - [*stdalign.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_STDALIGN_H"]) + [*stdalign.h*], [CFLAGS="$gl_saved_CFLAGS -DINCLUDE_STDALIGN_H"]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include @@ -56,7 +56,7 @@ AC_DEFUN([gl_ALIGNASOF], [gl_cv_header_working_stdalign_h=$gl_working], [gl_cv_header_working_stdalign_h=no]) - CFLAGS=$gl_save_CFLAGS + CFLAGS=$gl_saved_CFLAGS test "$gl_cv_header_working_stdalign_h" != no && break done]) @@ -68,8 +68,10 @@ AC_DEFUN([gl_ALIGNASOF], 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 +[#if !defined HAVE_C_ALIGNASOF \ + && !(defined __cplusplus && 201103 <= __cplusplus) \ + && !defined alignof +# if defined HAVE_STDALIGN_H # include # endif @@ -110,7 +112,11 @@ AC_DEFUN([gl_ALIGNASOF], # define _Alignof(type) alignof (type) # else template struct __alignof_helper { char __a; __t __b; }; -# define _Alignof(type) offsetof (__alignof_helper, __b) +# if (defined __GNUC__ && 4 <= __GNUC__) || defined __clang__ +# define _Alignof(type) __builtin_offsetof (__alignof_helper, __b) +# else +# define _Alignof(type) offsetof (__alignof_helper, __b) +# endif # define _GL_STDALIGN_NEEDS_STDDEF 1 # endif # else @@ -166,7 +172,7 @@ AC_DEFUN([gl_ALIGNASOF], # define _Alignas(a) __declspec (align (a)) # endif # endif -# if !HAVE_STDALIGN_H +# if !defined HAVE_STDALIGN_H # if ((defined _Alignas \ && !(defined __cplusplus \ && (201103 <= __cplusplus || defined _MSC_VER))) \ @@ -175,7 +181,7 @@ AC_DEFUN([gl_ALIGNASOF], # endif # endif -# if _GL_STDALIGN_NEEDS_STDDEF +# if defined _GL_STDALIGN_NEEDS_STDDEF # include # endif #endif]) diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4 index aa01221..1bf9eb3 100644 --- a/m4/stddef_h.m4 +++ b/m4/stddef_h.m4 @@ -1,5 +1,5 @@ # stddef_h.m4 serial 14 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/stdint.m4 b/m4/stdint.m4 index d6961b0..4aa2508 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,5 +1,5 @@ -# stdint.m4 serial 61 -dnl Copyright (C) 2001-2023 Free Software Foundation, Inc. +# stdint.m4 serial 63 +dnl Copyright (C) 2001-2024 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. @@ -150,7 +150,10 @@ intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; /* Check that SIZE_MAX has the correct type, if possible. */ -#if 201112 <= __STDC_VERSION__ +/* ISO C 11 mandates _Generic, but GCC versions < 4.9 lack it. */ +#if 201112 <= __STDC_VERSION__ \ + && (!defined __GNUC__ || 4 < __GNUC__ + (9 <= __GNUC_MINOR__) \ + || defined __clang__) int k = _Generic (SIZE_MAX, size_t: 0); #elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \ || (0x5110 <= __SUNPRO_C && !__STDC__)) @@ -283,10 +286,10 @@ static const char *macro_values[] = [gl_cv_header_working_stdint_h=yes], [], [case "$host_os" in - # Guess yes on native Windows. - mingw*) gl_cv_header_working_stdint_h="guessing yes" ;; - # In general, assume it works. - *) gl_cv_header_working_stdint_h="guessing yes" ;; + # Guess yes on native Windows. + mingw* | windows*) gl_cv_header_working_stdint_h="guessing yes" ;; + # In general, assume it works. + *) gl_cv_header_working_stdint_h="guessing yes" ;; esac ]) ]) diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4 index 70349f6..ee9773a 100644 --- a/m4/stdint_h.m4 +++ b/m4/stdint_h.m4 @@ -1,5 +1,5 @@ # stdint_h.m4 serial 9 -dnl Copyright (C) 1997-2004, 2006, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2004, 2006, 2008-2024 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/m4/stdio_h.m4 b/m4/stdio_h.m4 index dbfa0d5..c19feef 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -1,5 +1,5 @@ # stdio_h.m4 serial 63 -dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2024 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/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index f47c1eb..88ccd14 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 75 -dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. +# stdlib_h.m4 serial 77 +dnl Copyright (C) 2007-2024 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. @@ -134,6 +134,7 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTENV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_QSORT_R]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAND]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOCARRAY]) @@ -144,6 +145,7 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SECURE_GETENV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETENV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOD]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOF]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOL]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLD]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLL]) @@ -204,6 +206,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE]) HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE]) HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) + HAVE_STRTOF=1; AC_SUBST([HAVE_STRTOF]) HAVE_STRTOL=1; AC_SUBST([HAVE_STRTOL]) HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD]) HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) @@ -237,6 +240,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R]) + REPLACE_RAND=0; AC_SUBST([REPLACE_RAND]) REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM]) REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) REPLACE_REALLOC_FOR_REALLOC_GNU=0; AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_GNU]) @@ -246,6 +250,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE]) REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) + REPLACE_STRTOF=0; AC_SUBST([REPLACE_STRTOF]) REPLACE_STRTOL=0; AC_SUBST([REPLACE_STRTOL]) REPLACE_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD]) REPLACE_STRTOLL=0; AC_SUBST([REPLACE_STRTOLL]) diff --git a/m4/stpcpy.m4 b/m4/stpcpy.m4 index f3acbee..04c8bbe 100644 --- a/m4/stpcpy.m4 +++ b/m4/stpcpy.m4 @@ -1,5 +1,5 @@ # stpcpy.m4 serial 11 -dnl Copyright (C) 2002, 2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2007, 2009-2024 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/m4/strcase.m4 b/m4/strcase.m4 index 3cf740d..3252a62 100644 --- a/m4/strcase.m4 +++ b/m4/strcase.m4 @@ -1,5 +1,5 @@ # strcase.m4 serial 12 -dnl Copyright (C) 2002, 2005-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2005-2024 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/m4/strchrnul.m4 b/m4/strchrnul.m4 index 9b9ab11..7840d2e 100644 --- a/m4/strchrnul.m4 +++ b/m4/strchrnul.m4 @@ -1,5 +1,5 @@ # strchrnul.m4 serial 12 -dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007, 2009-2024 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/m4/strdup.m4 b/m4/strdup.m4 index ecfcdd0..491f760 100644 --- a/m4/strdup.m4 +++ b/m4/strdup.m4 @@ -1,6 +1,6 @@ # strdup.m4 serial 15 -dnl Copyright (C) 2002-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2024 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/m4/strerror.m4 b/m4/strerror.m4 index 9f1dddd..a1d1261 100644 --- a/m4/strerror.m4 +++ b/m4/strerror.m4 @@ -1,5 +1,5 @@ -# strerror.m4 serial 24 -dnl Copyright (C) 2002, 2007-2023 Free Software Foundation, Inc. +# strerror.m4 serial 25 +dnl Copyright (C) 2002, 2007-2024 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,7 +85,7 @@ AC_DEFUN([gl_FUNC_STRERROR_0], # 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" ;; + mingw* | windows*) 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/m4/strerror_r.m4 b/m4/strerror_r.m4 index d790ba8..903d03c 100644 --- a/m4/strerror_r.m4 +++ b/m4/strerror_r.m4 @@ -1,5 +1,5 @@ # strerror_r.m4 serial 26 -dnl Copyright (C) 2002, 2007-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2007-2024 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/m4/string_h.m4 b/m4/string_h.m4 index 7f51391..9ea748c 100644 --- a/m4/string_h.m4 +++ b/m4/string_h.m4 @@ -1,11 +1,11 @@ # Configure a GNU-like replacement for . -# Copyright (C) 2007-2023 Free Software Foundation, Inc. +# Copyright (C) 2007-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 37 +# serial 39 # Written by Paul Eggert. @@ -132,6 +132,7 @@ AC_DEFUN([gl_STRING_H_DEFAULTS], REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR]) REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) REPLACE_MEMPCPY=0; AC_SUBST([REPLACE_MEMPCPY]) + REPLACE_MEMSET_EXPLICIT=0; AC_SUBST([REPLACE_MEMSET_EXPLICIT]) REPLACE_STPCPY=0; AC_SUBST([REPLACE_STPCPY]) REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY]) REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL]) @@ -146,5 +147,6 @@ AC_DEFUN([gl_STRING_H_DEFAULTS], REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP]) REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) + REPLACE_STRVERSCMP=0; AC_SUBST([REPLACE_STRVERSCMP]) UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R]) ]) diff --git a/m4/strings_h.m4 b/m4/strings_h.m4 index 4c41221..37b6ca9 100644 --- a/m4/strings_h.m4 +++ b/m4/strings_h.m4 @@ -1,7 +1,7 @@ # Configure a replacement for . # serial 9 -# Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/strndup.m4 b/m4/strndup.m4 index 9ec9715..2218919 100644 --- a/m4/strndup.m4 +++ b/m4/strndup.m4 @@ -1,5 +1,5 @@ # strndup.m4 serial 23 -dnl Copyright (C) 2002-2003, 2005-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2005-2024 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/m4/strnlen.m4 b/m4/strnlen.m4 index d2cac59..3eac8e6 100644 --- a/m4/strnlen.m4 +++ b/m4/strnlen.m4 @@ -1,5 +1,5 @@ # strnlen.m4 serial 14 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 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/m4/strpbrk.m4 b/m4/strpbrk.m4 index e966a81..c8d6128 100644 --- a/m4/strpbrk.m4 +++ b/m4/strpbrk.m4 @@ -1,5 +1,5 @@ # strpbrk.m4 serial 7 -dnl Copyright (C) 2002-2003, 2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2007, 2009-2024 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/m4/strptime.m4 b/m4/strptime.m4 index e5d995e..778c275 100644 --- a/m4/strptime.m4 +++ b/m4/strptime.m4 @@ -1,5 +1,5 @@ # strptime.m4 serial 8 -dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2024 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/m4/strtok_r.m4 b/m4/strtok_r.m4 index 4c701cc..ee9872c 100644 --- a/m4/strtok_r.m4 +++ b/m4/strtok_r.m4 @@ -1,5 +1,5 @@ -# strtok_r.m4 serial 16 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2023 Free Software Foundation, +# strtok_r.m4 serial 17 +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2024 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, @@ -42,11 +42,11 @@ AC_DEFUN([gl_FUNC_STRTOK_R], [gl_cv_func_strtok_r_works=yes], [gl_cv_func_strtok_r_works=no], [case "$host_os" in - # Guess no on glibc systems. - *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_strtok_r_works="guessing yes" ;; - *) gl_cv_func_strtok_r_works="guessing yes" ;; + # Guess no on glibc systems. + *-gnu* | gnu*) gl_cv_func_strtok_r_works="guessing no" ;; + # Guess yes on native Windows. + mingw* | windows*) gl_cv_func_strtok_r_works="guessing yes" ;; + *) gl_cv_func_strtok_r_works="guessing yes" ;; esac ]) ]) diff --git a/m4/strtol.m4 b/m4/strtol.m4 index 5cdd86a..d5c6079 100644 --- a/m4/strtol.m4 +++ b/m4/strtol.m4 @@ -1,5 +1,5 @@ -# strtol.m4 serial 8 -dnl Copyright (C) 2002-2003, 2006, 2009-2023 Free Software Foundation, Inc. +# strtol.m4 serial 10 +dnl Copyright (C) 2002-2003, 2006, 2009-2024 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. @@ -19,10 +19,16 @@ AC_DEFUN([gl_FUNC_STRTOL], char *term; /* This test fails on Minix and native Windows. */ { - const char input[] = "0x"; - (void) strtol (input, &term, 16); - if (term != input + 1) - result |= 1; + static char const input[2][3] = {"0x", "0b"}; + static int const base[] = {0, 2, 10}; + int i, j; + for (i = 0; i < 2; i++) + for (j = 0; j < 3; j++) + { + (void) strtol (input[i], &term, base[j]); + if (term != input[i] + 1) + result |= 1; + } } /* This test fails on pre-C23 platforms. */ { @@ -38,7 +44,7 @@ AC_DEFUN([gl_FUNC_STRTOL], [gl_cv_func_strtol_works=no], [case "$host_os" in # Guess no on native Windows. - mingw*) gl_cv_func_strtol_works="guessing no" ;; + mingw* | windows*) gl_cv_func_strtol_works="guessing no" ;; # Guess no on glibc systems. *-gnu* | gnu*) gl_cv_func_strtol_works="guessing no" ;; # Guess no on musl systems. diff --git a/m4/strtoll.m4 b/m4/strtoll.m4 index ec09609..130b909 100644 --- a/m4/strtoll.m4 +++ b/m4/strtoll.m4 @@ -1,5 +1,5 @@ -# strtoll.m4 serial 10 -dnl Copyright (C) 2002, 2004, 2006, 2008-2023 Free Software Foundation, Inc. +# strtoll.m4 serial 12 +dnl Copyright (C) 2002, 2004, 2006, 2008-2024 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. @@ -19,10 +19,16 @@ AC_DEFUN([gl_FUNC_STRTOLL], char *term; /* This test fails on Minix and native Windows. */ { - const char input[] = "0x"; - (void) strtoll (input, &term, 16); - if (term != input + 1) - result |= 1; + static char const input[2][3] = {"0x", "0b"}; + static int const base[] = {0, 2, 10}; + int i, j; + for (i = 0; i < 2; i++) + for (j = 0; j < 3; j++) + { + (void) strtoll (input[i], &term, base[j]); + if (term != input[i] + 1) + result |= 1; + } } /* This test fails on pre-C23 platforms. */ { @@ -38,7 +44,7 @@ AC_DEFUN([gl_FUNC_STRTOLL], [gl_cv_func_strtoll_works=no], [case "$host_os" in # Guess no on native Windows. - mingw*) gl_cv_func_strtoll_works="guessing no" ;; + mingw* | windows*) gl_cv_func_strtoll_works="guessing no" ;; # Guess no on glibc systems. *-gnu* | gnu*) gl_cv_func_strtoll_works="guessing no" ;; # Guess no on musl systems. diff --git a/m4/symlink.m4 b/m4/symlink.m4 index 52d6c11..62062cf 100644 --- a/m4/symlink.m4 +++ b/m4/symlink.m4 @@ -1,7 +1,7 @@ # serial 10 # See if we need to provide symlink replacement. -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2024 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/m4/sys_file_h.m4 b/m4/sys_file_h.m4 index 60d4e30..f56a133 100644 --- a/m4/sys_file_h.m4 +++ b/m4/sys_file_h.m4 @@ -1,7 +1,7 @@ # Configure a replacement for . # serial 9 -# Copyright (C) 2008-2023 Free Software Foundation, Inc. +# Copyright (C) 2008-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/sys_ioctl_h.m4 b/m4/sys_ioctl_h.m4 index 80f0510..3e789f3 100644 --- a/m4/sys_ioctl_h.m4 +++ b/m4/sys_ioctl_h.m4 @@ -1,5 +1,5 @@ # sys_ioctl_h.m4 serial 15 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/sys_random_h.m4 b/m4/sys_random_h.m4 index 01d5fee..b050d07 100644 --- a/m4/sys_random_h.m4 +++ b/m4/sys_random_h.m4 @@ -1,5 +1,5 @@ # sys_random_h.m4 serial 8 -dnl Copyright (C) 2020-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2024 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/m4/sys_select_h.m4 b/m4/sys_select_h.m4 index 4ec5ed7..9e279fb 100644 --- a/m4/sys_select_h.m4 +++ b/m4/sys_select_h.m4 @@ -1,5 +1,5 @@ # sys_select_h.m4 serial 23 -dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2024 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/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4 index 98a1041..af52484 100644 --- a/m4/sys_socket_h.m4 +++ b/m4/sys_socket_h.m4 @@ -1,5 +1,5 @@ # sys_socket_h.m4 serial 29 -dnl Copyright (C) 2005-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2024 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/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4 index ca57398..7501853 100644 --- a/m4/sys_stat_h.m4 +++ b/m4/sys_stat_h.m4 @@ -1,5 +1,5 @@ # sys_stat_h.m4 serial 42 -*- Autoconf -*- -dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2024 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/m4/sys_time_h.m4 b/m4/sys_time_h.m4 index 45a1f8b..dc5353f 100644 --- a/m4/sys_time_h.m4 +++ b/m4/sys_time_h.m4 @@ -1,7 +1,7 @@ # Configure a replacement for . # serial 12 -# Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4 index 627671f..37d0cca 100644 --- a/m4/sys_types_h.m4 +++ b/m4/sys_types_h.m4 @@ -1,5 +1,5 @@ # sys_types_h.m4 serial 13 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2024 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/m4/sys_uio_h.m4 b/m4/sys_uio_h.m4 index 93a65d2..ce252ed 100644 --- a/m4/sys_uio_h.m4 +++ b/m4/sys_uio_h.m4 @@ -1,5 +1,5 @@ # sys_uio_h.m4 serial 3 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2024 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/m4/sys_wait_h.m4 b/m4/sys_wait_h.m4 index 36b4293..6759b08 100644 --- a/m4/sys_wait_h.m4 +++ b/m4/sys_wait_h.m4 @@ -1,5 +1,5 @@ # sys_wait_h.m4 serial 9 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/tcgetattr.m4 b/m4/tcgetattr.m4 index 2d55805..7091ab5 100644 --- a/m4/tcgetattr.m4 +++ b/m4/tcgetattr.m4 @@ -1,5 +1,5 @@ # tcgetattr.m4 serial 1 -dnl Copyright (C) 2002-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2024 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/m4/tempname.m4 b/m4/tempname.m4 index abed799..31d35c8 100644 --- a/m4/tempname.m4 +++ b/m4/tempname.m4 @@ -1,6 +1,6 @@ #serial 5 -# Copyright (C) 2006-2007, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2006-2007, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff --git a/m4/threadlib.m4 b/m4/threadlib.m4 index 1fc5777..6dee893 100644 --- a/m4/threadlib.m4 +++ b/m4/threadlib.m4 @@ -1,5 +1,5 @@ -# threadlib.m4 serial 38 -dnl Copyright (C) 2005-2023 Free Software Foundation, Inc. +# threadlib.m4 serial 42 +dnl Copyright (C) 2005-2024 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,7 +85,7 @@ AC_DEFUN([gl_WEAK_SYMBOLS], AC_CACHE_CHECK([whether imported symbols can be declared weak], [gl_cv_have_weak], [case "$host_os" in - cygwin* | mingw*) + cygwin* | mingw* | windows*) 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 @@ -206,7 +206,7 @@ AC_DEFUN([gl_PTHREADLIB_BODY], # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 # needs -pthread for some reason. See: # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html - save_LIBS=$LIBS + saved_LIBS="$LIBS" for gl_pthread in '' '-pthread'; do LIBS="$LIBS $gl_pthread" AC_LINK_IFELSE( @@ -220,7 +220,7 @@ AC_DEFUN([gl_PTHREADLIB_BODY], [gl_pthread_api=yes LIBPTHREAD=$gl_pthread LIBPMULTITHREAD=$gl_pthread]) - LIBS=$save_LIBS + LIBS="$saved_LIBS" test $gl_pthread_api = yes && break done echo "$as_me:__oline__: gl_pthread_api=$gl_pthread_api" >&AS_MESSAGE_LOG_FD @@ -269,6 +269,15 @@ changequote([,])dnl [Define if the pthread_in_use() detection is hard.]) esac fi + ], + [dnl This is needed on FreeBSD 5.2.1. + AC_CHECK_LIB([thr], [pthread_kill], + [if test $gl_pthread_in_glibc = yes; then + LIBPMULTITHREAD= + else + LIBPMULTITHREAD=-lthr + fi + ]) ]) elif test $gl_pthread_api != yes; then # Some library is needed. Try libpthread and libc_r. @@ -344,7 +353,7 @@ AC_DEFUN([gl_STDTHREADLIB_BODY], AC_CHECK_HEADERS_ONCE([threads.h]) case "$host_os" in - mingw*) + mingw* | windows*) LIBSTDTHREAD= ;; *) @@ -465,7 +474,7 @@ changequote(,)dnl esac ;; dnl Obey gl_AVOID_WINPTHREAD on mingw. - mingw*) + mingw* | windows*) case "$gl_use_winpthreads_default" in yes) gl_use_threads=posix ;; no) gl_use_threads=windows ;; @@ -564,7 +573,7 @@ AC_DEFUN([gl_THREADLIB_BODY], case "$gl_use_threads" in yes | windows | win32) # The 'win32' is for backward compatibility. if { case "$host_os" in - mingw*) true;; + mingw* | windows*) true;; *) false;; esac }; then @@ -575,6 +584,10 @@ AC_DEFUN([gl_THREADLIB_BODY], ;; esac fi + else + dnl "$gl_use_threads" is "no". + AC_DEFINE([AVOID_ANY_THREADS], [1], + [Define if no multithread safety and no multithreading is desired.]) fi AC_MSG_CHECKING([for multithread API to use]) AC_MSG_RESULT([$gl_threads_api]) diff --git a/m4/time_h.m4 b/m4/time_h.m4 index 51d553a..32fade0 100644 --- a/m4/time_h.m4 +++ b/m4/time_h.m4 @@ -1,8 +1,8 @@ # Configure a more-standard replacement for . -# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. -# serial 22 +# serial 25 # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -23,7 +23,10 @@ AC_DEFUN_ONCE([gl_TIME_H], dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ #include - ]], [asctime_r ctime_r]) + ]], [ + asctime asctime_r ctime ctime_r gmtime_r localtime localtime_r mktime + nanosleep strftime strptime time timegm timespec_get timespec_getres tzset + ]) AC_REQUIRE([AC_C_RESTRICT]) @@ -162,25 +165,16 @@ AC_DEFUN([gl_TIME_H_DEFAULTS], HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES]) dnl Even GNU libc does not have timezone_t yet. HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) - dnl If another module says to replace or to not replace, do that. - dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK; - dnl this lets maintainers check for portability. - REPLACE_CTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_CTIME]) - REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R]) - 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. - dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent. - : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY]) - dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME - dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier - dnl is no longer a big deal. + REPLACE_CTIME=0; AC_SUBST([REPLACE_CTIME]) REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) + REPLACE_LOCALTIME_R=0; AC_SUBST([REPLACE_LOCALTIME_R]) + REPLACE_MKTIME=0; AC_SUBST([REPLACE_MKTIME]) + REPLACE_NANOSLEEP=0; AC_SUBST([REPLACE_NANOSLEEP]) + REPLACE_STRFTIME=0; AC_SUBST([REPLACE_STRFTIME]) + REPLACE_TIME=0; AC_SUBST([REPLACE_TIME]) + REPLACE_TIMEGM=0; AC_SUBST([REPLACE_TIMEGM]) + REPLACE_TIMESPEC_GET=0; AC_SUBST([REPLACE_TIMESPEC_GET]) + REPLACE_TIMESPEC_GETRES=0; AC_SUBST([REPLACE_TIMESPEC_GETRES]) + REPLACE_TZSET=0; AC_SUBST([REPLACE_TZSET]) ]) diff --git a/m4/time_r.m4 b/m4/time_r.m4 index adce438..4ee2175 100644 --- a/m4/time_r.m4 +++ b/m4/time_r.m4 @@ -1,6 +1,6 @@ dnl Reentrant time functions: localtime_r, gmtime_r. -dnl Copyright (C) 2003, 2006-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2006-2024 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. @@ -57,9 +57,7 @@ AC_DEFUN([gl_TIME_R], [gl_cv_time_r_posix=yes], [gl_cv_time_r_posix=no]) ]) - if test $gl_cv_time_r_posix = yes; then - REPLACE_LOCALTIME_R=0 - else + if test $gl_cv_time_r_posix != yes; then REPLACE_LOCALTIME_R=1 fi else diff --git a/m4/timegm.m4 b/m4/timegm.m4 index 8ab265e..8433604 100644 --- a/m4/timegm.m4 +++ b/m4/timegm.m4 @@ -1,5 +1,5 @@ -# timegm.m4 serial 15 -dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc. +# timegm.m4 serial 16 +dnl Copyright (C) 2003, 2007, 2009-2024 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,6 @@ AC_DEFUN([gl_FUNC_TIMEGM], [ AC_REQUIRE([gl_TIME_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) - REPLACE_TIMEGM=0 gl_CHECK_FUNCS_ANDROID([timegm], [[#include ]]) if test $ac_cv_func_timegm = yes; then if test "$gl_cv_func_working_mktime" != yes; then diff --git a/m4/timespec.m4 b/m4/timespec.m4 index 95f475f..59a0db9 100644 --- a/m4/timespec.m4 +++ b/m4/timespec.m4 @@ -1,6 +1,6 @@ #serial 15 -# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2024 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/m4/tm_gmtoff.m4 b/m4/tm_gmtoff.m4 index bc41de3..f2e5159 100644 --- a/m4/tm_gmtoff.m4 +++ b/m4/tm_gmtoff.m4 @@ -1,5 +1,5 @@ # tm_gmtoff.m4 serial 3 -dnl Copyright (C) 2002, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2009-2024 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/m4/tmpdir.m4 b/m4/tmpdir.m4 index cf89497..89bece6 100644 --- a/m4/tmpdir.m4 +++ b/m4/tmpdir.m4 @@ -1,5 +1,5 @@ # tmpdir.m4 serial 4 -dnl Copyright (C) 2001-2002, 2006, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2002, 2006, 2009-2024 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/m4/uchar_h.m4 b/m4/uchar_h.m4 new file mode 100644 index 0000000..abd4f51 --- /dev/null +++ b/m4/uchar_h.m4 @@ -0,0 +1,249 @@ +# uchar_h.m4 serial 31 +dnl Copyright (C) 2019-2024 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 Prepare the overridden . + +AC_DEFUN_ONCE([gl_UCHAR_H], +[ + AC_REQUIRE([gl_UCHAR_H_DEFAULTS]) + + gl_CHECK_NEXT_HEADERS([uchar.h]) + if test $ac_cv_header_uchar_h = yes; then + HAVE_UCHAR_H=1 + else + HAVE_UCHAR_H=0 + fi + AC_SUBST([HAVE_UCHAR_H]) + + gl_TYPE_CHAR8_T + gl_TYPE_CHAR16_T + gl_TYPE_CHAR32_T + + dnl In C++ mode, clang defines 'char16_t' and 'char32_t' as built-in types + dnl on some platforms (e.g. OpenBSD 6.7), and as types defined by many + dnl header files (, , , , + dnl and others) on some platforms (e.g. Mac OS X 10.13). + dnl The same thing may also happen for 'char8_t'; so, be prepared for it. + m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])]) + CXX_HAS_UCHAR_TYPES=0 + if test $HAVE_UCHAR_H = 0; then + if test "$CXX" != no; then + AC_CACHE_CHECK([whether the C++ compiler predefines the types], + [gl_cv_cxx_has_uchar_types], + [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to + dnl an autoconf bug . + cat > conftest.cpp <<\EOF +#include +char16_t a; +char32_t b; +EOF + gl_command="$CXX $CXXFLAGS $CPPFLAGS -c conftest.cpp" + if AC_TRY_EVAL([gl_command]); then + gl_cv_cxx_has_uchar_types=yes + else + gl_cv_cxx_has_uchar_types=no + fi + rm -fr conftest* + ]) + if test $gl_cv_cxx_has_uchar_types = yes; then + CXX_HAS_UCHAR_TYPES=1 + fi + fi + fi + AC_SUBST([CXX_HAS_UCHAR_TYPES]) + CXX_HAS_CHAR8_TYPE=0 + if test $HAVE_UCHAR_H = 0; then + if test "$CXX" != no; then + AC_CACHE_CHECK([whether the C++ compiler predefines the char8_t types], + [gl_cv_cxx_has_char8_type], + [dnl We can't use AC_LANG_PUSH([C++]) and AC_LANG_POP([C++]) here, due to + dnl an autoconf bug . + cat > conftest.cpp <<\EOF +#include +char8_t a; +EOF + gl_command="$CXX $CXXFLAGS $CPPFLAGS -c conftest.cpp" + if AC_TRY_EVAL([gl_command]); then + gl_cv_cxx_has_char8_type=yes + else + gl_cv_cxx_has_char8_type=no + fi + rm -fr conftest* + ]) + if test $gl_cv_cxx_has_char8_type = yes; then + CXX_HAS_CHAR8_TYPE=1 + fi + fi + fi + AC_SUBST([CXX_HAS_CHAR8_TYPE]) + + dnl Test whether a 'char32_t' can hold more characters than a 'wchar_t'. + gl_STDINT_BITSIZEOF([wchar_t], [gl_STDINT_INCLUDES]) + if test $BITSIZEOF_WCHAR_T -lt 32; then + SMALL_WCHAR_T=1 + else + SMALL_WCHAR_T=0 + fi + dnl SMALL_WCHAR_T is expected to be 1 on 32-bit AIX, Cygwin, native Windows. + AC_SUBST([SMALL_WCHAR_T]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, and which is not + dnl guaranteed by C11. + gl_WARN_ON_USE_PREPARE([[ + #ifdef __HAIKU__ + #include + #endif + #include + ]], [c32rtomb mbrtoc16 mbrtoc32]) +]) + +AC_DEFUN_ONCE([gl_TYPE_CHAR8_T], +[ + dnl Determine whether gnulib's would, if present, override char8_t. + AC_CACHE_CHECK([whether char8_t is correctly defined], + [gl_cv_type_char8_t_works], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #ifdef __HAIKU__ + #include + #endif + #include + int verify[(char8_t)(-1) >= 0 && sizeof (char8_t) == sizeof (unsigned char) ? 1 : -1]; + ]]) + ], + [gl_cv_type_char8_t_works=yes], + [gl_cv_type_char8_t_works=no]) + ]) + if test $gl_cv_type_char8_t_works = no; then + GNULIBHEADERS_OVERRIDE_CHAR8_T=1 + else + GNULIBHEADERS_OVERRIDE_CHAR8_T=0 + fi + AC_SUBST([GNULIBHEADERS_OVERRIDE_CHAR8_T]) +]) + +dnl On Haiku 2020, char16_t and char32_t are incorrectly defined. +dnl See . +AC_DEFUN_ONCE([gl_TYPE_CHAR16_T], +[ + dnl Determine whether gnulib's would, if present, override char16_t. + AC_CACHE_CHECK([whether char16_t is correctly defined], + [gl_cv_type_char16_t_works], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #ifdef __HAIKU__ + #include + #endif + #include + /* For simplicity, assume that uint16_least_t is equivalent to + 'unsigned short'. */ + int verify[(char16_t)(-1) >= 0 && sizeof (char16_t) == sizeof (unsigned short) ? 1 : -1]; + ]]) + ], + [gl_cv_type_char16_t_works=yes], + [gl_cv_type_char16_t_works=no]) + ]) + if test $gl_cv_type_char16_t_works = no; then + GNULIBHEADERS_OVERRIDE_CHAR16_T=1 + else + GNULIBHEADERS_OVERRIDE_CHAR16_T=0 + fi + AC_SUBST([GNULIBHEADERS_OVERRIDE_CHAR16_T]) +]) +AC_DEFUN_ONCE([gl_TYPE_CHAR32_T], +[ + dnl Determine whether gnulib's would, if present, override char32_t. + AC_CACHE_CHECK([whether char32_t is correctly defined], + [gl_cv_type_char32_t_works], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #ifdef __HAIKU__ + #include + #endif + #include + /* For simplicity, assume that uint32_least_t is equivalent to + 'unsigned int'. */ + int verify[(char32_t)(-1) >= 0 && sizeof (char32_t) == sizeof (unsigned int) ? 1 : -1]; + ]]) + ], + [gl_cv_type_char32_t_works=yes], + [gl_cv_type_char32_t_works=no]) + ]) + if test $gl_cv_type_char32_t_works = no; then + GNULIBHEADERS_OVERRIDE_CHAR32_T=1 + else + GNULIBHEADERS_OVERRIDE_CHAR32_T=0 + fi + AC_SUBST([GNULIBHEADERS_OVERRIDE_CHAR32_T]) +]) + +# gl_UCHAR_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. +# This macro invocation must not occur in macros that are AC_REQUIREd. +AC_DEFUN([gl_UCHAR_MODULE_INDICATOR], +[ + dnl Ensure to expand the default settings once only. + gl_UCHAR_H_REQUIRE_DEFAULTS + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +# Initializes the default values for AC_SUBSTed shell variables. +# This macro must not be AC_REQUIREd. It must only be invoked, and only +# outside of macros or in macros that are not AC_REQUIREd. +AC_DEFUN([gl_UCHAR_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_UCHAR_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BTOC32]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISALNUM]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISALPHA]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISBLANK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISCNTRL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISDIGIT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISGRAPH]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISLOWER]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISPRINT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISPUNCT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISSPACE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISUPPER]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32ISXDIGIT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32TOLOWER]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32TOUPPER]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32WIDTH]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32RTOMB]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32SNRTOMBS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32SRTOMBS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32STOMBS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32SWIDTH]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32TOB]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32_APPLY_MAPPING]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32_APPLY_TYPE_TEST]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32_GET_MAPPING]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_C32_GET_TYPE_TEST]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRTOC16]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRTOC32]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNRTOC32S]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRTOC32S]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOC32S]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_UCHAR_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_UCHAR_H_DEFAULTS]) +]) + +AC_DEFUN([gl_UCHAR_H_DEFAULTS], +[ + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_C32RTOMB=1; AC_SUBST([HAVE_C32RTOMB]) + HAVE_MBRTOC16=1; AC_SUBST([HAVE_MBRTOC16]) + HAVE_MBRTOC32=1; AC_SUBST([HAVE_MBRTOC32]) + REPLACE_C32RTOMB=0; AC_SUBST([REPLACE_C32RTOMB]) + REPLACE_MBRTOC16=0; AC_SUBST([REPLACE_MBRTOC16]) + REPLACE_MBRTOC32=0; AC_SUBST([REPLACE_MBRTOC32]) +]) diff --git a/m4/ungetc.m4 b/m4/ungetc.m4 index 7727477..aab83e1 100644 --- a/m4/ungetc.m4 +++ b/m4/ungetc.m4 @@ -1,5 +1,5 @@ -# ungetc.m4 serial 11 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +# ungetc.m4 serial 12 +dnl Copyright (C) 2009-2024 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,7 +49,7 @@ AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS], # Guess yes on bionic systems. *-android*) gl_cv_func_ungetc_works="guessing yes" ;; # Guess yes on native Windows. - mingw*) gl_cv_func_ungetc_works="guessing yes" ;; + mingw* | windows*) gl_cv_func_ungetc_works="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) gl_cv_func_ungetc_works="$gl_cross_guess_normal" ;; esac diff --git a/m4/unicase_h.m4 b/m4/unicase_h.m4 index 86a1b7c..ad2f621 100644 --- a/m4/unicase_h.m4 +++ b/m4/unicase_h.m4 @@ -1,5 +1,5 @@ # unicase_h.m4 serial 1 -dnl Copyright (C) 2023 Free Software Foundation, Inc. +dnl Copyright (C) 2023-2024 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/m4/unictype_h.m4 b/m4/unictype_h.m4 index bab4635..68b864b 100644 --- a/m4/unictype_h.m4 +++ b/m4/unictype_h.m4 @@ -1,5 +1,5 @@ -# unictype_h.m4 serial 1 -dnl Copyright (C) 2023 Free Software Foundation, Inc. +# unictype_h.m4 serial 3 +dnl Copyright (C) 2023-2024 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. @@ -98,6 +98,8 @@ AC_DEFUN([gl_UNICTYPE_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_OTHER_ID_CONTINUE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_XID_START_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_XID_CONTINUE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_START_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_CONTINUE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PATTERN_WHITE_SPACE_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PATTERN_SYNTAX_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_JOIN_CONTROL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) @@ -127,6 +129,7 @@ AC_DEFUN([gl_UNICTYPE_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IDEOGRAPHIC_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_UNIFIED_IDEOGRAPH_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_RADICAL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IDS_UNARY_OPERATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IDS_BINARY_OPERATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_IDS_TRINARY_OPERATOR_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_EMOJI_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) @@ -140,6 +143,7 @@ AC_DEFUN([gl_UNICTYPE_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_NON_BREAK_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_ISO_CONTROL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_FORMAT_CONTROL_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PREPENDED_CONCATENATION_MARK_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_DASH_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_HYPHEN_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNICTYPE_PROPERTY_PUNCTUATION_DLL_VARIABLE], ['LIBUNISTRING_DLL_VARIABLE']) diff --git a/m4/uninorm_h.m4 b/m4/uninorm_h.m4 index b6b342d..aadf559 100644 --- a/m4/uninorm_h.m4 +++ b/m4/uninorm_h.m4 @@ -1,5 +1,5 @@ # uninorm_h.m4 serial 1 -dnl Copyright (C) 2023 Free Software Foundation, Inc. +dnl Copyright (C) 2023-2024 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/m4/unistd-safer.m4 b/m4/unistd-safer.m4 index ced03b0..9d50964 100644 --- a/m4/unistd-safer.m4 +++ b/m4/unistd-safer.m4 @@ -1,5 +1,5 @@ #serial 9 -dnl Copyright (C) 2002, 2005-2006, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2005-2006, 2009-2024 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/m4/unistd_h.m4 b/m4/unistd_h.m4 index 1c96158..e078bd6 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 94 -dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. +# unistd_h.m4 serial 95 +dnl Copyright (C) 2006-2024 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. @@ -234,6 +234,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP]) REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE]) REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT]) + REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) REPLACE_FDATASYNC=0; AC_SUBST([REPLACE_FDATASYNC]) REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) diff --git a/m4/unlink.m4 b/m4/unlink.m4 index 1fecaac..19982a0 100644 --- a/m4/unlink.m4 +++ b/m4/unlink.m4 @@ -1,5 +1,5 @@ -# unlink.m4 serial 16 -dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. +# unlink.m4 serial 17 +dnl Copyright (C) 2009-2024 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. @@ -43,16 +43,16 @@ AC_DEFUN([gl_FUNC_UNLINK], [gl_cv_func_unlink_honors_slashes=yes], [gl_cv_func_unlink_honors_slashes=no], [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. - mingw*) gl_cv_func_unlink_honors_slashes="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_unlink_honors_slashes="$gl_cross_guess_normal" ;; + # 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. + mingw* | windows*) gl_cv_func_unlink_honors_slashes="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_unlink_honors_slashes="$gl_cross_guess_normal" ;; esac ]) rm -f conftest.file conftest.lnk]) diff --git a/m4/unlocked-io.m4 b/m4/unlocked-io.m4 index 407c0ba..558f57d 100644 --- a/m4/unlocked-io.m4 +++ b/m4/unlocked-io.m4 @@ -1,6 +1,6 @@ # unlocked-io.m4 serial 16 -# Copyright (C) 1998-2006, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 1998-2006, 2009-2024 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/m4/utime.m4 b/m4/utime.m4 index 4c0443a..b738e1c 100644 --- a/m4/utime.m4 +++ b/m4/utime.m4 @@ -1,5 +1,5 @@ -# utime.m4 serial 4 -dnl Copyright (C) 2017-2023 Free Software Foundation, Inc. +# utime.m4 serial 6 +dnl Copyright (C) 2017-2024 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,7 +10,7 @@ AC_DEFUN([gl_FUNC_UTIME], AC_REQUIRE([AC_CANONICAL_HOST]) AC_CHECK_FUNCS_ONCE([lstat]) case "$host_os" in - mingw*) + mingw* | windows*) dnl On this platform, the original utime() or _utime() produces dnl timestamps that are affected by the time zone. dnl Use the function name 'rpl_utime' always, in order to avoid a @@ -48,14 +48,15 @@ AC_DEFUN([gl_FUNC_UTIME], [gl_cv_func_utime_file_slash=yes], [gl_cv_func_utime_file_slash=no], [case "$host_os" in - # Guess yes on Linux systems. - linux-* | linux) gl_cv_func_utime_file_slash="guessing yes" ;; - # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_utime_file_slash="guessing yes" ;; - # Guess no on macOS. - darwin*) gl_cv_func_utime_file_slash="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_utime_file_slash="$gl_cross_guess_normal" ;; + # Guess yes on Linux systems + # and on systems that emulate the Linux system calls. + linux* | midipix*) gl_cv_func_utime_file_slash="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_utime_file_slash="guessing yes" ;; + # Guess no on macOS. + darwin*) gl_cv_func_utime_file_slash="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_utime_file_slash="$gl_cross_guess_normal" ;; esac ]) rm -f conftest.tmp conftest.lnk diff --git a/m4/utime_h.m4 b/m4/utime_h.m4 index 6b6403e..7b224ee 100644 --- a/m4/utime_h.m4 +++ b/m4/utime_h.m4 @@ -1,5 +1,5 @@ # utime_h.m4 serial 8 -dnl Copyright (C) 2017-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2017-2024 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/m4/utimens.m4 b/m4/utimens.m4 index 5f86061..0f5bfd4 100644 --- a/m4/utimens.m4 +++ b/m4/utimens.m4 @@ -1,9 +1,9 @@ -dnl Copyright (C) 2003-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2024 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 15 +dnl serial 16 AC_DEFUN([gl_UTIMENS], [ @@ -36,12 +36,13 @@ AC_DEFUN([gl_UTIMENS], [gl_cv_func_futimesat_works=yes], [gl_cv_func_futimesat_works=no], [case "$host_os" in - # Guess yes on Linux systems. - linux-* | linux) gl_cv_func_futimesat_works="guessing yes" ;; - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_futimesat_works="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_futimesat_works="$gl_cross_guess_normal" ;; + # Guess yes on Linux systems + # and on systems that emulate the Linux system calls. + linux* | midipix*) gl_cv_func_futimesat_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_futimesat_works="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_futimesat_works="$gl_cross_guess_normal" ;; esac ]) rm -f conftest.file]) diff --git a/m4/utimes.m4 b/m4/utimes.m4 index 73b9a2d..05b23cb 100644 --- a/m4/utimes.m4 +++ b/m4/utimes.m4 @@ -1,7 +1,7 @@ # Detect some bugs in glibc's implementation of utimes. -# serial 8 +# serial 9 -dnl Copyright (C) 2003-2005, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2005, 2009-2024 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. @@ -144,11 +144,11 @@ main () [gl_cv_func_working_utimes=yes], [gl_cv_func_working_utimes=no], [case "$host_os" in - # Guess yes on musl systems. - *-musl*) gl_cv_func_working_utimes="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_working_utimes="guessing no" ;; - *) gl_cv_func_working_utimes="$gl_cross_guess_normal" ;; + # Guess yes on musl systems. + *-musl*) gl_cv_func_working_utimes="guessing yes" ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_working_utimes="guessing no" ;; + *) gl_cv_func_working_utimes="$gl_cross_guess_normal" ;; esac ]) ]) diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4 index 639b29a..21a85bb 100644 --- a/m4/vasnprintf.m4 +++ b/m4/vasnprintf.m4 @@ -1,5 +1,5 @@ -# vasnprintf.m4 serial 49 -dnl Copyright (C) 2002-2004, 2006-2023 Free Software Foundation, Inc. +# vasnprintf.m4 serial 52 +dnl Copyright (C) 2002-2004, 2006-2024 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. @@ -94,6 +94,7 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], # Prerequisites of lib/vasnwprintf.c. AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF], [ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_FUNCS_ONCE([swprintf wcsnlen mbrtowc]) AC_CHECK_DECLS([_snwprintf], , , [[#include ]]) AC_CHECK_DECLS([wcsnlen], , , [[#include ]]) @@ -107,13 +108,56 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF], esac gl_MBRTOWC_C_LOCALE case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in - *yes) ;; - *) - AC_DEFINE([NEED_WPRINTF_DIRECTIVE_C], [1], - [Define if the vasnwprintf implementation needs special code for - the 'c' directive.]) + *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 +#include +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 . */ + 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) ;; @@ -123,6 +167,15 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF], 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 ]) @@ -315,6 +368,22 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], esac ]) +# Extra prerequisites of lib/vasnprintf.c for supporting the # flag with a +# zero precision and a zero value in the 'x' and 'X' directives. +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ALT_PRECISION_ZERO], +[ + AC_REQUIRE([gl_PRINTF_FLAG_ALT_PRECISION_ZERO]) + case "$gl_cv_func_printf_flag_alt_precision_zero" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_ALT_PRECISION_ZERO], [1], + [Define if the vasnprintf implementation needs special code for the + # flag with a zero precision and a zero value in the 'x' and 'X' directives.]) + ;; + esac +]) + # Extra prerequisites of lib/vasnprintf.c for supporting large precisions. AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION], [ @@ -373,6 +442,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS], gl_PREREQ_VASNPRINTF_FLAG_GROUPING gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST gl_PREREQ_VASNPRINTF_FLAG_ZERO + gl_PREREQ_VASNPRINTF_FLAG_ALT_PRECISION_ZERO gl_PREREQ_VASNPRINTF_PRECISION gl_PREREQ_VASNPRINTF_ENOMEM ]) diff --git a/m4/vasprintf.m4 b/m4/vasprintf.m4 index 6e6156a..ea0a8dc 100644 --- a/m4/vasprintf.m4 +++ b/m4/vasprintf.m4 @@ -1,5 +1,5 @@ # vasprintf.m4 serial 6 -dnl Copyright (C) 2002-2003, 2006-2007, 2009-2023 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2006-2007, 2009-2024 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/m4/visibility.m4 b/m4/visibility.m4 index f0468e8..e091f02 100644 --- a/m4/visibility.m4 +++ b/m4/visibility.m4 @@ -1,5 +1,5 @@ -# visibility.m4 serial 8 -dnl Copyright (C) 2005, 2008, 2010-2023 Free Software Foundation, Inc. +# visibility.m4 serial 9 +dnl Copyright (C) 2005, 2008, 2010-2024 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. @@ -31,18 +31,18 @@ AC_DEFUN([gl_VISIBILITY], dnl user has put into $CC $CFLAGS $CPPFLAGS. AC_CACHE_CHECK([whether the -Werror option is usable], [gl_cv_cc_vis_werror], - [gl_save_CFLAGS="$CFLAGS" + [gl_saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[]], [[]])], [gl_cv_cc_vis_werror=yes], [gl_cv_cc_vis_werror=no]) - CFLAGS="$gl_save_CFLAGS" + CFLAGS="$gl_saved_CFLAGS" ]) dnl Now check whether visibility declarations are supported. AC_CACHE_CHECK([for simple visibility declarations], [gl_cv_cc_visibility], - [gl_save_CFLAGS="$CFLAGS" + [gl_saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" dnl We use the option -Werror and a function dummyfunc, because on some dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning @@ -68,7 +68,7 @@ AC_DEFUN([gl_VISIBILITY], [[]])], [gl_cv_cc_visibility=yes], [gl_cv_cc_visibility=no]) - CFLAGS="$gl_save_CFLAGS" + CFLAGS="$gl_saved_CFLAGS" ]) if test $gl_cv_cc_visibility = yes; then CFLAG_VISIBILITY="-fvisibility=hidden" diff --git a/m4/vsnprintf.m4 b/m4/vsnprintf.m4 index 7fbb11c..19524cf 100644 --- a/m4/vsnprintf.m4 +++ b/m4/vsnprintf.m4 @@ -1,5 +1,5 @@ # vsnprintf.m4 serial 7 -dnl Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2007-2024 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/m4/wait-process.m4 b/m4/wait-process.m4 index a70a592..dc519a1 100644 --- a/m4/wait-process.m4 +++ b/m4/wait-process.m4 @@ -1,5 +1,5 @@ # wait-process.m4 serial 6 -dnl Copyright (C) 2003, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2008-2024 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/m4/waitpid.m4 b/m4/waitpid.m4 index b001062..8dc538e 100644 --- a/m4/waitpid.m4 +++ b/m4/waitpid.m4 @@ -1,5 +1,5 @@ -# waitpid.m4 serial 2 -dnl Copyright (C) 2010-2023 Free Software Foundation, Inc. +# waitpid.m4 serial 3 +dnl Copyright (C) 2010-2024 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,6 +9,6 @@ AC_DEFUN([gl_FUNC_WAITPID], AC_REQUIRE([AC_CANONICAL_HOST]) HAVE_WAITPID=1 case $host_os in - mingw*) HAVE_WAITPID=0 ;; + mingw* | windows*) HAVE_WAITPID=0 ;; esac ]) diff --git a/m4/warn-on-use.m4 b/m4/warn-on-use.m4 index 10649c5..eef3a84 100644 --- a/m4/warn-on-use.m4 +++ b/m4/warn-on-use.m4 @@ -1,5 +1,5 @@ -# warn-on-use.m4 serial 10 -dnl Copyright (C) 2010-2023 Free Software Foundation, Inc. +# warn-on-use.m4 serial 11 +dnl Copyright (C) 2010-2024 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,7 +36,7 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE], 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" + ac_saved_ac_compile="$ac_compile" if test -n "$ac_compile_for_check_decl"; then ac_compile="$ac_compile_for_check_decl" fi @@ -46,7 +46,7 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE], [[#undef $gl_func (void) $gl_func;]])], [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])]) - ac_compile="$ac_save_ac_compile" + ac_compile="$ac_saved_ac_compile" AS_VAR_IF([gl_Symbol], [yes], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) dnl Shortcut for an AC_CHECK_DECL invocation that may come later: diff --git a/m4/warnings.m4 b/m4/warnings.m4 index 063bc5c..d487636 100644 --- a/m4/warnings.m4 +++ b/m4/warnings.m4 @@ -1,19 +1,12 @@ -# warnings.m4 serial 16 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +# warnings.m4 serial 20 +dnl Copyright (C) 2008-2024 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()]) @@ -33,13 +26,13 @@ case $gl_positive in 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]), + gl_saved_compiler_FLAGS="$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])], [AS_VAR_SET([gl_Warn], [no])]) - gl_Flags="$gl_save_compiler_FLAGS" + gl_Flags="$gl_saved_compiler_FLAGS" ]) AS_VAR_IF(gl_Warn, [yes], [$2], [$3]) m4_popdef([gl_Positive])dnl @@ -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/m4/wchar_h.m4 b/m4/wchar_h.m4 index 442932b..173f42a 100644 --- a/m4/wchar_h.m4 +++ b/m4/wchar_h.m4 @@ -1,13 +1,13 @@ dnl A placeholder for ISO C99 , for platforms that have issues. -dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2024 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 60 +# wchar_h.m4 serial 63 AC_DEFUN_ONCE([gl_WCHAR_H], [ @@ -86,8 +86,8 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK], dnl z/OS when using the XPLINK object format (due to duplicate dnl CSECT names). Instead, temporarily redefine $ac_compile so dnl that the object file has the latter name from the start. - save_ac_compile="$ac_compile" - ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` + saved_ac_compile="$ac_compile" + ac_compile=`echo "$saved_ac_compile" | sed s/conftest/conftest1/` if echo '#include "conftest.c"' >conftest1.c \ && AC_TRY_EVAL([ac_compile]); then AC_LANG_CONFTEST([ @@ -97,7 +97,7 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK], int zero (void) { return 0; } ]])]) dnl See note above about renaming object files. - ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` + ac_compile=`echo "$saved_ac_compile" | sed s/conftest/conftest2/` if echo '#include "conftest.c"' >conftest2.c \ && AC_TRY_EVAL([ac_compile]); then if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then @@ -107,7 +107,7 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK], fi fi fi - ac_compile="$save_ac_compile" + ac_compile="$saved_ac_compile" rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext ;; esac @@ -147,6 +147,7 @@ AC_DEFUN([gl_WCHAR_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BTOWC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTOB]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSINIT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSZERO]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRTOWC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRLEN]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRTOWCS]) @@ -185,6 +186,7 @@ AC_DEFUN([gl_WCHAR_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSTOK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSWIDTH]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSFTIME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WGETCWD]) dnl Support Microsoft deprecated alias function names by default. gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WCSDUP], [1]) ]) diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4 index 50bde08..9435357 100644 --- a/m4/wchar_t.m4 +++ b/m4/wchar_t.m4 @@ -1,5 +1,5 @@ # wchar_t.m4 serial 4 (gettext-0.18.2) -dnl Copyright (C) 2002-2003, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2008-2024 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/m4/wcrtomb.m4 b/m4/wcrtomb.m4 index d51b36e..f00f645 100644 --- a/m4/wcrtomb.m4 +++ b/m4/wcrtomb.m4 @@ -1,5 +1,5 @@ -# wcrtomb.m4 serial 17 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +# wcrtomb.m4 serial 19 +dnl Copyright (C) 2008-2024 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. @@ -82,9 +82,11 @@ int main () changequote(,)dnl case "$host_os" in # Guess no on AIX 4, OSF/1, Solaris, native Windows. - aix4* | osf* | solaris* | mingw*) gl_cv_func_wcrtomb_retval="guessing no" ;; + aix4* | osf* | solaris* | mingw* | windows*) + gl_cv_func_wcrtomb_retval="guessing no" ;; # Guess yes otherwise. - *) gl_cv_func_wcrtomb_retval="guessing yes" ;; + *) + gl_cv_func_wcrtomb_retval="guessing yes" ;; esac changequote([,])dnl if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then @@ -97,12 +99,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 +117,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/m4/wctype.m4 b/m4/wctype.m4 new file mode 100644 index 0000000..3660d7d --- /dev/null +++ b/m4/wctype.m4 @@ -0,0 +1,51 @@ +# wctype.m4 serial 6 +dnl Copyright (C) 2011-2024 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_FUNC_WCTYPE], +[ + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + AC_REQUIRE([gl_WCTYPE_H]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + HAVE_WCTYPE=$HAVE_WCTYPE_T + if test $HAVE_WCTYPE = 1; then + AC_CACHE_CHECK([whether wctype supports the "blank" and "punct" character classes], + [gl_cv_func_wctype_works], + [AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + #include + #include + #include + int main () + { + /* This test fails on mingw. */ + if (wctype ("blank") == (wctype_t)0) + return 1; + /* This test fails on MSVC 14. */ + if ((! iswctype ('\t', wctype ("blank"))) != (! iswblank ('\t'))) + return 2; + /* This test fails on Android 11. */ + if ((! iswctype ('\`', wctype ("punct"))) != (! ispunct ('\`'))) + return 4; + return 0; + } + ]])], + [gl_cv_func_wctype_works=yes], [gl_cv_func_wctype_works=no], + [case "$host_os" in + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_wctype_works="guessing no" ;; + # Guess no on Android. + android*) gl_cv_func_wctype_works="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_func_wctype_works="guessing yes" ;; + esac + ]) + ]) + case "$gl_cv_func_wctype_works" in + *yes) ;; + *) REPLACE_WCTYPE=1 ;; + esac + fi +]) diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4 index 6856a73..c899394 100644 --- a/m4/wctype_h.m4 +++ b/m4/wctype_h.m4 @@ -1,8 +1,8 @@ -# wctype_h.m4 serial 30 +# wctype_h.m4 serial 33 dnl A placeholder for ISO C99 , for platforms that lack it. -dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2024 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. @@ -178,6 +178,7 @@ AC_DEFUN([gl_WCTYPE_H_REQUIRE_DEFAULTS], m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS], [ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWBLANK]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWDIGIT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWPUNCT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWXDIGIT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTYPE]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWCTYPE]) @@ -196,5 +197,8 @@ AC_DEFUN([gl_WCTYPE_H_DEFAULTS], HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T]) REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK]) REPLACE_ISWDIGIT=0; AC_SUBST([REPLACE_ISWDIGIT]) + REPLACE_ISWPUNCT=0; AC_SUBST([REPLACE_ISWPUNCT]) REPLACE_ISWXDIGIT=0; AC_SUBST([REPLACE_ISWXDIGIT]) + REPLACE_WCTRANS=0; AC_SUBST([REPLACE_WCTRANS]) + REPLACE_WCTYPE=0; AC_SUBST([REPLACE_WCTYPE]) ]) diff --git a/m4/wcwidth.m4 b/m4/wcwidth.m4 index e7829e9..53a26c7 100644 --- a/m4/wcwidth.m4 +++ b/m4/wcwidth.m4 @@ -1,5 +1,5 @@ # wcwidth.m4 serial 36 -dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2024 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/m4/wget.m4 b/m4/wget.m4 index de03ecc..03b390b 100644 --- a/m4/wget.m4 +++ b/m4/wget.m4 @@ -1,5 +1,5 @@ dnl Wget-specific Autoconf macros. -dnl Copyright (C) 1995-2011, 2018-2023 Free Software Foundation, Inc. +dnl Copyright (C) 1995-2011, 2018-2024 Free Software Foundation, Inc. dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by diff --git a/m4/wget_manywarnings.m4 b/m4/wget_manywarnings.m4 index b977bd2..9a2390d 100644 --- a/m4/wget_manywarnings.m4 +++ b/m4/wget_manywarnings.m4 @@ -1,5 +1,5 @@ # wget_manywarnings.m4 serial 1 -dnl Copyright (C) 2016-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2016-2024 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/m4/wint_t.m4 b/m4/wint_t.m4 index dfd743b..21350f5 100644 --- a/m4/wint_t.m4 +++ b/m4/wint_t.m4 @@ -1,5 +1,5 @@ # wint_t.m4 serial 11 -dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007-2024 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/m4/wmemchr.m4 b/m4/wmemchr.m4 index ac414fb..54f1c83 100644 --- a/m4/wmemchr.m4 +++ b/m4/wmemchr.m4 @@ -1,5 +1,5 @@ # wmemchr.m4 serial 5 -dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2024 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/m4/wmempcpy.m4 b/m4/wmempcpy.m4 index abf1df3..6c08d55 100644 --- a/m4/wmempcpy.m4 +++ b/m4/wmempcpy.m4 @@ -1,5 +1,5 @@ # wmempcpy.m4 serial 3 -dnl Copyright (C) 2020-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2024 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/m4/write.m4 b/m4/write.m4 index fc691f0..c50efc4 100644 --- a/m4/write.m4 +++ b/m4/write.m4 @@ -1,5 +1,5 @@ # write.m4 serial 6 -dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2024 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/m4/xalloc.m4 b/m4/xalloc.m4 index fc56f59..f60ea3d 100644 --- a/m4/xalloc.m4 +++ b/m4/xalloc.m4 @@ -1,5 +1,5 @@ # xalloc.m4 serial 18 -dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2024 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/m4/xsize.m4 b/m4/xsize.m4 index 649db9c..6125f9c 100644 --- a/m4/xsize.m4 +++ b/m4/xsize.m4 @@ -1,5 +1,5 @@ # xsize.m4 serial 5 -dnl Copyright (C) 2003-2004, 2008-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2004, 2008-2024 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/m4/xstrndup.m4 b/m4/xstrndup.m4 index 1fb6a7d..d544650 100644 --- a/m4/xstrndup.m4 +++ b/m4/xstrndup.m4 @@ -1,5 +1,5 @@ # xstrndup.m4 serial 2 -dnl Copyright (C) 2003, 2009-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2024 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/m4/zzgnulib.m4 b/m4/zzgnulib.m4 index 362102b..eed5ecb 100644 --- a/m4/zzgnulib.m4 +++ b/m4/zzgnulib.m4 @@ -1,5 +1,5 @@ # zzgnulib.m4 serial 1 -dnl Copyright (C) 2020-2023 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2024 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. -- cgit v1.2.3