diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2023-05-14 18:51:22 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2023-05-14 19:28:09 -0700 |
commit | b77d357ea356134fbc159797b34498b7a0006dc9 (patch) | |
tree | 1a1d03db84c1b2aac7f6e8dafcdc3e952192c854 /m4 | |
parent | e7dc30c1d58c602ccc4b7b9c98c0ea07f5631675 (diff) | |
download | emacs-b77d357ea356134fbc159797b34498b7a0006dc9.tar.gz |
Update from Gnulib by running admin/merge-gnulib
* lib/dirent-private.h, m4/codeset.m4, m4/locale-fr.m4, m4/musl.m4:
New files, from Gnulib.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/acl.m4 | 48 | ||||
-rw-r--r-- | m4/codeset.m4 | 24 | ||||
-rw-r--r-- | m4/dirent_h.m4 | 21 | ||||
-rw-r--r-- | m4/dirfd.m4 | 25 | ||||
-rw-r--r-- | m4/extern-inline.m4 | 4 | ||||
-rw-r--r-- | m4/gnulib-common.m4 | 74 | ||||
-rw-r--r-- | m4/gnulib-comp.m4 | 55 | ||||
-rw-r--r-- | m4/largefile.m4 | 175 | ||||
-rw-r--r-- | m4/libgmp.m4 | 4 | ||||
-rw-r--r-- | m4/limits-h.m4 | 1 | ||||
-rw-r--r-- | m4/locale-fr.m4 | 253 | ||||
-rw-r--r-- | m4/manywarnings.m4 | 22 | ||||
-rw-r--r-- | m4/musl.m4 | 20 | ||||
-rw-r--r-- | m4/regex.m4 | 4 | ||||
-rw-r--r-- | m4/stdalign.m4 | 30 | ||||
-rw-r--r-- | m4/stddef_h.m4 | 17 | ||||
-rw-r--r-- | m4/stdio_h.m4 | 24 | ||||
-rw-r--r-- | m4/stdlib_h.m4 | 53 | ||||
-rw-r--r-- | m4/strtoll.m4 | 19 | ||||
-rw-r--r-- | m4/xattr.m4 | 4 |
20 files changed, 648 insertions, 229 deletions
diff --git a/m4/acl.m4 b/m4/acl.m4 index dc9853a156d..38b1dc66212 100644 --- a/m4/acl.m4 +++ b/m4/acl.m4 @@ -1,5 +1,5 @@ # acl.m4 - check for access control list (ACL) primitives -# serial 27 +# serial 29 # Copyright (C) 2002, 2004-2023 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -12,7 +12,7 @@ AC_DEFUN([gl_FUNC_ACL_ARG], [ gl_need_lib_has_acl= AC_ARG_ENABLE([acl], - AS_HELP_STRING([--disable-acl], [do not support ACLs]), + AS_HELP_STRING([[--disable-acl]], [do not support ACLs]), , [enable_acl=auto]) ]) @@ -177,37 +177,23 @@ AC_DEFUN([gl_ACL_GET_FILE], AS_IF([test "$gl_cv_func_working_acl_get_file" != no], [$1], [$2]) ]) -# On GNU/Linux, testing if a file has an acl can be done with the getxattr -# syscall which doesn't require linking against additional libraries. +# On GNU/Linux, testing if a file has an acl can be done with the +# listxattr and getxattr syscalls, which don't require linking +# against additional libraries. Assume this works if linux/attr.h +# and listxattr are present. AC_DEFUN([gl_FILE_HAS_ACL], [ AC_REQUIRE([gl_FUNC_ACL_ARG]) - if test "$enable_acl" != no; then - AC_CACHE_CHECK([for getxattr with XATTR_NAME_POSIX_ACL macros], - [gl_cv_getxattr_with_posix_acls], - [gl_cv_getxattr_with_posix_acls=no - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include <sys/types.h> - #include <sys/xattr.h> - #include <linux/xattr.h> - ]], - [[ssize_t a = getxattr (".", XATTR_NAME_POSIX_ACL_ACCESS, 0, 0); - ssize_t b = getxattr (".", XATTR_NAME_POSIX_ACL_DEFAULT, 0, 0); - return a < 0 || b < 0; - ]])], - [gl_cv_getxattr_with_posix_acls=yes])]) - fi - if test "$gl_cv_getxattr_with_posix_acls" = yes; then - FILE_HAS_ACL_LIB= - AC_DEFINE([GETXATTR_WITH_POSIX_ACLS], 1, - [Define to 1 if getxattr works with XATTR_NAME_POSIX_ACL_ACCESS - and XATTR_NAME_POSIX_ACL_DEFAULT.]) - else - dnl Set gl_need_lib_has_acl to a nonempty value, so that any - dnl later gl_FUNC_ACL call will set FILE_HAS_ACL_LIB=$LIB_ACL. - gl_need_lib_has_acl=1 - FILE_HAS_ACL_LIB=$LIB_ACL - fi + AC_CHECK_HEADERS_ONCE([linux/xattr.h]) + AC_CHECK_FUNCS_ONCE([listxattr]) + FILE_HAS_ACL_LIB= + AS_CASE([$enable_acl,$ac_cv_header_linux_xattr_h,$ac_cv_func_listxattr], + [no,*,*], [], + [*,yes,yes], [], + [*], + [dnl Set gl_need_lib_has_acl to a nonempty value, so that any + dnl later gl_FUNC_ACL call will set FILE_HAS_ACL_LIB=$LIB_ACL. + gl_need_lib_has_acl=1 + FILE_HAS_ACL_LIB=$LIB_ACL]) AC_SUBST([FILE_HAS_ACL_LIB]) ]) diff --git a/m4/codeset.m4 b/m4/codeset.m4 new file mode 100644 index 00000000000..5804f472e9a --- /dev/null +++ b/m4/codeset.m4 @@ -0,0 +1,24 @@ +# codeset.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2023 Free Software +dnl Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +AC_DEFUN([AM_LANGINFO_CODESET], +[ + AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <langinfo.h>]], + [[char* cs = nl_langinfo(CODESET); return !cs;]])], + [am_cv_langinfo_codeset=yes], + [am_cv_langinfo_codeset=no]) + ]) + if test $am_cv_langinfo_codeset = yes; then + AC_DEFINE([HAVE_LANGINFO_CODESET], [1], + [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) + fi +]) diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4 index 2a232a7622e..b6c189c0d9f 100644 --- a/m4/dirent_h.m4 +++ b/m4/dirent_h.m4 @@ -1,4 +1,4 @@ -# dirent_h.m4 serial 19 +# dirent_h.m4 serial 20 dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -21,12 +21,29 @@ AC_DEFUN_ONCE([gl_DIRENT_H], fi AC_SUBST([HAVE_DIRENT_H]) + gl_DIRENT_DIR + dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include <dirent.h> ]], [alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir]) ]) +dnl Determine whether <dirent.h> needs to override the DIR type. +AC_DEFUN_ONCE([gl_DIRENT_DIR], +[ + dnl Set DIR_HAS_FD_MEMBER if dirfd() works, i.e. not always returns -1, + dnl or has the __KLIBC__ workaround as in lib/dirfd.c. + dnl We could use the findings from gl_FUNC_DIRFD and gl_PREREQ_DIRFD, but + dnl it's simpler since we know the affected platforms. + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) DIR_HAS_FD_MEMBER=0 ;; + *) DIR_HAS_FD_MEMBER=1 ;; + esac + AC_SUBST([DIR_HAS_FD_MEMBER]) +]) + # gl_DIRENT_MODULE_INDICATOR([modulename]) # sets the shell variable that indicates the presence of the given module # to a C preprocessor expression that will evaluate to 1. @@ -73,6 +90,8 @@ AC_DEFUN([gl_DIRENT_H_DEFAULTS], HAVE_SCANDIR=1; AC_SUBST([HAVE_SCANDIR]) HAVE_ALPHASORT=1; AC_SUBST([HAVE_ALPHASORT]) REPLACE_OPENDIR=0; AC_SUBST([REPLACE_OPENDIR]) + REPLACE_READDIR=0; AC_SUBST([REPLACE_READDIR]) + REPLACE_REWINDDIR=0; AC_SUBST([REPLACE_REWINDDIR]) REPLACE_CLOSEDIR=0; AC_SUBST([REPLACE_CLOSEDIR]) REPLACE_DIRFD=0; AC_SUBST([REPLACE_DIRFD]) REPLACE_FDOPENDIR=0; AC_SUBST([REPLACE_FDOPENDIR]) diff --git a/m4/dirfd.m4 b/m4/dirfd.m4 index 2135535042b..7968b1287ce 100644 --- a/m4/dirfd.m4 +++ b/m4/dirfd.m4 @@ -1,4 +1,4 @@ -# serial 26 -*- Autoconf -*- +# serial 28 -*- Autoconf -*- dnl Find out how to get the file descriptor associated with an open DIR*. @@ -12,7 +12,7 @@ dnl From Jim Meyering AC_DEFUN([gl_FUNC_DIRFD], [ AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([AC_CANONICAL_HOST]) dnl Persuade glibc <dirent.h> to declare dirfd(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) @@ -36,15 +36,20 @@ AC_DEFUN([gl_FUNC_DIRFD], [gl_cv_func_dirfd_macro=yes], [gl_cv_func_dirfd_macro=no])]) - # Use the replacement if we have no function or macro with that name, - # or if OS/2 kLIBC whose dirfd() does not work. - # Replace only if the system declares dirfd already. - case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in - no,no,*,yes | *,*,os2*,yes) + if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no; then + HAVE_DIRFD=0 + else + HAVE_DIRFD=1 + dnl Replace dirfd() on native Windows, to support fdopendir(). + AC_REQUIRE([gl_DIRENT_DIR]) + if test $DIR_HAS_FD_MEMBER = 0; then REPLACE_DIRFD=1 - AC_DEFINE([REPLACE_DIRFD], [1], - [Define to 1 if gnulib's dirfd() replacement is used.]);; - esac + fi + dnl OS/2 kLIBC dirfd() does not work. + case "$host_os" in + os2*) REPLACE_DIRFD=1 ;; + esac + fi ]) dnl Prerequisites of lib/dirfd.c. diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4 index c001b1cff7d..f9894d7fe5c 100644 --- a/m4/extern-inline.m4 +++ b/m4/extern-inline.m4 @@ -79,7 +79,8 @@ AC_DEFUN([gl_EXTERN_INLINE], # define _GL_EXTERN_INLINE_STDHEADER_BUG #endif #if ((__GNUC__ \ - ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ + ? (defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ + && !defined __PCC__) \ : (199901L <= __STDC_VERSION__ \ && !defined __HP_cc \ && !defined __PGI \ @@ -89,6 +90,7 @@ AC_DEFUN([gl_EXTERN_INLINE], # define _GL_EXTERN_INLINE extern inline # define _GL_EXTERN_INLINE_IN_USE #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ + && !defined __PCC__ \ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) # if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index c84a2afd9c5..edb8572da25 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 82 +# gnulib-common.m4 serial 86 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -15,6 +15,10 @@ AC_DEFUN([gl_COMMON], [ AC_REQUIRE([gl_ZZGNULIB]) ]) AC_DEFUN([gl_COMMON_BODY], [ + AH_VERBATIM([0witness], +[/* Witness that <config.h> has been included. */ +#define _GL_CONFIG_H_INCLUDED 1 +]) AH_VERBATIM([_GL_GNUC_PREREQ], [/* True if the compiler says it groks GNU C version MAJOR.MINOR. */ #if defined __GNUC__ && defined __GNUC_MINOR__ @@ -116,6 +120,20 @@ AC_DEFUN([gl_COMMON_BODY], [ # pragma GCC diagnostic ignored "-Wpedantic" #endif +/* Define if, in a function declaration, the attributes in bracket syntax + [[...]] must come before the attributes in __attribute__((...)) syntax. + If this is defined, it is best to avoid the bracket syntax, so that the + various _GL_ATTRIBUTE_* can be cumulated on the same declaration in any + order. */ +#ifdef __cplusplus +# if defined __clang__ +# define _GL_BRACKET_BEFORE_ATTRIBUTE 1 +# endif +#else +# if defined __GNUC__ && !defined __clang__ +# define _GL_BRACKET_BEFORE_ATTRIBUTE 1 +# endif +#endif ]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's alignas instead. [ /* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function @@ -223,9 +241,11 @@ AC_DEFUN([gl_COMMON_BODY], [ - typedef, in C++ also: namespace, class, template specialization. */ #ifndef _GL_ATTRIBUTE_DEPRECATED -# ifdef __has_c_attribute -# if __has_c_attribute (__deprecated__) -# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]] +# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE +# ifdef __has_c_attribute +# if __has_c_attribute (__deprecated__) +# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]] +# endif # endif # endif # if !defined _GL_ATTRIBUTE_DEPRECATED && _GL_HAS_ATTRIBUTE (deprecated) @@ -355,13 +375,15 @@ AC_DEFUN([gl_COMMON_BODY], [ __has_c_attribute (__maybe_unused__) yields true but the use of [[__maybe_unused__]] nevertheless produces a warning. */ #ifndef _GL_ATTRIBUTE_MAYBE_UNUSED -# if defined __clang__ && defined __cplusplus -# if !defined __apple_build_version__ && __clang_major__ >= 10 -# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] -# endif -# elif defined __has_c_attribute -# if __has_c_attribute (__maybe_unused__) -# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] +# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE +# if defined __clang__ && defined __cplusplus +# if !defined __apple_build_version__ && __clang_major__ >= 10 +# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] +# endif +# elif defined __has_c_attribute +# if __has_c_attribute (__maybe_unused__) +# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] +# endif # endif # endif # ifndef _GL_ATTRIBUTE_MAYBE_UNUSED @@ -379,18 +401,20 @@ AC_DEFUN([gl_COMMON_BODY], [ the return value, unless the caller uses something like ignore_value. */ /* Applies to: function, enumeration, class. */ #ifndef _GL_ATTRIBUTE_NODISCARD -# if defined __clang__ && defined __cplusplus +# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE +# if defined __clang__ && defined __cplusplus /* With clang up to 15.0.6 (at least), in C++ mode, [[__nodiscard__]] produces a warning. The 1000 below means a yet unknown threshold. When clang++ version X starts supporting [[__nodiscard__]] without warning about it, you can replace the 1000 with X. */ -# if __clang_major__ >= 1000 -# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] -# endif -# elif defined __has_c_attribute -# if __has_c_attribute (__nodiscard__) -# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] +# if __clang_major__ >= 1000 +# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] +# endif +# elif defined __has_c_attribute +# if __has_c_attribute (__nodiscard__) +# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] +# endif # endif # endif # if !defined _GL_ATTRIBUTE_NODISCARD && _GL_HAS_ATTRIBUTE (warn_unused_result) @@ -528,6 +552,18 @@ AC_DEFUN([gl_COMMON_BODY], [ # endif #endif ]) + AH_VERBATIM([c_linkage], +[/* In C++, there is the concept of "language linkage", that encompasses + name mangling and function calling conventions. + The following macros start and end a block of "C" linkage. */ +#ifdef __cplusplus +# define _GL_BEGIN_C_LINKAGE extern "C" { +# define _GL_END_C_LINKAGE } +#else +# define _GL_BEGIN_C_LINKAGE +# define _GL_END_C_LINKAGE +#endif +]) AH_VERBATIM([async_safe], [/* The _GL_ASYNC_SAFE marker should be attached to functions that are signal handlers (for signals other than SIGABRT, SIGPIPE) or can be @@ -583,7 +619,7 @@ AC_DEFUN([gl_COMMON_BODY], [ dnl gl_cross_guess_normal (to be used when 'yes' is good and 'no' is bad), dnl gl_cross_guess_inverted (to be used when 'no' is good and 'yes' is bad). AC_ARG_ENABLE([cross-guesses], - [AS_HELP_STRING([--enable-cross-guesses={conservative|risky}], + [AS_HELP_STRING([[--enable-cross-guesses={conservative|risky}]], [specify policy for cross-compilation guesses])], [if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then AC_MSG_WARN([invalid argument supplied to --enable-cross-guesses]) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 1bd16a779eb..58fcd1c0481 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -176,6 +176,7 @@ AC_DEFUN([gl_EARLY], # Code from module stddef: # Code from module stdint: # Code from module stdio: + gl_STDIO_H_EARLY # Code from module stdlib: # Code from module stpcpy: # Code from module string: @@ -660,7 +661,7 @@ AC_DEFUN([gl_INIT], gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=false func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b () { - if ! $gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b; then + if $gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b; then :; else AC_REQUIRE([AC_CANONICAL_HOST]) gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=true if case $host_os in mingw*) false;; *) :;; esac; then @@ -670,17 +671,17 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_cloexec () { - if ! $gl_gnulib_enabled_cloexec; then + if $gl_gnulib_enabled_cloexec; then :; else gl_MODULE_INDICATOR_FOR_TESTS([cloexec]) gl_gnulib_enabled_cloexec=true fi } func_gl_gnulib_m4code_dirfd () { - if ! $gl_gnulib_enabled_dirfd; then + if $gl_gnulib_enabled_dirfd; then :; else gl_FUNC_DIRFD gl_CONDITIONAL([GL_COND_OBJ_DIRFD], - [test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no || test $REPLACE_DIRFD = 1]) + [test $HAVE_DIRFD = 0 || test $REPLACE_DIRFD = 1]) AM_COND_IF([GL_COND_OBJ_DIRFD], [ gl_PREREQ_DIRFD ]) @@ -690,13 +691,13 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_925677f0343de64b89a9f0c790b4104c () { - if ! $gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c; then + if $gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c; then :; else gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c=true fi } func_gl_gnulib_m4code_euidaccess () { - if ! $gl_gnulib_enabled_euidaccess; then + if $gl_gnulib_enabled_euidaccess; then :; else gl_FUNC_EUIDACCESS gl_CONDITIONAL([GL_COND_OBJ_EUIDACCESS], [test $HAVE_EUIDACCESS = 0]) AM_COND_IF([GL_COND_OBJ_EUIDACCESS], [ @@ -712,7 +713,7 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_getdtablesize () { - if ! $gl_gnulib_enabled_getdtablesize; then + if $gl_gnulib_enabled_getdtablesize; then :; else gl_FUNC_GETDTABLESIZE gl_CONDITIONAL([GL_COND_OBJ_GETDTABLESIZE], [test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1]) @@ -725,7 +726,7 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_getgroups () { - if ! $gl_gnulib_enabled_getgroups; then + if $gl_gnulib_enabled_getgroups; then :; else gl_FUNC_GETGROUPS gl_CONDITIONAL([GL_COND_OBJ_GETGROUPS], [test $HAVE_GETGROUPS = 0 || test $REPLACE_GETGROUPS = 1]) @@ -738,7 +739,7 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 () { - if ! $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then + if $gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36; then :; else AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true @@ -746,14 +747,14 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_fd38c7e463b54744b77b98aeafb4fa7c () { - if ! $gl_gnulib_enabled_fd38c7e463b54744b77b98aeafb4fa7c; then + if $gl_gnulib_enabled_fd38c7e463b54744b77b98aeafb4fa7c; then :; else AC_PROG_MKDIR_P gl_gnulib_enabled_fd38c7e463b54744b77b98aeafb4fa7c=true fi } func_gl_gnulib_m4code_8444034ea779b88768865bb60b4fb8c9 () { - if ! $gl_gnulib_enabled_8444034ea779b88768865bb60b4fb8c9; then + if $gl_gnulib_enabled_8444034ea779b88768865bb60b4fb8c9; then :; else AC_PROG_MKDIR_P gl_gnulib_enabled_8444034ea779b88768865bb60b4fb8c9=true func_gl_gnulib_m4code_ef455225c00f5049c808c2eda3e76866 @@ -762,7 +763,7 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_a9786850e999ae65a836a6041e8e5ed1 () { - if ! $gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1; then + if $gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1; then :; else gl_FUNC_GROUP_MEMBER gl_CONDITIONAL([GL_COND_OBJ_GROUP_MEMBER], [test $HAVE_GROUP_MEMBER = 0]) AM_COND_IF([GL_COND_OBJ_GROUP_MEMBER], [ @@ -780,7 +781,7 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_lchmod () { - if ! $gl_gnulib_enabled_lchmod; then + if $gl_gnulib_enabled_lchmod; then :; else gl_FUNC_LCHMOD gl_CONDITIONAL([GL_COND_OBJ_LCHMOD], [test $HAVE_LCHMOD = 0]) AM_COND_IF([GL_COND_OBJ_LCHMOD], [ @@ -792,7 +793,7 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_e80bf6f757095d2e5fc94dafb8f8fc8b () { - if ! $gl_gnulib_enabled_e80bf6f757095d2e5fc94dafb8f8fc8b; then + if $gl_gnulib_enabled_e80bf6f757095d2e5fc94dafb8f8fc8b; then :; else gl_FUNC_MALLOC_GNU if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 1; then AC_LIBOBJ([malloc]) @@ -807,7 +808,7 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_ef455225c00f5049c808c2eda3e76866 () { - if ! $gl_gnulib_enabled_ef455225c00f5049c808c2eda3e76866; then + if $gl_gnulib_enabled_ef455225c00f5049c808c2eda3e76866; then :; else AC_REQUIRE([gl_FUNC_MALLOC_POSIX]) if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then AC_LIBOBJ([malloc]) @@ -821,7 +822,7 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_5264294aa0a5557541b53c8c741f7f31 () { - if ! $gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31; then + if $gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31; then :; else gl_FUNC_MKTIME_INTERNAL if test $WANT_MKTIME_INTERNAL = 1; then AC_LIBOBJ([mktime]) @@ -832,7 +833,7 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_open () { - if ! $gl_gnulib_enabled_open; then + if $gl_gnulib_enabled_open; then :; else gl_FUNC_OPEN gl_CONDITIONAL([GL_COND_OBJ_OPEN], [test $REPLACE_OPEN = 1]) AM_COND_IF([GL_COND_OBJ_OPEN], [ @@ -847,13 +848,13 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7 () { - if ! $gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7; then + if $gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7; then :; else gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=true fi } func_gl_gnulib_m4code_rawmemchr () { - if ! $gl_gnulib_enabled_rawmemchr; then + if $gl_gnulib_enabled_rawmemchr; then :; else gl_FUNC_RAWMEMCHR gl_CONDITIONAL([GL_COND_OBJ_RAWMEMCHR], [test $HAVE_RAWMEMCHR = 0]) AM_COND_IF([GL_COND_OBJ_RAWMEMCHR], [ @@ -865,7 +866,7 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_d3b2383720ee0e541357aa2aac598e2b () { - if ! $gl_gnulib_enabled_d3b2383720ee0e541357aa2aac598e2b; then + if $gl_gnulib_enabled_d3b2383720ee0e541357aa2aac598e2b; then :; else gl_FUNC_REALLOC_GNU if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 1; then AC_LIBOBJ([realloc]) @@ -883,7 +884,7 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_61bcaca76b3e6f9ae55d57a1c3193bc4 () { - if ! $gl_gnulib_enabled_61bcaca76b3e6f9ae55d57a1c3193bc4; then + if $gl_gnulib_enabled_61bcaca76b3e6f9ae55d57a1c3193bc4; then :; else gl_FUNC_REALLOC_POSIX if test $REPLACE_REALLOC_FOR_REALLOC_POSIX = 1; then AC_LIBOBJ([realloc]) @@ -900,13 +901,13 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_6099e9737f757db36c47fa9d9f02e88c () { - if ! $gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c; then + if $gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c; then :; else gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=true fi } func_gl_gnulib_m4code_strtoll () { - if ! $gl_gnulib_enabled_strtoll; then + if $gl_gnulib_enabled_strtoll; then :; else gl_FUNC_STRTOLL gl_CONDITIONAL([GL_COND_OBJ_STRTOLL], [test $HAVE_STRTOLL = 0 || test $REPLACE_STRTOLL = 1]) @@ -919,14 +920,14 @@ AC_DEFUN([gl_INIT], } func_gl_gnulib_m4code_utimens () { - if ! $gl_gnulib_enabled_utimens; then + if $gl_gnulib_enabled_utimens; then :; else gl_UTIMENS gl_gnulib_enabled_utimens=true fi } func_gl_gnulib_m4code_682e609604ccaac6be382e4ee3a4eaec () { - if ! $gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec; then + if $gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec; then :; else gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=true fi } @@ -1246,6 +1247,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/count-trailing-zeros.c lib/count-trailing-zeros.h lib/diffseq.h + lib/dirent-private.h lib/dirent.in.h lib/dirfd.c lib/dtoastr.c @@ -1429,6 +1431,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/c-bool.m4 m4/canonicalize.m4 m4/clock_time.m4 + m4/codeset.m4 m4/copy-file-range.m4 m4/d-type.m4 m4/dirent_h.m4 @@ -1474,6 +1477,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/lchmod.m4 m4/libgmp.m4 m4/limits-h.m4 + m4/locale-fr.m4 m4/lstat.m4 m4/malloc.m4 m4/manywarnings-c++.m4 @@ -1489,6 +1493,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/mktime.m4 m4/mode_t.m4 m4/multiarch.m4 + m4/musl.m4 m4/nanosleep.m4 m4/nocrash.m4 m4/nproc.m4 diff --git a/m4/largefile.m4 b/m4/largefile.m4 index 7fb81b864af..a2adb533ae6 100644 --- a/m4/largefile.m4 +++ b/m4/largefile.m4 @@ -10,7 +10,7 @@ # It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this # setting of _LARGEFILE_SOURCE is needed so that <stdio.h> declares fseeko # and ftello in C++ mode as well. -# Fixed in Autoconf 2.72, which has AC_SYS_YEAR2038. +# This problem occurs in Autoconf 2.71 and earlier, which lack AC_SYS_YEAR2038. AC_DEFUN([gl_SET_LARGEFILE_SOURCE], m4_ifndef([AC_SYS_YEAR2038], [[ AC_REQUIRE([AC_CANONICAL_HOST]) @@ -24,29 +24,9 @@ AC_DEFUN([gl_SET_LARGEFILE_SOURCE], ]]) ) -# Work around a problem in autoconf <= 2.69: -# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5, -# or configures them incorrectly in some cases. -m4_version_prereq([2.70], [], [ - -# _AC_SYS_LARGEFILE_TEST_INCLUDES -# ------------------------------- -m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], -[#include <sys/types.h> - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]];[]dnl -]) -])# m4_version_prereq 2.70 - -# Support AC_SYS_YEAR2038, even if Autoconf 2.71 or earlier. -# This code is taken from Autoconf master. -m4_ifndef([AC_SYS_YEAR2038], [ +m4_ifndef([AC_SYS_YEAR2038_RECOMMENDED], [ +# Support AC_SYS_YEAR2038_RECOMMENDED and related macros, even if +# Autoconf 2.71 or earlier. This code is taken from Autoconf master. # _AC_SYS_YEAR2038_TEST_CODE # -------------------------- @@ -78,8 +58,8 @@ m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize( dnl 32-bit MinGW (misconfiguration) )) -# _AC_SYS_YEAR2038_PROBE([IF-NOT-DETECTED]) -# ----------------------------------------- +# _AC_SYS_YEAR2038_PROBE +# ---------------------- # Subroutine of AC_SYS_YEAR2038. Probe for time_t that can represent # time points more than 2**31 - 1 seconds after the epoch (dates after # 2038-01-18, see above) and set the cache variable ac_cv_sys_year2038_opts @@ -92,13 +72,10 @@ m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize( # AC_TRY_RUN. Note also that some systems only support large time_t # together with large off_t. # -# If support is not detected, the behavior depends on which of the -# top-level AC_SYS_YEAR2038 macros was used (see below). -# # If you change this macro you may also need to change # _AC_SYS_YEAR2038_OPTIONS. AC_DEFUN([_AC_SYS_YEAR2038_PROBE], -[AC_CACHE_CHECK([for $CC option to enable timestamps after Jan 2038], +[AC_CACHE_CHECK([for $CC option for timestamps after 2038], [ac_cv_sys_year2038_opts], [ac_save_CPPFLAGS="$CPPFLAGS" ac_opt_found=no @@ -117,40 +94,20 @@ ac_have_year2038=yes AS_CASE([$ac_cv_sys_year2038_opts], ["none needed"], [], ["support not detected"], - [ac_have_year2038=no - AS_CASE([$enable_year2038], - [yes], - [# If we're not cross compiling and 'touch' works with a large - # timestamp, then we can presume the system supports wider time_t - # *somehow* and we just weren't able to detect it. One common - # case that we deliberately *don't* probe for is a system that - # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers - # wide time_t. (It would be inappropriate for us to override an - # intentional use of -m32.) Error out, demanding use of - # --disable-year2038 if this is intentional. - AS_IF([test $cross_compiling = no], - [AS_IF([TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null], - [AS_CASE([`TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null`], - [*'Feb 7 2106'* | *'Feb 7 17:10'*], - [AC_MSG_FAILURE(m4_text_wrap( - [this system appears to support timestamps after January 2038, - but no mechanism for enabling wide 'time_t' was detected. - Did you mean to build a 64-bit binary? (e.g. 'CC="${CC} -m64"'.) - To proceed with 32-bit time_t, configure with '--disable-year2038'.], - [], [], [55]))])])])])], + [ac_have_year2038=no], ["-D_TIME_BITS=64"], [AC_DEFINE([_TIME_BITS], [64], [Number of bits in time_t, on hosts where this is settable.])], - ["-D__MINGW_USE_VC2005_COMPAT=1"], + ["-D__MINGW_USE_VC2005_COMPAT"], [AC_DEFINE([__MINGW_USE_VC2005_COMPAT], [1], [Define to 1 on platforms where this makes time_t a 64-bit type.])], ["-U_USE_32_BIT_TIME_T"*], [AC_MSG_FAILURE(m4_text_wrap( [the 'time_t' type is currently forced to be 32-bit. - It will stop working after January 2038. + It will stop working after mid-January 2038. Remove _USE_32BIT_TIME_T from the compiler flags.], [], [], [55]))], @@ -160,12 +117,11 @@ AS_CASE([$ac_cv_sys_year2038_opts], # _AC_SYS_YEAR2038_ENABLE # ----------------------- -# Subroutine of AC_SYS_YEAR2038 and _AC_SYS_YEAR2038_OPT_IN. # Depending on which of the YEAR2038 macros was used, add either an -# --enable-year2038, or a --disable-year2038, or no option at all to -# the configure script. Note that this is expanded very late and +# --enable-year2038 or a --disable-year2038 to +# the configure script. This is expanded very late and # therefore there cannot be any code in the AC_ARG_ENABLE. The -# default value for enable_year2038 is emitted unconditionally +# default value for 'enable_year2038' is emitted unconditionally # because the generated code always looks at this variable. m4_define([_AC_SYS_YEAR2038_ENABLE], [m4_divert_text([DEFAULTS], @@ -175,35 +131,50 @@ m4_define([_AC_SYS_YEAR2038_ENABLE], [AC_ARG_ENABLE([year2038], m4_provide_if([AC_SYS_YEAR2038], [AS_HELP_STRING([--disable-year2038], - [do not support timestamps after 2038])], + [don't support timestamps after 2038])], [AS_HELP_STRING([--enable-year2038], [support timestamps after 2038])]))]) -# _AC_SYS_YEAR2038_OPT_IN -# ----------------------- -# If the --enable-year2038 option is given to configure, attempt to -# detect and activate support for large time_t on 32-bit systems. -# This macro is automatically invoked by AC_SYS_LARGEFILE when large -# *file* support is detected. It does not AC_REQUIRE AC_SYS_LARGEFILE -# to avoid a dependency loop, and is therefore unsafe to expose as a -# documented macro. -AC_DEFUN([_AC_SYS_YEAR2038_OPT_IN], -[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl - AS_IF([test "$enable_year2038" != no], [_AC_SYS_YEAR2038_PROBE]) - AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE]) -])]) - # AC_SYS_YEAR2038 # --------------- # Attempt to detect and activate support for large time_t. # On systems where time_t is not always 64 bits, this probe can be # skipped by passing the --disable-year2038 option to configure. AC_DEFUN([AC_SYS_YEAR2038], -[AC_REQUIRE([AC_SYS_LARGEFILE])]dnl -[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl - AS_IF([test "$enable_year2038" != no], [_AC_SYS_YEAR2038_PROBE]) - AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE]) -])]) +[AC_REQUIRE([AC_SYS_LARGEFILE])dnl +AS_IF([test "$enable_year2038,$ac_have_year2038,$cross_compiling" = yes,no,no], + [# If we're not cross compiling and 'touch' works with a large + # timestamp, then we can presume the system supports wider time_t + # *somehow* and we just weren't able to detect it. One common + # case that we deliberately *don't* probe for is a system that + # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers + # wide time_t. (It would be inappropriate for us to override an + # intentional use of -m32.) Error out, demanding use of + # --disable-year2038 if this is intentional. + AS_IF([TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null], + [AS_CASE([`TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null`], + [*'Feb 7 2106'* | *'Feb 7 17:10'*], + [AC_MSG_FAILURE(m4_text_wrap( + [this system appears to support timestamps after mid-January 2038, + but no mechanism for enabling wide 'time_t' was detected. + Did you mean to build a 64-bit binary? (E.g., 'CC="${CC} -m64"'.) + To proceed with 32-bit time_t, configure with '--disable-year2038'.], + [], [], [55]))])])])]) + +# AC_SYS_YEAR2038_RECOMMENDED +# --------------------------- +# Same as AC_SYS_YEAR2038, but recommend support for large time_t. +# If we cannot find any way to make time_t capable of representing +# values larger than 2**31 - 1, error out unless --disable-year2038 is given. +AC_DEFUN([AC_SYS_YEAR2038_RECOMMENDED], +[AC_REQUIRE([AC_SYS_YEAR2038])dnl +AS_IF([test "$enable_year2038,$ac_have_year2038" = yes,no], + [AC_MSG_FAILURE(m4_text_wrap( + [could not enable timestamps after mid-January 2038. + This package recommends support for these later timestamps. + However, to proceed with signed 32-bit time_t even though it + will fail then, configure with '--disable-year2038'.], + [], [], [55]))])]) # _AC_SYS_LARGEFILE_TEST_CODE # --------------------------- @@ -219,6 +190,8 @@ m4_define([_AC_SYS_LARGEFILE_TEST_CODE], && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]];[]dnl ]) +# Defined by Autoconf 2.71 and circa 2022 Gnulib unwisely depended on it. +m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], [_AC_SYS_LARGEFILE_TEST_CODE]) # _AC_SYS_LARGEFILE_OPTIONS # ------------------------- @@ -228,8 +201,8 @@ m4_define([_AC_SYS_LARGEFILE_TEST_CODE], m4_define([_AC_SYS_LARGEFILE_OPTIONS], m4_normalize( ["none needed"] dnl Most current systems ["-D_FILE_OFFSET_BITS=64"] dnl X/Open LFS spec - ["-D_LARGE_FILES=1"] dnl AIX (which versions?) - ["-n32"] dnl Irix 6.2 w/ SGI compiler + ["-D_LARGE_FILES=1"] dnl 32-bit AIX 4.2.1+, 32-bit z/OS + ["-n32"] dnl 32-bit IRIX 6, SGI cc (obsolete) )) # _AC_SYS_LARGEFILE_PROBE @@ -259,11 +232,24 @@ AC_DEFUN([_AC_SYS_LARGEFILE_PROBE], test $ac_opt_found = no || break done CC="$ac_save_CC" + dnl Gnulib implements large file support for native Windows, based on the + dnl variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE. + m4_ifdef([gl_LARGEFILE], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + if test $ac_opt_found != yes; then + AS_CASE([$host_os], + [mingw*], + [ac_cv_sys_largefile_opts="supported through gnulib" + ac_opt_found=yes] + ) + fi + ]) test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected"]) ac_have_largefile=yes AS_CASE([$ac_cv_sys_largefile_opts], ["none needed"], [], + ["supported through gnulib"], [], ["support not detected"], [ac_have_largefile=no], @@ -281,21 +267,9 @@ AS_CASE([$ac_cv_sys_largefile_opts], [AC_MSG_ERROR( [internal error: bad value for \$ac_cv_sys_largefile_opts])]) -_AC_SYS_YEAR2038_OPT_IN -]) - -# _AC_SYS_LARGEFILE_ENABLE -# ------------------------ -# Subroutine of AC_SYS_LARGEFILE. Note that this -# is expanded very late and therefore there cannot be any code in the -# AC_ARG_ENABLE. The default value for enable_largefile is emitted -# unconditionally because the generated shell code always looks at -# this variable. -m4_define([_AC_SYS_LARGEFILE_ENABLE], -[m4_divert_text([DEFAULTS], - enable_largefile=yes)]dnl -[AC_ARG_ENABLE([largefile], - [AS_HELP_STRING([--disable-largefile], [omit support for large files])])]) +AS_IF([test "$enable_year2038" != no], + [_AC_SYS_YEAR2038_PROBE]) +AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])]) # AC_SYS_LARGEFILE # ---------------- @@ -306,14 +280,13 @@ m4_define([_AC_SYS_LARGEFILE_ENABLE], # Additionally, on Linux file systems with 64-bit inodes a file that happens # to have a 64-bit inode number cannot be accessed by 32-bit applications on # Linux x86/x86_64. This can occur with file systems such as XFS and NFS. -# This macro allows configuration to continue if the system doesn't support -# large files. AC_DEFUN([AC_SYS_LARGEFILE], -[m4_provide_if([_AC_SYS_LARGEFILE_PROBE], [], [dnl - AS_IF([test "$enable_largefile" != no], [_AC_SYS_LARGEFILE_PROBE]) - AC_CONFIG_COMMANDS_PRE([_AC_SYS_LARGEFILE_ENABLE]) -])]) -])# m4_ifndef AC_SYS_YEAR2038 +[AC_ARG_ENABLE([largefile], + [AS_HELP_STRING([--disable-largefile], + [omit support for large files])])dnl +AS_IF([test "$enable_largefile,$enable_year2038" != no,no], + [_AC_SYS_LARGEFILE_PROBE])]) +])# m4_ifndef AC_SYS_YEAR2038_RECOMMENDED # Enable large files on systems where this is implemented by Gnulib, not by the # system headers. diff --git a/m4/libgmp.m4 b/m4/libgmp.m4 index 58576c4d0c5..eb20ada0fa5 100644 --- a/m4/libgmp.m4 +++ b/m4/libgmp.m4 @@ -1,4 +1,4 @@ -# libgmp.m4 serial 7 +# libgmp.m4 serial 8 # Configure the GMP library or a replacement. dnl Copyright 2020-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation @@ -15,7 +15,7 @@ dnl empty. AC_DEFUN([gl_LIBGMP], [ AC_ARG_WITH([libgmp], - [AS_HELP_STRING([--without-libgmp], + [AS_HELP_STRING([[--without-libgmp]], [do not use the GNU Multiple Precision (GMP) library; this is the default on systems lacking libgmp.])]) HAVE_LIBGMP=no diff --git a/m4/limits-h.m4 b/m4/limits-h.m4 index 4f8ce41098a..ca0294e5500 100644 --- a/m4/limits-h.m4 +++ b/m4/limits-h.m4 @@ -24,6 +24,7 @@ AC_DEFUN_ONCE([gl_LIMITS_H], int ullw = ULLONG_WIDTH; int bw = BOOL_WIDTH; int bm = BOOL_MAX; + int mblm = MB_LEN_MAX; ]])], [gl_cv_header_limits_width=yes], [gl_cv_header_limits_width=no])]) diff --git a/m4/locale-fr.m4 b/m4/locale-fr.m4 new file mode 100644 index 00000000000..5e13f3945d2 --- /dev/null +++ b/m4/locale-fr.m4 @@ -0,0 +1,253 @@ +# locale-fr.m4 serial 21 +dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +dnl Determine the name of a french locale with traditional encoding. +AC_DEFUN_ONCE([gt_LOCALE_FR], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([[ +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if defined __BEOS__ || defined __HAIKU__ + return 1; +#else + /* Check whether the given locale name is recognized by the system. */ +# if defined _WIN32 && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +# endif + return 0; +#endif +} + ]])]) + 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 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 + else + # None found. + gt_cv_locale_fr=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=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + 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. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ]) + LOCALE_FR=$gt_cv_locale_fr + 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([AM_LANGINFO_CODESET]) + AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [ + AC_LANG_CONFTEST([AC_LANG_SOURCE([[ +#include <locale.h> +#include <time.h> +#if HAVE_LANGINFO_CODESET +# include <langinfo.h> +#endif +#include <stdlib.h> +#include <string.h> +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if defined _WIN32 && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#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 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + ]) + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 + AC_SUBST([LOCALE_FR_UTF8]) +]) diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index 2fac86e20be..13db996516d 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -46,8 +46,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], dnl First, check for some issues that only occur when combining multiple dnl gcc warning categories. AC_REQUIRE([AC_PROG_CC]) - if test -n "$GCC"; then - + AS_IF([test -n "$GCC"], [ dnl Check if -Wextra -Werror -Wno-missing-field-initializers is supported dnl with the current $CC $CFLAGS $CPPFLAGS. AC_CACHE_CHECK([whether -Wno-missing-field-initializers is supported], @@ -61,7 +60,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], CFLAGS="$gl_save_CFLAGS" ]) - if test "$gl_cv_cc_nomfi_supported" = yes; then + AS_IF([test "$gl_cv_cc_nomfi_supported" = yes], [ dnl Now check whether -Wno-missing-field-initializers is needed dnl for the { 0, } construct. AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed], @@ -82,7 +81,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], [gl_cv_cc_nomfi_needed=yes]) CFLAGS="$gl_save_CFLAGS" ]) - fi + ]) dnl Next, check if -Werror -Wuninitialized is useful with the dnl user's choice of $CFLAGS; some versions of gcc warn that it @@ -97,8 +96,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], [gl_cv_cc_uninitialized_supported=no]) CFLAGS="$gl_save_CFLAGS" ]) - - fi + ]) # List all gcc warning categories. # To compare this list to your installed GCC's, run this Bash command: @@ -109,7 +107,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], # <(LC_ALL=C gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort) $1= - for gl_manywarn_item in -fanalyzer -fno-common \ + for gl_manywarn_item in -fanalyzer -fstrict-flex-arrays \ -Wall \ -Warith-conversion \ -Wbad-function-cast \ @@ -137,6 +135,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], -Wpointer-arith \ -Wshadow \ -Wstack-protector \ + -Wstrict-flex-arrays \ -Wstrict-overflow \ -Wstrict-prototypes \ -Wsuggest-attribute=cold \ @@ -178,14 +177,19 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], gl_AS_VAR_APPEND([$1], [' -Wvla-larger-than=4031']) # These are needed for older GCC versions. - if test -n "$GCC"; then - case `($CC --version) 2>/dev/null` in + if test -n "$GCC" && gl_gcc_version=`($CC --version) 2>/dev/null`; then + case $gl_gcc_version in 'gcc (GCC) '[[0-3]].* | \ 'gcc (GCC) '4.[[0-7]].*) gl_AS_VAR_APPEND([$1], [' -fdiagnostics-show-option']) gl_AS_VAR_APPEND([$1], [' -funit-at-a-time']) ;; esac + case $gl_gcc_version in + 'gcc (GCC) '[[0-9]].*) + gl_AS_VAR_APPEND([$1], [' -fno-common']) + ;; + esac fi # Disable specific options as needed. diff --git a/m4/musl.m4 b/m4/musl.m4 new file mode 100644 index 00000000000..e28a3fed677 --- /dev/null +++ b/m4/musl.m4 @@ -0,0 +1,20 @@ +# musl.m4 serial 4 +dnl Copyright (C) 2019-2023 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# Test for musl libc, despite the musl libc authors don't like it +# <https://wiki.musl-libc.org/faq.html> +# <https://lists.gnu.org/archive/html/bug-gnulib/2018-02/msg00079.html>. +# From Bruno Haible. + +AC_DEFUN_ONCE([gl_MUSL_LIBC], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + *-musl* | midipix*) + AC_DEFINE([MUSL_LIBC], [1], [Define to 1 on musl libc.]) + ;; + esac +]) diff --git a/m4/regex.m4 b/m4/regex.m4 index c89a1432a7b..7acadc48343 100644 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -1,4 +1,4 @@ -# serial 73 +# serial 74 # Copyright (C) 1996-2001, 2003-2023 Free Software Foundation, Inc. # @@ -15,7 +15,7 @@ AC_DEFUN([gl_REGEX], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_ARG_WITH([included-regex], - [AS_HELP_STRING([--without-included-regex], + [AS_HELP_STRING([[--without-included-regex]], [don't compile regex; this is the default on systems with recent-enough versions of the GNU C Library (use with caution on other systems).])]) diff --git a/m4/stdalign.m4 b/m4/stdalign.m4 index f49cf8ec162..1a236d66d2f 100644 --- a/m4/stdalign.m4 +++ b/m4/stdalign.m4 @@ -151,22 +151,22 @@ AC_DEFUN([gl_ALIGNASOF], - alignas (TYPE) is equivalent to alignas (alignof (TYPE)). */ -# if !HAVE_STDALIGN_H -# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 -# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER) -# define _Alignas(a) alignas (a) -# elif (!defined __attribute__ \ - && ((defined __APPLE__ && defined __MACH__ \ - ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ - : __GNUC__ && !defined __ibmxl__) \ - || (4 <= __clang_major__) \ - || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ - || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)) -# define _Alignas(a) __attribute__ ((__aligned__ (a))) -# elif 1300 <= _MSC_VER -# define _Alignas(a) __declspec (align (a)) -# endif +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 +# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER) +# define _Alignas(a) alignas (a) +# elif (!defined __attribute__ \ + && ((defined __APPLE__ && defined __MACH__ \ + ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ + : __GNUC__ && !defined __ibmxl__) \ + || (4 <= __clang_major__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)) +# define _Alignas(a) __attribute__ ((__aligned__ (a))) +# elif 1300 <= _MSC_VER +# define _Alignas(a) __declspec (align (a)) # endif +# endif +# if !HAVE_STDALIGN_H # if ((defined _Alignas \ && !(defined __cplusplus \ && (201103 <= __cplusplus || defined _MSC_VER))) \ diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4 index a2322ebb7ee..aa012219fcd 100644 --- a/m4/stddef_h.m4 +++ b/m4/stddef_h.m4 @@ -1,4 +1,4 @@ -# stddef_h.m4 serial 13 +# stddef_h.m4 serial 14 dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -68,6 +68,21 @@ AC_DEFUN_ONCE([gl_STDDEF_H], GL_GENERATE_STDDEF_H=true fi + AC_CACHE_CHECK([for unreachable], + [gl_cv_func_unreachable], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <stddef.h> + ]], + [[unreachable (); + ]])], + [gl_cv_func_unreachable=yes], + [gl_cv_func_unreachable=no]) + ]) + if test $gl_cv_func_unreachable = no; then + GL_GENERATE_STDDEF_H=true + fi + if $GL_GENERATE_STDDEF_H; then gl_NEXT_HEADERS([stddef.h]) fi diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 index 07569961f8b..dbfa0d5d61b 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 @@ -1,12 +1,22 @@ -# stdio_h.m4 serial 61 +# stdio_h.m4 serial 63 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN_ONCE([gl_STDIO_H], +AC_DEFUN([gl_STDIO_H_EARLY], [ - AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + dnl Defining __USE_MINGW_ANSI_STDIO to 1 must be done early, because + dnl the results of several configure tests depend on it: The tests + dnl - checking whether snprintf returns a byte count as in C99... + dnl - checking whether snprintf truncates the result as in C99... + dnl - checking whether printf supports the 'F' directive... + dnl - checking whether printf supports the grouping flag... + dnl - checking whether printf supports the zero flag correctly... + dnl - checking whether printf supports infinite 'double' arguments... + dnl - checking whether printf supports large precisions... + dnl report 'yes' if __USE_MINGW_ANSI_STDIO is 1 but 'no' if + dnl __USE_MINGW_ANSI_STDIO is not set. AH_VERBATIM([MINGW_ANSI_STDIO], [/* Use GNU style printf and scanf. */ #ifndef __USE_MINGW_ANSI_STDIO @@ -14,6 +24,11 @@ AC_DEFUN_ONCE([gl_STDIO_H], #endif ]) AC_DEFINE([__USE_MINGW_ANSI_STDIO]) +]) + +AC_DEFUN_ONCE([gl_STDIO_H], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_NEXT_HEADERS([stdio.h]) dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and @@ -40,6 +55,9 @@ AC_DEFUN_ONCE([gl_STDIO_H], attribute "__gnu_printf__" instead of "__printf__"]) fi + dnl For defining _PRINTF_NAN_LEN_MAX. + gl_MUSL_LIBC + dnl This ifdef is an optimization, to avoid performing a configure check whose dnl result is not used. But it does not make the test of dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant. diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index 249ef657224..f47c1eb37b3 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 71 +# stdlib_h.m4 serial 75 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -24,14 +24,57 @@ AC_DEFUN_ONCE([gl_STDLIB_H], #endif ]], [_Exit aligned_alloc atoll canonicalize_file_name free getloadavg getprogname getsubopt grantpt - initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps - posix_memalign posix_openpt ptsname ptsname_r qsort_r + initstate initstate_r mbstowcs mbtowc mkdtemp mkostemp mkostemps mkstemp + mkstemps posix_memalign posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtol strtold strtoll strtoul strtoull unlockpt unsetenv]) AC_REQUIRE([AC_C_RESTRICT]) + dnl Test whether MB_CUR_MAX needs to be overridden. + dnl On Solaris 10, in UTF-8 locales, its value is 3 but needs to be 4. + dnl Fortunately, we can do this because on this platform MB_LEN_MAX is 5. + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gt_LOCALE_FR_UTF8]) + AC_CACHE_CHECK([whether MB_CUR_MAX is correct], + [gl_cv_macro_MB_CUR_MAX_good], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. +changequote(,)dnl + case "$host_os" in + # Guess no on Solaris. + solaris*) gl_cv_macro_MB_CUR_MAX_good="guessing no" ;; + # Guess yes otherwise. + *) gl_cv_macro_MB_CUR_MAX_good="guessing yes" ;; + esac +changequote([,])dnl + if test $LOCALE_FR_UTF8 != none; then + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <locale.h> +#include <stdlib.h> +int main () +{ + int result = 0; + if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) + { + if (MB_CUR_MAX < 4) + result |= 1; + } + return result; +}]])], + [gl_cv_macro_MB_CUR_MAX_good=yes], + [gl_cv_macro_MB_CUR_MAX_good=no], + [:]) + fi + ]) + case "$gl_cv_macro_MB_CUR_MAX_good" in + *yes) ;; + *) REPLACE_MB_CUR_MAX=1 ;; + esac + AC_CHECK_DECLS_ONCE([ecvt]) if test $ac_cv_have_decl_ecvt = no; then HAVE_DECL_ECVT=0 @@ -78,6 +121,7 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GRANTPT]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_GNU]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOWCS]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBTOWC]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDTEMP]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMP]) @@ -131,6 +175,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], HAVE_DECL_FCVT=1; AC_SUBST([HAVE_DECL_FCVT]) HAVE_DECL_GCVT=1; AC_SUBST([HAVE_DECL_GCVT]) HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) + HAVE_DECL_PROGRAM_INVOCATION_NAME=1; AC_SUBST([HAVE_DECL_PROGRAM_INVOCATION_NAME]) HAVE_GETPROGNAME=1; AC_SUBST([HAVE_GETPROGNAME]) HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT]) @@ -180,6 +225,8 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE]) REPLACE_MALLOC_FOR_MALLOC_GNU=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_GNU]) REPLACE_MALLOC_FOR_MALLOC_POSIX=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_POSIX]) + REPLACE_MB_CUR_MAX=0; AC_SUBST([REPLACE_MB_CUR_MAX]) + REPLACE_MBSTOWCS=0; AC_SUBST([REPLACE_MBSTOWCS]) REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) REPLACE_MKOSTEMP=0; AC_SUBST([REPLACE_MKOSTEMP]) REPLACE_MKOSTEMPS=0; AC_SUBST([REPLACE_MKOSTEMPS]) diff --git a/m4/strtoll.m4 b/m4/strtoll.m4 index ede630c6061..ec09609cd42 100644 --- a/m4/strtoll.m4 +++ b/m4/strtoll.m4 @@ -1,4 +1,4 @@ -# strtoll.m4 serial 9 +# strtoll.m4 serial 10 dnl Copyright (C) 2002, 2004, 2006, 2008-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -24,15 +24,26 @@ AC_DEFUN([gl_FUNC_STRTOLL], if (term != input + 1) result |= 1; } + /* This test fails on pre-C23 platforms. */ + { + const char input[] = "0b1"; + (void) strtoll (input, &term, 2); + if (term != input + 3) + result |= 2; + } return result; ]]) ], [gl_cv_func_strtoll_works=yes], [gl_cv_func_strtoll_works=no], [case "$host_os" in - # Guess no on native Windows. - mingw*) gl_cv_func_strtoll_works="guessing no" ;; - *) gl_cv_func_strtoll_works="$gl_cross_guess_normal" ;; + # Guess no on native Windows. + mingw*) 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. + *-musl* | midipix*) gl_cv_func_strtoll_works="guessing no" ;; + *) gl_cv_func_strtoll_works="$gl_cross_guess_normal" ;; esac ]) ]) diff --git a/m4/xattr.m4 b/m4/xattr.m4 index 0e179cc0d1d..70bf0db4419 100644 --- a/m4/xattr.m4 +++ b/m4/xattr.m4 @@ -1,5 +1,5 @@ # xattr.m4 - check for Extended Attributes (Linux) -# serial 6 +# serial 7 # Copyright (C) 2003-2023 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_XATTR], [ AC_ARG_ENABLE([xattr], - AS_HELP_STRING([--disable-xattr], + AS_HELP_STRING([[--disable-xattr]], [do not support extended attributes]), [use_xattr=$enableval], [use_xattr=yes]) |