From dc6c21dabfbd242616b9e6266b459eded2d0762b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 18 Apr 2022 09:44:18 -0600 Subject: Update gnulib This updates gnulib to a relatively recent commit. Most of this was done by the gnulib import script; the only change I made was to update-gnulib.sh. Tested on x86-64 Fedora 34. I also did a mingw cross build. --- gnulib/import/m4/00gnulib.m4 | 2 +- gnulib/import/m4/__inline.m4 | 2 +- gnulib/import/m4/absolute-header.m4 | 2 +- gnulib/import/m4/alloca.m4 | 12 +- gnulib/import/m4/arpa_inet_h.m4 | 33 +- gnulib/import/m4/btowc.m4 | 2 +- gnulib/import/m4/builtin-expect.m4 | 2 +- gnulib/import/m4/canonicalize.m4 | 62 ++- gnulib/import/m4/chdir-long.m4 | 2 +- gnulib/import/m4/chown.m4 | 2 +- gnulib/import/m4/clock_time.m4 | 9 +- gnulib/import/m4/close.m4 | 2 +- gnulib/import/m4/closedir.m4 | 2 +- gnulib/import/m4/codeset.m4 | 2 +- gnulib/import/m4/ctype.m4 | 32 -- gnulib/import/m4/ctype_h.m4 | 47 +++ gnulib/import/m4/d-ino.m4 | 2 +- gnulib/import/m4/d-type.m4 | 2 +- gnulib/import/m4/dirent_h.m4 | 47 ++- gnulib/import/m4/dirfd.m4 | 2 +- gnulib/import/m4/double-slash-root.m4 | 2 +- gnulib/import/m4/dup.m4 | 2 +- gnulib/import/m4/dup2.m4 | 2 +- gnulib/import/m4/eealloc.m4 | 2 +- gnulib/import/m4/environ.m4 | 7 +- gnulib/import/m4/errno_h.m4 | 12 +- gnulib/import/m4/error.m4 | 8 +- gnulib/import/m4/exponentd.m4 | 2 +- gnulib/import/m4/exponentl.m4 | 2 +- gnulib/import/m4/extensions.m4 | 2 +- gnulib/import/m4/extern-inline.m4 | 28 +- gnulib/import/m4/fchdir.m4 | 6 +- gnulib/import/m4/fcntl-o.m4 | 2 +- gnulib/import/m4/fcntl.m4 | 2 +- gnulib/import/m4/fcntl_h.m4 | 41 +- gnulib/import/m4/fdopendir.m4 | 2 +- gnulib/import/m4/ffs.m4 | 6 +- gnulib/import/m4/filenamecat.m4 | 2 +- gnulib/import/m4/flexmember.m4 | 2 +- gnulib/import/m4/float_h.m4 | 22 +- gnulib/import/m4/fnmatch.m4 | 2 +- gnulib/import/m4/fnmatch_h.m4 | 40 +- gnulib/import/m4/fpieee.m4 | 2 +- gnulib/import/m4/free.m4 | 9 +- gnulib/import/m4/frexp.m4 | 2 +- gnulib/import/m4/frexpl.m4 | 2 +- gnulib/import/m4/fstat.m4 | 6 +- gnulib/import/m4/fstatat.m4 | 2 +- gnulib/import/m4/getcwd-abort-bug.m4 | 21 +- gnulib/import/m4/getcwd-path-max.m4 | 2 +- gnulib/import/m4/getcwd.m4 | 2 +- gnulib/import/m4/getdelim.m4 | 2 +- gnulib/import/m4/getdtablesize.m4 | 2 +- gnulib/import/m4/getline.m4 | 2 +- gnulib/import/m4/getlogin.m4 | 2 +- gnulib/import/m4/getlogin_r.m4 | 2 +- gnulib/import/m4/getpagesize.m4 | 2 +- gnulib/import/m4/getprogname.m4 | 2 +- gnulib/import/m4/getrandom.m4 | 2 +- gnulib/import/m4/gettimeofday.m4 | 8 +- gnulib/import/m4/glob.m4 | 43 +- gnulib/import/m4/glob_h.m4 | 40 +- gnulib/import/m4/gnulib-cache.m4 | 4 +- gnulib/import/m4/gnulib-common.m4 | 407 +++++++++++++++++-- gnulib/import/m4/gnulib-comp.m4 | 642 +++++++++++++++++------------- gnulib/import/m4/gnulib-tool.m4 | 10 +- gnulib/import/m4/include_next.m4 | 8 +- gnulib/import/m4/inet_ntop.m4 | 2 +- gnulib/import/m4/inttypes.m4 | 35 +- gnulib/import/m4/isblank.m4 | 2 +- gnulib/import/m4/isnand.m4 | 2 +- gnulib/import/m4/isnanl.m4 | 2 +- gnulib/import/m4/largefile.m4 | 30 +- gnulib/import/m4/limits-h.m4 | 14 +- gnulib/import/m4/localcharset.m4 | 2 +- gnulib/import/m4/locale-fr.m4 | 2 +- gnulib/import/m4/locale-ja.m4 | 2 +- gnulib/import/m4/locale-zh.m4 | 2 +- gnulib/import/m4/locale_h.m4 | 40 +- gnulib/import/m4/lock.m4 | 2 +- gnulib/import/m4/lstat.m4 | 2 +- gnulib/import/m4/malloc.m4 | 157 ++++++-- gnulib/import/m4/malloca.m4 | 2 +- gnulib/import/m4/math_h.m4 | 229 ++++++----- gnulib/import/m4/mbrtowc.m4 | 2 +- gnulib/import/m4/mbsinit.m4 | 2 +- gnulib/import/m4/mbsrtowcs.m4 | 2 +- gnulib/import/m4/mbstate_t.m4 | 2 +- gnulib/import/m4/mbtowc.m4 | 2 +- gnulib/import/m4/memchr.m4 | 6 +- gnulib/import/m4/memmem.m4 | 7 +- gnulib/import/m4/mempcpy.m4 | 6 +- gnulib/import/m4/memrchr.m4 | 6 +- gnulib/import/m4/minmax.m4 | 2 +- gnulib/import/m4/mkdir.m4 | 2 +- gnulib/import/m4/mkdtemp.m4 | 2 +- gnulib/import/m4/mkostemp.m4 | 2 +- gnulib/import/m4/mmap-anon.m4 | 6 +- gnulib/import/m4/mode_t.m4 | 2 +- gnulib/import/m4/msvc-inval.m4 | 2 +- gnulib/import/m4/msvc-nothrow.m4 | 2 +- gnulib/import/m4/multiarch.m4 | 2 +- gnulib/import/m4/netdb_h.m4 | 27 +- gnulib/import/m4/netinet_in_h.m4 | 10 +- gnulib/import/m4/nocrash.m4 | 2 +- gnulib/import/m4/off_t.m4 | 2 +- gnulib/import/m4/open-cloexec.m4 | 2 +- gnulib/import/m4/open-slash.m4 | 2 +- gnulib/import/m4/open.m4 | 2 +- gnulib/import/m4/openat.m4 | 2 +- gnulib/import/m4/opendir.m4 | 2 +- gnulib/import/m4/pathmax.m4 | 2 +- gnulib/import/m4/pid_t.m4 | 2 +- gnulib/import/m4/pipe.m4 | 2 +- gnulib/import/m4/pthread_rwlock_rdlock.m4 | 2 +- gnulib/import/m4/rawmemchr.m4 | 6 +- gnulib/import/m4/readdir.m4 | 2 +- gnulib/import/m4/readlink.m4 | 2 +- gnulib/import/m4/realloc.m4 | 51 +-- gnulib/import/m4/rename.m4 | 2 +- gnulib/import/m4/rewinddir.m4 | 2 +- gnulib/import/m4/rmdir.m4 | 2 +- gnulib/import/m4/save-cwd.m4 | 2 +- gnulib/import/m4/select.m4 | 6 +- gnulib/import/m4/setenv.m4 | 2 +- gnulib/import/m4/setlocale_null.m4 | 8 +- gnulib/import/m4/signal_h.m4 | 35 +- gnulib/import/m4/socketlib.m4 | 2 +- gnulib/import/m4/sockets.m4 | 2 +- gnulib/import/m4/socklen.m4 | 2 +- gnulib/import/m4/sockpfaf.m4 | 8 +- gnulib/import/m4/ssize_t.m4 | 2 +- gnulib/import/m4/stat-time.m4 | 2 +- gnulib/import/m4/stat.m4 | 6 +- gnulib/import/m4/std-gnu11.m4 | 2 +- gnulib/import/m4/stdalign.m4 | 13 +- gnulib/import/m4/stdbool.m4 | 19 +- gnulib/import/m4/stddef_h.m4 | 37 +- gnulib/import/m4/stdint.m4 | 14 +- gnulib/import/m4/stdio_h.m4 | 199 +++++---- gnulib/import/m4/stdlib_h.m4 | 136 ++++--- gnulib/import/m4/strchrnul.m4 | 6 +- gnulib/import/m4/strdup.m4 | 8 +- gnulib/import/m4/strerror.m4 | 8 +- gnulib/import/m4/strerror_r.m4 | 19 +- gnulib/import/m4/string_h.m4 | 128 +++--- gnulib/import/m4/strings_h.m4 | 40 +- gnulib/import/m4/strnlen.m4 | 6 +- gnulib/import/m4/strstr.m4 | 9 +- gnulib/import/m4/strtok_r.m4 | 6 +- gnulib/import/m4/sys_random_h.m4 | 27 +- gnulib/import/m4/sys_select_h.m4 | 31 +- gnulib/import/m4/sys_socket_h.m4 | 60 ++- gnulib/import/m4/sys_stat_h.m4 | 67 ++-- gnulib/import/m4/sys_time_h.m4 | 36 +- gnulib/import/m4/sys_types_h.m4 | 18 +- gnulib/import/m4/sys_uio_h.m4 | 25 +- gnulib/import/m4/sys_wait_h.m4 | 27 +- gnulib/import/m4/tempname.m4 | 2 +- gnulib/import/m4/threadlib.m4 | 130 ++++-- gnulib/import/m4/time_h.m4 | 66 +-- gnulib/import/m4/time_r.m4 | 4 +- gnulib/import/m4/unistd-safer.m4 | 2 +- gnulib/import/m4/unistd_h.m4 | 383 +++++++++--------- gnulib/import/m4/vararrays.m4 | 72 ++++ gnulib/import/m4/visibility.m4 | 9 +- gnulib/import/m4/warn-on-use.m4 | 2 +- gnulib/import/m4/wchar_h.m4 | 113 +++--- gnulib/import/m4/wchar_t.m4 | 2 +- gnulib/import/m4/wctype_h.m4 | 41 +- gnulib/import/m4/wint_t.m4 | 12 +- gnulib/import/m4/wmemchr.m4 | 2 +- gnulib/import/m4/wmempcpy.m4 | 2 +- gnulib/import/m4/year2038.m4 | 124 ++++++ gnulib/import/m4/zzgnulib.m4 | 2 +- 175 files changed, 2808 insertions(+), 1578 deletions(-) delete mode 100644 gnulib/import/m4/ctype.m4 create mode 100644 gnulib/import/m4/ctype_h.m4 create mode 100644 gnulib/import/m4/vararrays.m4 create mode 100644 gnulib/import/m4/year2038.m4 (limited to 'gnulib/import/m4') diff --git a/gnulib/import/m4/00gnulib.m4 b/gnulib/import/m4/00gnulib.m4 index 9ba1743..dea34e83 100644 --- a/gnulib/import/m4/00gnulib.m4 +++ b/gnulib/import/m4/00gnulib.m4 @@ -1,5 +1,5 @@ # 00gnulib.m4 serial 8 -dnl Copyright (C) 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/__inline.m4 b/gnulib/import/m4/__inline.m4 index b28cc6a..fbe2098 100644 --- a/gnulib/import/m4/__inline.m4 +++ b/gnulib/import/m4/__inline.m4 @@ -1,5 +1,5 @@ # Test for __inline keyword -dnl Copyright 2017-2021 Free Software Foundation, Inc. +dnl Copyright 2017-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/absolute-header.m4 b/gnulib/import/m4/absolute-header.m4 index 52d80d0..67d6507 100644 --- a/gnulib/import/m4/absolute-header.m4 +++ b/gnulib/import/m4/absolute-header.m4 @@ -1,5 +1,5 @@ # absolute-header.m4 serial 17 -dnl Copyright (C) 2006-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/alloca.m4 b/gnulib/import/m4/alloca.m4 index ba2f679..dc6f47e 100644 --- a/gnulib/import/m4/alloca.m4 +++ b/gnulib/import/m4/alloca.m4 @@ -1,5 +1,5 @@ -# alloca.m4 serial 20 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2021 Free Software Foundation, +# alloca.m4 serial 21 +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2022 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, @@ -26,17 +26,15 @@ AC_DEFUN([gl_FUNC_ALLOCA], AC_DEFINE([HAVE_ALLOCA], [1], [Define to 1 if you have 'alloca' after including , a header that may be supplied by this distribution.]) - ALLOCA_H=alloca.h + GL_GENERATE_ALLOCA_H=true else dnl alloca exists as a library function, i.e. it is slow and probably dnl a memory leak. Don't define HAVE_ALLOCA in this case. - ALLOCA_H= + GL_GENERATE_ALLOCA_H=false fi else - ALLOCA_H=alloca.h + GL_GENERATE_ALLOCA_H=true fi - AC_SUBST([ALLOCA_H]) - AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"]) if test $ac_cv_working_alloca_h = yes; then HAVE_ALLOCA_H=1 diff --git a/gnulib/import/m4/arpa_inet_h.m4 b/gnulib/import/m4/arpa_inet_h.m4 index c4e386d..057e13f 100644 --- a/gnulib/import/m4/arpa_inet_h.m4 +++ b/gnulib/import/m4/arpa_inet_h.m4 @@ -1,15 +1,15 @@ -# arpa_inet_h.m4 serial 14 -dnl Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc. +# arpa_inet_h.m4 serial 17 +dnl Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Simon Josefsson and Bruno Haible -AC_DEFUN([gl_HEADER_ARPA_INET], +AC_DEFUN_ONCE([gl_ARPA_INET_H], [ - dnl Use AC_REQUIRE here, so that the default behavior below is expanded - dnl once only, before all statements that occur in other macros. + dnl Ensure to expand the default settings once only, before all statements + dnl that occur in other macros. AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) AC_CHECK_HEADERS_ONCE([arpa/inet.h]) @@ -40,17 +40,32 @@ AC_DEFUN([gl_HEADER_ARPA_INET], ]], [inet_ntop inet_pton]) ]) +# gl_ARPA_INET_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_ARPA_INET_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_ARPA_INET_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$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_ARPA_INET_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_ARPA_INET_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_INET_NTOP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_INET_PTON]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_ARPA_INET_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) +]) + AC_DEFUN([gl_ARPA_INET_H_DEFAULTS], [ - GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP]) - GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP]) HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON]) diff --git a/gnulib/import/m4/btowc.m4 b/gnulib/import/m4/btowc.m4 index d2b2fe8..45a61f5 100644 --- a/gnulib/import/m4/btowc.m4 +++ b/gnulib/import/m4/btowc.m4 @@ -1,5 +1,5 @@ # btowc.m4 serial 12 -dnl Copyright (C) 2008-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/builtin-expect.m4 b/gnulib/import/m4/builtin-expect.m4 index c584116..b1fb12a 100644 --- a/gnulib/import/m4/builtin-expect.m4 +++ b/gnulib/import/m4/builtin-expect.m4 @@ -1,6 +1,6 @@ dnl Check for __builtin_expect. -dnl Copyright 2016-2021 Free Software Foundation, Inc. +dnl Copyright 2016-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/canonicalize.m4 b/gnulib/import/m4/canonicalize.m4 index 475fa15..b55d5c0 100644 --- a/gnulib/import/m4/canonicalize.m4 +++ b/gnulib/import/m4/canonicalize.m4 @@ -1,6 +1,6 @@ -# canonicalize.m4 serial 35 +# canonicalize.m4 serial 37 -dnl Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2003-2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -78,68 +78,106 @@ AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE], # so is the latter. AC_DEFUN([gl_FUNC_REALPATH_WORKS], [ - AC_CHECK_FUNCS_ONCE([realpath]) + AC_CHECK_FUNCS_ONCE([realpath lstat]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [ rm -rf conftest.a conftest.d touch conftest.a + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.a conftest.l + fi mkdir conftest.d AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ ]GL_NOCRASH[ + #include #include #include ]], [[ int result = 0; + /* This test fails on Solaris 10. */ { char *name = realpath ("conftest.a", NULL); if (!(name && *name == '/')) result |= 1; free (name); } + /* This test fails on older versions of Cygwin. */ { char *name = realpath ("conftest.b/../conftest.a", NULL); if (name != NULL) result |= 2; free (name); } + /* This test fails on Cygwin 2.9. */ + #if HAVE_LSTAT + { + char *name = realpath ("conftest.l/../conftest.a", NULL); + if (name != NULL || errno != ENOTDIR) + result |= 4; + free (name); + } + #endif + /* This test fails on Mac OS X 10.13, OpenBSD 6.0. */ { char *name = realpath ("conftest.a/", NULL); if (name != NULL) - result |= 4; + result |= 8; free (name); } + /* This test fails on AIX 7, Solaris 10. */ { char *name1 = realpath (".", NULL); char *name2 = realpath ("conftest.d//./..", NULL); if (! name1 || ! name2 || strcmp (name1, name2)) - result |= 8; + result |= 16; free (name1); free (name2); } + #ifdef __linux__ + /* On Linux, // is the same as /. See also double-slash-root.m4. + realpath() should respect this. + This test fails on musl libc 1.2.2. */ + { + char *name = realpath ("//", NULL); + if (! name || strcmp (name, "/")) + result |= 32; + free (name); + } + #endif return result; ]]) ], [gl_cv_func_realpath_works=yes], - [gl_cv_func_realpath_works=no], + [case $? in + 32) gl_cv_func_realpath_works=nearly ;; + *) gl_cv_func_realpath_works=no ;; + esac + ], [case "$host_os" in # Guess yes on glibc systems. *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;; - # Guess yes on musl systems. - *-musl*) 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" ;; esac ]) - rm -rf conftest.a conftest.d + rm -rf conftest.a conftest.l conftest.d ]) case "$gl_cv_func_realpath_works" in *yes) - AC_DEFINE([FUNC_REALPATH_WORKS], [1], [Define to 1 if realpath() - can malloc memory, always gives an absolute path, and handles - trailing slash correctly.]) + AC_DEFINE([FUNC_REALPATH_WORKS], [1], + [Define to 1 if realpath() can malloc memory, always gives an absolute path, and handles leading slashes and a trailing slash correctly.]) + ;; + *nearly) + AC_DEFINE([FUNC_REALPATH_NEARLY_WORKS], [1], + [Define to 1 if realpath() can malloc memory, always gives an absolute path, and handles a trailing slash correctly.]) ;; esac ]) diff --git a/gnulib/import/m4/chdir-long.m4 b/gnulib/import/m4/chdir-long.m4 index e5cd8df..4cadc3f 100644 --- a/gnulib/import/m4/chdir-long.m4 +++ b/gnulib/import/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-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/chown.m4 b/gnulib/import/m4/chown.m4 index d1c0831..56dda0a 100644 --- a/gnulib/import/m4/chown.m4 +++ b/gnulib/import/m4/chown.m4 @@ -1,7 +1,7 @@ # serial 35 # Determine whether we need the chown wrapper. -dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009-2021 Free Software +dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009-2022 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation diff --git a/gnulib/import/m4/clock_time.m4 b/gnulib/import/m4/clock_time.m4 index c3b9e7e..2253553 100644 --- a/gnulib/import/m4/clock_time.m4 +++ b/gnulib/import/m4/clock_time.m4 @@ -1,10 +1,11 @@ -# clock_time.m4 serial 10 -dnl Copyright (C) 2002-2006, 2009-2021 Free Software Foundation, Inc. +# clock_time.m4 serial 11 +dnl Copyright (C) 2002-2006, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -# Check for clock_gettime and clock_settime, and set LIB_CLOCK_GETTIME. +# Check for clock_getres, clock_gettime and clock_settime, +# and set LIB_CLOCK_GETTIME. # For a program named, say foo, you should add a line like the following # in the corresponding Makefile.am file: # foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @@ -26,6 +27,6 @@ AC_DEFUN([gl_CLOCK_TIME], AC_SEARCH_LIBS([clock_gettime], [rt posix4], [test "$ac_cv_search_clock_gettime" = "none required" || LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) - AC_CHECK_FUNCS([clock_gettime clock_settime]) + AC_CHECK_FUNCS([clock_getres clock_gettime clock_settime]) LIBS=$gl_saved_libs ]) diff --git a/gnulib/import/m4/close.m4 b/gnulib/import/m4/close.m4 index 77a5047..f95dbc9 100644 --- a/gnulib/import/m4/close.m4 +++ b/gnulib/import/m4/close.m4 @@ -1,5 +1,5 @@ # close.m4 serial 9 -dnl Copyright (C) 2008-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/closedir.m4 b/gnulib/import/m4/closedir.m4 index fc55a21..cac29d6 100644 --- a/gnulib/import/m4/closedir.m4 +++ b/gnulib/import/m4/closedir.m4 @@ -1,5 +1,5 @@ # closedir.m4 serial 6 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/codeset.m4 b/gnulib/import/m4/codeset.m4 index 629f4ee..eb73260 100644 --- a/gnulib/import/m4/codeset.m4 +++ b/gnulib/import/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-2021 Free Software +dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2022 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/gnulib/import/m4/ctype.m4 b/gnulib/import/m4/ctype.m4 deleted file mode 100644 index 06efe61..0000000 --- a/gnulib/import/m4/ctype.m4 +++ /dev/null @@ -1,32 +0,0 @@ -# ctype_h.m4 serial 6 -dnl Copyright (C) 2009-2021 Free Software Foundation, Inc. -dnl This file is free software; the Free 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_CTYPE_H], -[ - AC_REQUIRE([gl_CTYPE_H_DEFAULTS]) - - dnl is always overridden, because of GNULIB_POSIXCHECK. - gl_NEXT_HEADERS([ctype.h]) - - 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 - ]], [isblank]) -]) - -AC_DEFUN([gl_CTYPE_MODULE_INDICATOR], -[ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_CTYPE_H_DEFAULTS]) - gl_MODULE_INDICATOR_SET_VARIABLE([$1]) -]) - -AC_DEFUN([gl_CTYPE_H_DEFAULTS], -[ - GNULIB_ISBLANK=0; AC_SUBST([GNULIB_ISBLANK]) - dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_ISBLANK=1; AC_SUBST([HAVE_ISBLANK]) -]) diff --git a/gnulib/import/m4/ctype_h.m4 b/gnulib/import/m4/ctype_h.m4 new file mode 100644 index 0000000..6f420de --- /dev/null +++ b/gnulib/import/m4/ctype_h.m4 @@ -0,0 +1,47 @@ +# ctype_h.m4 serial 9 +dnl Copyright (C) 2009-2022 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN_ONCE([gl_CTYPE_H], +[ + AC_REQUIRE([gl_CTYPE_H_DEFAULTS]) + + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_NEXT_HEADERS([ctype.h]) + + 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 + ]], [isblank]) +]) + +# gl_CTYPE_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_CTYPE_MODULE_INDICATOR], +[ + dnl Ensure to expand the default settings once only. + gl_CTYPE_H_REQUIRE_DEFAULTS + gl_MODULE_INDICATOR_SET_VARIABLE([$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_CTYPE_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_CTYPE_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISBLANK]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_CTYPE_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_CTYPE_H_DEFAULTS]) +]) + +AC_DEFUN([gl_CTYPE_H_DEFAULTS], +[ + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_ISBLANK=1; AC_SUBST([HAVE_ISBLANK]) +]) diff --git a/gnulib/import/m4/d-ino.m4 b/gnulib/import/m4/d-ino.m4 index e4dcfeb..daefce9 100644 --- a/gnulib/import/m4/d-ino.m4 +++ b/gnulib/import/m4/d-ino.m4 @@ -5,7 +5,7 @@ dnl dnl Check whether struct dirent has a member named d_ino. dnl -# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2021 Free Software +# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2022 Free Software # Foundation, Inc. # This file is free software; the Free Software Foundation diff --git a/gnulib/import/m4/d-type.m4 b/gnulib/import/m4/d-type.m4 index 534a59e..b8858b1 100644 --- a/gnulib/import/m4/d-type.m4 +++ b/gnulib/import/m4/d-type.m4 @@ -5,7 +5,7 @@ dnl dnl Check whether struct dirent has a member named d_type. dnl -# Copyright (C) 1997, 1999-2004, 2006, 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 1997, 1999-2004, 2006, 2009-2022 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/gnulib/import/m4/dirent_h.m4 b/gnulib/import/m4/dirent_h.m4 index 6d86142..ddaca168 100644 --- a/gnulib/import/m4/dirent_h.m4 +++ b/gnulib/import/m4/dirent_h.m4 @@ -1,15 +1,15 @@ -# dirent_h.m4 serial 16 -dnl Copyright (C) 2008-2021 Free Software Foundation, Inc. +# dirent_h.m4 serial 19 +dnl Copyright (C) 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Bruno Haible. -AC_DEFUN([gl_DIRENT_H], +AC_DEFUN_ONCE([gl_DIRENT_H], [ - dnl Use AC_REQUIRE here, so that the default behavior below is expanded - dnl once only, before all statements that occur in other macros. + dnl Ensure to expand the default settings once only, before all statements + dnl that occur in other macros. AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) dnl is always overridden, because of GNULIB_POSIXCHECK. @@ -27,26 +27,41 @@ AC_DEFUN([gl_DIRENT_H], ]], [alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir]) ]) +# 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. +# This macro invocation must not occur in macros that are AC_REQUIREd. AC_DEFUN([gl_DIRENT_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_DIRENT_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_DIRENT_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_DIRENT_H_MODULE_INDICATOR_DEFAULTS], [ + gl_UNISTD_H_REQUIRE_DEFAULTS dnl for REPLACE_FCHDIR + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPENDIR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READDIR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REWINDDIR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CLOSEDIR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DIRFD]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPENDIR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANDIR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ALPHASORT]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_DIRENT_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) +]) + AC_DEFUN([gl_DIRENT_H_DEFAULTS], [ - AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR - GNULIB_OPENDIR=0; AC_SUBST([GNULIB_OPENDIR]) - GNULIB_READDIR=0; AC_SUBST([GNULIB_READDIR]) - GNULIB_REWINDDIR=0; AC_SUBST([GNULIB_REWINDDIR]) - GNULIB_CLOSEDIR=0; AC_SUBST([GNULIB_CLOSEDIR]) - GNULIB_DIRFD=0; AC_SUBST([GNULIB_DIRFD]) - GNULIB_FDOPENDIR=0; AC_SUBST([GNULIB_FDOPENDIR]) - GNULIB_SCANDIR=0; AC_SUBST([GNULIB_SCANDIR]) - GNULIB_ALPHASORT=0; AC_SUBST([GNULIB_ALPHASORT]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_OPENDIR=1; AC_SUBST([HAVE_OPENDIR]) HAVE_READDIR=1; AC_SUBST([HAVE_READDIR]) diff --git a/gnulib/import/m4/dirfd.m4 b/gnulib/import/m4/dirfd.m4 index 3c9ce5d..9200170 100644 --- a/gnulib/import/m4/dirfd.m4 +++ b/gnulib/import/m4/dirfd.m4 @@ -2,7 +2,7 @@ dnl Find out how to get the file descriptor associated with an open DIR*. -# Copyright (C) 2001-2006, 2008-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2006, 2008-2022 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/gnulib/import/m4/double-slash-root.m4 b/gnulib/import/m4/double-slash-root.m4 index c9bbcef..09ff5f0 100644 --- a/gnulib/import/m4/double-slash-root.m4 +++ b/gnulib/import/m4/double-slash-root.m4 @@ -1,5 +1,5 @@ # double-slash-root.m4 serial 4 -*- Autoconf -*- -dnl Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/dup.m4 b/gnulib/import/m4/dup.m4 index 433a466..3109a65 100644 --- a/gnulib/import/m4/dup.m4 +++ b/gnulib/import/m4/dup.m4 @@ -1,5 +1,5 @@ # dup.m4 serial 7 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/dup2.m4 b/gnulib/import/m4/dup2.m4 index 0753a32..7e777cd 100644 --- a/gnulib/import/m4/dup2.m4 +++ b/gnulib/import/m4/dup2.m4 @@ -1,5 +1,5 @@ #serial 27 -dnl Copyright (C) 2002, 2005, 2007, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2005, 2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/eealloc.m4 b/gnulib/import/m4/eealloc.m4 index 002f0c8..a6aa2f8 100644 --- a/gnulib/import/m4/eealloc.m4 +++ b/gnulib/import/m4/eealloc.m4 @@ -1,5 +1,5 @@ # eealloc.m4 serial 3 -dnl Copyright (C) 2003, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/environ.m4 b/gnulib/import/m4/environ.m4 index d971770..583dac3 100644 --- a/gnulib/import/m4/environ.m4 +++ b/gnulib/import/m4/environ.m4 @@ -1,5 +1,5 @@ -# environ.m4 serial 7 -dnl Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc. +# environ.m4 serial 8 +dnl Copyright (C) 2001-2004, 2006-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -33,7 +33,8 @@ AC_DEFUN([gt_CHECK_VAR_DECL], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[$1 - extern struct { int foo; } $2;]], + typedef struct { int foo; } foo_t; + extern foo_t $2;]], [[$2.foo = 1;]])], [gt_cv_var=no], [gt_cv_var=yes])]) diff --git a/gnulib/import/m4/errno_h.m4 b/gnulib/import/m4/errno_h.m4 index 51dfe92..4be9780 100644 --- a/gnulib/import/m4/errno_h.m4 +++ b/gnulib/import/m4/errno_h.m4 @@ -1,5 +1,5 @@ -# errno_h.m4 serial 13 -dnl Copyright (C) 2004, 2006, 2008-2021 Free Software Foundation, Inc. +# errno_h.m4 serial 14 +dnl Copyright (C) 2004, 2006, 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -68,13 +68,11 @@ booboo [gl_cv_header_errno_h_complete=yes]) ]) if test $gl_cv_header_errno_h_complete = yes; then - ERRNO_H='' + GL_GENERATE_ERRNO_H=false else gl_NEXT_HEADERS([errno.h]) - ERRNO_H='errno.h' + GL_GENERATE_ERRNO_H=true fi - AC_SUBST([ERRNO_H]) - AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"]) gl_REPLACE_ERRNO_VALUE([EMULTIHOP]) gl_REPLACE_ERRNO_VALUE([ENOLINK]) gl_REPLACE_ERRNO_VALUE([EOVERFLOW]) @@ -88,7 +86,7 @@ booboo # Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE. AC_DEFUN([gl_REPLACE_ERRNO_VALUE], [ - if test -n "$ERRNO_H"; then + if $GL_GENERATE_ERRNO_H; then AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [ AC_EGREP_CPP([yes],[ #include diff --git a/gnulib/import/m4/error.m4 b/gnulib/import/m4/error.m4 index 77f67f7..7a10344 100644 --- a/gnulib/import/m4/error.m4 +++ b/gnulib/import/m4/error.m4 @@ -1,6 +1,6 @@ -#serial 14 +#serial 15 -# Copyright (C) 1996-1998, 2001-2004, 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 1996-1998, 2001-2004, 2009-2022 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -22,6 +22,10 @@ AC_DEFUN([gl_ERROR], # Prerequisites of lib/error.c. AC_DEFUN([gl_PREREQ_ERROR], [ + dnl Use system extensions on Android, so that AC_FUNC_STRERROR_R + dnl discovers the GNU API for strerror_r on Android API level 23 and later. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([AC_FUNC_STRERROR_R]) : ]) diff --git a/gnulib/import/m4/exponentd.m4 b/gnulib/import/m4/exponentd.m4 index fb136f4..83ac08b 100644 --- a/gnulib/import/m4/exponentd.m4 +++ b/gnulib/import/m4/exponentd.m4 @@ -1,5 +1,5 @@ # exponentd.m4 serial 3 -dnl Copyright (C) 2007-2008, 2010-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2008, 2010-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/exponentl.m4 b/gnulib/import/m4/exponentl.m4 index 508fe93..653ad5a 100644 --- a/gnulib/import/m4/exponentl.m4 +++ b/gnulib/import/m4/exponentl.m4 @@ -1,5 +1,5 @@ # exponentl.m4 serial 5 -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/extensions.m4 b/gnulib/import/m4/extensions.m4 index 5792a95..0b3e4b5 100644 --- a/gnulib/import/m4/extensions.m4 +++ b/gnulib/import/m4/extensions.m4 @@ -1,7 +1,7 @@ # serial 22 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2021 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2022 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/gnulib/import/m4/extern-inline.m4 b/gnulib/import/m4/extern-inline.m4 index a2acf12..8a12bdd 100644 --- a/gnulib/import/m4/extern-inline.m4 +++ b/gnulib/import/m4/extern-inline.m4 @@ -1,13 +1,28 @@ dnl 'extern inline' a la ISO C99. -dnl Copyright 2012-2021 Free Software Foundation, Inc. +dnl Copyright 2012-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_EXTERN_INLINE], [ - AH_VERBATIM([extern_inline], + AC_CACHE_CHECK([whether ctype.h defines __header_inline], + [gl_cv_have___header_inline], + [AC_PREPROC_IFELSE( + [AC_LANG_SOURCE([[#include + #ifndef __header_inline + #error " does not define __header_inline" + #endif + ]])], + [gl_cv_have___header_inline=yes], + [gl_cv_have___header_inline=no])]) + if test "$gl_cv_have___header_inline" = yes; then + AC_DEFINE([HAVE___HEADER_INLINE], [1], + [Define to 1 if ctype.h defines __header_inline.]) + fi + + AH_VERBATIM([HAVE___HEADER_INLINE_1], [/* Please see the Gnulib manual for how to use these macros. Suppress extern inline with HP-UX cc, as it appears to be broken; see @@ -17,7 +32,8 @@ AC_DEFUN([gl_EXTERN_INLINE], mishandles inline functions that call each other. E.g., for 'inline void f (void) { } inline void g (void) { f (); }', c99 incorrectly complains 'reference to static identifier "f" in extern inline function'. - This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16. + This bug was observed with Oracle Developer Studio 12.6 + (Sun C 5.15 SunOS_sparc 2017/05/30). Suppress extern inline (with or without __attribute__ ((__gnu_inline__))) on configurations that mistakenly use 'static inline' to implement @@ -53,7 +69,7 @@ AC_DEFUN([gl_EXTERN_INLINE], */ #if (((defined __APPLE__ && defined __MACH__) \ || defined __DragonFly__ || defined __FreeBSD__) \ - && (defined __header_inline \ + && (defined HAVE___HEADER_INLINE \ ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \ && ! defined __clang__) \ : ((! defined _DONT_USE_CTYPE_INLINE_ \ @@ -83,8 +99,8 @@ AC_DEFUN([gl_EXTERN_INLINE], # define _GL_EXTERN_INLINE extern # define _GL_EXTERN_INLINE_IN_USE #else -# define _GL_INLINE static _GL_UNUSED -# define _GL_EXTERN_INLINE static _GL_UNUSED +# define _GL_INLINE _GL_UNUSED static +# define _GL_EXTERN_INLINE _GL_UNUSED static #endif /* In GCC 4.6 (inclusive) to 5.1 (exclusive), diff --git a/gnulib/import/m4/fchdir.m4 b/gnulib/import/m4/fchdir.m4 index 5d2fab7..f85549a 100644 --- a/gnulib/import/m4/fchdir.m4 +++ b/gnulib/import/m4/fchdir.m4 @@ -1,5 +1,5 @@ -# fchdir.m4 serial 26 -dnl Copyright (C) 2006-2021 Free Software Foundation, Inc. +# fchdir.m4 serial 27 +dnl Copyright (C) 2006-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -17,8 +17,6 @@ AC_DEFUN([gl_FUNC_FCHDIR], AC_REQUIRE([gl_TEST_FCHDIR]) if test $HAVE_FCHDIR = 0; then - AC_LIBOBJ([fchdir]) - gl_PREREQ_FCHDIR 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, diff --git a/gnulib/import/m4/fcntl-o.m4 b/gnulib/import/m4/fcntl-o.m4 index 7c459ad..4dcde9e 100644 --- a/gnulib/import/m4/fcntl-o.m4 +++ b/gnulib/import/m4/fcntl-o.m4 @@ -1,5 +1,5 @@ # fcntl-o.m4 serial 7 -dnl Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/fcntl.m4 b/gnulib/import/m4/fcntl.m4 index f626434..428e570 100644 --- a/gnulib/import/m4/fcntl.m4 +++ b/gnulib/import/m4/fcntl.m4 @@ -1,5 +1,5 @@ # fcntl.m4 serial 11 -dnl Copyright (C) 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/fcntl_h.m4 b/gnulib/import/m4/fcntl_h.m4 index e63a82f..267f98b 100644 --- a/gnulib/import/m4/fcntl_h.m4 +++ b/gnulib/import/m4/fcntl_h.m4 @@ -1,13 +1,13 @@ -# serial 17 +# serial 20 # Configure fcntl.h. -dnl Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Paul Eggert. -AC_DEFUN([gl_FCNTL_H], +AC_DEFUN_ONCE([gl_FCNTL_H], [ AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) AC_REQUIRE([gl_FCNTL_O_FLAGS]) @@ -26,25 +26,40 @@ AC_DEFUN([gl_FCNTL_H], ]], [fcntl openat]) ]) +# gl_FCNTL_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_FCNTL_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_FCNTL_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_FCNTL_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_FCNTL_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CREAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCNTL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NONBLOCKING]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPEN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPENAT]) + dnl Support Microsoft deprecated alias function names by default. + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CREAT], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_OPEN], [1]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_FCNTL_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) +]) + AC_DEFUN([gl_FCNTL_H_DEFAULTS], [ - GNULIB_CREAT=0; AC_SUBST([GNULIB_CREAT]) - GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL]) - GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING]) - GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) - GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT]) - dnl Support Microsoft deprecated alias function names by default. - GNULIB_MDA_CREAT=1; AC_SUBST([GNULIB_MDA_CREAT]) - GNULIB_MDA_OPEN=1; AC_SUBST([GNULIB_MDA_OPEN]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL]) HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) diff --git a/gnulib/import/m4/fdopendir.m4 b/gnulib/import/m4/fdopendir.m4 index d428380..3001608 100644 --- a/gnulib/import/m4/fdopendir.m4 +++ b/gnulib/import/m4/fdopendir.m4 @@ -1,7 +1,7 @@ # serial 14 # See if we need to provide fdopendir. -dnl Copyright (C) 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/ffs.m4 b/gnulib/import/m4/ffs.m4 index b6e6b31..8fa4fc2 100644 --- a/gnulib/import/m4/ffs.m4 +++ b/gnulib/import/m4/ffs.m4 @@ -1,12 +1,12 @@ -# ffs.m4 serial 4 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +# ffs.m4 serial 5 +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_FFS], [ - AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + AC_REQUIRE([gl_STRINGS_H_DEFAULTS]) dnl We can't use AC_CHECK_FUNC here, because ffs() is defined as a dnl static inline function when compiling for Android 4.2 or older. diff --git a/gnulib/import/m4/filenamecat.m4 b/gnulib/import/m4/filenamecat.m4 index e6eac12..4546b83 100644 --- a/gnulib/import/m4/filenamecat.m4 +++ b/gnulib/import/m4/filenamecat.m4 @@ -1,5 +1,5 @@ # filenamecat.m4 serial 11 -dnl Copyright (C) 2002-2006, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/flexmember.m4 b/gnulib/import/m4/flexmember.m4 index 49b1c75..3b4237e 100644 --- a/gnulib/import/m4/flexmember.m4 +++ b/gnulib/import/m4/flexmember.m4 @@ -1,7 +1,7 @@ # serial 5 # Check for flexible array member support. -# Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009-2022 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/gnulib/import/m4/float_h.m4 b/gnulib/import/m4/float_h.m4 index ba38a28..0e84572 100644 --- a/gnulib/import/m4/float_h.m4 +++ b/gnulib/import/m4/float_h.m4 @@ -1,5 +1,5 @@ -# float_h.m4 serial 12 -dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. +# float_h.m4 serial 13 +dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -8,18 +8,18 @@ AC_DEFUN([gl_FLOAT_H], [ AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) - FLOAT_H= + GL_GENERATE_FLOAT_H=false REPLACE_FLOAT_LDBL=0 case "$host_os" in aix* | beos* | openbsd* | mirbsd* | irix*) - FLOAT_H=float.h + GL_GENERATE_FLOAT_H=true ;; freebsd* | dragonfly*) case "$host_cpu" in changequote(,)dnl i[34567]86 ) changequote([,])dnl - FLOAT_H=float.h + GL_GENERATE_FLOAT_H=true ;; x86_64 ) # On x86_64 systems, the C compiler may still be generating @@ -33,21 +33,21 @@ changequote([,])dnl #endif ]])], [], - [FLOAT_H=float.h]) + [GL_GENERATE_FLOAT_H=true]) ;; esac ;; linux*) case "$host_cpu" in powerpc*) - FLOAT_H=float.h + GL_GENERATE_FLOAT_H=true ;; esac ;; esac case "$host_os" in aix* | freebsd* | dragonfly* | linux*) - if test -n "$FLOAT_H"; then + if $GL_GENERATE_FLOAT_H; then REPLACE_FLOAT_LDBL=1 fi ;; @@ -95,14 +95,12 @@ int main () REPLACE_ITOLD=1 dnl We add the workaround to but also to , dnl to increase the chances that the fix function gets pulled in. - FLOAT_H=float.h + GL_GENERATE_FLOAT_H=true ;; esac - if test -n "$FLOAT_H"; then + if $GL_GENERATE_FLOAT_H; then gl_NEXT_HEADERS([float.h]) fi - AC_SUBST([FLOAT_H]) - AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"]) AC_SUBST([REPLACE_ITOLD]) ]) diff --git a/gnulib/import/m4/fnmatch.m4 b/gnulib/import/m4/fnmatch.m4 index 81589ca..9c60559 100644 --- a/gnulib/import/m4/fnmatch.m4 +++ b/gnulib/import/m4/fnmatch.m4 @@ -1,6 +1,6 @@ # Check for fnmatch - serial 15. -*- coding: utf-8 -*- -# Copyright (C) 2000-2007, 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2000-2007, 2009-2022 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/gnulib/import/m4/fnmatch_h.m4 b/gnulib/import/m4/fnmatch_h.m4 index 7840b4a..ae5cd86 100644 --- a/gnulib/import/m4/fnmatch_h.m4 +++ b/gnulib/import/m4/fnmatch_h.m4 @@ -1,5 +1,5 @@ -# fnmatch_h.m4 serial 4 -dnl Copyright (C) 2009-2021 Free Software Foundation, Inc. +# fnmatch_h.m4 serial 8 +dnl Copyright (C) 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -27,20 +27,18 @@ AC_DEFUN_ONCE([gl_FNMATCH_H], AC_SUBST([HAVE_FNMATCH_H]) m4_ifdef([gl_POSIXCHECK], - [FNMATCH_H=fnmatch.h], - [FNMATCH_H='' + [GL_GENERATE_FNMATCH_H=true], + [GL_GENERATE_FNMATCH_H=false if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then dnl Override always, to support the C++ GNULIB_NAMESPACE. - FNMATCH_H=fnmatch.h + GL_GENERATE_FNMATCH_H=true else if test $ac_cv_header_fnmatch_h != yes; then dnl Provide a substitute file. - FNMATCH_H=fnmatch.h + GL_GENERATE_FNMATCH_H=true fi fi ]) - AC_SUBST([FNMATCH_H]) - AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. @@ -52,23 +50,37 @@ AC_DEFUN_ONCE([gl_FNMATCH_H], dnl Unconditionally enables the replacement of . AC_DEFUN([gl_REPLACE_FNMATCH_H], [ - AC_REQUIRE([gl_FNMATCH_H_DEFAULTS]) - FNMATCH_H='fnmatch.h' - AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"]) + gl_FNMATCH_H_REQUIRE_DEFAULTS + GL_GENERATE_FNMATCH_H=true ]) +# gl_FNMATCH_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_FNMATCH_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_FNMATCH_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_FNMATCH_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_FNMATCH_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_FNMATCH_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FNMATCH]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_FNMATCH_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_FNMATCH_H_DEFAULTS]) +]) + AC_DEFUN([gl_FNMATCH_H_DEFAULTS], [ - GNULIB_FNMATCH=0; AC_SUBST([GNULIB_FNMATCH]) dnl Assume POSIX behavior unless another module says otherwise. HAVE_FNMATCH=1; AC_SUBST([HAVE_FNMATCH]) REPLACE_FNMATCH=0; AC_SUBST([REPLACE_FNMATCH]) diff --git a/gnulib/import/m4/fpieee.m4 b/gnulib/import/m4/fpieee.m4 index 3f16957..c0c23e9 100644 --- a/gnulib/import/m4/fpieee.m4 +++ b/gnulib/import/m4/fpieee.m4 @@ -1,5 +1,5 @@ # fpieee.m4 serial 2 -*- coding: utf-8 -*- -dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/free.m4 b/gnulib/import/m4/free.m4 index d671376..dfeecd2 100644 --- a/gnulib/import/m4/free.m4 +++ b/gnulib/import/m4/free.m4 @@ -1,5 +1,5 @@ -# free.m4 serial 5 -# Copyright (C) 2003-2005, 2009-2021 Free Software Foundation, Inc. +# free.m4 serial 6 +# Copyright (C) 2003-2005, 2009-2022 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,7 +40,10 @@ AC_DEFUN([gl_FUNC_FREE], ]) case $gl_cv_func_free_preserves_errno in - *yes) ;; + *yes) + AC_DEFINE([HAVE_FREE_POSIX], [1], + [Define if the 'free' function is guaranteed to preserve errno.]) + ;; *) REPLACE_FREE=1 ;; esac ]) diff --git a/gnulib/import/m4/frexp.m4 b/gnulib/import/m4/frexp.m4 index 04248b0..d8f3cef 100644 --- a/gnulib/import/m4/frexp.m4 +++ b/gnulib/import/m4/frexp.m4 @@ -1,5 +1,5 @@ # frexp.m4 serial 16 -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/frexpl.m4 b/gnulib/import/m4/frexpl.m4 index 32f1eac..4557613 100644 --- a/gnulib/import/m4/frexpl.m4 +++ b/gnulib/import/m4/frexpl.m4 @@ -1,5 +1,5 @@ # frexpl.m4 serial 22 -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/fstat.m4 b/gnulib/import/m4/fstat.m4 index 3b5b238..9e61bcc 100644 --- a/gnulib/import/m4/fstat.m4 +++ b/gnulib/import/m4/fstat.m4 @@ -1,5 +1,5 @@ -# fstat.m4 serial 7 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +# fstat.m4 serial 8 +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -34,7 +34,7 @@ AC_DEFUN([gl_FUNC_FSTAT], # Prerequisites of lib/fstat.c and lib/stat-w32.c. AC_DEFUN([gl_PREREQ_FSTAT], [ - AC_REQUIRE([gl_HEADER_SYS_STAT_H]) + AC_REQUIRE([gl_SYS_STAT_H]) AC_REQUIRE([gl_PREREQ_STAT_W32]) : ]) diff --git a/gnulib/import/m4/fstatat.m4 b/gnulib/import/m4/fstatat.m4 index d730e46..e8604a6 100644 --- a/gnulib/import/m4/fstatat.m4 +++ b/gnulib/import/m4/fstatat.m4 @@ -1,5 +1,5 @@ # fstatat.m4 serial 4 -dnl Copyright (C) 2004-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/getcwd-abort-bug.m4 b/gnulib/import/m4/getcwd-abort-bug.m4 index 89d0689..2174e3f 100644 --- a/gnulib/import/m4/getcwd-abort-bug.m4 +++ b/gnulib/import/m4/getcwd-abort-bug.m4 @@ -1,9 +1,9 @@ -# serial 15 +# serial 16 # Determine whether getcwd aborts when the length of the working directory # 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-2021 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009-2022 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. @@ -128,11 +128,12 @@ main () ]])], [gl_cv_func_getcwd_succeeds_beyond_4k=yes], [dnl An abort will provoke an exit code of something like 134 (128 + 6). - dnl An exit code of 4 can also occur (in OpenBSD 6.7, NetBSD 5.1 for - dnl example): getcwd (NULL, 0) fails rather than returning a string - dnl longer than PATH_MAX. This may be POSIX compliant (in some - dnl interpretations of POSIX). But gnulib's getcwd module wants to - dnl provide a non-NULL value in this case. + dnl An exit code of 4 can also occur (for example in + dnl musl libc 1.2.2/powerpc64le, NetBSD 9.0, OpenBSD 6.7: + dnl getcwd (NULL, 0) fails rather than returning a string longer than + dnl PATH_MAX. This may be POSIX compliant (in some interpretations of + dnl POSIX). But gnulib's getcwd module wants to provide a non-NULL + dnl value in this case. ret=$? if test $ret -ge 128 || test $ret = 4; then gl_cv_func_getcwd_succeeds_beyond_4k=no @@ -141,10 +142,8 @@ main () fi ], [case "$host_os" in - # Guess yes on musl systems. - *-musl*) gl_cv_func_getcwd_succeeds_beyond_4k="guessing yes" ;; - # Guess no otherwise, even on glibc systems. - *) gl_cv_func_getcwd_succeeds_beyond_4k="guessing no" + # Guess no otherwise, even on glibc systems and musl systems. + *) gl_cv_func_getcwd_succeeds_beyond_4k="guessing no" esac ]) ]) diff --git a/gnulib/import/m4/getcwd-path-max.m4 b/gnulib/import/m4/getcwd-path-max.m4 index 4238ae7..e120455 100644 --- a/gnulib/import/m4/getcwd-path-max.m4 +++ b/gnulib/import/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-2021 Free Software Foundation, Inc. +# Copyright (C) 2003-2007, 2009-2022 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/gnulib/import/m4/getcwd.m4 b/gnulib/import/m4/getcwd.m4 index 6ec7a94..076ca31 100644 --- a/gnulib/import/m4/getcwd.m4 +++ b/gnulib/import/m4/getcwd.m4 @@ -1,6 +1,6 @@ # getcwd.m4 - check for working getcwd that is compatible with glibc -# Copyright (C) 2001, 2003-2007, 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003-2007, 2009-2022 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/gnulib/import/m4/getdelim.m4 b/gnulib/import/m4/getdelim.m4 index 244a731..0b63b55 100644 --- a/gnulib/import/m4/getdelim.m4 +++ b/gnulib/import/m4/getdelim.m4 @@ -1,6 +1,6 @@ # getdelim.m4 serial 15 -dnl Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2022 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/gnulib/import/m4/getdtablesize.m4 b/gnulib/import/m4/getdtablesize.m4 index 8fbc941..6134eaa 100644 --- a/gnulib/import/m4/getdtablesize.m4 +++ b/gnulib/import/m4/getdtablesize.m4 @@ -1,5 +1,5 @@ # getdtablesize.m4 serial 8 -dnl Copyright (C) 2008-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/getline.m4 b/gnulib/import/m4/getline.m4 index 58b27c7..ca0301d 100644 --- a/gnulib/import/m4/getline.m4 +++ b/gnulib/import/m4/getline.m4 @@ -1,6 +1,6 @@ # getline.m4 serial 30 -dnl Copyright (C) 1998-2003, 2005-2007, 2009-2021 Free Software Foundation, +dnl Copyright (C) 1998-2003, 2005-2007, 2009-2022 Free Software Foundation, dnl Inc. dnl dnl This file is free software; the Free Software Foundation diff --git a/gnulib/import/m4/getlogin.m4 b/gnulib/import/m4/getlogin.m4 index c5b7f1a..d51d6cf 100644 --- a/gnulib/import/m4/getlogin.m4 +++ b/gnulib/import/m4/getlogin.m4 @@ -1,5 +1,5 @@ # getlogin.m4 serial 5 -dnl Copyright (C) 2010-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/getlogin_r.m4 b/gnulib/import/m4/getlogin_r.m4 index 3e8a2f0..c60ef34 100644 --- a/gnulib/import/m4/getlogin_r.m4 +++ b/gnulib/import/m4/getlogin_r.m4 @@ -1,6 +1,6 @@ #serial 13 -# Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2005-2007, 2009-2022 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/gnulib/import/m4/getpagesize.m4 b/gnulib/import/m4/getpagesize.m4 index 7e61801..19f894c 100644 --- a/gnulib/import/m4/getpagesize.m4 +++ b/gnulib/import/m4/getpagesize.m4 @@ -1,5 +1,5 @@ # getpagesize.m4 serial 10 -dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2021 Free Software Foundation, +dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2022 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/gnulib/import/m4/getprogname.m4 b/gnulib/import/m4/getprogname.m4 index 65917d6..b26146e 100644 --- a/gnulib/import/m4/getprogname.m4 +++ b/gnulib/import/m4/getprogname.m4 @@ -1,6 +1,6 @@ # getprogname.m4 - check for getprogname or replacements for it -# Copyright (C) 2016-2021 Free Software Foundation, Inc. +# Copyright (C) 2016-2022 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/gnulib/import/m4/getrandom.m4 b/gnulib/import/m4/getrandom.m4 index 5f174dc..6ca7150 100644 --- a/gnulib/import/m4/getrandom.m4 +++ b/gnulib/import/m4/getrandom.m4 @@ -1,5 +1,5 @@ # getrandom.m4 serial 8 -dnl Copyright 2020-2021 Free Software Foundation, Inc. +dnl Copyright 2020-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/gettimeofday.m4 b/gnulib/import/m4/gettimeofday.m4 index 3c20081..f729601 100644 --- a/gnulib/import/m4/gettimeofday.m4 +++ b/gnulib/import/m4/gettimeofday.m4 @@ -1,6 +1,6 @@ -# serial 28 +# serial 29 -# Copyright (C) 2001-2003, 2005, 2007, 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2003, 2005, 2007, 2009-2022 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,10 +9,10 @@ dnl From Jim Meyering. AC_DEFUN([gl_FUNC_GETTIMEOFDAY], [ - AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) + AC_REQUIRE([gl_SYS_TIME_H_DEFAULTS]) AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([gl_HEADER_SYS_TIME_H]) + AC_REQUIRE([gl_SYS_TIME_H]) AC_CHECK_FUNCS_ONCE([gettimeofday]) gl_gettimeofday_timezone=void diff --git a/gnulib/import/m4/glob.m4 b/gnulib/import/m4/glob.m4 index 232136e..cf5f939 100644 --- a/gnulib/import/m4/glob.m4 +++ b/gnulib/import/m4/glob.m4 @@ -1,5 +1,5 @@ -# glob.m4 serial 24 -dnl Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc. +# glob.m4 serial 25 +dnl Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -66,6 +66,45 @@ char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1 esac fi + if test $REPLACE_GLOB = 0; then + AC_CACHE_CHECK([whether glob NOTDIR*/ omits symlink to nondir], + [gl_cv_glob_omit_nondir_symlinks], + [if test $cross_compiling != yes; then + if ln -s conf-file conf$$-globtest 2>/dev/null && touch conf-file + then + gl_cv_glob_omit_nondir_symlinks=maybe + else + # If we can't make a symlink, then we cannot test this issue. Be + # pessimistic about this. + gl_cv_glob_omit_nondir_symlinks=no + fi + if test $gl_cv_glob_omit_nondir_symlinks = maybe; then + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include ]], + [[glob_t found; + if (glob ("conf*-globtest/", 0, NULL, &found) != GLOB_NOMATCH) + return 1; + globfree (&found); + ]])], + [gl_cv_glob_omit_nondir_symlinks=yes], + [gl_cv_glob_omit_nondir_symlinks=no], + [dnl We don't get here. + : + ]) + fi + rm -f conf$$-globtest + else + gl_cv_glob_omit_nondir_symlinks="$gl_cross_guess_normal" + fi + ]) + case "$gl_cv_glob_omit_nondir_symlinks" in + *yes) ;; + *) REPLACE_GLOB=1 ;; + esac + fi + fi if test $ac_cv_func_glob_pattern_p = no; then diff --git a/gnulib/import/m4/glob_h.m4 b/gnulib/import/m4/glob_h.m4 index ef4c9cc..41ffde2 100644 --- a/gnulib/import/m4/glob_h.m4 +++ b/gnulib/import/m4/glob_h.m4 @@ -1,5 +1,5 @@ -# glob_h.m4 serial 5 -dnl Copyright (C) 2018-2021 Free Software Foundation, Inc. +# glob_h.m4 serial 9 +dnl Copyright (C) 2018-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -22,20 +22,18 @@ AC_DEFUN_ONCE([gl_GLOB_H], AC_SUBST([HAVE_GLOB_H]) m4_ifdef([gl_POSIXCHECK], - [GLOB_H=glob.h], - [GLOB_H='' + [GL_GENERATE_GLOB_H=true], + [GL_GENERATE_GLOB_H=false if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then dnl Override always, to support the C++ GNULIB_NAMESPACE. - GLOB_H=glob.h + GL_GENERATE_GLOB_H=true else if test $ac_cv_header_glob_h != yes; then dnl Provide a substitute file. - GLOB_H=glob.h + GL_GENERATE_GLOB_H=true fi fi ]) - AC_SUBST([GLOB_H]) - AM_CONDITIONAL([GL_GENERATE_GLOB_H], [test -n "$GLOB_H"]) dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. @@ -47,23 +45,37 @@ AC_DEFUN_ONCE([gl_GLOB_H], dnl Unconditionally enables the replacement of . AC_DEFUN([gl_REPLACE_GLOB_H], [ - AC_REQUIRE([gl_GLOB_H_DEFAULTS]) - GLOB_H='glob.h' - AM_CONDITIONAL([GL_GENERATE_GLOB_H], [test -n "$GLOB_H"]) + gl_GLOB_H_REQUIRE_DEFAULTS + GL_GENERATE_GLOB_H=true ]) +# gl_GLOB_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_GLOB_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_GLOB_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_GLOB_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_GLOB_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_GLOB_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GLOB]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_GLOB_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_GLOB_H_DEFAULTS]) +]) + AC_DEFUN([gl_GLOB_H_DEFAULTS], [ - GNULIB_GLOB=0; AC_SUBST([GNULIB_GLOB]) dnl Assume POSIX and GNU behavior unless another module says otherwise. HAVE_GLOB=1; AC_SUBST([HAVE_GLOB]) HAVE_GLOB_PATTERN_P=1; AC_SUBST([HAVE_GLOB_PATTERN_P]) diff --git a/gnulib/import/m4/gnulib-cache.m4 b/gnulib/import/m4/gnulib-cache.m4 index 381cdde..a5f8e30 100644 --- a/gnulib/import/m4/gnulib-cache.m4 +++ b/gnulib/import/m4/gnulib-cache.m4 @@ -1,8 +1,8 @@ -# Copyright (C) 2002-2021 Free Software Foundation, Inc. +# Copyright (C) 2002-2022 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 -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This file is distributed in the hope that it will be useful, diff --git a/gnulib/import/m4/gnulib-common.m4 b/gnulib/import/m4/gnulib-common.m4 index 535359b..c5ced04 100644 --- a/gnulib/import/m4/gnulib-common.m4 +++ b/gnulib/import/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 63 -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +# gnulib-common.m4 serial 72 +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -39,11 +39,12 @@ AC_DEFUN([gl_COMMON_BODY], [ this syntax with 'extern'. */ # define _Noreturn [[noreturn]] # elif ((!defined __cplusplus || defined __clang__) \ - && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ - || _GL_GNUC_PREREQ (4, 7) \ - || (defined __apple_build_version__ \ - ? 6000000 <= __apple_build_version__ \ - : 3 < __clang_major__ + (5 <= __clang_minor__)))) + && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ + || (!defined __STRICT_ANSI__ \ + && (_GL_GNUC_PREREQ (4, 7) \ + || (defined __apple_build_version__ \ + ? 6000000 <= __apple_build_version__ \ + : 3 < __clang_major__ + (5 <= __clang_minor__)))))) /* _Noreturn works as-is. */ # elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C # define _Noreturn __attribute__ ((__noreturn__)) @@ -66,7 +67,11 @@ AC_DEFUN([gl_COMMON_BODY], [ #endif]) AH_VERBATIM([attribute], [/* Attributes. */ -#ifdef __has_attribute +#if (defined __has_attribute \ + && (!defined __clang_minor__ \ + || (defined __apple_build_version__ \ + ? 6000000 <= __apple_build_version__ \ + : 3 < __clang_major__ + (5 <= __clang_minor__)))) # define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__) #else # define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr @@ -82,12 +87,12 @@ AC_DEFUN([gl_COMMON_BODY], [ # 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_malloc _GL_GNUC_PREREQ (3, 0) # 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) @@ -100,26 +105,47 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4) #endif +#ifdef __has_c_attribute +# define _GL_HAS_C_ATTRIBUTE(attr) __has_c_attribute (__##attr##__) +#else +# define _GL_HAS_C_ATTRIBUTE(attr) 0 +#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 + is the size of the returned memory block. + _GL_ATTRIBUTE_ALLOC_SIZE ((M, N)) declares that the Mth argument multiplied + by the Nth argument of the function is the size of the returned memory block. + */ +/* Applies to: function, pointer to function, function types. */ #if _GL_HAS_ATTRIBUTE (alloc_size) # define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args)) #else # define _GL_ATTRIBUTE_ALLOC_SIZE(args) #endif +/* _GL_ATTRIBUTE_ALWAYS_INLINE tells that the compiler should always inline the + function and report an error if it cannot do so. */ +/* Applies to: function. */ #if _GL_HAS_ATTRIBUTE (always_inline) # define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__)) #else # define _GL_ATTRIBUTE_ALWAYS_INLINE #endif +/* _GL_ATTRIBUTE_ARTIFICIAL declares that the function is not important to show + in stack traces when debugging. The compiler should omit the function from + stack traces. */ +/* Applies to: function. */ #if _GL_HAS_ATTRIBUTE (artificial) # define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__)) #else # define _GL_ATTRIBUTE_ARTIFICIAL #endif +/* _GL_ATTRIBUTE_COLD declares that the function is rarely executed. */ +/* Applies to: functions. */ /* Avoid __attribute__ ((cold)) on MinGW; see thread starting at . Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */ @@ -133,13 +159,46 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _GL_ATTRIBUTE_COLD #endif +/* _GL_ATTRIBUTE_CONST declares that it is OK for a compiler to omit duplicate + calls to the function with the same arguments. + This attribute is safe for a function that neither depends on nor affects + observable state, and always returns exactly once - e.g., does not loop + forever, and does not call longjmp. + (This attribute is stricter than _GL_ATTRIBUTE_PURE.) */ +/* Applies to: functions. */ #if _GL_HAS_ATTRIBUTE (const) # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) #else # define _GL_ATTRIBUTE_CONST #endif -#if 201710L < __STDC_VERSION__ +/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers + that can be freed by passing them as the Ith argument to the + function F. + _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that + can be freed via 'free'; it can be used only after declaring 'free'. */ +/* Applies to: functions. Cannot be used on inline functions. */ +#if _GL_GNUC_PREREQ (11, 0) +# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) +#else +# define _GL_ATTRIBUTE_DEALLOC(f, i) +#endif +/* If gnulib's or has already defined this macro, continue + to use this earlier definition, since may not have been included + yet. */ +#ifndef _GL_ATTRIBUTE_DEALLOC_FREE +# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1) +#endif + +/* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated. + The compiler may warn if the entity is used. */ +/* Applies to: + - function, variable, + - struct, union, struct/union member, + - enumeration, enumeration item, + - typedef, + in C++ also: namespace, class, template specialization. */ +#if _GL_HAS_C_ATTRIBUTE (deprecated) # define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]] #elif _GL_HAS_ATTRIBUTE (deprecated) # define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__)) @@ -147,6 +206,11 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _GL_ATTRIBUTE_DEPRECATED #endif +/* _GL_ATTRIBUTE_ERROR(msg) requests an error if a function is called and + the function call is not optimized away. + _GL_ATTRIBUTE_WARNING(msg) requests a warning if a function is called and + the function call is not optimized away. */ +/* Applies to: functions. */ #if _GL_HAS_ATTRIBUTE (error) # define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg))) # define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg))) @@ -158,14 +222,21 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _GL_ATTRIBUTE_WARNING(msg) #endif +/* _GL_ATTRIBUTE_EXTERNALLY_VISIBLE declares that the entity should remain + visible to debuggers etc., even with '-fwhole-program'. */ +/* Applies to: functions, variables. */ #if _GL_HAS_ATTRIBUTE (externally_visible) # define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible)) #else # define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE #endif -/* FALLTHROUGH is special, because it always expands to something. */ -#if 201710L < __STDC_VERSION__ +/* _GL_ATTRIBUTE_FALLTHROUGH declares that it is not a programming mistake if + the control flow falls through to the immediately following 'case' or + 'default' label. The compiler should not warn in this case. */ +/* Applies to: Empty statement (;), inside a 'switch' statement. */ +/* Always expands to something. */ +#if _GL_HAS_C_ATTRIBUTE (fallthrough) # define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]] #elif _GL_HAS_ATTRIBUTE (fallthrough) # define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__)) @@ -173,18 +244,47 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0) #endif +/* _GL_ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)) + declares that the STRING-INDEXth function argument is a format string of + style ARCHETYPE, which is one of: + printf, gnu_printf + scanf, gnu_scanf, + strftime, gnu_strftime, + strfmon, + or the same thing prefixed and suffixed with '__'. + If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK + are suitable for the format string. */ +/* Applies to: functions. */ #if _GL_HAS_ATTRIBUTE (format) # define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) #else # define _GL_ATTRIBUTE_FORMAT(spec) #endif +/* _GL_ATTRIBUTE_LEAF declares that if the function is called from some other + compilation unit, it executes code from that unit only by return or by + exception handling. This declaration lets the compiler optimize that unit + more aggressively. */ +/* Applies to: functions. */ #if _GL_HAS_ATTRIBUTE (leaf) # define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__)) #else # define _GL_ATTRIBUTE_LEAF #endif +/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly + allocated memory. */ +/* Applies to: functions. */ +#if _GL_HAS_ATTRIBUTE (malloc) +# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +#else +# define _GL_ATTRIBUTE_MALLOC +#endif + +/* _GL_ATTRIBUTE_MAY_ALIAS declares that pointers to the type may point to the + same storage as pointers to other types. Thus this declaration disables + strict aliasing optimization. */ +/* Applies to: types. */ /* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */ #if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C # define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__)) @@ -192,24 +292,33 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _GL_ATTRIBUTE_MAY_ALIAS #endif -#if 201710L < __STDC_VERSION__ +/* _GL_ATTRIBUTE_MAYBE_UNUSED declares that it is not a programming mistake if + the entity is not used. The compiler should not warn if the entity is not + used. */ +/* Applies to: + - function, variable, + - struct, union, struct/union member, + - enumeration, enumeration item, + - typedef, + in C++ also: class. */ +/* In C++ and C2x, this is spelled [[__maybe_unused__]]. + GCC's syntax is __attribute__ ((__unused__)). + clang supports both syntaxes. */ +#if _GL_HAS_C_ATTRIBUTE (maybe_unused) # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] -#elif _GL_HAS_ATTRIBUTE (unused) -# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__)) #else -# define _GL_ATTRIBUTE_MAYBE_UNUSED +# define _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_UNUSED #endif -/* Earlier spellings of this macro. */ +/* Alternative spelling of this macro, for convenience. */ #define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED +/* Earlier spellings of this macro. */ #define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED -#if _GL_HAS_ATTRIBUTE (malloc) -# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) -#else -# define _GL_ATTRIBUTE_MALLOC -#endif - -#if 201710L < __STDC_VERSION__ +/* _GL_ATTRIBUTE_NODISCARD declares that the caller of the function should not + discard the return value. The compiler may warn if the caller does not use + the return value, unless the caller uses something like ignore_value. */ +/* Applies to: function, enumeration, class. */ +#if _GL_HAS_C_ATTRIBUTE (nodiscard) # define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] #elif _GL_HAS_ATTRIBUTE (warn_unused_result) # define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__)) @@ -217,18 +326,30 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _GL_ATTRIBUTE_NODISCARD #endif +/* _GL_ATTRIBUTE_NOINLINE tells that the compiler should not inline the + function. */ +/* Applies to: functions. */ #if _GL_HAS_ATTRIBUTE (noinline) # define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__)) #else # define _GL_ATTRIBUTE_NOINLINE #endif +/* _GL_ATTRIBUTE_NONNULL ((N1, N2,...)) declares that the arguments N1, N2,... + must not be NULL. + _GL_ATTRIBUTE_NONNULL () declares that all pointer arguments must not be + null. */ +/* Applies to: functions. */ #if _GL_HAS_ATTRIBUTE (nonnull) # define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args)) #else # define _GL_ATTRIBUTE_NONNULL(args) #endif +/* _GL_ATTRIBUTE_NONSTRING declares that the contents of a character array is + not meant to be NUL-terminated. */ +/* Applies to: struct/union members and variables that are arrays of element + type '[[un]signed] char'. */ #if _GL_HAS_ATTRIBUTE (nonstring) # define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__)) #else @@ -237,41 +358,77 @@ AC_DEFUN([gl_COMMON_BODY], [ /* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */ +/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. + */ +/* Applies to: functions. */ #if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus # define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__)) #else # define _GL_ATTRIBUTE_NOTHROW #endif +/* _GL_ATTRIBUTE_PACKED declares: + For struct members: The member has the smallest possible alignment. + For struct, union, class: All members have the smallest possible alignment, + minimizing the memory required. */ +/* Applies to: struct members, struct, union, + in C++ also: class. */ #if _GL_HAS_ATTRIBUTE (packed) # define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__)) #else # define _GL_ATTRIBUTE_PACKED #endif +/* _GL_ATTRIBUTE_PURE declares that It is OK for a compiler to omit duplicate + calls to the function with the same arguments if observable state is not + changed between calls. + This attribute is safe for a function that does not affect + observable state, and always returns exactly once. + (This attribute is looser than _GL_ATTRIBUTE_CONST.) */ +/* Applies to: functions. */ #if _GL_HAS_ATTRIBUTE (pure) # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) #else # define _GL_ATTRIBUTE_PURE #endif +/* _GL_ATTRIBUTE_RETURNS_NONNULL declares that the function's return value is + a non-NULL pointer. */ +/* Applies to: functions. */ #if _GL_HAS_ATTRIBUTE (returns_nonnull) # define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__)) #else # define _GL_ATTRIBUTE_RETURNS_NONNULL #endif +/* _GL_ATTRIBUTE_SENTINEL(pos) declares that the variadic function expects a + trailing NULL argument. + _GL_ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99). + _GL_ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */ +/* Applies to: functions. */ #if _GL_HAS_ATTRIBUTE (sentinel) # define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos)) #else # define _GL_ATTRIBUTE_SENTINEL(pos) #endif +/* A helper macro. Don't use it directly. */ +#if _GL_HAS_ATTRIBUTE (unused) +# define _GL_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#else +# define _GL_ATTRIBUTE_UNUSED +#endif + ]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead. [ -/* To support C++ as well as C, use _GL_UNUSED_LABEL with trailing ';'. */ -#if !defined __cplusplus || _GL_GNUC_PREREQ (4, 5) -# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_MAYBE_UNUSED +/* _GL_UNUSED_LABEL; declares that it is not a programming mistake if the + immediately preceding label is not used. The compiler should not warn + if the label is not used. */ +/* Applies to: label (both in C and C++). */ +/* Note that g++ < 4.5 does not support the '__attribute__ ((__unused__)) ;' + syntax. But clang does. */ +#if !(defined __cplusplus && !_GL_GNUC_PREREQ (4, 5)) || defined __clang__ +# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_UNUSED #else # define _GL_UNUSED_LABEL #endif @@ -354,6 +511,16 @@ AC_DEFUN([gl_COMMON_BODY], [ export LIBC_FATAL_STDERR_ ]) +# gl_MODULE_INDICATOR_INIT_VARIABLE([variablename]) +# gl_MODULE_INDICATOR_INIT_VARIABLE([variablename], [initialvalue]) +# initializes the shell variable that indicates the presence of the given module +# as a C preprocessor expression. +AC_DEFUN([gl_MODULE_INDICATOR_INIT_VARIABLE], +[ + GL_MODULE_INDICATOR_PREFIX[]_[$1]=m4_if([$2], , [0], [$2]) + AC_SUBST(GL_MODULE_INDICATOR_PREFIX[]_[$1]) +]) + # gl_MODULE_INDICATOR_CONDITION # expands to a C preprocessor expression that evaluates to 1 or 0, depending # whether a gnulib module that has been requested shall be considered present @@ -366,9 +533,9 @@ m4_define([gl_MODULE_INDICATOR_CONDITION], [1]) AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE], [ gl_MODULE_INDICATOR_SET_VARIABLE_AUX( - [GNULIB_[]m4_translit([[$1]], - [abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], + [GL_MODULE_INDICATOR_PREFIX[]_GNULIB_[]m4_translit([[$1]], + [abcdefghijklmnopqrstuvwxyz./-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])], [gl_MODULE_INDICATOR_CONDITION]) ]) @@ -653,6 +820,186 @@ AC_DEFUN([gl_CACHE_VAL_SILENT], ]) ]) +# gl_CONDITIONAL(conditional, condition) +# is like AM_CONDITIONAL(conditional, condition), except that it does not +# produce an error +# configure: error: conditional "..." was never defined. +# Usually this means the macro was only invoked conditionally. +# when only invoked conditionally. Instead, in that case, both the _TRUE +# and the _FALSE case are disabled. +AC_DEFUN([gl_CONDITIONAL], +[ + pushdef([AC_CONFIG_COMMANDS_PRE], [:])dnl + AM_CONDITIONAL([$1], [$2]) + popdef([AC_CONFIG_COMMANDS_PRE])dnl + if test -z "${[$1]_TRUE}" && test -z "${[$1]_FALSE}"; then + [$1]_TRUE='#' + [$1]_FALSE='#' + fi +]) + +# gl_CC_ALLOW_WARNINGS +# sets and substitutes a variable GL_CFLAG_ALLOW_WARNINGS, to a $(CC) option +# that reverts a preceding '-Werror' option, if available. +# This is expected to be '-Wno-error' on gcc, clang (except clang/MSVC), xlclang +# and empty otherwise. +AC_DEFUN([gl_CC_ALLOW_WARNINGS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_CACHE_CHECK([for C compiler option to allow warnings], + [gl_cv_cc_wallow], + [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 -Wno-error -c conftest.c 2>conftest2.err]) >/dev/null + dnl Test the number of error output lines, because AIX xlc accepts the + dnl option '-Wno-error', just to produce a warning + dnl "Option -Wno-error was incorrectly specified. The option will be ignored." + dnl afterwards. + if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then + gl_cv_cc_wallow='-Wno-error' + else + gl_cv_cc_wallow=none + fi + rm -f conftest* + ]) + case "$gl_cv_cc_wallow" in + none) GL_CFLAG_ALLOW_WARNINGS='' ;; + *) GL_CFLAG_ALLOW_WARNINGS="$gl_cv_cc_wallow" ;; + esac + AC_SUBST([GL_CFLAG_ALLOW_WARNINGS]) +]) + +# gl_CXX_ALLOW_WARNINGS +# sets and substitutes a variable GL_CXXFLAG_ALLOW_WARNINGS, to a $(CC) option +# that reverts a preceding '-Werror' option, if available. +AC_DEFUN([gl_CXX_ALLOW_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 allow warnings], + [gl_cv_cxx_wallow], + [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 -Wno-error -c conftest.cc 2>conftest2.err]) >/dev/null + dnl Test the number of error output lines, because AIX xlC accepts the + dnl option '-Wno-error', just to produce a warning + dnl "Option -Wno-error was incorrectly specified. The option will be ignored." + dnl afterwards. + if test $? = 0 && test `wc -l < conftest1.err` = `wc -l < conftest2.err`; then + gl_cv_cxx_wallow='-Wno-error' + else + gl_cv_cxx_wallow=none + fi + rm -f conftest* + ]) + case "$gl_cv_cxx_wallow" in + none) GL_CXXFLAG_ALLOW_WARNINGS='' ;; + *) GL_CXXFLAG_ALLOW_WARNINGS="$gl_cv_cxx_wallow" ;; + esac + else + GL_CXXFLAG_ALLOW_WARNINGS='' + fi + AC_SUBST([GL_CXXFLAG_ALLOW_WARNINGS]) +]) + +# gl_CC_GNULIB_WARNINGS +# sets and substitutes a variable GL_CFLAG_GNULIB_WARNINGS, to a $(CC) option +# set that enables or disables warnings as suitable for the Gnulib coding style. +AC_DEFUN([gl_CC_GNULIB_WARNINGS], +[ + AC_REQUIRE([gl_CC_ALLOW_WARNINGS]) + dnl Assume that the compiler supports -Wno-* options only if it also supports + dnl -Wno-error. + GL_CFLAG_GNULIB_WARNINGS='' + if test -n "$GL_CFLAG_ALLOW_WARNINGS"; then + dnl Enable these warning options: + dnl + dnl GCC clang + dnl -Wno-cast-qual >= 3 >= 3.9 + dnl -Wno-conversion >= 3 >= 3.9 + dnl -Wno-float-conversion >= 4.9 >= 3.9 + dnl -Wno-float-equal >= 3 >= 3.9 + dnl -Wimplicit-fallthrough >= 7 >= 3.9 + dnl -Wno-pedantic >= 4.8 >= 3.9 + dnl -Wno-sign-compare >= 3 >= 3.9 + dnl -Wno-sign-conversion >= 4.3 >= 3.9 + dnl -Wno-type-limits >= 4.3 >= 3.9 + dnl -Wno-undef >= 3 >= 3.9 + dnl -Wno-unsuffixed-float-constants >= 4.5 + dnl -Wno-unused-function >= 3 >= 3.9 + dnl -Wno-unused-parameter >= 3 >= 3.9 + dnl + cat > conftest.c <<\EOF + #if __GNUC__ >= 3 || (__clang_major__ + (__clang_minor__ >= 9) > 3) + -Wno-cast-qual + -Wno-conversion + -Wno-float-equal + -Wno-sign-compare + -Wno-undef + -Wno-unused-function + -Wno-unused-parameter + #endif + #if __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) + -Wno-float-conversion + #endif + #if __GNUC__ >= 7 || (__clang_major__ + (__clang_minor__ >= 9) > 3) + -Wimplicit-fallthrough + #endif + #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) + -Wno-pedantic + #endif + #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) + -Wno-sign-conversion + -Wno-type-limits + #endif + #if __GNUC__ + (__GNUC_MINOR__ >= 5) > 4 + -Wno-unsuffixed-float-constants + #endif +EOF + gl_command="$CC $CFLAGS $CPPFLAGS -E conftest.c > conftest.out" + if AC_TRY_EVAL([gl_command]); then + gl_options=`grep -v '#' conftest.out` + for word in $gl_options; do + GL_CFLAG_GNULIB_WARNINGS="$GL_CFLAG_GNULIB_WARNINGS $word" + done + fi + rm -f conftest.c conftest.out + fi + AC_SUBST([GL_CFLAG_GNULIB_WARNINGS]) +]) + +dnl gl_CONDITIONAL_HEADER([foo.h]) +dnl takes a shell variable GL_GENERATE_FOO_H (with value true or false) as input +dnl and produces +dnl - an AC_SUBSTed variable FOO_H that is either a file name or empty, based +dnl on whether GL_GENERATE_FOO_H is true or false, +dnl - an Automake conditional GL_GENERATE_FOO_H that evaluates to the value of +dnl the shell variable GL_GENERATE_FOO_H. +AC_DEFUN([gl_CONDITIONAL_HEADER], +[ + m4_pushdef([gl_header_name], AS_TR_SH(m4_toupper($1))) + m4_pushdef([gl_generate_var], [GL_GENERATE_]AS_TR_SH(m4_toupper($1))) + m4_pushdef([gl_generate_cond], [GL_GENERATE_]AS_TR_SH(m4_toupper($1))) + case "$gl_generate_var" in + false) gl_header_name='' ;; + true) + dnl It is OK to use a .h file in lib/ from within tests/, but not vice + dnl versa. + if test -z "$gl_header_name"; then + gl_header_name="${gl_source_base_prefix}$1" + fi + ;; + *) echo "*** gl_generate_var is not set correctly" 1>&2; exit 1 ;; + esac + AC_SUBST(gl_header_name) + gl_CONDITIONAL(gl_generate_cond, [$gl_generate_var]) + m4_popdef([gl_generate_cond]) + m4_popdef([gl_generate_var]) + m4_popdef([gl_header_name]) +]) + dnl Expands to some code for use in .c programs that, on native Windows, defines dnl the Microsoft deprecated alias function names to the underscore-prefixed dnl actual function names. With this macro, these function names are available diff --git a/gnulib/import/m4/gnulib-comp.m4 b/gnulib/import/m4/gnulib-comp.m4 index 5376a93..94e2cfe 100644 --- a/gnulib/import/m4/gnulib-comp.m4 +++ b/gnulib/import/m4/gnulib-comp.m4 @@ -1,9 +1,9 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2021 Free Software Foundation, Inc. +# Copyright (C) 2002-2022 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 -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This file is distributed in the hope that it will be useful, @@ -42,7 +42,6 @@ AC_DEFUN([gl_EARLY], AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_PROG_AR_RANLIB]) - AC_REQUIRE([AM_PROG_CC_C_O]) # Code from module absolute-header: # Code from module accept: # Code from module alloca: @@ -104,6 +103,7 @@ AC_DEFUN([gl_EARLY], # Code from module frexpl: # Code from module fstat: # Code from module fstatat: + # Code from module gen-header: # Code from module gendocs: # Code from module getcwd: # Code from module getcwd-lgpl: @@ -130,6 +130,7 @@ AC_DEFUN([gl_EARLY], # Code from module isnanl-nolibm: # Code from module largefile: AC_REQUIRE([AC_SYS_LARGEFILE]) + AC_REQUIRE([gl_YEAR2038_EARLY]) # Code from module libc-config: # Code from module limits-h: # Code from module listen: @@ -229,6 +230,7 @@ AC_DEFUN([gl_EARLY], # Code from module unistd-safer: # Code from module unsetenv: # Code from module update-copyright: + # Code from module vararrays: # Code from module verify: # Code from module wchar: # Code from module wctype-h: @@ -245,6 +247,7 @@ AC_DEFUN([gl_EARLY], # "Check for header files, types and library functions". AC_DEFUN([gl_INIT], [ + AC_CONFIG_LIBOBJ_DIR([import]) AM_CONDITIONAL([GL_COND_LIBTOOL], [false]) gl_cond_libtool=false gl_libdeps= @@ -255,133 +258,137 @@ AC_DEFUN([gl_INIT], m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES])) m4_pushdef([gl_LIBSOURCES_LIST], []) m4_pushdef([gl_LIBSOURCES_DIR], []) + m4_pushdef([GL_MACRO_PREFIX], [gl]) + m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL]) gl_COMMON gl_source_base='import' - AC_REQUIRE([gl_HEADER_SYS_SOCKET]) - if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([accept]) - fi + gl_source_base_prefix= + AC_REQUIRE([gl_SYS_SOCKET_H]) + gl_CONDITIONAL([GL_COND_OBJ_ACCEPT], [test "$ac_cv_header_winsock2_h" = yes]) gl_SYS_SOCKET_MODULE_INDICATOR([accept]) gl_FUNC_ALLOCA - gl_HEADER_ARPA_INET + gl_CONDITIONAL_HEADER([alloca.h]) + AC_PROG_MKDIR_P + gl_ARPA_INET_H + gl_ARPA_INET_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([gl_HEADER_SYS_SOCKET]) - if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([bind]) - fi + 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_FUNC_BTOWC - if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then - AC_LIBOBJ([btowc]) + gl_CONDITIONAL([GL_COND_OBJ_BTOWC], + [test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1]) + AM_COND_IF([GL_COND_OBJ_BTOWC], [ gl_PREREQ_BTOWC - fi + ]) gl_WCHAR_MODULE_INDICATOR([btowc]) gl___BUILTIN_EXPECT gl_CANONICALIZE_LGPL - if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then - AC_LIBOBJ([canonicalize-lgpl]) - fi + gl_CONDITIONAL([GL_COND_OBJ_CANONICALIZE_LGPL], + [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1]) gl_MODULE_INDICATOR([canonicalize-lgpl]) gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name]) gl_STDLIB_MODULE_INDICATOR([realpath]) gl_UNISTD_MODULE_INDICATOR([chdir]) gl_FUNC_CHDIR_LONG - if test $gl_cv_have_unlimited_file_name_length = no; then - AC_LIBOBJ([chdir-long]) + gl_CONDITIONAL([GL_COND_OBJ_CHDIR_LONG], + [test $gl_cv_have_unlimited_file_name_length = no]) + AM_COND_IF([GL_COND_OBJ_CHDIR_LONG], [ gl_PREREQ_CHDIR_LONG - fi + ]) gl_FUNC_CHOWN - if test $HAVE_CHOWN = 0 || test $REPLACE_CHOWN = 1; then - AC_LIBOBJ([chown]) - fi - if test $REPLACE_CHOWN = 1 && test $ac_cv_func_fchown = no; then - AC_LIBOBJ([fchown-stub]) - fi + gl_CONDITIONAL([GL_COND_OBJ_CHOWN], + [test $HAVE_CHOWN = 0 || test $REPLACE_CHOWN = 1]) + gl_CONDITIONAL([GL_COND_OBJ_FCHOWN_STUB], + [test $REPLACE_CHOWN = 1 && test $ac_cv_func_fchown = no]) gl_UNISTD_MODULE_INDICATOR([chown]) gl_CLOCK_TIME gl_MODULE_INDICATOR_FOR_TESTS([cloexec]) gl_FUNC_CLOSE - if test $REPLACE_CLOSE = 1; then - AC_LIBOBJ([close]) - fi + gl_CONDITIONAL([GL_COND_OBJ_CLOSE], [test $REPLACE_CLOSE = 1]) gl_UNISTD_MODULE_INDICATOR([close]) gl_FUNC_CLOSEDIR - if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then - AC_LIBOBJ([closedir]) - fi + gl_CONDITIONAL([GL_COND_OBJ_CLOSEDIR], + [test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1]) gl_DIRENT_MODULE_INDICATOR([closedir]) - AC_REQUIRE([gl_HEADER_SYS_SOCKET]) - if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([connect]) - fi + AC_REQUIRE([gl_SYS_SOCKET_H]) + gl_CONDITIONAL([GL_COND_OBJ_CONNECT], [test "$ac_cv_header_winsock2_h" = yes]) gl_SYS_SOCKET_MODULE_INDICATOR([connect]) gl_CTYPE_H + gl_CTYPE_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_CHECK_TYPE_STRUCT_DIRENT_D_INO gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE gl_DIRENT_H + gl_DIRENT_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_FUNC_DIRFD - if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \ - || test $REPLACE_DIRFD = 1; then - AC_LIBOBJ([dirfd]) + gl_CONDITIONAL([GL_COND_OBJ_DIRFD], + [test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no || test $REPLACE_DIRFD = 1]) + AM_COND_IF([GL_COND_OBJ_DIRFD], [ gl_PREREQ_DIRFD - fi + ]) gl_DIRENT_MODULE_INDICATOR([dirfd]) gl_DOUBLE_SLASH_ROOT gl_FUNC_DUP - if test $REPLACE_DUP = 1; then - AC_LIBOBJ([dup]) + gl_CONDITIONAL([GL_COND_OBJ_DUP], [test $REPLACE_DUP = 1]) + AM_COND_IF([GL_COND_OBJ_DUP], [ gl_PREREQ_DUP - fi + ]) gl_UNISTD_MODULE_INDICATOR([dup]) gl_FUNC_DUP2 - if test $REPLACE_DUP2 = 1; then - AC_LIBOBJ([dup2]) + gl_CONDITIONAL([GL_COND_OBJ_DUP2], [test $REPLACE_DUP2 = 1]) + AM_COND_IF([GL_COND_OBJ_DUP2], [ gl_PREREQ_DUP2 - fi + ]) gl_UNISTD_MODULE_INDICATOR([dup2]) gl_ENVIRON gl_UNISTD_MODULE_INDICATOR([environ]) gl_HEADER_ERRNO_H + gl_CONDITIONAL_HEADER([errno.h]) + AC_PROG_MKDIR_P gl_ERROR - if test $ac_cv_lib_error_at_line = no; then - AC_LIBOBJ([error]) + gl_CONDITIONAL([GL_COND_OBJ_ERROR], [test "$ac_cv_lib_error_at_line" = no]) + AM_COND_IF([GL_COND_OBJ_ERROR], [ gl_PREREQ_ERROR - fi + ]) m4_ifdef([AM_XGETTEXT_OPTION], [AM_][XGETTEXT_OPTION([--flag=error:3:c-format]) AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) AC_REQUIRE([gl_EXTERN_INLINE]) gl_FUNC_FCHDIR + gl_CONDITIONAL([GL_COND_OBJ_FCHDIR], [test $HAVE_FCHDIR = 0]) + AM_COND_IF([GL_COND_OBJ_FCHDIR], [ + gl_PREREQ_FCHDIR + ]) gl_UNISTD_MODULE_INDICATOR([fchdir]) gl_FUNC_FCNTL - if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then - AC_LIBOBJ([fcntl]) - fi + gl_CONDITIONAL([GL_COND_OBJ_FCNTL], + [test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1]) gl_FCNTL_MODULE_INDICATOR([fcntl]) gl_FCNTL_H + gl_FCNTL_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_MODULE_INDICATOR([fd-safer-flag]) gl_FUNC_FDOPENDIR - if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then - AC_LIBOBJ([fdopendir]) - fi + gl_CONDITIONAL([GL_COND_OBJ_FDOPENDIR], + [test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1]) gl_DIRENT_MODULE_INDICATOR([fdopendir]) gl_MODULE_INDICATOR([fdopendir]) gl_FUNC_FFS - if test $HAVE_FFS = 0; then - AC_LIBOBJ([ffs]) - fi + gl_CONDITIONAL([GL_COND_OBJ_FFS], [test $HAVE_FFS = 0]) gl_STRINGS_MODULE_INDICATOR([ffs]) gl_FILE_NAME_CONCAT_LGPL AC_C_FLEXIBLE_ARRAY_MEMBER gl_FLOAT_H - if test $REPLACE_FLOAT_LDBL = 1; then - AC_LIBOBJ([float]) - fi - if test $REPLACE_ITOLD = 1; then - AC_LIBOBJ([itold]) - fi + gl_CONDITIONAL_HEADER([float.h]) + AC_PROG_MKDIR_P + gl_CONDITIONAL([GL_COND_OBJ_FLOAT], [test $REPLACE_FLOAT_LDBL = 1]) + gl_CONDITIONAL([GL_COND_OBJ_ITOLD], [test $REPLACE_ITOLD = 1]) gl_FUNC_FNMATCH_POSIX + dnl Because of gl_REPLACE_FNMATCH_H: + gl_CONDITIONAL_HEADER([fnmatch.h]) if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then AC_LIBOBJ([fnmatch]) gl_PREREQ_FNMATCH @@ -394,11 +401,14 @@ AC_DEFUN([gl_INIT], fi gl_MODULE_INDICATOR([fnmatch-gnu]) gl_FNMATCH_H + gl_FNMATCH_H_REQUIRE_DEFAULTS + gl_CONDITIONAL_HEADER([fnmatch.h]) + AC_PROG_MKDIR_P gl_FUNC_FREE - if test $REPLACE_FREE = 1; then - AC_LIBOBJ([free]) + gl_CONDITIONAL([GL_COND_OBJ_FREE], [test $REPLACE_FREE = 1]) + AM_COND_IF([GL_COND_OBJ_FREE], [ gl_PREREQ_FREE - fi + ]) gl_STDLIB_MODULE_INDICATOR([free-posix]) AC_REQUIRE([gl_FUNC_FREXP]) if test $gl_func_frexp != yes; then @@ -411,99 +421,104 @@ AC_DEFUN([gl_INIT], fi gl_MATH_MODULE_INDICATOR([frexpl]) gl_FUNC_FSTAT - if test $REPLACE_FSTAT = 1; then - AC_LIBOBJ([fstat]) + gl_CONDITIONAL([GL_COND_OBJ_FSTAT], [test $REPLACE_FSTAT = 1]) + AM_COND_IF([GL_COND_OBJ_FSTAT], [ case "$host_os" in mingw*) AC_LIBOBJ([stat-w32]) ;; esac gl_PREREQ_FSTAT - fi + ]) gl_SYS_STAT_MODULE_INDICATOR([fstat]) gl_FUNC_FSTATAT - if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then - AC_LIBOBJ([fstatat]) - fi + gl_CONDITIONAL([GL_COND_OBJ_FSTATAT], + [test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1]) gl_SYS_STAT_MODULE_INDICATOR([fstatat]) gl_FUNC_GETCWD - if test $REPLACE_GETCWD = 1; then - AC_LIBOBJ([getcwd]) + gl_CONDITIONAL([GL_COND_OBJ_GETCWD], [test $REPLACE_GETCWD = 1]) + AM_COND_IF([GL_COND_OBJ_GETCWD], [ gl_PREREQ_GETCWD - fi + ]) gl_MODULE_INDICATOR([getcwd]) gl_UNISTD_MODULE_INDICATOR([getcwd]) gl_FUNC_GETCWD_LGPL - if test $REPLACE_GETCWD = 1; then - AC_LIBOBJ([getcwd-lgpl]) - fi + gl_CONDITIONAL([GL_COND_OBJ_GETCWD_LGPL], [test $REPLACE_GETCWD = 1]) gl_UNISTD_MODULE_INDICATOR([getcwd]) gl_FUNC_GETDELIM - if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then - AC_LIBOBJ([getdelim]) + gl_CONDITIONAL([GL_COND_OBJ_GETDELIM], + [test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1]) + AM_COND_IF([GL_COND_OBJ_GETDELIM], [ gl_PREREQ_GETDELIM - fi + ]) gl_STDIO_MODULE_INDICATOR([getdelim]) gl_FUNC_GETDTABLESIZE - if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then - AC_LIBOBJ([getdtablesize]) + gl_CONDITIONAL([GL_COND_OBJ_GETDTABLESIZE], + [test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1]) + AM_COND_IF([GL_COND_OBJ_GETDTABLESIZE], [ gl_PREREQ_GETDTABLESIZE - fi + ]) gl_UNISTD_MODULE_INDICATOR([getdtablesize]) gl_FUNC_GETLINE - if test $REPLACE_GETLINE = 1; then - AC_LIBOBJ([getline]) + gl_CONDITIONAL([GL_COND_OBJ_GETLINE], [test $REPLACE_GETLINE = 1]) + AM_COND_IF([GL_COND_OBJ_GETLINE], [ gl_PREREQ_GETLINE - fi + ]) gl_STDIO_MODULE_INDICATOR([getline]) gl_FUNC_GETLOGIN_R - if test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1; then - AC_LIBOBJ([getlogin_r]) + gl_CONDITIONAL([GL_COND_OBJ_GETLOGIN_R], + [test $HAVE_GETLOGIN_R = 0 || test $REPLACE_GETLOGIN_R = 1]) + AM_COND_IF([GL_COND_OBJ_GETLOGIN_R], [ gl_PREREQ_GETLOGIN_R - fi + ]) gl_UNISTD_MODULE_INDICATOR([getlogin_r]) AC_REQUIRE([gl_LIB_GETLOGIN]) gl_FUNC_GETPROGNAME AC_REQUIRE([AC_CANONICAL_HOST]) gl_FUNC_GETRANDOM - if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then - AC_LIBOBJ([getrandom]) - fi + gl_CONDITIONAL([GL_COND_OBJ_GETRANDOM], + [test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1]) gl_SYS_RANDOM_MODULE_INDICATOR([getrandom]) AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) gl_FUNC_GETTIMEOFDAY - if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then - AC_LIBOBJ([gettimeofday]) + gl_CONDITIONAL([GL_COND_OBJ_GETTIMEOFDAY], + [test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1]) + AM_COND_IF([GL_COND_OBJ_GETTIMEOFDAY], [ gl_PREREQ_GETTIMEOFDAY - fi + ]) gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) gl_GLOB - if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then - AC_LIBOBJ([glob]) - AC_LIBOBJ([globfree]) + dnl Because of gl_REPLACE_GLOB_H: + gl_CONDITIONAL_HEADER([glob.h]) + gl_CONDITIONAL([GL_COND_OBJ_GLOB], + [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]) + AM_COND_IF([GL_COND_OBJ_GLOB], [ gl_PREREQ_GLOB - fi - if test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1; then - AC_LIBOBJ([glob_pattern_p]) - fi + ]) + gl_CONDITIONAL([GL_COND_OBJ_GLOB_PATTERN_P], + [test $HAVE_GLOB_PATTERN_P = 0 || test $REPLACE_GLOB_PATTERN_P = 1]) gl_GLOB_MODULE_INDICATOR([glob]) gl_GLOB_H + gl_GLOB_H_REQUIRE_DEFAULTS + gl_CONDITIONAL_HEADER([glob.h]) + AC_PROG_MKDIR_P AC_REQUIRE([gl_FUNC_SETLOCALE_NULL]) LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL" AC_SUBST([LIB_HARD_LOCALE]) gl_FUNC_INET_NTOP - if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then - AC_LIBOBJ([inet_ntop]) + gl_CONDITIONAL([GL_COND_OBJ_INET_NTOP], + [test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1]) + AM_COND_IF([GL_COND_OBJ_INET_NTOP], [ gl_PREREQ_INET_NTOP - fi + ]) gl_ARPA_INET_MODULE_INDICATOR([inet_ntop]) gl_INTTYPES_H gl_INTTYPES_INCOMPLETE + gl_INTTYPES_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_FUNC_ISBLANK - if test $HAVE_ISBLANK = 0; then - AC_LIBOBJ([isblank]) - fi + gl_CONDITIONAL([GL_COND_OBJ_ISBLANK], [test $HAVE_ISBLANK = 0]) gl_MODULE_INDICATOR([isblank]) gl_CTYPE_MODULE_INDICATOR([isblank]) gl_FUNC_ISNAND_NO_LIBM @@ -519,66 +534,74 @@ AC_DEFUN([gl_INIT], AC_REQUIRE([gl_LARGEFILE]) gl___INLINE gl_LIMITS_H - AC_REQUIRE([gl_HEADER_SYS_SOCKET]) - if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([listen]) - fi + gl_CONDITIONAL_HEADER([limits.h]) + AC_PROG_MKDIR_P + AC_REQUIRE([gl_SYS_SOCKET_H]) + gl_CONDITIONAL([GL_COND_OBJ_LISTEN], [test "$ac_cv_header_winsock2_h" = yes]) gl_SYS_SOCKET_MODULE_INDICATOR([listen]) gl_LOCALCHARSET dnl For backward compatibility. Some packages still use this. LOCALCHARSET_TESTS_ENVIRONMENT= AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) gl_LOCALE_H + gl_LOCALE_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_LOCK gl_MODULE_INDICATOR([lock]) gl_FUNC_LSTAT - if test $REPLACE_LSTAT = 1; then - AC_LIBOBJ([lstat]) + gl_CONDITIONAL([GL_COND_OBJ_LSTAT], [test $REPLACE_LSTAT = 1]) + AM_COND_IF([GL_COND_OBJ_LSTAT], [ gl_PREREQ_LSTAT - fi + ]) gl_SYS_STAT_MODULE_INDICATOR([lstat]) - gl_FUNC_MALLOC_POSIX - if test $REPLACE_MALLOC = 1; then + AC_REQUIRE([gl_FUNC_MALLOC_POSIX]) + if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then AC_LIBOBJ([malloc]) fi gl_STDLIB_MODULE_INDICATOR([malloc-posix]) gl_MALLOCA gl_MATH_H + gl_MATH_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_FUNC_MBRTOWC - if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then - AC_LIBOBJ([mbrtowc]) + gl_CONDITIONAL([GL_COND_OBJ_MBRTOWC], + [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]) + AM_COND_IF([GL_COND_OBJ_MBRTOWC], [ if test $REPLACE_MBSTATE_T = 1; then AC_LIBOBJ([lc-charset-dispatch]) AC_LIBOBJ([mbtowc-lock]) gl_PREREQ_MBTOWC_LOCK fi gl_PREREQ_MBRTOWC - fi + ]) gl_WCHAR_MODULE_INDICATOR([mbrtowc]) gl_FUNC_MBSINIT - if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then - AC_LIBOBJ([mbsinit]) + gl_CONDITIONAL([GL_COND_OBJ_MBSINIT], + [test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1]) + AM_COND_IF([GL_COND_OBJ_MBSINIT], [ gl_PREREQ_MBSINIT - fi + ]) gl_WCHAR_MODULE_INDICATOR([mbsinit]) gl_FUNC_MBSRTOWCS - if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then - AC_LIBOBJ([mbsrtowcs]) + gl_CONDITIONAL([GL_COND_OBJ_MBSRTOWCS], + [test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1]) + AM_COND_IF([GL_COND_OBJ_MBSRTOWCS], [ AC_LIBOBJ([mbsrtowcs-state]) gl_PREREQ_MBSRTOWCS - fi + ]) gl_WCHAR_MODULE_INDICATOR([mbsrtowcs]) gl_FUNC_MBTOWC - if test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1; then - AC_LIBOBJ([mbtowc]) + gl_CONDITIONAL([GL_COND_OBJ_MBTOWC], + [test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1]) + AM_COND_IF([GL_COND_OBJ_MBTOWC], [ gl_PREREQ_MBTOWC - fi + ]) gl_STDLIB_MODULE_INDICATOR([mbtowc]) gl_FUNC_MEMCHR - if test $REPLACE_MEMCHR = 1; then - AC_LIBOBJ([memchr]) + gl_CONDITIONAL([GL_COND_OBJ_MEMCHR], [test $REPLACE_MEMCHR = 1]) + AM_COND_IF([GL_COND_OBJ_MEMCHR], [ gl_PREREQ_MEMCHR - fi + ]) gl_STRING_MODULE_INDICATOR([memchr]) gl_FUNC_MEMMEM if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then @@ -590,141 +613,129 @@ AC_DEFUN([gl_INIT], fi gl_STRING_MODULE_INDICATOR([memmem]) gl_FUNC_MEMPCPY - if test $HAVE_MEMPCPY = 0; then - AC_LIBOBJ([mempcpy]) + gl_CONDITIONAL([GL_COND_OBJ_MEMPCPY], [test $HAVE_MEMPCPY = 0]) + AM_COND_IF([GL_COND_OBJ_MEMPCPY], [ gl_PREREQ_MEMPCPY - fi + ]) gl_STRING_MODULE_INDICATOR([mempcpy]) gl_FUNC_MEMRCHR - if test $ac_cv_func_memrchr = no; then - AC_LIBOBJ([memrchr]) + gl_CONDITIONAL([GL_COND_OBJ_MEMRCHR], [test $ac_cv_func_memrchr = no]) + AM_COND_IF([GL_COND_OBJ_MEMRCHR], [ gl_PREREQ_MEMRCHR - fi + ]) gl_STRING_MODULE_INDICATOR([memrchr]) gl_MINMAX gl_FUNC_MKDIR - if test $REPLACE_MKDIR = 1; then - AC_LIBOBJ([mkdir]) - fi + gl_CONDITIONAL([GL_COND_OBJ_MKDIR], [test $REPLACE_MKDIR = 1]) gl_SYS_STAT_MODULE_INDICATOR([mkdir]) gl_FUNC_MKDTEMP - if test $HAVE_MKDTEMP = 0; then - AC_LIBOBJ([mkdtemp]) + gl_CONDITIONAL([GL_COND_OBJ_MKDTEMP], [test $HAVE_MKDTEMP = 0]) + AM_COND_IF([GL_COND_OBJ_MKDTEMP], [ gl_PREREQ_MKDTEMP - fi + ]) gl_STDLIB_MODULE_INDICATOR([mkdtemp]) gl_FUNC_MKOSTEMP - if test $HAVE_MKOSTEMP = 0; then - AC_LIBOBJ([mkostemp]) + gl_CONDITIONAL([GL_COND_OBJ_MKOSTEMP], [test $HAVE_MKOSTEMP = 0]) + AM_COND_IF([GL_COND_OBJ_MKOSTEMP], [ gl_PREREQ_MKOSTEMP - fi + ]) gl_MODULE_INDICATOR([mkostemp]) gl_STDLIB_MODULE_INDICATOR([mkostemp]) AC_REQUIRE([gl_MSVC_INVAL]) - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - AC_LIBOBJ([msvc-inval]) - fi + gl_CONDITIONAL([GL_COND_OBJ_MSVC_INVAL], + [test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1]) AC_REQUIRE([gl_MSVC_NOTHROW]) - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - AC_LIBOBJ([msvc-nothrow]) - fi + gl_CONDITIONAL([GL_COND_OBJ_MSVC_NOTHROW], + [test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1]) gl_MODULE_INDICATOR([msvc-nothrow]) gl_MULTIARCH - gl_HEADER_NETDB + gl_NETDB_H + gl_NETDB_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_HEADER_NETINET_IN + gl_CONDITIONAL_HEADER([netinet/in.h]) AC_PROG_MKDIR_P gl_FUNC_OPEN - if test $REPLACE_OPEN = 1; then - AC_LIBOBJ([open]) + gl_CONDITIONAL([GL_COND_OBJ_OPEN], [test $REPLACE_OPEN = 1]) + AM_COND_IF([GL_COND_OBJ_OPEN], [ gl_PREREQ_OPEN - fi + ]) gl_FCNTL_MODULE_INDICATOR([open]) gl_FUNC_OPENAT - if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then - AC_LIBOBJ([openat]) + gl_CONDITIONAL([GL_COND_OBJ_OPENAT], + [test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1]) + AM_COND_IF([GL_COND_OBJ_OPENAT], [ gl_PREREQ_OPENAT - fi + ]) gl_MODULE_INDICATOR([openat]) dnl for lib/getcwd.c gl_FCNTL_MODULE_INDICATOR([openat]) gl_FUNC_OPENDIR - if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then - AC_LIBOBJ([opendir]) - fi + gl_CONDITIONAL([GL_COND_OBJ_OPENDIR], + [test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1]) gl_DIRENT_MODULE_INDICATOR([opendir]) gl_PATHMAX gl_FUNC_PIPE - if test $HAVE_PIPE = 0; then - AC_LIBOBJ([pipe]) - fi + gl_CONDITIONAL([GL_COND_OBJ_PIPE], [test $HAVE_PIPE = 0]) gl_UNISTD_MODULE_INDICATOR([pipe]) gl_FUNC_RAWMEMCHR - if test $HAVE_RAWMEMCHR = 0; then - AC_LIBOBJ([rawmemchr]) + gl_CONDITIONAL([GL_COND_OBJ_RAWMEMCHR], [test $HAVE_RAWMEMCHR = 0]) + AM_COND_IF([GL_COND_OBJ_RAWMEMCHR], [ gl_PREREQ_RAWMEMCHR - fi + ]) gl_STRING_MODULE_INDICATOR([rawmemchr]) gl_FUNC_READDIR - if test $HAVE_READDIR = 0; then - AC_LIBOBJ([readdir]) - fi + gl_CONDITIONAL([GL_COND_OBJ_READDIR], [test $HAVE_READDIR = 0]) gl_DIRENT_MODULE_INDICATOR([readdir]) gl_FUNC_READLINK - if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then - AC_LIBOBJ([readlink]) + gl_CONDITIONAL([GL_COND_OBJ_READLINK], + [test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1]) + AM_COND_IF([GL_COND_OBJ_READLINK], [ gl_PREREQ_READLINK - fi + ]) gl_UNISTD_MODULE_INDICATOR([readlink]) gl_FUNC_REALLOC_POSIX - if test $REPLACE_REALLOC = 1; then + if test $REPLACE_REALLOC_FOR_REALLOC_POSIX = 1; then AC_LIBOBJ([realloc]) fi gl_STDLIB_MODULE_INDICATOR([realloc-posix]) gl_FUNC_RENAME - if test $REPLACE_RENAME = 1; then - AC_LIBOBJ([rename]) - fi + gl_CONDITIONAL([GL_COND_OBJ_RENAME], [test $REPLACE_RENAME = 1]) gl_STDIO_MODULE_INDICATOR([rename]) gl_FUNC_REWINDDIR - if test $HAVE_REWINDDIR = 0; then - AC_LIBOBJ([rewinddir]) - fi + gl_CONDITIONAL([GL_COND_OBJ_REWINDDIR], [test $HAVE_REWINDDIR = 0]) gl_DIRENT_MODULE_INDICATOR([rewinddir]) gl_FUNC_RMDIR - if test $REPLACE_RMDIR = 1; then - AC_LIBOBJ([rmdir]) - fi + gl_CONDITIONAL([GL_COND_OBJ_RMDIR], [test $REPLACE_RMDIR = 1]) gl_UNISTD_MODULE_INDICATOR([rmdir]) gl_SAVE_CWD + AC_PROG_MKDIR_P gl_FUNC_SELECT - if test $REPLACE_SELECT = 1; then - AC_LIBOBJ([select]) - fi + gl_CONDITIONAL([GL_COND_OBJ_SELECT], [test $REPLACE_SELECT = 1]) gl_SYS_SELECT_MODULE_INDICATOR([select]) gl_FUNC_SETENV - if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then - AC_LIBOBJ([setenv]) - fi + gl_CONDITIONAL([GL_COND_OBJ_SETENV], + [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]) gl_STDLIB_MODULE_INDICATOR([setenv]) gl_FUNC_SETLOCALE_NULL - if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then - AC_LIBOBJ([setlocale-lock]) + gl_CONDITIONAL([GL_COND_OBJ_SETLOCALE_LOCK], + [test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0]) + AM_COND_IF([GL_COND_OBJ_SETLOCALE_LOCK], [ gl_PREREQ_SETLOCALE_LOCK - fi + ]) gl_LOCALE_MODULE_INDICATOR([setlocale_null]) - AC_REQUIRE([gl_HEADER_SYS_SOCKET]) - if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([setsockopt]) - fi + AC_REQUIRE([gl_SYS_SOCKET_H]) + gl_CONDITIONAL([GL_COND_OBJ_SETSOCKOPT], + [test "$ac_cv_header_winsock2_h" = yes]) gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt]) gl_SIGNAL_H - AC_REQUIRE([gl_HEADER_SYS_SOCKET]) - if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([socket]) - fi + gl_SIGNAL_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P + AC_REQUIRE([gl_SYS_SOCKET_H]) + gl_CONDITIONAL([GL_COND_OBJ_SOCKET], [test "$ac_cv_header_winsock2_h" = yes]) # When this module is used, sockets may actually occur as file descriptors, # hence it is worth warning if the modules 'close' and 'ioctl' are not used. - m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])]) - m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])]) + m4_ifdef([gl_UNISTD_H_DEFAULTS], [gl_UNISTD_H_REQUIRE_DEFAULTS]) + m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [gl_SYS_IOCTL_H_REQUIRE_DEFAULTS]) AC_REQUIRE([gl_PREREQ_SYS_H_WINSOCK2]) if test "$ac_cv_header_winsock2_h" = yes; then UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 @@ -736,63 +747,108 @@ AC_DEFUN([gl_INIT], gl_TYPE_SOCKLEN_T gt_TYPE_SSIZE_T gl_FUNC_STAT - if test $REPLACE_STAT = 1; then - AC_LIBOBJ([stat]) + gl_CONDITIONAL([GL_COND_OBJ_STAT], [test $REPLACE_STAT = 1]) + AM_COND_IF([GL_COND_OBJ_STAT], [ case "$host_os" in mingw*) AC_LIBOBJ([stat-w32]) ;; esac gl_PREREQ_STAT - fi + ]) gl_SYS_STAT_MODULE_INDICATOR([stat]) gl_STAT_TIME gl_STAT_BIRTHTIME gl_STDALIGN_H - AM_STDBOOL_H + gl_CONDITIONAL_HEADER([stdalign.h]) + AC_PROG_MKDIR_P + gl_STDBOOL_H + gl_CONDITIONAL_HEADER([stdbool.h]) + AC_PROG_MKDIR_P gl_STDDEF_H + gl_STDDEF_H_REQUIRE_DEFAULTS + gl_CONDITIONAL_HEADER([stddef.h]) + AC_PROG_MKDIR_P gl_STDINT_H + gl_CONDITIONAL_HEADER([stdint.h]) + dnl Because of gl_REPLACE_LIMITS_H: + gl_CONDITIONAL_HEADER([limits.h]) + AC_PROG_MKDIR_P gl_STDIO_H + gl_STDIO_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P + gl_CONDITIONAL([GL_COND_OBJ_STDIO_READ], [test $REPLACE_STDIO_READ_FUNCS = 1]) + gl_CONDITIONAL([GL_COND_OBJ_STDIO_WRITE], [test $REPLACE_STDIO_WRITE_FUNCS = 1]) + dnl No need to create extra modules for these functions. Everyone who uses + dnl likely needs them. + gl_STDIO_MODULE_INDICATOR([fscanf]) + gl_MODULE_INDICATOR([fscanf]) + gl_STDIO_MODULE_INDICATOR([scanf]) + gl_MODULE_INDICATOR([scanf]) + gl_STDIO_MODULE_INDICATOR([fgetc]) + gl_STDIO_MODULE_INDICATOR([getc]) + gl_STDIO_MODULE_INDICATOR([getchar]) + gl_STDIO_MODULE_INDICATOR([fgets]) + gl_STDIO_MODULE_INDICATOR([fread]) + dnl No need to create extra modules for these functions. Everyone who uses + dnl likely needs them. + gl_STDIO_MODULE_INDICATOR([fprintf]) + gl_STDIO_MODULE_INDICATOR([printf]) + gl_STDIO_MODULE_INDICATOR([vfprintf]) + gl_STDIO_MODULE_INDICATOR([vprintf]) + gl_STDIO_MODULE_INDICATOR([fputc]) + gl_STDIO_MODULE_INDICATOR([putc]) + gl_STDIO_MODULE_INDICATOR([putchar]) + gl_STDIO_MODULE_INDICATOR([fputs]) + gl_STDIO_MODULE_INDICATOR([puts]) + gl_STDIO_MODULE_INDICATOR([fwrite]) gl_STDLIB_H + gl_STDLIB_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_FUNC_STRCHRNUL - if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then - AC_LIBOBJ([strchrnul]) + gl_CONDITIONAL([GL_COND_OBJ_STRCHRNUL], + [test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1]) + AM_COND_IF([GL_COND_OBJ_STRCHRNUL], [ gl_PREREQ_STRCHRNUL - fi + ]) gl_STRING_MODULE_INDICATOR([strchrnul]) gl_FUNC_STRDUP_POSIX - if test $REPLACE_STRDUP = 1; then - AC_LIBOBJ([strdup]) + gl_CONDITIONAL([GL_COND_OBJ_STRDUP], [test $REPLACE_STRDUP = 1]) + AM_COND_IF([GL_COND_OBJ_STRDUP], [ gl_PREREQ_STRDUP - fi + ]) gl_STRING_MODULE_INDICATOR([strdup]) gl_FUNC_STRERROR - if test $REPLACE_STRERROR = 1; then - AC_LIBOBJ([strerror]) - fi + gl_CONDITIONAL([GL_COND_OBJ_STRERROR], [test $REPLACE_STRERROR = 1]) gl_MODULE_INDICATOR([strerror]) gl_STRING_MODULE_INDICATOR([strerror]) AC_REQUIRE([gl_HEADER_ERRNO_H]) AC_REQUIRE([gl_FUNC_STRERROR_0]) - if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then - AC_LIBOBJ([strerror-override]) + gl_CONDITIONAL([GL_COND_OBJ_STRERROR_OVERRIDE], + [test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1]) + AM_COND_IF([GL_COND_OBJ_STRERROR_OVERRIDE], [ gl_PREREQ_SYS_H_WINSOCK2 - fi + ]) gl_FUNC_STRERROR_R - if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + AS_IF([test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1], [ AC_LIBOBJ([strerror_r]) gl_PREREQ_STRERROR_R - fi + ]) gl_STRING_MODULE_INDICATOR([strerror_r]) dnl For the modules argp, error. gl_MODULE_INDICATOR([strerror_r-posix]) - gl_HEADER_STRING_H - gl_HEADER_STRINGS_H + gl_STRING_H + gl_STRING_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P + gl_STRINGS_H + gl_STRINGS_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_FUNC_STRNLEN - if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then - AC_LIBOBJ([strnlen]) + gl_CONDITIONAL([GL_COND_OBJ_STRNLEN], + [test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1]) + AM_COND_IF([GL_COND_OBJ_STRNLEN], [ gl_PREREQ_STRNLEN - fi + ]) gl_STRING_MODULE_INDICATOR([strnlen]) gl_FUNC_STRSTR if test $REPLACE_STRSTR = 1; then @@ -804,80 +860,84 @@ AC_DEFUN([gl_INIT], fi gl_STRING_MODULE_INDICATOR([strstr]) gl_FUNC_STRTOK_R - if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then - AC_LIBOBJ([strtok_r]) + gl_CONDITIONAL([GL_COND_OBJ_STRTOK_R], + [test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1]) + AM_COND_IF([GL_COND_OBJ_STRTOK_R], [ gl_PREREQ_STRTOK_R - fi + ]) gl_STRING_MODULE_INDICATOR([strtok_r]) - gl_HEADER_SYS_RANDOM + gl_SYS_RANDOM_H + gl_SYS_RANDOM_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P - AC_REQUIRE([gl_HEADER_SYS_SELECT]) + gl_SYS_SELECT_H + gl_SYS_SELECT_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P - AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + gl_SYS_SOCKET_H + gl_SYS_SOCKET_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P - gl_HEADER_SYS_STAT_H + gl_SYS_STAT_H + gl_SYS_STAT_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P - gl_HEADER_SYS_TIME_H + gl_SYS_TIME_H + gl_SYS_TIME_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_SYS_TYPES_H + gl_SYS_TYPES_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P - gl_HEADER_SYS_UIO + gl_SYS_UIO_H + gl_SYS_UIO_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_SYS_WAIT_H + gl_SYS_WAIT_H_REQUIRE_DEFAULTS AC_PROG_MKDIR_P gl_FUNC_GEN_TEMPNAME gl_MODULE_INDICATOR([tempname]) AC_REQUIRE([gl_THREADLIB]) - gl_HEADER_TIME_H + gl_TIME_H + gl_TIME_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_TIME_R - if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then - AC_LIBOBJ([time_r]) + gl_CONDITIONAL([GL_COND_OBJ_TIME_R], + [test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1]) + AM_COND_IF([GL_COND_OBJ_TIME_R], [ gl_PREREQ_TIME_R - fi + ]) gl_TIME_MODULE_INDICATOR([time_r]) gl_UNISTD_H + gl_UNISTD_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_UNISTD_SAFER gl_FUNC_UNSETENV - if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then - AC_LIBOBJ([unsetenv]) + gl_CONDITIONAL([GL_COND_OBJ_UNSETENV], + [test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1]) + AM_COND_IF([GL_COND_OBJ_UNSETENV], [ gl_PREREQ_UNSETENV - fi + ]) gl_STDLIB_MODULE_INDICATOR([unsetenv]) + AC_C_VARARRAYS gl_WCHAR_H + gl_WCHAR_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P gl_WCTYPE_H + gl_WCTYPE_H_REQUIRE_DEFAULTS + AC_PROG_MKDIR_P AC_REQUIRE([AC_CANONICAL_HOST]) - case "$host_os" in - mingw*) - AC_LIBOBJ([windows-mutex]) - ;; - esac + gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_MUTEX], + [case "$host_os" in mingw*) true;; *) false;; esac]) AC_REQUIRE([AC_CANONICAL_HOST]) - case "$host_os" in - mingw*) - AC_LIBOBJ([windows-once]) - ;; - esac + gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_ONCE], + [case "$host_os" in mingw*) true;; *) false;; esac]) AC_REQUIRE([AC_CANONICAL_HOST]) - case "$host_os" in - mingw*) - AC_LIBOBJ([windows-recmutex]) - ;; - esac + gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_RECMUTEX], + [case "$host_os" in mingw*) true;; *) false;; esac]) AC_REQUIRE([AC_CANONICAL_HOST]) - case "$host_os" in - mingw*) - AC_LIBOBJ([windows-rwlock]) - ;; - esac + gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_RWLOCK], + [case "$host_os" in mingw*) true;; *) false;; esac]) gl_FUNC_WMEMCHR - if test $HAVE_WMEMCHR = 0; then - AC_LIBOBJ([wmemchr]) - fi + gl_CONDITIONAL([GL_COND_OBJ_WMEMCHR], [test $HAVE_WMEMCHR = 0]) gl_WCHAR_MODULE_INDICATOR([wmemchr]) gl_FUNC_WMEMPCPY - if test $HAVE_WMEMPCPY = 0; then - AC_LIBOBJ([wmempcpy]) - fi + gl_CONDITIONAL([GL_COND_OBJ_WMEMPCPY], [test $HAVE_WMEMPCPY = 0]) gl_WCHAR_MODULE_INDICATOR([wmempcpy]) # End of code from modules m4_ifval(gl_LIBSOURCES_LIST, [ @@ -891,6 +951,8 @@ AC_DEFUN([gl_INIT], m4_if(m4_sysval, [0], [], [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) ]) + m4_popdef([GL_MODULE_INDICATOR_PREFIX]) + m4_popdef([GL_MACRO_PREFIX]) m4_popdef([gl_LIBSOURCES_DIR]) m4_popdef([gl_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) @@ -899,16 +961,28 @@ AC_DEFUN([gl_INIT], AC_CONFIG_COMMANDS_PRE([ gl_libobjs= gl_ltlibobjs= + gl_libobjdeps= if test -n "$gl_LIBOBJS"; then # Remove the extension. +changequote(,)dnl sed_drop_objext='s/\.o$//;s/\.obj$//' + sed_dirname1='s,//*,/,g' + sed_dirname2='s,\(.\)/$,\1,' + sed_dirname3='s,^[^/]*$,.,' + sed_dirname4='s,\(.\)/[^/]*$,\1,' + sed_basename1='s,.*/,,' +changequote([, ])dnl for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do gl_libobjs="$gl_libobjs $i.$ac_objext" gl_ltlibobjs="$gl_ltlibobjs $i.lo" + i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"` + i_base=`echo "$i" | sed -e "$sed_basename1"` + gl_libobjdeps="$gl_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Po" done fi AC_SUBST([gl_LIBOBJS], [$gl_libobjs]) AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs]) + AC_SUBST([gl_LIBOBJDEPS], [$gl_libobjdeps]) ]) gltests_libdeps= gltests_ltlibdeps= @@ -917,8 +991,11 @@ AC_DEFUN([gl_INIT], m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES])) m4_pushdef([gltests_LIBSOURCES_LIST], []) m4_pushdef([gltests_LIBSOURCES_DIR], []) + m4_pushdef([GL_MACRO_PREFIX], [gltests]) + m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL]) gl_COMMON gl_source_base='tests' + gl_source_base_prefix= changequote(,)dnl gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS changequote([, ])dnl @@ -937,6 +1014,8 @@ changequote([, ])dnl m4_if(m4_sysval, [0], [], [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])]) ]) + m4_popdef([GL_MODULE_INDICATOR_PREFIX]) + m4_popdef([GL_MACRO_PREFIX]) m4_popdef([gltests_LIBSOURCES_DIR]) m4_popdef([gltests_LIBSOURCES_LIST]) m4_popdef([AC_LIBSOURCES]) @@ -945,17 +1024,30 @@ changequote([, ])dnl AC_CONFIG_COMMANDS_PRE([ gltests_libobjs= gltests_ltlibobjs= + gltests_libobjdeps= if test -n "$gltests_LIBOBJS"; then # Remove the extension. +changequote(,)dnl sed_drop_objext='s/\.o$//;s/\.obj$//' + sed_dirname1='s,//*,/,g' + sed_dirname2='s,\(.\)/$,\1,' + sed_dirname3='s,^[^/]*$,.,' + sed_dirname4='s,\(.\)/[^/]*$,\1,' + sed_basename1='s,.*/,,' +changequote([, ])dnl for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do gltests_libobjs="$gltests_libobjs $i.$ac_objext" gltests_ltlibobjs="$gltests_ltlibobjs $i.lo" + i_dir=`echo "$i" | sed -e "$sed_dirname1" -e "$sed_dirname2" -e "$sed_dirname3" -e "$sed_dirname4"` + i_base=`echo "$i" | sed -e "$sed_basename1"` + gltests_libobjdeps="$gltests_libobjdeps $i_dir/\$(DEPDIR)/$i_base.Po" done fi AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs]) AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs]) + AC_SUBST([gltests_LIBOBJDEPS], [$gltests_libobjdeps]) ]) + AC_REQUIRE([gl_CC_GNULIB_WARNINGS]) LIBGNU_LIBDEPS="$gl_libdeps" AC_SUBST([LIBGNU_LIBDEPS]) LIBGNU_LTLIBDEPS="$gl_ltlibdeps" @@ -1211,6 +1303,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/stdbool.in.h lib/stddef.in.h lib/stdint.in.h + lib/stdio-read.c + lib/stdio-write.c lib/stdio.in.h lib/stdlib.in.h lib/str-two-way.h @@ -1281,7 +1375,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/close.m4 m4/closedir.m4 m4/codeset.m4 - m4/ctype.m4 + m4/ctype_h.m4 m4/d-ino.m4 m4/d-type.m4 m4/dirent_h.m4 @@ -1427,6 +1521,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/time_r.m4 m4/unistd-safer.m4 m4/unistd_h.m4 + m4/vararrays.m4 m4/visibility.m4 m4/warn-on-use.m4 m4/wchar_h.m4 @@ -1435,5 +1530,6 @@ AC_DEFUN([gl_FILE_LIST], [ m4/wint_t.m4 m4/wmemchr.m4 m4/wmempcpy.m4 + m4/year2038.m4 m4/zzgnulib.m4 ]) diff --git a/gnulib/import/m4/gnulib-tool.m4 b/gnulib/import/m4/gnulib-tool.m4 index 3d56d83..8428901 100644 --- a/gnulib/import/m4/gnulib-tool.m4 +++ b/gnulib/import/m4/gnulib-tool.m4 @@ -1,5 +1,5 @@ -# gnulib-tool.m4 serial 2 -dnl Copyright (C) 2004-2005, 2009-2021 Free Software Foundation, Inc. +# gnulib-tool.m4 serial 4 +dnl Copyright (C) 2004-2005, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -44,6 +44,12 @@ AC_DEFUN([gl_LGPL], []) dnl Usage: gl_MAKEFILE_NAME([FILENAME]) AC_DEFUN([gl_MAKEFILE_NAME], []) +dnl Usage: gl_TESTS_MAKEFILE_NAME([FILENAME]) +AC_DEFUN([gl_TESTS_MAKEFILE_NAME], []) + +dnl Usage: gl_AUTOMAKE_SUBDIR +AC_DEFUN([gl_AUTOMAKE_SUBDIR], []) + dnl Usage: gl_LIBTOOL AC_DEFUN([gl_LIBTOOL], []) diff --git a/gnulib/import/m4/include_next.m4 b/gnulib/import/m4/include_next.m4 index bdd542b..a9247f6 100644 --- a/gnulib/import/m4/include_next.m4 +++ b/gnulib/import/m4/include_next.m4 @@ -1,5 +1,5 @@ # include_next.m4 serial 26 -dnl Copyright (C) 2006-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -193,9 +193,9 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL], if test AS_VAR_GET([gl_header_exists]) = yes; then AS_VAR_POPDEF([gl_header_exists]) ]) - gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME) - AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME)) - AS_VAR_SET([gl_next_header], ['"'$gl_header'"']) + gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME) + AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME)) + AS_VAR_SET([gl_next_header], ['"'$gl_header'"']) m4_if([$2], [check], [else AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) diff --git a/gnulib/import/m4/inet_ntop.m4 b/gnulib/import/m4/inet_ntop.m4 index 171f53e..c335cae 100644 --- a/gnulib/import/m4/inet_ntop.m4 +++ b/gnulib/import/m4/inet_ntop.m4 @@ -1,5 +1,5 @@ # inet_ntop.m4 serial 21 -dnl Copyright (C) 2005-2006, 2008-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2006, 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/inttypes.m4 b/gnulib/import/m4/inttypes.m4 index f56e94a..df25a21 100644 --- a/gnulib/import/m4/inttypes.m4 +++ b/gnulib/import/m4/inttypes.m4 @@ -1,5 +1,5 @@ -# inttypes.m4 serial 32 -dnl Copyright (C) 2006-2021 Free Software Foundation, Inc. +# inttypes.m4 serial 36 +dnl Copyright (C) 2006-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Derek Price, Bruno Haible. dnl Test whether is supported or must be substituted. -AC_DEFUN([gl_INTTYPES_H], +AC_DEFUN_ONCE([gl_INTTYPES_H], [ AC_REQUIRE([gl_INTTYPES_INCOMPLETE]) gl_INTTYPES_PRI_SCN @@ -36,7 +36,7 @@ AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE], AC_DEFUN([gl_INTTYPES_PRI_SCN], [ PRIPTR_PREFIX= - if test -n "$STDINT_H"; then + if $GL_GENERATE_STDINT_H; then dnl Using the gnulib . It defines intptr_t to 'long' or dnl 'long long', depending on _WIN64. AC_COMPILE_IFELSE( @@ -136,19 +136,34 @@ AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION], AC_SUBST([$1]) ]) +# gl_INTTYPES_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_INTTYPES_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_INTTYPES_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$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_INTTYPES_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_INTTYPES_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_IMAXABS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_IMAXDIV]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOIMAX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOUMAX]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_INTTYPES_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_INTTYPES_H_DEFAULTS]) +]) + AC_DEFUN([gl_INTTYPES_H_DEFAULTS], [ - GNULIB_IMAXABS=0; AC_SUBST([GNULIB_IMAXABS]) - GNULIB_IMAXDIV=0; AC_SUBST([GNULIB_IMAXDIV]) - GNULIB_STRTOIMAX=0; AC_SUBST([GNULIB_STRTOIMAX]) - GNULIB_STRTOUMAX=0; AC_SUBST([GNULIB_STRTOUMAX]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_IMAXABS=1; AC_SUBST([HAVE_DECL_IMAXABS]) HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV]) diff --git a/gnulib/import/m4/isblank.m4 b/gnulib/import/m4/isblank.m4 index e77e1a8..1d0ed6c 100644 --- a/gnulib/import/m4/isblank.m4 +++ b/gnulib/import/m4/isblank.m4 @@ -1,5 +1,5 @@ # isblank.m4 serial 3 -dnl Copyright (C) 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/isnand.m4 b/gnulib/import/m4/isnand.m4 index fc79f0b..4eadde7 100644 --- a/gnulib/import/m4/isnand.m4 +++ b/gnulib/import/m4/isnand.m4 @@ -1,5 +1,5 @@ # isnand.m4 serial 12 -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/isnanl.m4 b/gnulib/import/m4/isnanl.m4 index 1ef16f5..fa49a64 100644 --- a/gnulib/import/m4/isnanl.m4 +++ b/gnulib/import/m4/isnanl.m4 @@ -1,5 +1,5 @@ # isnanl.m4 serial 22 -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/largefile.m4 b/gnulib/import/m4/largefile.m4 index cadb16d..3e8b5e3 100644 --- a/gnulib/import/m4/largefile.m4 +++ b/gnulib/import/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-2021 Free Software Foundation, Inc. +# Copyright 1992-1996, 1998-2022 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. @@ -22,7 +22,8 @@ AC_DEFUN([gl_SET_LARGEFILE_SOURCE], esac ]) -# The following implementation works around a problem in autoconf <= 2.69; +# Work around a problem in Autoconf through at least 2.71 on glibc 2.34+ +# with _TIME_BITS. Also, work around a problem in autoconf <= 2.69: # AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5, # or configures them incorrectly in some cases. m4_version_prereq([2.70], [], [ @@ -40,6 +41,7 @@ m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]];[]dnl ]) +])# m4_version_prereq 2.70 # _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, @@ -54,7 +56,8 @@ m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE], [AC_LANG_PROGRAM([$5], [$6])], [$3=no; break]) m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( - [AC_LANG_PROGRAM([#define $1 $2 + [AC_LANG_PROGRAM([#undef $1 +#define $1 $2 $5], [$6])], [$3=$2; break]) $3=unknown @@ -80,9 +83,8 @@ rm -rf conftest*[]dnl AC_DEFUN([AC_SYS_LARGEFILE], [AC_ARG_ENABLE(largefile, [ --disable-largefile omit support for large files]) -if test "$enable_largefile" != no; then - - AC_CACHE_CHECK([for special C compiler options needed for large files], +AS_IF([test "$enable_largefile" != no], + [AC_CACHE_CHECK([for special C compiler options needed for large files], ac_cv_sys_largefile_CC, [ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then @@ -107,15 +109,15 @@ if test "$enable_largefile" != no; then ac_cv_sys_file_offset_bits, [Number of bits in a file offset, on hosts where this is settable.], [_AC_SYS_LARGEFILE_TEST_INCLUDES]) - if test $ac_cv_sys_file_offset_bits = unknown; then - _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, - ac_cv_sys_large_files, - [Define for large files, on AIX-style hosts.], - [_AC_SYS_LARGEFILE_TEST_INCLUDES]) - fi -fi + AS_CASE([$ac_cv_sys_file_offset_bits], + [unknown], + [_AC_SYS_LARGEFILE_MACRO_VALUE([_LARGE_FILES], [1], + [ac_cv_sys_large_files], + [Define for large files, on AIX-style hosts.], + [_AC_SYS_LARGEFILE_TEST_INCLUDES])], + [64], + [gl_YEAR2038_BODY([])])]) ])# AC_SYS_LARGEFILE -])# m4_version_prereq 2.70 # Enable large files on systems where this is implemented by Gnulib, not by the # system headers. diff --git a/gnulib/import/m4/limits-h.m4 b/gnulib/import/m4/limits-h.m4 index 70dbb7d..5d5a5bf 100644 --- a/gnulib/import/m4/limits-h.m4 +++ b/gnulib/import/m4/limits-h.m4 @@ -1,6 +1,6 @@ dnl Check whether limits.h has needed features. -dnl Copyright 2016-2021 Free Software Foundation, Inc. +dnl Copyright 2016-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,7 +11,7 @@ AC_DEFUN_ONCE([gl_LIMITS_H], [ gl_CHECK_NEXT_HEADERS([limits.h]) - AC_CACHE_CHECK([whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.], + AC_CACHE_CHECK([whether limits.h has WORD_BIT, BOOL_WIDTH etc.], [gl_cv_header_limits_width], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( @@ -22,22 +22,20 @@ AC_DEFUN_ONCE([gl_LIMITS_H], long long llm = LLONG_MAX; int wb = WORD_BIT; int ullw = ULLONG_WIDTH; + int bw = BOOL_WIDTH; ]])], [gl_cv_header_limits_width=yes], [gl_cv_header_limits_width=no])]) if test "$gl_cv_header_limits_width" = yes; then - LIMITS_H= + GL_GENERATE_LIMITS_H=false else - LIMITS_H=limits.h + GL_GENERATE_LIMITS_H=true fi - AC_SUBST([LIMITS_H]) - AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) ]) dnl Unconditionally enables the replacement of . AC_DEFUN([gl_REPLACE_LIMITS_H], [ AC_REQUIRE([gl_LIMITS_H]) - LIMITS_H='limits.h' - AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) + GL_GENERATE_LIMITS_H=true ]) diff --git a/gnulib/import/m4/localcharset.m4 b/gnulib/import/m4/localcharset.m4 index 04389fc..f5dbbd4 100644 --- a/gnulib/import/m4/localcharset.m4 +++ b/gnulib/import/m4/localcharset.m4 @@ -1,5 +1,5 @@ # localcharset.m4 serial 8 -dnl Copyright (C) 2002, 2004, 2006, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004, 2006, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/locale-fr.m4 b/gnulib/import/m4/locale-fr.m4 index b61df7e..3753891 100644 --- a/gnulib/import/m4/locale-fr.m4 +++ b/gnulib/import/m4/locale-fr.m4 @@ -1,5 +1,5 @@ # locale-fr.m4 serial 20 -dnl Copyright (C) 2003, 2005-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/locale-ja.m4 b/gnulib/import/m4/locale-ja.m4 index cd94288..73a5d1a 100644 --- a/gnulib/import/m4/locale-ja.m4 +++ b/gnulib/import/m4/locale-ja.m4 @@ -1,5 +1,5 @@ # locale-ja.m4 serial 15 -dnl Copyright (C) 2003, 2005-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/locale-zh.m4 b/gnulib/import/m4/locale-zh.m4 index 1228be8..c997971 100644 --- a/gnulib/import/m4/locale-zh.m4 +++ b/gnulib/import/m4/locale-zh.m4 @@ -1,5 +1,5 @@ # locale-zh.m4 serial 15 -dnl Copyright (C) 2003, 2005-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/locale_h.m4 b/gnulib/import/m4/locale_h.m4 index a95379a..ca5d0d0 100644 --- a/gnulib/import/m4/locale_h.m4 +++ b/gnulib/import/m4/locale_h.m4 @@ -1,13 +1,13 @@ -# locale_h.m4 serial 24 -dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. +# locale_h.m4 serial 28 +dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN([gl_LOCALE_H], +AC_DEFUN_ONCE([gl_LOCALE_H], [ - dnl Use AC_REQUIRE here, so that the default behavior below is expanded - dnl once only, before all statements that occur in other macros. + dnl Ensure to expand the default settings once only, before all statements + dnl that occur in other macros. AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) dnl Persuade glibc to define locale_t and the int_p_*, int_n_* @@ -129,22 +129,37 @@ AC_DEFUN([gl_LOCALE_T], AC_SUBST([HAVE_XLOCALE_H]) ]) +# gl_LOCALE_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_LOCALE_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_LOCALE_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_LOCALE_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALECONV]) + 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]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) +]) + AC_DEFUN([gl_LOCALE_H_DEFAULTS], [ - GNULIB_LOCALECONV=0; AC_SUBST([GNULIB_LOCALECONV]) - GNULIB_SETLOCALE=0; AC_SUBST([GNULIB_SETLOCALE]) - GNULIB_SETLOCALE_NULL=0; AC_SUBST([GNULIB_SETLOCALE_NULL]) - GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE]) - GNULIB_LOCALENAME=0; AC_SUBST([GNULIB_LOCALENAME]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_NEWLOCALE=1; AC_SUBST([HAVE_NEWLOCALE]) HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE]) @@ -155,4 +170,5 @@ AC_DEFUN([gl_LOCALE_H_DEFAULTS], REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE]) REPLACE_FREELOCALE=0; AC_SUBST([REPLACE_FREELOCALE]) REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV]) + LOCALENAME_ENHANCE_LOCALE_FUNCS=0; AC_SUBST([LOCALENAME_ENHANCE_LOCALE_FUNCS]) ]) diff --git a/gnulib/import/m4/lock.m4 b/gnulib/import/m4/lock.m4 index d68c12d..c4cbf07 100644 --- a/gnulib/import/m4/lock.m4 +++ b/gnulib/import/m4/lock.m4 @@ -1,5 +1,5 @@ # lock.m4 serial 14 -dnl Copyright (C) 2005-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/lstat.m4 b/gnulib/import/m4/lstat.m4 index 62e9db2..d987060 100644 --- a/gnulib/import/m4/lstat.m4 +++ b/gnulib/import/m4/lstat.m4 @@ -1,6 +1,6 @@ # serial 33 -# Copyright (C) 1997-2001, 2003-2021 Free Software Foundation, Inc. +# Copyright (C) 1997-2001, 2003-2022 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/gnulib/import/m4/malloc.m4 b/gnulib/import/m4/malloc.m4 index 514d19a..6b76c1e 100644 --- a/gnulib/import/m4/malloc.m4 +++ b/gnulib/import/m4/malloc.m4 @@ -1,21 +1,21 @@ -# malloc.m4 serial 21 -dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. +# malloc.m4 serial 28 +dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # This is adapted with modifications from upstream Autoconf here: -# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c +# https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/functions.m4?id=v2.70#n949 AC_DEFUN([_AC_FUNC_MALLOC_IF], [ AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles - AC_CACHE_CHECK([for GNU libc compatible malloc], + AC_CACHE_CHECK([whether malloc (0) returns nonnull], [ac_cv_func_malloc_0_nonnull], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include ]], - [[char *p = malloc (0); + [[void *p = malloc (0); int result = !p; free (p); return result;]]) @@ -24,75 +24,152 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF], [ac_cv_func_malloc_0_nonnull=no], [case "$host_os" in # Guess yes on platforms where we know the result. - *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \ - | hpux* | solaris* | cygwin* | mingw*) + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | gnu* | *-musl* | midnightbsd* \ + | hpux* | solaris* | cygwin* | mingw* | 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" ;; esac ]) ]) - case "$ac_cv_func_malloc_0_nonnull" in - *yes) - $1 - ;; - *) - $2 - ;; - esac + AS_CASE([$ac_cv_func_malloc_0_nonnull], [*yes], [$1], [$2]) ])# _AC_FUNC_MALLOC_IF # gl_FUNC_MALLOC_GNU # ------------------ -# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if -# it is not. +# Replace malloc if it is not compatible with GNU libc. AC_DEFUN([gl_FUNC_MALLOC_GNU], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - dnl _AC_FUNC_MALLOC_IF is defined in Autoconf. - _AC_FUNC_MALLOC_IF( - [AC_DEFINE([HAVE_MALLOC_GNU], [1], - [Define to 1 if your system has a GNU libc compatible 'malloc' - function, and to 0 otherwise.])], - [AC_DEFINE([HAVE_MALLOC_GNU], [0]) - REPLACE_MALLOC=1 + AC_REQUIRE([gl_FUNC_MALLOC_POSIX]) + REPLACE_MALLOC_FOR_MALLOC_GNU="$REPLACE_MALLOC_FOR_MALLOC_POSIX" + if test $REPLACE_MALLOC_FOR_MALLOC_GNU = 0; then + _AC_FUNC_MALLOC_IF([], [REPLACE_MALLOC_FOR_MALLOC_GNU=1]) + fi +]) + +# gl_FUNC_MALLOC_PTRDIFF +# ---------------------- +# Test whether malloc (N) reliably fails when N exceeds PTRDIFF_MAX, +# and replace malloc otherwise. +AC_DEFUN([gl_FUNC_MALLOC_PTRDIFF], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([gl_CHECK_MALLOC_PTRDIFF]) + test "$gl_cv_malloc_ptrdiff" = yes || REPLACE_MALLOC_FOR_MALLOC_POSIX=1 +]) + +# Test whether malloc, realloc, calloc refuse to create objects +# larger than what can be expressed in ptrdiff_t. +# Set gl_cv_func_malloc_gnu to yes or no accordingly. +AC_DEFUN([gl_CHECK_MALLOC_PTRDIFF], +[ + AC_CACHE_CHECK([whether malloc is ptrdiff_t safe], + [gl_cv_malloc_ptrdiff], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[/* 64-bit ptrdiff_t is so wide that no practical platform + can exceed it. */ + #define WIDE_PTRDIFF (PTRDIFF_MAX >> 31 >> 31 != 0) + + /* On rare machines where size_t fits in ptrdiff_t there + is no problem. */ + #define NARROW_SIZE (SIZE_MAX <= PTRDIFF_MAX) + + /* glibc 2.30 and later malloc refuses to exceed ptrdiff_t + bounds even on 32-bit platforms. We don't know which + non-glibc systems are safe. */ + #define KNOWN_SAFE (2 < __GLIBC__ + (30 <= __GLIBC_MINOR__)) + + #if WIDE_PTRDIFF || NARROW_SIZE || KNOWN_SAFE + return 0; + #else + #error "malloc might not be ptrdiff_t safe" + syntax error + #endif + ]])], + [gl_cv_malloc_ptrdiff=yes], + [gl_cv_malloc_ptrdiff=no]) ]) ]) # gl_FUNC_MALLOC_POSIX # -------------------- # Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it -# fails), and replace malloc if it is not. +# fails, and doesn't mess up with ptrdiff_t overflow), and replace +# malloc if it is not. AC_DEFUN([gl_FUNC_MALLOC_POSIX], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_MALLOC_PTRDIFF]) AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) - if test $gl_cv_func_malloc_posix = yes; then + if test "$gl_cv_func_malloc_posix" = yes; then AC_DEFINE([HAVE_MALLOC_POSIX], [1], - [Define if the 'malloc' function is POSIX compliant.]) + [Define if malloc, realloc, and calloc set errno on allocation failure.]) else - REPLACE_MALLOC=1 + REPLACE_MALLOC_FOR_MALLOC_POSIX=1 fi ]) -# Test whether malloc, realloc, calloc are POSIX compliant, +# Test whether malloc, realloc, calloc set errno to ENOMEM on failure. # Set gl_cv_func_malloc_posix to yes or no accordingly. AC_DEFUN([gl_CHECK_MALLOC_POSIX], [ - AC_CACHE_CHECK([whether malloc, realloc, calloc are POSIX compliant], + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CACHE_CHECK([whether malloc, realloc, calloc set errno on failure], [gl_cv_func_malloc_posix], [ dnl It is too dangerous to try to allocate a large amount of memory: dnl some systems go to their knees when you do that. So assume that - dnl all Unix implementations of the function are POSIX compliant. - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[]], - [[#if defined _WIN32 && ! defined __CYGWIN__ - choke me - #endif - ]])], - [gl_cv_func_malloc_posix=yes], - [gl_cv_func_malloc_posix=no]) + dnl all Unix implementations of the function set errno on failure, + 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*) + gl_cv_func_malloc_posix=no ;; + irix* | solaris*) + dnl On IRIX 6.5, the three functions return NULL with errno unset + dnl when the argument is larger than PTRDIFF_MAX. + dnl On Solaris 11.3, the three functions return NULL with errno set + dnl to EAGAIN, not ENOMEM, when the argument is larger than + dnl PTRDIFF_MAX. + dnl Here is a test program: +m4_divert_push([KILL]) +#include +#include +#include +#define ptrdiff_t long +#ifndef PTRDIFF_MAX +# define PTRDIFF_MAX ((ptrdiff_t) ((1UL << (8 * sizeof (ptrdiff_t) - 1)) - 1)) +#endif + +int main () +{ + void *p; + + fprintf (stderr, "PTRDIFF_MAX = %lu\n", (unsigned long) PTRDIFF_MAX); + + errno = 0; + p = malloc ((unsigned long) PTRDIFF_MAX + 1); + fprintf (stderr, "p=%p errno=%d\n", p, errno); + + errno = 0; + p = calloc (PTRDIFF_MAX / 2 + 1, 2); + fprintf (stderr, "p=%p errno=%d\n", p, errno); + + errno = 0; + p = realloc (NULL, (unsigned long) PTRDIFF_MAX + 1); + fprintf (stderr, "p=%p errno=%d\n", p, errno); + + return 0; +} +m4_divert_pop([KILL]) + gl_cv_func_malloc_posix=no ;; + *) + gl_cv_func_malloc_posix=yes ;; + esac ]) ]) diff --git a/gnulib/import/m4/malloca.m4 b/gnulib/import/m4/malloca.m4 index 06ed2c6..77eb96a 100644 --- a/gnulib/import/m4/malloca.m4 +++ b/gnulib/import/m4/malloca.m4 @@ -1,5 +1,5 @@ # malloca.m4 serial 2 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2021 Free Software Foundation, +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2022 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/gnulib/import/m4/math_h.m4 b/gnulib/import/m4/math_h.m4 index a9ba5e6..a08526a 100644 --- a/gnulib/import/m4/math_h.m4 +++ b/gnulib/import/m4/math_h.m4 @@ -1,10 +1,10 @@ -# math_h.m4 serial 122 -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +# math_h.m4 serial 125 +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN([gl_MATH_H], +AC_DEFUN_ONCE([gl_MATH_H], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([math.h]) @@ -53,119 +53,134 @@ AC_DEFUN([gl_MATH_H], tanf tanl tanhf trunc truncf truncl]) ]) +# gl_MATH_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_MATH_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_MATH_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_MATH_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_MATH_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATAN2F]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEIL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSHF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2F]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2L]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1F]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1L]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOOR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMA]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMOD]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGB]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISFINITE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAND]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10F]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10L]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1P]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2F]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2L]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGB]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POWF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDER]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUND]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINHF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANHF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNC]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCL]) + dnl Support Microsoft deprecated alias function names by default. + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J0], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J1], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_JN], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y0], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y1], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_YN], [1]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_MATH_H_DEFAULTS]) +]) + AC_DEFUN([gl_MATH_H_DEFAULTS], [ - GNULIB_ACOSF=0; AC_SUBST([GNULIB_ACOSF]) - GNULIB_ACOSL=0; AC_SUBST([GNULIB_ACOSL]) - GNULIB_ASINF=0; AC_SUBST([GNULIB_ASINF]) - GNULIB_ASINL=0; AC_SUBST([GNULIB_ASINL]) - GNULIB_ATANF=0; AC_SUBST([GNULIB_ATANF]) - GNULIB_ATANL=0; AC_SUBST([GNULIB_ATANL]) - GNULIB_ATAN2F=0; AC_SUBST([GNULIB_ATAN2F]) - GNULIB_CBRT=0; AC_SUBST([GNULIB_CBRT]) - GNULIB_CBRTF=0; AC_SUBST([GNULIB_CBRTF]) - GNULIB_CBRTL=0; AC_SUBST([GNULIB_CBRTL]) - GNULIB_CEIL=0; AC_SUBST([GNULIB_CEIL]) - GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF]) - GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL]) - GNULIB_COPYSIGN=0; AC_SUBST([GNULIB_COPYSIGN]) - GNULIB_COPYSIGNF=0; AC_SUBST([GNULIB_COPYSIGNF]) - GNULIB_COPYSIGNL=0; AC_SUBST([GNULIB_COPYSIGNL]) - GNULIB_COSF=0; AC_SUBST([GNULIB_COSF]) - GNULIB_COSL=0; AC_SUBST([GNULIB_COSL]) - GNULIB_COSHF=0; AC_SUBST([GNULIB_COSHF]) - GNULIB_EXPF=0; AC_SUBST([GNULIB_EXPF]) - GNULIB_EXPL=0; AC_SUBST([GNULIB_EXPL]) - GNULIB_EXP2=0; AC_SUBST([GNULIB_EXP2]) - GNULIB_EXP2F=0; AC_SUBST([GNULIB_EXP2F]) - GNULIB_EXP2L=0; AC_SUBST([GNULIB_EXP2L]) - GNULIB_EXPM1=0; AC_SUBST([GNULIB_EXPM1]) - GNULIB_EXPM1F=0; AC_SUBST([GNULIB_EXPM1F]) - GNULIB_EXPM1L=0; AC_SUBST([GNULIB_EXPM1L]) - GNULIB_FABSF=0; AC_SUBST([GNULIB_FABSF]) - GNULIB_FABSL=0; AC_SUBST([GNULIB_FABSL]) - GNULIB_FLOOR=0; AC_SUBST([GNULIB_FLOOR]) - GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF]) - GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL]) - GNULIB_FMA=0; AC_SUBST([GNULIB_FMA]) - GNULIB_FMAF=0; AC_SUBST([GNULIB_FMAF]) - GNULIB_FMAL=0; AC_SUBST([GNULIB_FMAL]) - GNULIB_FMOD=0; AC_SUBST([GNULIB_FMOD]) - GNULIB_FMODF=0; AC_SUBST([GNULIB_FMODF]) - GNULIB_FMODL=0; AC_SUBST([GNULIB_FMODL]) - GNULIB_FREXPF=0; AC_SUBST([GNULIB_FREXPF]) - GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP]) - GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL]) - GNULIB_HYPOT=0; AC_SUBST([GNULIB_HYPOT]) - GNULIB_HYPOTF=0; AC_SUBST([GNULIB_HYPOTF]) - GNULIB_HYPOTL=0; AC_SUBST([GNULIB_HYPOTL]) - GNULIB_ILOGB=0; AC_SUBST([GNULIB_ILOGB]) - GNULIB_ILOGBF=0; AC_SUBST([GNULIB_ILOGBF]) - GNULIB_ILOGBL=0; AC_SUBST([GNULIB_ILOGBL]) - GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE]) - GNULIB_ISINF=0; AC_SUBST([GNULIB_ISINF]) - GNULIB_ISNAN=0; AC_SUBST([GNULIB_ISNAN]) - GNULIB_ISNANF=0; AC_SUBST([GNULIB_ISNANF]) - GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND]) - GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL]) - GNULIB_LDEXPF=0; AC_SUBST([GNULIB_LDEXPF]) - GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL]) - GNULIB_LOG=0; AC_SUBST([GNULIB_LOG]) - GNULIB_LOGF=0; AC_SUBST([GNULIB_LOGF]) - GNULIB_LOGL=0; AC_SUBST([GNULIB_LOGL]) - GNULIB_LOG10=0; AC_SUBST([GNULIB_LOG10]) - GNULIB_LOG10F=0; AC_SUBST([GNULIB_LOG10F]) - GNULIB_LOG10L=0; AC_SUBST([GNULIB_LOG10L]) - GNULIB_LOG1P=0; AC_SUBST([GNULIB_LOG1P]) - GNULIB_LOG1PF=0; AC_SUBST([GNULIB_LOG1PF]) - GNULIB_LOG1PL=0; AC_SUBST([GNULIB_LOG1PL]) - GNULIB_LOG2=0; AC_SUBST([GNULIB_LOG2]) - GNULIB_LOG2F=0; AC_SUBST([GNULIB_LOG2F]) - GNULIB_LOG2L=0; AC_SUBST([GNULIB_LOG2L]) - GNULIB_LOGB=0; AC_SUBST([GNULIB_LOGB]) - GNULIB_LOGBF=0; AC_SUBST([GNULIB_LOGBF]) - GNULIB_LOGBL=0; AC_SUBST([GNULIB_LOGBL]) - GNULIB_MODF=0; AC_SUBST([GNULIB_MODF]) - GNULIB_MODFF=0; AC_SUBST([GNULIB_MODFF]) - GNULIB_MODFL=0; AC_SUBST([GNULIB_MODFL]) - GNULIB_POWF=0; AC_SUBST([GNULIB_POWF]) - GNULIB_REMAINDER=0; AC_SUBST([GNULIB_REMAINDER]) - GNULIB_REMAINDERF=0; AC_SUBST([GNULIB_REMAINDERF]) - GNULIB_REMAINDERL=0; AC_SUBST([GNULIB_REMAINDERL]) - GNULIB_RINT=0; AC_SUBST([GNULIB_RINT]) - GNULIB_RINTF=0; AC_SUBST([GNULIB_RINTF]) - GNULIB_RINTL=0; AC_SUBST([GNULIB_RINTL]) - GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND]) - GNULIB_ROUNDF=0; AC_SUBST([GNULIB_ROUNDF]) - GNULIB_ROUNDL=0; AC_SUBST([GNULIB_ROUNDL]) - GNULIB_SIGNBIT=0; AC_SUBST([GNULIB_SIGNBIT]) - GNULIB_SINF=0; AC_SUBST([GNULIB_SINF]) - GNULIB_SINL=0; AC_SUBST([GNULIB_SINL]) - GNULIB_SINHF=0; AC_SUBST([GNULIB_SINHF]) - GNULIB_SQRTF=0; AC_SUBST([GNULIB_SQRTF]) - GNULIB_SQRTL=0; AC_SUBST([GNULIB_SQRTL]) - GNULIB_TANF=0; AC_SUBST([GNULIB_TANF]) - GNULIB_TANL=0; AC_SUBST([GNULIB_TANL]) - GNULIB_TANHF=0; AC_SUBST([GNULIB_TANHF]) - GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC]) - GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF]) - GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL]) - dnl Support Microsoft deprecated alias function names by default. - GNULIB_MDA_J0=1; AC_SUBST([GNULIB_MDA_J0]) - GNULIB_MDA_J1=1; AC_SUBST([GNULIB_MDA_J1]) - GNULIB_MDA_JN=1; AC_SUBST([GNULIB_MDA_JN]) - GNULIB_MDA_Y0=1; AC_SUBST([GNULIB_MDA_Y0]) - GNULIB_MDA_Y1=1; AC_SUBST([GNULIB_MDA_Y1]) - GNULIB_MDA_YN=1; AC_SUBST([GNULIB_MDA_YN]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF]) HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL]) diff --git a/gnulib/import/m4/mbrtowc.m4 b/gnulib/import/m4/mbrtowc.m4 index 1d4e73d..ec8716b 100644 --- a/gnulib/import/m4/mbrtowc.m4 +++ b/gnulib/import/m4/mbrtowc.m4 @@ -1,5 +1,5 @@ # mbrtowc.m4 serial 38 -*- coding: utf-8 -*- -dnl Copyright (C) 2001-2002, 2004-2005, 2008-2021 Free Software Foundation, +dnl Copyright (C) 2001-2002, 2004-2005, 2008-2022 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/gnulib/import/m4/mbsinit.m4 b/gnulib/import/m4/mbsinit.m4 index dc6e10d..ebd2d4f 100644 --- a/gnulib/import/m4/mbsinit.m4 +++ b/gnulib/import/m4/mbsinit.m4 @@ -1,5 +1,5 @@ # mbsinit.m4 serial 9 -dnl Copyright (C) 2008, 2010-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2010-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/mbsrtowcs.m4 b/gnulib/import/m4/mbsrtowcs.m4 index cf8e962..f672fa5 100644 --- a/gnulib/import/m4/mbsrtowcs.m4 +++ b/gnulib/import/m4/mbsrtowcs.m4 @@ -1,5 +1,5 @@ # mbsrtowcs.m4 serial 14 -dnl Copyright (C) 2008-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/mbstate_t.m4 b/gnulib/import/m4/mbstate_t.m4 index e7fe358..a6eba1b 100644 --- a/gnulib/import/m4/mbstate_t.m4 +++ b/gnulib/import/m4/mbstate_t.m4 @@ -1,5 +1,5 @@ # mbstate_t.m4 serial 14 -dnl Copyright (C) 2000-2002, 2008-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2000-2002, 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/mbtowc.m4 b/gnulib/import/m4/mbtowc.m4 index 7fc74c9..2827e83 100644 --- a/gnulib/import/m4/mbtowc.m4 +++ b/gnulib/import/m4/mbtowc.m4 @@ -1,5 +1,5 @@ # mbtowc.m4 serial 3 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/memchr.m4 b/gnulib/import/m4/memchr.m4 index 64470de..c7489d8 100644 --- a/gnulib/import/m4/memchr.m4 +++ b/gnulib/import/m4/memchr.m4 @@ -1,5 +1,5 @@ -# memchr.m4 serial 17 -dnl Copyright (C) 2002-2004, 2009-2021 Free Software Foundation, Inc. +# memchr.m4 serial 18 +dnl Copyright (C) 2002-2004, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], AC_CHECK_HEADERS_ONCE([sys/mman.h]) AC_CHECK_FUNCS_ONCE([mprotect]) - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) # Detect platform-specific bugs in some versions of glibc: # memchr should not dereference anything with length 0 # https://bugzilla.redhat.com/show_bug.cgi?id=499689 diff --git a/gnulib/import/m4/memmem.m4 b/gnulib/import/m4/memmem.m4 index e2a785f..e01aa5c 100644 --- a/gnulib/import/m4/memmem.m4 +++ b/gnulib/import/m4/memmem.m4 @@ -1,5 +1,5 @@ -# memmem.m4 serial 27 -dnl Copyright (C) 2002-2004, 2007-2021 Free Software Foundation, Inc. +# memmem.m4 serial 29 +dnl Copyright (C) 2002-2004, 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -10,7 +10,7 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE], dnl Persuade glibc to declare memmem(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_CHECK_FUNCS([memmem]) if test $ac_cv_func_memmem = yes; then HAVE_MEMMEM=1 @@ -50,6 +50,7 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE], dnl Assume that it works on all other platforms (even if not linear). AC_EGREP_CPP([Lucky user], [ +#include /* for __GNU_LIBRARY__ */ #ifdef __GNU_LIBRARY__ #include #if ((__GLIBC__ == 2 && ((__GLIBC_MINOR > 0 && __GLIBC_MINOR__ < 9) \ diff --git a/gnulib/import/m4/mempcpy.m4 b/gnulib/import/m4/mempcpy.m4 index c5ee2af..1107eb4 100644 --- a/gnulib/import/m4/mempcpy.m4 +++ b/gnulib/import/m4/mempcpy.m4 @@ -1,5 +1,5 @@ -# mempcpy.m4 serial 11 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2021 Free Software Foundation, +# mempcpy.m4 serial 12 +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2022 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, @@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_MEMPCPY], dnl The mempcpy() declaration in lib/string.in.h uses 'restrict'. AC_REQUIRE([AC_C_RESTRICT]) - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_CHECK_FUNCS([mempcpy]) if test $ac_cv_func_mempcpy = no; then HAVE_MEMPCPY=0 diff --git a/gnulib/import/m4/memrchr.m4 b/gnulib/import/m4/memrchr.m4 index d0c0589..ec5e208 100644 --- a/gnulib/import/m4/memrchr.m4 +++ b/gnulib/import/m4/memrchr.m4 @@ -1,5 +1,5 @@ -# memrchr.m4 serial 10 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2021 Free Software Foundation, +# memrchr.m4 serial 11 +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2022 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, @@ -10,7 +10,7 @@ AC_DEFUN([gl_FUNC_MEMRCHR], dnl Persuade glibc to declare memrchr(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_CHECK_DECLS_ONCE([memrchr]) if test $ac_cv_have_decl_memrchr = no; then HAVE_DECL_MEMRCHR=0 diff --git a/gnulib/import/m4/minmax.m4 b/gnulib/import/m4/minmax.m4 index e21a687..b976739 100644 --- a/gnulib/import/m4/minmax.m4 +++ b/gnulib/import/m4/minmax.m4 @@ -1,5 +1,5 @@ # minmax.m4 serial 4 -dnl Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/mkdir.m4 b/gnulib/import/m4/mkdir.m4 index 031fd29..8b78ce9 100644 --- a/gnulib/import/m4/mkdir.m4 +++ b/gnulib/import/m4/mkdir.m4 @@ -1,6 +1,6 @@ # serial 17 -# Copyright (C) 2001, 2003-2004, 2006, 2008-2021 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003-2004, 2006, 2008-2022 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/gnulib/import/m4/mkdtemp.m4 b/gnulib/import/m4/mkdtemp.m4 index 9f4816c..b616a9a 100644 --- a/gnulib/import/m4/mkdtemp.m4 +++ b/gnulib/import/m4/mkdtemp.m4 @@ -1,5 +1,5 @@ # mkdtemp.m4 serial 8 -dnl Copyright (C) 2001-2003, 2006-2007, 2009-2021 Free Software Foundation, +dnl Copyright (C) 2001-2003, 2006-2007, 2009-2022 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/gnulib/import/m4/mkostemp.m4 b/gnulib/import/m4/mkostemp.m4 index 46534d4..2176f37 100644 --- a/gnulib/import/m4/mkostemp.m4 +++ b/gnulib/import/m4/mkostemp.m4 @@ -1,5 +1,5 @@ # mkostemp.m4 serial 2 -dnl Copyright (C) 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/mmap-anon.m4 b/gnulib/import/m4/mmap-anon.m4 index 5a9f968..a4580ff 100644 --- a/gnulib/import/m4/mmap-anon.m4 +++ b/gnulib/import/m4/mmap-anon.m4 @@ -1,5 +1,5 @@ -# mmap-anon.m4 serial 11 -dnl Copyright (C) 2005, 2007, 2009-2021 Free Software Foundation, Inc. +# mmap-anon.m4 serial 12 +dnl Copyright (C) 2005, 2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ dnl with or without modifications, as long as this notice is preserved. # - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be # used. -AC_DEFUN([gl_FUNC_MMAP_ANON], +AC_DEFUN_ONCE([gl_FUNC_MMAP_ANON], [ dnl Persuade glibc to define MAP_ANONYMOUS. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) diff --git a/gnulib/import/m4/mode_t.m4 b/gnulib/import/m4/mode_t.m4 index 3bd4b89..e08d27a 100644 --- a/gnulib/import/m4/mode_t.m4 +++ b/gnulib/import/m4/mode_t.m4 @@ -1,5 +1,5 @@ # mode_t.m4 serial 2 -dnl Copyright (C) 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/msvc-inval.m4 b/gnulib/import/m4/msvc-inval.m4 index 3ba5b4e..b32cf6e 100644 --- a/gnulib/import/m4/msvc-inval.m4 +++ b/gnulib/import/m4/msvc-inval.m4 @@ -1,5 +1,5 @@ # msvc-inval.m4 serial 1 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/msvc-nothrow.m4 b/gnulib/import/m4/msvc-nothrow.m4 index aae25ce..16ceb1f 100644 --- a/gnulib/import/m4/msvc-nothrow.m4 +++ b/gnulib/import/m4/msvc-nothrow.m4 @@ -1,5 +1,5 @@ # msvc-nothrow.m4 serial 1 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/multiarch.m4 b/gnulib/import/m4/multiarch.m4 index f1678d9..5d94276 100644 --- a/gnulib/import/m4/multiarch.m4 +++ b/gnulib/import/m4/multiarch.m4 @@ -1,5 +1,5 @@ # multiarch.m4 serial 9 -dnl Copyright (C) 2008-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/netdb_h.m4 b/gnulib/import/m4/netdb_h.m4 index db84c78..d6a9d70 100644 --- a/gnulib/import/m4/netdb_h.m4 +++ b/gnulib/import/m4/netdb_h.m4 @@ -1,10 +1,10 @@ -# netdb_h.m4 serial 12 -dnl Copyright (C) 2008-2021 Free Software Foundation, Inc. +# netdb_h.m4 serial 15 +dnl Copyright (C) 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN([gl_HEADER_NETDB], +AC_DEFUN_ONCE([gl_NETDB_H], [ AC_REQUIRE([gl_NETDB_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([netdb.h]) @@ -21,18 +21,33 @@ AC_DEFUN([gl_HEADER_NETDB], [getaddrinfo freeaddrinfo gai_strerror getnameinfo]) ]) +# gl_NETDB_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_NETDB_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_NETDB_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_NETDB_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_NETDB_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_NETDB_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETADDRINFO]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_NETDB_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_NETDB_H_DEFAULTS]) +]) + AC_DEFUN([gl_NETDB_H_DEFAULTS], [ - GNULIB_GETADDRINFO=0; AC_SUBST([GNULIB_GETADDRINFO]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_STRUCT_ADDRINFO=1; AC_SUBST([HAVE_STRUCT_ADDRINFO]) HAVE_DECL_FREEADDRINFO=1; AC_SUBST([HAVE_DECL_FREEADDRINFO]) diff --git a/gnulib/import/m4/netinet_in_h.m4 b/gnulib/import/m4/netinet_in_h.m4 index c555596..de26fe8 100644 --- a/gnulib/import/m4/netinet_in_h.m4 +++ b/gnulib/import/m4/netinet_in_h.m4 @@ -1,5 +1,5 @@ -# netinet_in_h.m4 serial 5 -dnl Copyright (C) 2006-2021 Free Software Foundation, Inc. +# netinet_in_h.m4 serial 6 +dnl Copyright (C) 2006-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,9 +14,9 @@ AC_DEFUN([gl_HEADER_NETINET_IN], [gl_cv_header_netinet_in_h_selfcontained=no]) ]) if test $gl_cv_header_netinet_in_h_selfcontained = yes; then - NETINET_IN_H='' + GL_GENERATE_NETINET_IN_H=false else - NETINET_IN_H='netinet/in.h' + GL_GENERATE_NETINET_IN_H=true AC_CHECK_HEADERS([netinet/in.h]) gl_CHECK_NEXT_HEADERS([netinet/in.h]) if test $ac_cv_header_netinet_in_h = yes; then @@ -26,6 +26,4 @@ AC_DEFUN([gl_HEADER_NETINET_IN], fi AC_SUBST([HAVE_NETINET_IN_H]) fi - AC_SUBST([NETINET_IN_H]) - AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"]) ]) diff --git a/gnulib/import/m4/nocrash.m4 b/gnulib/import/m4/nocrash.m4 index 27412cd..91f00c1 100644 --- a/gnulib/import/m4/nocrash.m4 +++ b/gnulib/import/m4/nocrash.m4 @@ -1,5 +1,5 @@ # nocrash.m4 serial 5 -dnl Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/off_t.m4 b/gnulib/import/m4/off_t.m4 index bdec43c..0890ada 100644 --- a/gnulib/import/m4/off_t.m4 +++ b/gnulib/import/m4/off_t.m4 @@ -1,5 +1,5 @@ # off_t.m4 serial 1 -dnl Copyright (C) 2012-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/open-cloexec.m4 b/gnulib/import/m4/open-cloexec.m4 index 542a90f..16cd5ec 100644 --- a/gnulib/import/m4/open-cloexec.m4 +++ b/gnulib/import/m4/open-cloexec.m4 @@ -1,6 +1,6 @@ # Test whether O_CLOEXEC is defined. -dnl Copyright 2017-2021 Free Software Foundation, Inc. +dnl Copyright 2017-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/open-slash.m4 b/gnulib/import/m4/open-slash.m4 index e619039..4fbf491 100644 --- a/gnulib/import/m4/open-slash.m4 +++ b/gnulib/import/m4/open-slash.m4 @@ -1,5 +1,5 @@ # open-slash.m4 serial 2 -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/open.m4 b/gnulib/import/m4/open.m4 index c634386..f82fd6c 100644 --- a/gnulib/import/m4/open.m4 +++ b/gnulib/import/m4/open.m4 @@ -1,5 +1,5 @@ # open.m4 serial 15 -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/openat.m4 b/gnulib/import/m4/openat.m4 index eba0f51..de74799 100644 --- a/gnulib/import/m4/openat.m4 +++ b/gnulib/import/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-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/opendir.m4 b/gnulib/import/m4/opendir.m4 index 517edae..7816dc5 100644 --- a/gnulib/import/m4/opendir.m4 +++ b/gnulib/import/m4/opendir.m4 @@ -1,5 +1,5 @@ # opendir.m4 serial 5 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/pathmax.m4 b/gnulib/import/m4/pathmax.m4 index e67c656..44add99 100644 --- a/gnulib/import/m4/pathmax.m4 +++ b/gnulib/import/m4/pathmax.m4 @@ -1,5 +1,5 @@ # pathmax.m4 serial 11 -dnl Copyright (C) 2002-2003, 2005-2006, 2009-2021 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2022 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/gnulib/import/m4/pid_t.m4 b/gnulib/import/m4/pid_t.m4 index b7650a1..cb26f36 100644 --- a/gnulib/import/m4/pid_t.m4 +++ b/gnulib/import/m4/pid_t.m4 @@ -1,5 +1,5 @@ # pid_t.m4 serial 4 -dnl Copyright (C) 2020-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/pipe.m4 b/gnulib/import/m4/pipe.m4 index 89d666d..62871c6 100644 --- a/gnulib/import/m4/pipe.m4 +++ b/gnulib/import/m4/pipe.m4 @@ -1,5 +1,5 @@ # pipe.m4 serial 2 -dnl Copyright (C) 2010-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/pthread_rwlock_rdlock.m4 b/gnulib/import/m4/pthread_rwlock_rdlock.m4 index a5fbead..8ad7839 100644 --- a/gnulib/import/m4/pthread_rwlock_rdlock.m4 +++ b/gnulib/import/m4/pthread_rwlock_rdlock.m4 @@ -1,5 +1,5 @@ # pthread_rwlock_rdlock.m4 serial 4 -dnl Copyright (C) 2017-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2017-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/rawmemchr.m4 b/gnulib/import/m4/rawmemchr.m4 index f928465..dae4193 100644 --- a/gnulib/import/m4/rawmemchr.m4 +++ b/gnulib/import/m4/rawmemchr.m4 @@ -1,5 +1,5 @@ -# rawmemchr.m4 serial 2 -dnl Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc. +# rawmemchr.m4 serial 3 +dnl Copyright (C) 2003, 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_RAWMEMCHR], dnl Persuade glibc to declare rawmemchr(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_CHECK_FUNCS([rawmemchr]) if test $ac_cv_func_rawmemchr = no; then HAVE_RAWMEMCHR=0 diff --git a/gnulib/import/m4/readdir.m4 b/gnulib/import/m4/readdir.m4 index 94dc99c..ff3d2ab 100644 --- a/gnulib/import/m4/readdir.m4 +++ b/gnulib/import/m4/readdir.m4 @@ -1,5 +1,5 @@ # readdir.m4 serial 1 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/readlink.m4 b/gnulib/import/m4/readlink.m4 index 352788c..d1dd521 100644 --- a/gnulib/import/m4/readlink.m4 +++ b/gnulib/import/m4/readlink.m4 @@ -1,5 +1,5 @@ # readlink.m4 serial 16 -dnl Copyright (C) 2003, 2007, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/realloc.m4 b/gnulib/import/m4/realloc.m4 index 6f4461d..86e57c2 100644 --- a/gnulib/import/m4/realloc.m4 +++ b/gnulib/import/m4/realloc.m4 @@ -1,21 +1,21 @@ -# realloc.m4 serial 19 -dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. +# realloc.m4 serial 26 +dnl Copyright (C) 2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # This is adapted with modifications from upstream Autoconf here: -# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c +# https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/functions.m4?id=v2.70#n1455 AC_DEFUN([_AC_FUNC_REALLOC_IF], [ AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles - AC_CACHE_CHECK([for GNU libc compatible realloc], + AC_CACHE_CHECK([whether realloc (0, 0) returns nonnull], [ac_cv_func_realloc_0_nonnull], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include ]], - [[char *p = realloc (0, 0); + [[void *p = realloc (0, 0); int result = !p; free (p); return result;]]) @@ -24,53 +24,40 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF], [ac_cv_func_realloc_0_nonnull=no], [case "$host_os" in # Guess yes on platforms where we know the result. - *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \ - | hpux* | solaris* | cygwin* | mingw*) + *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ + | gnu* | *-musl* | midnightbsd* \ + | hpux* | solaris* | cygwin* | mingw* | 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" ;; esac ]) ]) - case "$ac_cv_func_realloc_0_nonnull" in - *yes) - $1 - ;; - *) - $2 - ;; - esac + AS_CASE([$ac_cv_func_realloc_0_nonnull], [*yes], [$1], [$2]) ])# AC_FUNC_REALLOC # gl_FUNC_REALLOC_GNU # ------------------- -# Test whether 'realloc (0, 0)' is handled like in GNU libc, and replace -# realloc if it is not. +# Replace realloc if it is not compatible with GNU libc. AC_DEFUN([gl_FUNC_REALLOC_GNU], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - dnl _AC_FUNC_REALLOC_IF is defined in Autoconf. - _AC_FUNC_REALLOC_IF( - [AC_DEFINE([HAVE_REALLOC_GNU], [1], - [Define to 1 if your system has a GNU libc compatible 'realloc' - function, and to 0 otherwise.])], - [AC_DEFINE([HAVE_REALLOC_GNU], [0]) - REPLACE_REALLOC=1 - ]) + AC_REQUIRE([gl_FUNC_REALLOC_POSIX]) + if test $REPLACE_REALLOC_FOR_REALLOC_GNU = 0; then + _AC_FUNC_REALLOC_IF([], [REPLACE_REALLOC_FOR_REALLOC_GNU=1]) + fi ])# gl_FUNC_REALLOC_GNU # gl_FUNC_REALLOC_POSIX # --------------------- # Test whether 'realloc' is POSIX compliant (sets errno to ENOMEM when it -# fails), and replace realloc if it is not. +# fails, and doesn't mess up with ptrdiff_t overflow), +# and replace realloc if it is not. AC_DEFUN([gl_FUNC_REALLOC_POSIX], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) - if test $gl_cv_func_malloc_posix = yes; then - AC_DEFINE([HAVE_REALLOC_POSIX], [1], - [Define if the 'realloc' function is POSIX compliant.]) - else - REPLACE_REALLOC=1 + AC_REQUIRE([gl_FUNC_MALLOC_POSIX]) + if test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1; then + REPLACE_REALLOC_FOR_REALLOC_POSIX=1 fi ]) diff --git a/gnulib/import/m4/rename.m4 b/gnulib/import/m4/rename.m4 index 8a95b8a..9f1a565 100644 --- a/gnulib/import/m4/rename.m4 +++ b/gnulib/import/m4/rename.m4 @@ -1,6 +1,6 @@ # serial 33 -# Copyright (C) 2001, 2003, 2005-2006, 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005-2006, 2009-2022 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/gnulib/import/m4/rewinddir.m4 b/gnulib/import/m4/rewinddir.m4 index ed25456..87c050f 100644 --- a/gnulib/import/m4/rewinddir.m4 +++ b/gnulib/import/m4/rewinddir.m4 @@ -1,5 +1,5 @@ # rewinddir.m4 serial 1 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/rmdir.m4 b/gnulib/import/m4/rmdir.m4 index 82b9ccc..5488027 100644 --- a/gnulib/import/m4/rmdir.m4 +++ b/gnulib/import/m4/rmdir.m4 @@ -1,5 +1,5 @@ # rmdir.m4 serial 18 -dnl Copyright (C) 2002, 2005, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2005, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/save-cwd.m4 b/gnulib/import/m4/save-cwd.m4 index 74cfe96..90073ee 100644 --- a/gnulib/import/m4/save-cwd.m4 +++ b/gnulib/import/m4/save-cwd.m4 @@ -1,5 +1,5 @@ # serial 10 -dnl Copyright (C) 2002-2006, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/select.m4 b/gnulib/import/m4/select.m4 index c7409d2..163f8fb 100644 --- a/gnulib/import/m4/select.m4 +++ b/gnulib/import/m4/select.m4 @@ -1,12 +1,12 @@ -# select.m4 serial 12 -dnl Copyright (C) 2009-2021 Free Software Foundation, Inc. +# select.m4 serial 13 +dnl Copyright (C) 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_SELECT], [ - AC_REQUIRE([gl_HEADER_SYS_SELECT]) + AC_REQUIRE([gl_SYS_SELECT_H]) AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_REQUIRE([gl_SOCKETS]) diff --git a/gnulib/import/m4/setenv.m4 b/gnulib/import/m4/setenv.m4 index f79a278..2000039 100644 --- a/gnulib/import/m4/setenv.m4 +++ b/gnulib/import/m4/setenv.m4 @@ -1,5 +1,5 @@ # setenv.m4 serial 30 -dnl Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2004, 2006-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/setlocale_null.m4 b/gnulib/import/m4/setlocale_null.m4 index c486ca8..09ea50e 100644 --- a/gnulib/import/m4/setlocale_null.m4 +++ b/gnulib/import/m4/setlocale_null.m4 @@ -1,5 +1,5 @@ -# setlocale_null.m4 serial 4 -dnl Copyright (C) 2019-2021 Free Software Foundation, Inc. +# setlocale_null.m4 serial 5 +dnl Copyright (C) 2019-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL], [gl_cv_func_setlocale_null_all_mtsafe], [case "$host_os" in # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin. - *-musl* | darwin* | freebsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*) + *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*) gl_cv_func_setlocale_null_all_mtsafe=no ;; # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*) @@ -48,7 +48,7 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL], openbsd* | aix*) gl_cv_func_setlocale_null_one_mtsafe=no ;; # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows. - *-gnu* | gnu* | *-musl* | darwin* | freebsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*) + *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*) gl_cv_func_setlocale_null_one_mtsafe=yes ;; # If we don't know, obey --enable-cross-guesses. *) diff --git a/gnulib/import/m4/signal_h.m4 b/gnulib/import/m4/signal_h.m4 index ff9f025..4c05c62 100644 --- a/gnulib/import/m4/signal_h.m4 +++ b/gnulib/import/m4/signal_h.m4 @@ -1,10 +1,10 @@ -# signal_h.m4 serial 19 -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +# signal_h.m4 serial 22 +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN([gl_SIGNAL_H], +AC_DEFUN_ONCE([gl_SIGNAL_H], [ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T]) @@ -52,22 +52,37 @@ AC_DEFUN([gl_CHECK_TYPE_SIGSET_T], fi ]) +# gl_SIGNAL_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_SIGNAL_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_SIGNAL_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_SIGNAL_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_SIGNAL_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_SIGMASK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAISE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNAL_H_SIGPIPE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGPROCMASK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGACTION]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_SIGNAL_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) +]) + AC_DEFUN([gl_SIGNAL_H_DEFAULTS], [ - GNULIB_PTHREAD_SIGMASK=0; AC_SUBST([GNULIB_PTHREAD_SIGMASK]) - GNULIB_RAISE=0; AC_SUBST([GNULIB_RAISE]) - GNULIB_SIGNAL_H_SIGPIPE=0; AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE]) - GNULIB_SIGPROCMASK=0; AC_SUBST([GNULIB_SIGPROCMASK]) - GNULIB_SIGACTION=0; AC_SUBST([GNULIB_SIGACTION]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING]) HAVE_PTHREAD_SIGMASK=1; AC_SUBST([HAVE_PTHREAD_SIGMASK]) diff --git a/gnulib/import/m4/socketlib.m4 b/gnulib/import/m4/socketlib.m4 index 0f8a082..b8bd0af 100644 --- a/gnulib/import/m4/socketlib.m4 +++ b/gnulib/import/m4/socketlib.m4 @@ -1,5 +1,5 @@ # socketlib.m4 serial 3 -dnl Copyright (C) 2008-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/sockets.m4 b/gnulib/import/m4/sockets.m4 index 02b43b6..aa04acc 100644 --- a/gnulib/import/m4/sockets.m4 +++ b/gnulib/import/m4/sockets.m4 @@ -1,5 +1,5 @@ # sockets.m4 serial 7 -dnl Copyright (C) 2008-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/socklen.m4 b/gnulib/import/m4/socklen.m4 index eca1d1b..1390ac4 100644 --- a/gnulib/import/m4/socklen.m4 +++ b/gnulib/import/m4/socklen.m4 @@ -1,5 +1,5 @@ # socklen.m4 serial 11 -dnl Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/sockpfaf.m4 b/gnulib/import/m4/sockpfaf.m4 index edae5d8..b1c4068 100644 --- a/gnulib/import/m4/sockpfaf.m4 +++ b/gnulib/import/m4/sockpfaf.m4 @@ -1,5 +1,5 @@ -# sockpfaf.m4 serial 9 -dnl Copyright (C) 2004, 2006, 2009-2021 Free Software Foundation, Inc. +# sockpfaf.m4 serial 10 +dnl Copyright (C) 2004, 2006, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,7 @@ dnl From Bruno Haible. AC_DEFUN([gl_SOCKET_FAMILIES], [ - AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_REQUIRE([gl_SYS_SOCKET_H]) AC_CHECK_HEADERS_ONCE([netinet/in.h]) AC_CACHE_CHECK([for IPv4 sockets], @@ -60,7 +60,7 @@ AC_DEFUN([gl_SOCKET_FAMILIES], AC_DEFUN([gl_SOCKET_FAMILY_UNIX], [ - AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_REQUIRE([gl_SYS_SOCKET_H]) AC_CHECK_HEADERS_ONCE([sys/un.h]) AC_CACHE_CHECK([for UNIX domain sockets], diff --git a/gnulib/import/m4/ssize_t.m4 b/gnulib/import/m4/ssize_t.m4 index f0ed509..03b2b89 100644 --- a/gnulib/import/m4/ssize_t.m4 +++ b/gnulib/import/m4/ssize_t.m4 @@ -1,5 +1,5 @@ # ssize_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2001-2003, 2006, 2010-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2003, 2006, 2010-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/stat-time.m4 b/gnulib/import/m4/stat-time.m4 index df1c2a7..342857d 100644 --- a/gnulib/import/m4/stat-time.m4 +++ b/gnulib/import/m4/stat-time.m4 @@ -1,6 +1,6 @@ # Checks for stat-related time functions. -# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2021 Free Software +# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2022 Free Software # Foundation, Inc. # This file is free software; the Free Software Foundation diff --git a/gnulib/import/m4/stat.m4 b/gnulib/import/m4/stat.m4 index 08cdbea..ab7c6b3 100644 --- a/gnulib/import/m4/stat.m4 +++ b/gnulib/import/m4/stat.m4 @@ -1,6 +1,6 @@ -# serial 17 +# serial 18 -# Copyright (C) 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2009-2022 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -69,7 +69,7 @@ AC_DEFUN([gl_FUNC_STAT], # Prerequisites of lib/stat.c and lib/stat-w32.c. AC_DEFUN([gl_PREREQ_STAT], [ - AC_REQUIRE([gl_HEADER_SYS_STAT_H]) + AC_REQUIRE([gl_SYS_STAT_H]) AC_REQUIRE([gl_PREREQ_STAT_W32]) : ]) diff --git a/gnulib/import/m4/std-gnu11.m4 b/gnulib/import/m4/std-gnu11.m4 index 7b1a042..5ca1860 100644 --- a/gnulib/import/m4/std-gnu11.m4 +++ b/gnulib/import/m4/std-gnu11.m4 @@ -9,7 +9,7 @@ m4_version_prereq([2.70], [], [ -# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# Copyright (C) 2001-2022 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gnulib/import/m4/stdalign.m4 b/gnulib/import/m4/stdalign.m4 index 8dcb634..78577cb 100644 --- a/gnulib/import/m4/stdalign.m4 +++ b/gnulib/import/m4/stdalign.m4 @@ -1,6 +1,6 @@ # Check for stdalign.h that conforms to C11. -dnl Copyright 2011-2021 Free Software Foundation, Inc. +dnl Copyright 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -13,7 +13,8 @@ AC_DEFUN([gl_STDALIGN_H], [gl_cv_header_working_stdalign_h], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[#include + [[#include + #include #include /* Test that alignof yields a result consistent with offsetof. @@ -32,6 +33,7 @@ AC_DEFUN([gl_STDALIGN_H], /* Test _Alignas only on platforms where gnulib can help. */ #if \ ((defined __cplusplus && 201103 <= __cplusplus) \ + || (__TINYC__ && defined __attribute__) \ || (defined __APPLE__ && defined __MACH__ \ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ : __GNUC__) \ @@ -47,11 +49,8 @@ AC_DEFUN([gl_STDALIGN_H], [gl_cv_header_working_stdalign_h=no])]) if test $gl_cv_header_working_stdalign_h = yes; then - STDALIGN_H='' + GL_GENERATE_STDALIGN_H=false else - STDALIGN_H='stdalign.h' + GL_GENERATE_STDALIGN_H=true fi - - AC_SUBST([STDALIGN_H]) - AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"]) ]) diff --git a/gnulib/import/m4/stdbool.m4 b/gnulib/import/m4/stdbool.m4 index 3169779..3e6c400 100644 --- a/gnulib/import/m4/stdbool.m4 +++ b/gnulib/import/m4/stdbool.m4 @@ -1,15 +1,15 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -#serial 8 +#serial 9 # Prepare for substituting if it is not supported. -AC_DEFUN([AM_STDBOOL_H], +AC_DEFUN([gl_STDBOOL_H], [ AC_REQUIRE([AC_CHECK_HEADER_STDBOOL]) AC_REQUIRE([AC_CANONICAL_HOST]) @@ -22,20 +22,18 @@ AC_DEFUN([AM_STDBOOL_H], case "$host_os" in solaris*) if test -z "$GCC"; then - STDBOOL_H='stdbool.h' + GL_GENERATE_STDBOOL_H=true else - STDBOOL_H='' + GL_GENERATE_STDBOOL_H=false fi ;; *) - STDBOOL_H='' + GL_GENERATE_STDBOOL_H=false ;; esac else - STDBOOL_H='stdbool.h' + GL_GENERATE_STDBOOL_H=true fi - AC_SUBST([STDBOOL_H]) - AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"]) if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 @@ -45,9 +43,6 @@ AC_DEFUN([AM_STDBOOL_H], AC_SUBST([HAVE__BOOL]) ]) -# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future. -AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) - # This version of the macro is needed in autoconf <= 2.68. AC_DEFUN([AC_CHECK_HEADER_STDBOOL], diff --git a/gnulib/import/m4/stddef_h.m4 b/gnulib/import/m4/stddef_h.m4 index cd666c4..abfd203 100644 --- a/gnulib/import/m4/stddef_h.m4 +++ b/gnulib/import/m4/stddef_h.m4 @@ -1,12 +1,12 @@ -# stddef_h.m4 serial 9 -dnl Copyright (C) 2009-2021 Free Software Foundation, Inc. +# stddef_h.m4 serial 12 +dnl Copyright (C) 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl A placeholder for , for platforms that have issues. -AC_DEFUN([gl_STDDEF_H], +AC_DEFUN_ONCE([gl_STDDEF_H], [ AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) AC_REQUIRE([gt_TYPE_WCHAR_T]) @@ -14,7 +14,7 @@ AC_DEFUN([gl_STDDEF_H], dnl Persuade OpenBSD to declare max_align_t. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - STDDEF_H= + GL_GENERATE_STDDEF_H=false dnl Test whether the type max_align_t exists and whether its alignment dnl "is as great as is supported by the implementation in all contexts". @@ -41,12 +41,12 @@ AC_DEFUN([gl_STDDEF_H], ]) if test $gl_cv_type_max_align_t = no; then HAVE_MAX_ALIGN_T=0 - STDDEF_H=stddef.h + GL_GENERATE_STDDEF_H=true fi if test $gt_cv_c_wchar_t = no; then HAVE_WCHAR_T=0 - STDDEF_H=stddef.h + GL_GENERATE_STDDEF_H=true fi AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions], @@ -58,23 +58,36 @@ AC_DEFUN([gl_STDDEF_H], [gl_cv_decl_null_works=no])]) if test $gl_cv_decl_null_works = no; then REPLACE_NULL=1 - STDDEF_H=stddef.h + GL_GENERATE_STDDEF_H=true fi - AC_SUBST([STDDEF_H]) - AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) - if test -n "$STDDEF_H"; then + if $GL_GENERATE_STDDEF_H; then gl_NEXT_HEADERS([stddef.h]) fi ]) +# gl_STDDEF_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_STDDEF_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_STDDEF_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$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_STDDEF_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDDEF_H_MODULE_INDICATOR_DEFAULTS], [ + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_STDDEF_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) +]) + AC_DEFUN([gl_STDDEF_H_DEFAULTS], [ dnl Assume proper GNU behavior unless another module says otherwise. diff --git a/gnulib/import/m4/stdint.m4 b/gnulib/import/m4/stdint.m4 index a785b44..c3f0894 100644 --- a/gnulib/import/m4/stdint.m4 +++ b/gnulib/import/m4/stdint.m4 @@ -1,5 +1,5 @@ -# stdint.m4 serial 58 -dnl Copyright (C) 2001-2021 Free Software Foundation, Inc. +# stdint.m4 serial 61 +dnl Copyright (C) 2001-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -170,7 +170,7 @@ struct s { PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t) && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t) ? 1 : -1; - /* Detect bug in FreeBSD 6.0 / ia64. */ + /* Detect bug in FreeBSD 6.0/ia64 and FreeBSD 13.0/arm64. */ int check_SIG_ATOMIC: SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t) && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t) @@ -296,7 +296,7 @@ static const char *macro_values[] = HAVE_C99_STDINT_H=0 HAVE_SYS_BITYPES_H=0 HAVE_SYS_INTTYPES_H=0 - STDINT_H=stdint.h + GL_GENERATE_STDINT_H=true case "$gl_cv_header_working_stdint_h" in *yes) HAVE_C99_STDINT_H=1 @@ -341,7 +341,7 @@ int32_t i32 = INT32_C (0x7fffffff); ]])], [gl_cv_header_stdint_width=yes])]) if test "$gl_cv_header_stdint_width" = yes; then - STDINT_H= + GL_GENERATE_STDINT_H=false fi ;; *) @@ -364,8 +364,6 @@ int32_t i32 = INT32_C (0x7fffffff); AC_SUBST([HAVE_C99_STDINT_H]) AC_SUBST([HAVE_SYS_BITYPES_H]) AC_SUBST([HAVE_SYS_INTTYPES_H]) - AC_SUBST([STDINT_H]) - AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) @@ -527,7 +525,7 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], dnl requirement that wint_t is "unchanged by default argument promotions". dnl In this case gnulib's and override wint_t. dnl Set the variable BITSIZEOF_WINT_T accordingly. - if test $GNULIB_OVERRIDES_WINT_T = 1; then + if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then BITSIZEOF_WINT_T=32 fi ]) diff --git a/gnulib/import/m4/stdio_h.m4 b/gnulib/import/m4/stdio_h.m4 index 4c3f24a..42e9607 100644 --- a/gnulib/import/m4/stdio_h.m4 +++ b/gnulib/import/m4/stdio_h.m4 @@ -1,11 +1,12 @@ -# stdio_h.m4 serial 52 -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +# stdio_h.m4 serial 59 +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN([gl_STDIO_H], +AC_DEFUN_ONCE([gl_STDIO_H], [ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AH_VERBATIM([MINGW_ANSI_STDIO], [/* Use GNU style printf and scanf. */ #ifndef __USE_MINGW_ANSI_STDIO @@ -13,7 +14,6 @@ AC_DEFUN([gl_STDIO_H], #endif ]) AC_DEFINE([__USE_MINGW_ANSI_STDIO]) - AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_NEXT_HEADERS([stdio.h]) dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and @@ -40,64 +40,32 @@ AC_DEFUN([gl_STDIO_H], attribute "__gnu_printf__" instead of "__printf__"]) fi - dnl No need to create extra modules for these functions. Everyone who uses - dnl likely needs them. - GNULIB_FSCANF=1 - gl_MODULE_INDICATOR([fscanf]) - GNULIB_SCANF=1 - gl_MODULE_INDICATOR([scanf]) - GNULIB_FGETC=1 - GNULIB_GETC=1 - GNULIB_GETCHAR=1 - GNULIB_FGETS=1 - GNULIB_FREAD=1 - dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c" - dnl "expected source file, required through AC_LIBSOURCES, not found". It is - dnl also an optimization, to avoid performing a configure check whose result - dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING - dnl or GNULIB_NONBLOCKING redundant. + 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. m4_ifdef([gl_NONBLOCKING_IO], [ gl_NONBLOCKING_IO if test $gl_cv_have_nonblocking != yes; then REPLACE_STDIO_READ_FUNCS=1 - AC_LIBOBJ([stdio-read]) fi ]) - dnl No need to create extra modules for these functions. Everyone who uses - dnl likely needs them. - GNULIB_FPRINTF=1 - GNULIB_PRINTF=1 - GNULIB_VFPRINTF=1 - GNULIB_VPRINTF=1 - GNULIB_FPUTC=1 - GNULIB_PUTC=1 - GNULIB_PUTCHAR=1 - GNULIB_FPUTS=1 - GNULIB_PUTS=1 - GNULIB_FWRITE=1 - dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" - dnl "expected source file, required through AC_LIBSOURCES, not found". It is - dnl also an optimization, to avoid performing a configure check whose result - dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or - dnl GNULIB_SIGPIPE redundant. + 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_SIGPIPE or GNULIB_SIGPIPE redundant. m4_ifdef([gl_SIGNAL_SIGPIPE], [ gl_SIGNAL_SIGPIPE if test $gl_cv_header_signal_h_SIGPIPE != yes; then REPLACE_STDIO_WRITE_FUNCS=1 - AC_LIBOBJ([stdio-write]) fi ]) - dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c" - dnl "expected source file, required through AC_LIBSOURCES, not found". It is - dnl also an optimization, to avoid performing a configure check whose result - dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING - dnl or GNULIB_NONBLOCKING redundant. + 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. m4_ifdef([gl_NONBLOCKING_IO], [ gl_NONBLOCKING_IO if test $gl_cv_have_nonblocking != yes; then REPLACE_STDIO_WRITE_FUNCS=1 - AC_LIBOBJ([stdio-write]) fi ]) @@ -116,77 +84,93 @@ AC_DEFUN([gl_STDIO_H], fi ]) +# gl_STDIO_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_STDIO_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_STDIO_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_STDIO_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DPRINTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCLOSE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPEN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFLUSH]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FGETC]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FGETS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FOPEN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FOPEN_GNU]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPRINTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPRINTF_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPURGE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPUTC]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPUTS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREAD]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREOPEN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSCANF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSEEK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSEEKO]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELLO]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FWRITE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETC]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCHAR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDELIM]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLINE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PCLOSE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PERROR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POPEN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PRINTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PRINTF_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTC]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTCHAR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMOVE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAMEAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNPRINTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SPRINTF_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_NONBLOCKING]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TMPFILE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASPRINTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFSCANF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSCANF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDPRINTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNPRINTF]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX]) + dnl Support Microsoft deprecated alias function names by default. + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCLOSEALL], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FDOPEN], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FILENO], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETW], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_PUTW], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_TEMPNAM], [1]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) +]) + AC_DEFUN([gl_STDIO_H_DEFAULTS], [ - GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF]) - GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE]) - GNULIB_FDOPEN=0; AC_SUBST([GNULIB_FDOPEN]) - GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH]) - GNULIB_FGETC=0; AC_SUBST([GNULIB_FGETC]) - GNULIB_FGETS=0; AC_SUBST([GNULIB_FGETS]) - GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN]) - GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF]) - GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX]) - GNULIB_FPURGE=0; AC_SUBST([GNULIB_FPURGE]) - GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC]) - GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS]) - GNULIB_FREAD=0; AC_SUBST([GNULIB_FREAD]) - GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN]) - GNULIB_FSCANF=0; AC_SUBST([GNULIB_FSCANF]) - GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK]) - GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO]) - GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL]) - GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO]) - GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE]) - GNULIB_GETC=0; AC_SUBST([GNULIB_GETC]) - GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR]) - GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) - GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) - GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) - GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) - GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE]) - GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR]) - GNULIB_POPEN=0; AC_SUBST([GNULIB_POPEN]) - GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF]) - GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX]) - GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC]) - GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR]) - GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS]) - GNULIB_REMOVE=0; AC_SUBST([GNULIB_REMOVE]) - GNULIB_RENAME=0; AC_SUBST([GNULIB_RENAME]) - GNULIB_RENAMEAT=0; AC_SUBST([GNULIB_RENAMEAT]) - GNULIB_SCANF=0; AC_SUBST([GNULIB_SCANF]) - GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF]) - GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX]) - GNULIB_STDIO_H_NONBLOCKING=0; AC_SUBST([GNULIB_STDIO_H_NONBLOCKING]) - GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE]) - GNULIB_TMPFILE=0; AC_SUBST([GNULIB_TMPFILE]) - GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) - GNULIB_VFSCANF=0; AC_SUBST([GNULIB_VFSCANF]) - GNULIB_VSCANF=0; AC_SUBST([GNULIB_VSCANF]) - GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF]) - GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF]) - GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX]) - GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF]) - GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) - GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) - GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) - dnl Support Microsoft deprecated alias function names by default. - GNULIB_MDA_FCLOSEALL=1; AC_SUBST([GNULIB_MDA_FCLOSEALL]) - GNULIB_MDA_FDOPEN=1; AC_SUBST([GNULIB_MDA_FDOPEN]) - GNULIB_MDA_FILENO=1; AC_SUBST([GNULIB_MDA_FILENO]) - GNULIB_MDA_GETW=1; AC_SUBST([GNULIB_MDA_GETW]) - GNULIB_MDA_PUTW=1; AC_SUBST([GNULIB_MDA_PUTW]) - GNULIB_MDA_TEMPNAM=1; AC_SUBST([GNULIB_MDA_TEMPNAM]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_FCLOSEALL=1; AC_SUBST([HAVE_DECL_FCLOSEALL]) HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE]) @@ -210,6 +194,7 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN]) REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH]) REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN]) + REPLACE_FOPEN_FOR_FOPEN_GNU=0; AC_SUBST([REPLACE_FOPEN_FOR_FOPEN_GNU]) REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF]) REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE]) REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN]) diff --git a/gnulib/import/m4/stdlib_h.m4 b/gnulib/import/m4/stdlib_h.m4 index 5a02972..9e20969 100644 --- a/gnulib/import/m4/stdlib_h.m4 +++ b/gnulib/import/m4/stdlib_h.m4 @@ -1,10 +1,10 @@ -# stdlib_h.m4 serial 55 -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +# stdlib_h.m4 serial 66 +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN([gl_STDLIB_H], +AC_DEFUN_ONCE([gl_STDLIB_H], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) gl_NEXT_HEADERS([stdlib.h]) @@ -28,7 +28,7 @@ AC_DEFUN([gl_STDLIB_H], 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 strtold strtoll strtoull unlockpt unsetenv]) + strtod strtol strtold strtoll strtoul strtoull unlockpt unsetenv]) AC_REQUIRE([AC_C_RESTRICT]) @@ -46,61 +46,81 @@ AC_DEFUN([gl_STDLIB_H], fi ]) +# gl_STDLIB_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_STDLIB_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_STDLIB_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_STDLIB_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB__EXIT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ALIGNED_ALLOC]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATOLL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CALLOC_GNU]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CALLOC_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CANONICALIZE_FILE_NAME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREE_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOADAVG]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSUBOPT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GRANTPT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_GNU]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBTOWC]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDTEMP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMPS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKSTEMP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKSTEMPS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_MEMALIGN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_OPENPT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME]) + 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_RANDOM]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM_R]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOCARRAY]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOC_GNU]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOC_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALPATH]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RPMATCH]) + 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_STRTOL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLD]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOUL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOULL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYSTEM_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLOCKPT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNSETENV]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTOMB]) + dnl Support Microsoft deprecated alias function names by default. + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ECVT], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCVT], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GCVT], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MKTEMP], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_PUTENV], [1]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) +]) + AC_DEFUN([gl_STDLIB_H_DEFAULTS], [ - GNULIB__EXIT=0; AC_SUBST([GNULIB__EXIT]) - GNULIB_ALIGNED_ALLOC=0; AC_SUBST([GNULIB_ALIGNED_ALLOC]) - GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL]) - GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) - GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME]) - GNULIB_FREE_POSIX=0; AC_SUBST([GNULIB_FREE_POSIX]) - GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG]) - GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) - GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT]) - GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX]) - GNULIB_MBTOWC=0; AC_SUBST([GNULIB_MBTOWC]) - GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP]) - GNULIB_MKOSTEMP=0; AC_SUBST([GNULIB_MKOSTEMP]) - GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS]) - GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) - GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS]) - GNULIB_POSIX_MEMALIGN=0;AC_SUBST([GNULIB_POSIX_MEMALIGN]) - GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT]) - GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME]) - GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R]) - GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV]) - GNULIB_QSORT_R=0; AC_SUBST([GNULIB_QSORT_R]) - GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM]) - GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R]) - GNULIB_REALLOCARRAY=0; AC_SUBST([GNULIB_REALLOCARRAY]) - GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX]) - GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH]) - GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH]) - GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV]) - GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) - GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD]) - GNULIB_STRTOLD=0; AC_SUBST([GNULIB_STRTOLD]) - GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL]) - GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL]) - GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX]) - GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT]) - GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) - GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB]) - dnl Support Microsoft deprecated alias function names by default. - GNULIB_MDA_ECVT=1; AC_SUBST([GNULIB_MDA_ECVT]) - GNULIB_MDA_FCVT=1; AC_SUBST([GNULIB_MDA_FCVT]) - GNULIB_MDA_GCVT=1; AC_SUBST([GNULIB_MDA_GCVT]) - GNULIB_MDA_MKTEMP=1; AC_SUBST([GNULIB_MDA_MKTEMP]) - GNULIB_MDA_PUTENV=1; AC_SUBST([GNULIB_MDA_PUTENV]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE__EXIT=1; AC_SUBST([HAVE__EXIT]) HAVE_ALIGNED_ALLOC=1; AC_SUBST([HAVE_ALIGNED_ALLOC]) @@ -137,19 +157,23 @@ 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_STRTOL=1; AC_SUBST([HAVE_STRTOL]) HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD]) HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) + HAVE_STRTOUL=1; AC_SUBST([HAVE_STRTOUL]) HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL]) HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT]) HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV]) REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC]) - REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC]) + REPLACE_CALLOC_FOR_CALLOC_GNU=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_GNU]) + REPLACE_CALLOC_FOR_CALLOC_POSIX=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_POSIX]) REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) REPLACE_FREE=0; AC_SUBST([REPLACE_FREE]) REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE]) - REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC]) + 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_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN]) @@ -159,12 +183,18 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R]) REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM]) REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) - REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC]) + REPLACE_REALLOC_FOR_REALLOC_GNU=0; AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_GNU]) + REPLACE_REALLOC_FOR_REALLOC_POSIX=0; AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_POSIX]) + REPLACE_REALLOCARRAY=0; AC_SUBST([REPLACE_REALLOCARRAY]) REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH]) REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE]) REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) + REPLACE_STRTOL=0; AC_SUBST([REPLACE_STRTOL]) REPLACE_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD]) + REPLACE_STRTOLL=0; AC_SUBST([REPLACE_STRTOLL]) + REPLACE_STRTOUL=0; AC_SUBST([REPLACE_STRTOUL]) + REPLACE_STRTOULL=0; AC_SUBST([REPLACE_STRTOULL]) REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV]) REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB]) ]) diff --git a/gnulib/import/m4/strchrnul.m4 b/gnulib/import/m4/strchrnul.m4 index 76c9a04..630699b 100644 --- a/gnulib/import/m4/strchrnul.m4 +++ b/gnulib/import/m4/strchrnul.m4 @@ -1,5 +1,5 @@ -# strchrnul.m4 serial 9 -dnl Copyright (C) 2003, 2007, 2009-2021 Free Software Foundation, Inc. +# strchrnul.m4 serial 10 +dnl Copyright (C) 2003, 2007, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_STRCHRNUL], dnl Persuade glibc to declare strchrnul(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_CHECK_FUNCS([strchrnul]) if test $ac_cv_func_strchrnul = no; then HAVE_STRCHRNUL=0 diff --git a/gnulib/import/m4/strdup.m4 b/gnulib/import/m4/strdup.m4 index f6f421d..da8899d 100644 --- a/gnulib/import/m4/strdup.m4 +++ b/gnulib/import/m4/strdup.m4 @@ -1,6 +1,6 @@ -# strdup.m4 serial 14 +# strdup.m4 serial 15 -dnl Copyright (C) 2002-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -8,7 +8,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRDUP], [ - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_CHECK_DECLS_ONCE([strdup]) if test $ac_cv_have_decl_strdup = no; then HAVE_DECL_STRDUP=0 @@ -17,7 +17,7 @@ AC_DEFUN([gl_FUNC_STRDUP], AC_DEFUN([gl_FUNC_STRDUP_POSIX], [ - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) if test $gl_cv_func_malloc_posix != yes; then REPLACE_STRDUP=1 diff --git a/gnulib/import/m4/strerror.m4 b/gnulib/import/m4/strerror.m4 index 48c56ae..4716649 100644 --- a/gnulib/import/m4/strerror.m4 +++ b/gnulib/import/m4/strerror.m4 @@ -1,19 +1,19 @@ -# strerror.m4 serial 21 -dnl Copyright (C) 2002, 2007-2021 Free Software Foundation, Inc. +# strerror.m4 serial 23 +dnl Copyright (C) 2002, 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRERROR], [ - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_REQUIRE([gl_HEADER_ERRNO_H]) AC_REQUIRE([gl_FUNC_STRERROR_0]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [ AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS]) ]) - if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test "$GL_GENERATE_ERRNO_H:$REPLACE_STRERROR_0" = false:0; then AC_CACHE_CHECK([for working strerror function], [gl_cv_func_working_strerror], [AC_RUN_IFELSE( diff --git a/gnulib/import/m4/strerror_r.m4 b/gnulib/import/m4/strerror_r.m4 index b0b2ed0..23c3b42 100644 --- a/gnulib/import/m4/strerror_r.m4 +++ b/gnulib/import/m4/strerror_r.m4 @@ -1,17 +1,14 @@ -# strerror_r.m4 serial 20 -dnl Copyright (C) 2002, 2007-2021 Free Software Foundation, Inc. +# strerror_r.m4 serial 24 +dnl Copyright (C) 2002, 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRERROR_R], [ - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS]) - dnl Persuade Solaris to declare strerror_r(). - AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - dnl Some systems don't declare strerror_r() if _THREAD_SAFE and _REENTRANT dnl are not defined. AC_CHECK_DECLS_ONCE([strerror_r]) @@ -20,7 +17,7 @@ AC_DEFUN([gl_FUNC_STRERROR_R], fi if test $ac_cv_func_strerror_r = yes; then - if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test "$GL_GENERATE_ERRNO_H:$REPLACE_STRERROR_0" = false:0; then if test $gl_cv_func_strerror_r_posix_signature = yes; then case "$gl_cv_func_strerror_r_works" in dnl The system's strerror_r has bugs. Replace it. @@ -40,6 +37,7 @@ AC_DEFUN([gl_FUNC_STRERROR_R], # Prerequisites of lib/strerror_r.c. AC_DEFUN([gl_PREREQ_STRERROR_R], [ + AC_REQUIRE([AC_FUNC_STRERROR_R]) dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r. AC_CHECK_FUNCS_ONCE([__xpg_strerror_r]) AC_CHECK_FUNCS_ONCE([catgets]) @@ -52,11 +50,16 @@ AC_DEFUN([gl_FUNC_STRERROR_R_WORKS], [ AC_REQUIRE([gl_HEADER_ERRNO_H]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Persuade Android to use the GNU strerror_r API, + dnl and Solaris to declare strerror_r. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_FUNC_STRERROR_0]) AC_CHECK_FUNCS_ONCE([strerror_r]) if test $ac_cv_func_strerror_r = yes; then - if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then + if test "$GL_GENERATE_ERRNO_H:$REPLACE_STRERROR_0" = false:0; then dnl The POSIX prototype is: int strerror_r (int, char *, size_t); dnl glibc, Cygwin: char *strerror_r (int, char *, size_t); dnl AIX 5.1, OSF/1 5.1: int strerror_r (int, char *, int); diff --git a/gnulib/import/m4/string_h.m4 b/gnulib/import/m4/string_h.m4 index a4cc5b4..9e09b96 100644 --- a/gnulib/import/m4/string_h.m4 +++ b/gnulib/import/m4/string_h.m4 @@ -1,24 +1,19 @@ # Configure a GNU-like replacement for . -# Copyright (C) 2007-2021 Free Software Foundation, Inc. +# Copyright (C) 2007-2022 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 29 +# serial 34 # Written by Paul Eggert. -AC_DEFUN([gl_HEADER_STRING_H], +AC_DEFUN_ONCE([gl_STRING_H], [ - dnl Use AC_REQUIRE here, so that the default behavior below is expanded - dnl once only, before all statements that occur in other macros. - AC_REQUIRE([gl_HEADER_STRING_H_BODY]) -]) - -AC_DEFUN([gl_HEADER_STRING_H_BODY], -[ - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + dnl Ensure to expand the default settings once only, before all statements + dnl that occur in other macros. + AC_REQUIRE([gl_STRING_H_DEFAULTS]) gl_NEXT_HEADERS([string.h]) dnl Check for declarations of anything we want to poison if the @@ -33,62 +28,79 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY], AC_REQUIRE([AC_C_RESTRICT]) ]) +# gl_STRING_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_STRING_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_STRING_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]) ]) -AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], +# 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_STRING_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPLICIT_BZERO]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFSL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFSLL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMCHR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMMEM]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMPCPY]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMRCHR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAWMEMCHR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPCPY]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPNCPY]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCHRNUL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRDUP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNCAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNDUP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNLEN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPBRK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSEP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSTR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCASESTR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOK_R]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSLEN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNLEN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCHR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRCHR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSTR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCASECMP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNCASECMP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSPCASECMP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCASESTR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCSPN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSPBRK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSPN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSEP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOK_R]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR_R]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERRORNAME_NP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGABBREV_NP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGDESCR_NP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSIGNAL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRVERSCMP]) + dnl Support Microsoft deprecated alias function names by default. + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MEMCCPY], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_STRDUP], [1]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS]) + dnl Make sure the shell variable for GNULIB_FREE_POSIX is initialized. + gl_STDLIB_H_REQUIRE_DEFAULTS + AC_REQUIRE([gl_STRING_H_DEFAULTS]) +]) + +AC_DEFUN([gl_STRING_H_DEFAULTS], [ - GNULIB_EXPLICIT_BZERO=0; AC_SUBST([GNULIB_EXPLICIT_BZERO]) - GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) - GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) - GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) - GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) - GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) - GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) - GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) - GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) - GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) - GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) - GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) - GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT]) - GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) - GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) - GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) - GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) - GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) - GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) - GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) - GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) - GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN]) - GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) - GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) - GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) - GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) - GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) - GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) - GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) - GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) - GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) - GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) - GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) - GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) - GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) - GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R]) - GNULIB_STRERRORNAME_NP=0; AC_SUBST([GNULIB_STRERRORNAME_NP]) - GNULIB_SIGABBREV_NP=0; AC_SUBST([GNULIB_SIGABBREV_NP]) - GNULIB_SIGDESCR_NP=0; AC_SUBST([GNULIB_SIGDESCR_NP]) - GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) - GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) - dnl Support Microsoft deprecated alias function names by default. - GNULIB_MDA_MEMCCPY=1; AC_SUBST([GNULIB_MDA_MEMCCPY]) - GNULIB_MDA_STRDUP=1; AC_SUBST([GNULIB_MDA_STRDUP]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_EXPLICIT_BZERO=1; AC_SUBST([HAVE_EXPLICIT_BZERO]) HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) diff --git a/gnulib/import/m4/strings_h.m4 b/gnulib/import/m4/strings_h.m4 index 1dc2212..6965b7c 100644 --- a/gnulib/import/m4/strings_h.m4 +++ b/gnulib/import/m4/strings_h.m4 @@ -1,21 +1,16 @@ # Configure a replacement for . -# serial 6 +# serial 9 -# Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2007, 2009-2022 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. -AC_DEFUN([gl_HEADER_STRINGS_H], +AC_DEFUN_ONCE([gl_STRINGS_H], [ - dnl Use AC_REQUIRE here, so that the default behavior below is expanded - dnl once only, before all statements that occur in other macros. - AC_REQUIRE([gl_HEADER_STRINGS_H_BODY]) -]) - -AC_DEFUN([gl_HEADER_STRINGS_H_BODY], -[ - AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + dnl Ensure to expand the default settings once only, before all statements + dnl that occur in other macros. + AC_REQUIRE([gl_STRINGS_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([strings.h]) if test $ac_cv_header_strings_h = yes; then @@ -35,16 +30,31 @@ AC_DEFUN([gl_HEADER_STRINGS_H_BODY], ]], [ffs strcasecmp strncasecmp]) ]) +# gl_STRINGS_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_STRINGS_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_STRINGS_H_REQUIRE_DEFAULTS gl_MODULE_INDICATOR_SET_VARIABLE([$1]) ]) -AC_DEFUN([gl_HEADER_STRINGS_H_DEFAULTS], +# 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_STRINGS_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRINGS_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFS]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_STRINGS_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_STRINGS_H_DEFAULTS]) +]) + +AC_DEFUN([gl_STRINGS_H_DEFAULTS], [ - GNULIB_FFS=0; AC_SUBST([GNULIB_FFS]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FFS=1; AC_SUBST([HAVE_FFS]) HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP]) diff --git a/gnulib/import/m4/strnlen.m4 b/gnulib/import/m4/strnlen.m4 index bb9a680..0934274 100644 --- a/gnulib/import/m4/strnlen.m4 +++ b/gnulib/import/m4/strnlen.m4 @@ -1,5 +1,5 @@ -# strnlen.m4 serial 13 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2021 Free Software Foundation, +# strnlen.m4 serial 14 +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2022 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, @@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRNLEN], [ - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) dnl Persuade glibc to declare strnlen(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) diff --git a/gnulib/import/m4/strstr.m4 b/gnulib/import/m4/strstr.m4 index 1226b05..6cc2072 100644 --- a/gnulib/import/m4/strstr.m4 +++ b/gnulib/import/m4/strstr.m4 @@ -1,5 +1,5 @@ -# strstr.m4 serial 22 -dnl Copyright (C) 2008-2021 Free Software Foundation, Inc. +# strstr.m4 serial 24 +dnl Copyright (C) 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. dnl Check that strstr works. AC_DEFUN([gl_FUNC_STRSTR_SIMPLE], [ - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_REQUIRE([gl_FUNC_MEMCHR]) if test $REPLACE_MEMCHR = 1; then REPLACE_STRSTR=1 @@ -18,7 +18,7 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE], [gl_cv_func_strstr_works_always], [AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ -#include /* for strstr */ +#include /* for __GNU_LIBRARY__, strstr */ #ifdef __GNU_LIBRARY__ #include #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28 @@ -40,6 +40,7 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE], dnl linear. AC_EGREP_CPP([Lucky user], [ +#include /* for __GNU_LIBRARY__ */ #ifdef __GNU_LIBRARY__ #include #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \ diff --git a/gnulib/import/m4/strtok_r.m4 b/gnulib/import/m4/strtok_r.m4 index b8e2f68..22185f5 100644 --- a/gnulib/import/m4/strtok_r.m4 +++ b/gnulib/import/m4/strtok_r.m4 @@ -1,5 +1,5 @@ -# strtok_r.m4 serial 15 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2021 Free Software Foundation, +# strtok_r.m4 serial 16 +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2022 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, @@ -10,7 +10,7 @@ AC_DEFUN([gl_FUNC_STRTOK_R], dnl The strtok_r() declaration in lib/string.in.h uses 'restrict'. AC_REQUIRE([AC_C_RESTRICT]) - AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_STRING_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CHECK_FUNCS([strtok_r]) if test $ac_cv_func_strtok_r = yes; then diff --git a/gnulib/import/m4/sys_random_h.m4 b/gnulib/import/m4/sys_random_h.m4 index 45e0469..a5ba85c 100644 --- a/gnulib/import/m4/sys_random_h.m4 +++ b/gnulib/import/m4/sys_random_h.m4 @@ -1,10 +1,10 @@ -# sys_random_h.m4 serial 5 -dnl Copyright (C) 2020-2021 Free Software Foundation, Inc. +# sys_random_h.m4 serial 8 +dnl Copyright (C) 2020-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN([gl_HEADER_SYS_RANDOM], +AC_DEFUN_ONCE([gl_SYS_RANDOM_H], [ AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS]) dnl is always overridden, because of GNULIB_POSIXCHECK. @@ -35,18 +35,33 @@ AC_DEFUN([gl_HEADER_SYS_RANDOM], [getrandom]) ]) +# gl_SYS_RANDOM_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_SYS_RANDOM_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_SYS_RANDOM_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_SYS_RANDOM_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_RANDOM_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETRANDOM]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_RANDOM_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS]) +]) + AC_DEFUN([gl_SYS_RANDOM_H_DEFAULTS], [ - GNULIB_GETRANDOM=0; AC_SUBST([GNULIB_GETRANDOM]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_GETRANDOM=1; AC_SUBST([HAVE_GETRANDOM]) REPLACE_GETRANDOM=0; AC_SUBST([REPLACE_GETRANDOM]) diff --git a/gnulib/import/m4/sys_select_h.m4 b/gnulib/import/m4/sys_select_h.m4 index 4b33d31..2743cd1 100644 --- a/gnulib/import/m4/sys_select_h.m4 +++ b/gnulib/import/m4/sys_select_h.m4 @@ -1,13 +1,13 @@ -# sys_select_h.m4 serial 20 -dnl Copyright (C) 2006-2021 Free Software Foundation, Inc. +# sys_select_h.m4 serial 23 +dnl Copyright (C) 2006-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN([gl_HEADER_SYS_SELECT], +AC_DEFUN_ONCE([gl_SYS_SELECT_H], [ - AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS]) + AC_REQUIRE([AC_C_RESTRICT]) AC_CACHE_CHECK([whether is self-contained], [gl_cv_header_sys_select_h_selfcontained], [ @@ -75,19 +75,34 @@ AC_DEFUN([gl_HEADER_SYS_SELECT], ]], [pselect select]) ]) +# gl_SYS_SELECT_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_SYS_SELECT_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_SYS_SELECT_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_SYS_SELECT_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_SELECT_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PSELECT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SELECT]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_SELECT_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS]) +]) + AC_DEFUN([gl_SYS_SELECT_H_DEFAULTS], [ - GNULIB_PSELECT=0; AC_SUBST([GNULIB_PSELECT]) - GNULIB_SELECT=0; AC_SUBST([GNULIB_SELECT]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_PSELECT=1; AC_SUBST([HAVE_PSELECT]) REPLACE_PSELECT=0; AC_SUBST([REPLACE_PSELECT]) diff --git a/gnulib/import/m4/sys_socket_h.m4 b/gnulib/import/m4/sys_socket_h.m4 index 503cb96..ba3ae68 100644 --- a/gnulib/import/m4/sys_socket_h.m4 +++ b/gnulib/import/m4/sys_socket_h.m4 @@ -1,12 +1,12 @@ -# sys_socket_h.m4 serial 25 -dnl Copyright (C) 2005-2021 Free Software Foundation, Inc. +# sys_socket_h.m4 serial 29 +dnl Copyright (C) 2005-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Simon Josefsson. -AC_DEFUN([gl_HEADER_SYS_SOCKET], +AC_DEFUN_ONCE([gl_SYS_SOCKET_H], [ AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) @@ -22,6 +22,7 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET], ;; esac + GL_GENERATE_SYS_SOCKET_H=false AC_CACHE_CHECK([whether is self-contained], [gl_cv_header_sys_socket_h_selfcontained], [ @@ -44,7 +45,7 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET], [gl_cv_header_sys_socket_h_shut=no]) ]) if test $gl_cv_header_sys_socket_h_shut = no; then - SYS_SOCKET_H='sys/socket.h' + GL_GENERATE_SYS_SOCKET_H=true fi fi fi @@ -83,7 +84,7 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET], fi if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \ || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then - SYS_SOCKET_H='sys/socket.h' + GL_GENERATE_SYS_SOCKET_H=true fi gl_PREREQ_SYS_H_WINSOCK2 @@ -156,32 +157,47 @@ AC_DEFUN([gl_PREREQ_SYS_H_WS2TCPIP], AC_SUBST([HAVE_WS2TCPIP_H]) ]) +# gl_SYS_SOCKET_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_SYS_SOCKET_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_SYS_SOCKET_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_SYS_SOCKET_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_SOCKET_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SOCKET]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CONNECT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCEPT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BIND]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPEERNAME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSOCKNAME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSOCKOPT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LISTEN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RECV]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SEND]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RECVFROM]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SENDTO]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETSOCKOPT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SHUTDOWN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCEPT4]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_SOCKET_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS]) +]) + AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS], [ - GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET]) - GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT]) - GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT]) - GNULIB_BIND=0; AC_SUBST([GNULIB_BIND]) - GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME]) - GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME]) - GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT]) - GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN]) - GNULIB_RECV=0; AC_SUBST([GNULIB_RECV]) - GNULIB_SEND=0; AC_SUBST([GNULIB_SEND]) - GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM]) - GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO]) - GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT]) - GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN]) - GNULIB_ACCEPT4=0; AC_SUBST([GNULIB_ACCEPT4]) HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE]) HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY]) diff --git a/gnulib/import/m4/sys_stat_h.m4 b/gnulib/import/m4/sys_stat_h.m4 index 23cbdd2..b5a9789 100644 --- a/gnulib/import/m4/sys_stat_h.m4 +++ b/gnulib/import/m4/sys_stat_h.m4 @@ -1,5 +1,5 @@ -# sys_stat_h.m4 serial 38 -*- Autoconf -*- -dnl Copyright (C) 2006-2021 Free Software Foundation, Inc. +# sys_stat_h.m4 serial 41 -*- Autoconf -*- +dnl Copyright (C) 2006-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. dnl From Eric Blake. dnl Provide a GNU-like . -AC_DEFUN([gl_HEADER_SYS_STAT_H], +AC_DEFUN_ONCE([gl_SYS_STAT_H], [ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) @@ -52,38 +52,53 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H], AC_REQUIRE([AC_C_RESTRICT]) ]) +# gl_SYS_STAT_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_SYS_STAT_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_SYS_STAT_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_SYS_STAT_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_STAT_H_MODULE_INDICATOR_DEFAULTS], [ + gl_UNISTD_H_REQUIRE_DEFAULTS dnl for REPLACE_FCHDIR + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHMODAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSTAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSTATAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FUTIMENS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETUMASK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LCHMOD]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LSTAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDIR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDIRAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKFIFO]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKFIFOAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKNOD]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKNODAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UTIMENSAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OVERRIDES_STRUCT_STAT]) + dnl Support Microsoft deprecated alias function names by default. + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CHMOD], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MKDIR], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UMASK], [1]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_STAT_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) +]) + AC_DEFUN([gl_SYS_STAT_H_DEFAULTS], [ - AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR - GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT]) - GNULIB_FSTAT=0; AC_SUBST([GNULIB_FSTAT]) - GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT]) - GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS]) - GNULIB_GETUMASK=0; AC_SUBST([GNULIB_GETUMASK]) - GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) - GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT]) - GNULIB_MKDIR=0; AC_SUBST([GNULIB_MKDIR]) - GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT]) - GNULIB_MKFIFO=0; AC_SUBST([GNULIB_MKFIFO]) - GNULIB_MKFIFOAT=0; AC_SUBST([GNULIB_MKFIFOAT]) - GNULIB_MKNOD=0; AC_SUBST([GNULIB_MKNOD]) - GNULIB_MKNODAT=0; AC_SUBST([GNULIB_MKNODAT]) - GNULIB_STAT=0; AC_SUBST([GNULIB_STAT]) - GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT]) - GNULIB_OVERRIDES_STRUCT_STAT=0; AC_SUBST([GNULIB_OVERRIDES_STRUCT_STAT]) - dnl Support Microsoft deprecated alias function names by default. - GNULIB_MDA_CHMOD=1; AC_SUBST([GNULIB_MDA_CHMOD]) - GNULIB_MDA_MKDIR=1; AC_SUBST([GNULIB_MDA_MKDIR]) - GNULIB_MDA_UMASK=1; AC_SUBST([GNULIB_MDA_UMASK]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) diff --git a/gnulib/import/m4/sys_time_h.m4 b/gnulib/import/m4/sys_time_h.m4 index 64f133d..bc5e2b1 100644 --- a/gnulib/import/m4/sys_time_h.m4 +++ b/gnulib/import/m4/sys_time_h.m4 @@ -1,25 +1,20 @@ # Configure a replacement for . -# serial 9 +# serial 12 -# Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2007, 2009-2022 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 and Martin Lambers. -AC_DEFUN([gl_HEADER_SYS_TIME_H], +AC_DEFUN_ONCE([gl_SYS_TIME_H], [ dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1 dnl statements that occur in other macros. - AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY]) -]) - -AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], -[ + AC_REQUIRE([gl_SYS_TIME_H_DEFAULTS]) AC_REQUIRE([AC_C_RESTRICT]) - AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) AC_CHECK_HEADERS_ONCE([sys/time.h]) gl_CHECK_NEXT_HEADERS([sys/time.h]) @@ -89,18 +84,33 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], ]], [gettimeofday]) ]) +# gl_SYS_TIME_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_SYS_TIME_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_SYS_TIME_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]) ]) -AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS], +# 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_SYS_TIME_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_TIME_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETTIMEOFDAY]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_TIME_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_SYS_TIME_H_DEFAULTS]) +]) + +AC_DEFUN([gl_SYS_TIME_H_DEFAULTS], [ - GNULIB_GETTIMEOFDAY=0; AC_SUBST([GNULIB_GETTIMEOFDAY]) dnl Assume POSIX behavior unless another module says otherwise. HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY]) HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL]) diff --git a/gnulib/import/m4/sys_types_h.m4 b/gnulib/import/m4/sys_types_h.m4 index 2172c83..a5bef22 100644 --- a/gnulib/import/m4/sys_types_h.m4 +++ b/gnulib/import/m4/sys_types_h.m4 @@ -1,15 +1,16 @@ -# sys_types_h.m4 serial 11 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +# sys_types_h.m4 serial 13 +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN_ONCE([gl_SYS_TYPES_H], [ + AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS]) + dnl Use sane struct stat types in OpenVMS 8.2 and later. AC_DEFINE([_USE_STD_STAT], 1, [For standard stat data types on VMS.]) - AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS]) gl_NEXT_HEADERS([sys/types.h]) dnl Ensure the type pid_t gets defined. @@ -30,6 +31,17 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H], AC_SUBST([WINDOWS_STAT_INODES]) ]) +# 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_SYS_TYPES_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS], [ + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS]) +]) + AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], [ ]) diff --git a/gnulib/import/m4/sys_uio_h.m4 b/gnulib/import/m4/sys_uio_h.m4 index 503de4d..36f55ea 100644 --- a/gnulib/import/m4/sys_uio_h.m4 +++ b/gnulib/import/m4/sys_uio_h.m4 @@ -1,10 +1,10 @@ -# sys_uio_h.m4 serial 1 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +# sys_uio_h.m4 serial 3 +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN([gl_HEADER_SYS_UIO], +AC_DEFUN_ONCE([gl_SYS_UIO_H], [ AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS]) dnl is always overridden, because of GNULIB_POSIXCHECK. @@ -17,15 +17,30 @@ AC_DEFUN([gl_HEADER_SYS_UIO], AC_SUBST([HAVE_SYS_UIO_H]) ]) +# gl_SYS_UIO_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_SYS_UIO_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_SYS_UIO_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_SYS_UIO_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_UIO_H_MODULE_INDICATOR_DEFAULTS], [ + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_UIO_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS]) +]) + AC_DEFUN([gl_SYS_UIO_H_DEFAULTS], [ ]) diff --git a/gnulib/import/m4/sys_wait_h.m4 b/gnulib/import/m4/sys_wait_h.m4 index 96e9ba2..0aa4f7c 100644 --- a/gnulib/import/m4/sys_wait_h.m4 +++ b/gnulib/import/m4/sys_wait_h.m4 @@ -1,10 +1,10 @@ -# sys_wait_h.m4 serial 6 -dnl Copyright (C) 2008-2021 Free Software Foundation, Inc. +# sys_wait_h.m4 serial 9 +dnl Copyright (C) 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN([gl_SYS_WAIT_H], +AC_DEFUN_ONCE([gl_SYS_WAIT_H], [ AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) @@ -20,17 +20,32 @@ AC_DEFUN([gl_SYS_WAIT_H], [waitpid]) ]) +# gl_SYS_WAIT_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_SYS_WAIT_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_SYS_WAIT_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_SYS_WAIT_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_WAIT_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WAITPID]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_WAIT_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) +]) + AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS], [ - GNULIB_WAITPID=0; AC_SUBST([GNULIB_WAITPID]) dnl Assume proper GNU behavior unless another module says otherwise. ]) diff --git a/gnulib/import/m4/tempname.m4 b/gnulib/import/m4/tempname.m4 index 14c796d..22ccec1 100644 --- a/gnulib/import/m4/tempname.m4 +++ b/gnulib/import/m4/tempname.m4 @@ -1,6 +1,6 @@ #serial 5 -# Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2006-2007, 2009-2022 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/gnulib/import/m4/threadlib.m4 b/gnulib/import/m4/threadlib.m4 index 20b383a..ecb4970 100644 --- a/gnulib/import/m4/threadlib.m4 +++ b/gnulib/import/m4/threadlib.m4 @@ -1,5 +1,5 @@ -# threadlib.m4 serial 29 -dnl Copyright (C) 2005-2021 Free Software Foundation, Inc. +# threadlib.m4 serial 32 +dnl Copyright (C) 2005-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -84,38 +84,48 @@ AC_DEFUN([gl_WEAK_SYMBOLS], AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether imported symbols can be declared weak], [gl_cv_have_weak], - [gl_cv_have_weak=no - dnl First, test whether the compiler accepts it syntactically. - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[extern void xyzzy (); + [case "$host_os" in + cygwin*) + dnl On Cygwin 3.2.0 with gcc 10.2, the test below would succeed, but + dnl programs that use pthread_in_use() with weak symbol references + dnl crash miserably at runtime. + gl_cv_have_weak="guessing no" + ;; + *) + gl_cv_have_weak=no + dnl First, test whether the compiler accepts it syntactically. + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[extern void xyzzy (); #pragma weak xyzzy]], - [[xyzzy();]])], - [gl_cv_have_weak=maybe]) - if test $gl_cv_have_weak = maybe; then - dnl Second, test whether it actually works. On Cygwin 1.7.2, with - dnl gcc 4.3, symbols declared weak always evaluate to the address 0. - AC_RUN_IFELSE( - [AC_LANG_SOURCE([[ + [[xyzzy();]])], + [gl_cv_have_weak=maybe]) + if test $gl_cv_have_weak = maybe; then + dnl Second, test whether it actually works. On Cygwin 1.7.2, with + dnl gcc 4.3, symbols declared weak always evaluate to the address 0. + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ #include #pragma weak fputs int main () { return (fputs == NULL); }]])], - [gl_cv_have_weak=yes], - [gl_cv_have_weak=no], - [dnl When cross-compiling, assume that only ELF platforms support - dnl weak symbols. - AC_EGREP_CPP([Extensible Linking Format], - [#ifdef __ELF__ - Extensible Linking Format - #endif - ], - [gl_cv_have_weak="guessing yes"], - [gl_cv_have_weak="guessing no"]) - ]) - fi + [gl_cv_have_weak=yes], + [gl_cv_have_weak=no], + [dnl When cross-compiling, assume that only ELF platforms support + dnl weak symbols. + AC_EGREP_CPP([Extensible Linking Format], + [#ifdef __ELF__ + Extensible Linking Format + #endif + ], + [gl_cv_have_weak="guessing yes"], + [gl_cv_have_weak="guessing no"]) + ]) + fi + ;; + esac dnl But when linking statically, weak symbols don't work. case " $LDFLAGS " in *" -static "*) gl_cv_have_weak=no ;; @@ -126,7 +136,7 @@ int main () case "$gl_cv_have_weak" in *yes) case "$host_os" in - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) : > conftest1.c $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&AS_MESSAGE_LOG_FD 2>&1 cat < conftest2.c @@ -212,6 +222,27 @@ AC_DEFUN([gl_PTHREADLIB_BODY], LIBS=$save_LIBS test $gl_pthread_api = yes && break done + echo "$as_me:__oline__: gl_pthread_api=$gl_pthread_api" >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: LIBPTHREAD=$LIBPTHREAD" >&AS_MESSAGE_LOG_FD + + gl_pthread_in_glibc=no + # On Linux with glibc >= 2.34, libc contains the fully functional + # pthread functions. + case "$host_os" in + linux*) + AC_EGREP_CPP([Lucky user], + [#include + #ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || (__GLIBC__ > 2) + Lucky user + #endif + #endif + ], + [gl_pthread_in_glibc=yes], + []) + ;; + esac + echo "$as_me:__oline__: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&AS_MESSAGE_LOG_FD # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) @@ -219,18 +250,22 @@ AC_DEFUN([gl_PTHREADLIB_BODY], # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. AC_CHECK_LIB([pthread], [pthread_kill], - [LIBPMULTITHREAD=-lpthread - # On Solaris and HP-UX, most pthread functions exist also in libc. - # Therefore pthread_in_use() needs to actually try to create a - # thread: pthread_create from libc will fail, whereas - # pthread_create will actually create a thread. - # On Solaris 10 or newer, this test is no longer needed, because - # libc contains the fully functional pthread functions. - case "$host_os" in - solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*) - AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1], - [Define if the pthread_in_use() detection is hard.]) - esac + [if test $gl_pthread_in_glibc = yes; then + LIBPMULTITHREAD= + else + LIBPMULTITHREAD=-lpthread + # On Solaris and HP-UX, most pthread functions exist also in libc. + # Therefore pthread_in_use() needs to actually try to create a + # thread: pthread_create from libc will fail, whereas + # pthread_create will actually create a thread. + # On Solaris 10 or newer, this test is no longer needed, because + # libc contains the fully functional pthread functions. + case "$host_os" in + solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*) + AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1], + [Define if the pthread_in_use() detection is hard.]) + esac + fi ]) elif test $gl_pthread_api != yes; then # Some library is needed. Try libpthread and libc_r. @@ -246,6 +281,7 @@ AC_DEFUN([gl_PTHREADLIB_BODY], LIBPMULTITHREAD=-lc_r]) fi fi + echo "$as_me:__oline__: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&AS_MESSAGE_LOG_FD fi AC_MSG_CHECKING([whether POSIX threads API is available]) AC_MSG_RESULT([$gl_pthread_api]) @@ -311,7 +347,8 @@ AC_DEFUN([gl_STDTHREADLIB_BODY], dnl glibc >= 2.29 has thrd_create in libpthread. dnl FreeBSD >= 10 has thrd_create in libstdthreads; this library depends dnl on libpthread (for the symbol 'pthread_mutexattr_gettype'). - dnl AIX >= 7.1 and Solaris >= 11.4 have thrd_create in libc. + dnl glibc >= 2.34, AIX >= 7.1, and Solaris >= 11.4 have thrd_create in + dnl libc. AC_CHECK_FUNCS([thrd_create]) if test $ac_cv_func_thrd_create = yes; then LIBSTDTHREAD= @@ -481,14 +518,17 @@ AC_DEFUN([gl_THREADLIB_BODY], gl_threads_api=posix AC_DEFINE([USE_POSIX_THREADS], [1], [Define if the POSIX multithreading library can be used.]) - if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then + if test -z "$LIBMULTITHREAD" && test -z "$LTLIBMULTITHREAD"; then + AC_DEFINE([USE_POSIX_THREADS_FROM_LIBC], [1], + [Define if references to the POSIX multithreading library are satisfied by libc.]) + else if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then AC_DEFINE([USE_POSIX_THREADS_WEAK], [1], [Define if references to the POSIX multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= else case "$host_os" in - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then dnl If weak symbols can't tell whether pthread_create(), pthread_key_create() dnl etc. will succeed, we need a runtime test. @@ -576,7 +616,9 @@ dnl flavours option weak result dnl --------------- --------- --------- -------- --------- dnl Linux 2.4/glibc posix -lpthread Y OK dnl -dnl GNU Hurd/glibc posix +dnl Linux/glibc 2.34 posix Y OK +dnl +dnl GNU Hurd/glibc posix -lpthread Y OK dnl dnl Ubuntu 14.04 posix -pthread Y OK dnl diff --git a/gnulib/import/m4/time_h.m4 b/gnulib/import/m4/time_h.m4 index b6a1aa3..98d7b6e 100644 --- a/gnulib/import/m4/time_h.m4 +++ b/gnulib/import/m4/time_h.m4 @@ -1,8 +1,8 @@ # Configure a more-standard replacement for . -# Copyright (C) 2000-2001, 2003-2007, 2009-2021 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2022 Free Software Foundation, Inc. -# serial 15 +# serial 19 # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -10,16 +10,11 @@ # Written by Paul Eggert and Jim Meyering. -AC_DEFUN([gl_HEADER_TIME_H], +AC_DEFUN_ONCE([gl_TIME_H], [ - dnl Use AC_REQUIRE here, so that the default behavior below is expanded - dnl once only, before all statements that occur in other macros. - AC_REQUIRE([gl_HEADER_TIME_H_BODY]) -]) - -AC_DEFUN([gl_HEADER_TIME_H_BODY], -[ - AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + dnl Ensure to expand the default settings once only, before all statements + dnl that occur in other macros. + AC_REQUIRE([gl_TIME_H_DEFAULTS]) gl_NEXT_HEADERS([time.h]) AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) @@ -111,36 +106,53 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC], AC_SUBST([UNISTD_H_DEFINES_STRUCT_TIMESPEC]) ]) +# gl_TIME_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_TIME_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_TIME_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]) ]) -AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS], +# 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_TIME_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_TIME_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CTIME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKTIME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALTIME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NANOSLEEP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRFTIME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPTIME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMEGM]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GET]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GETRES]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME_R]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME_RZ]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TZSET]) + dnl Support Microsoft deprecated alias function names by default. + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_TZSET], [1]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_TIME_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_TIME_H_DEFAULTS]) +]) + +AC_DEFUN([gl_TIME_H_DEFAULTS], [ - GNULIB_CTIME=0; AC_SUBST([GNULIB_CTIME]) - GNULIB_MKTIME=0; AC_SUBST([GNULIB_MKTIME]) - GNULIB_LOCALTIME=0; AC_SUBST([GNULIB_LOCALTIME]) - GNULIB_NANOSLEEP=0; AC_SUBST([GNULIB_NANOSLEEP]) - GNULIB_STRFTIME=0; AC_SUBST([GNULIB_STRFTIME]) - GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME]) - GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) - GNULIB_TIMESPEC_GET=0; AC_SUBST([GNULIB_TIMESPEC_GET]) - GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) - GNULIB_TIME_RZ=0; AC_SUBST([GNULIB_TIME_RZ]) - GNULIB_TZSET=0; AC_SUBST([GNULIB_TZSET]) - dnl Support Microsoft deprecated alias function names by default. - GNULIB_MDA_TZSET=1; AC_SUBST([GNULIB_MDA_TZSET]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) HAVE_TIMESPEC_GET=1; AC_SUBST([HAVE_TIMESPEC_GET]) + 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. diff --git a/gnulib/import/m4/time_r.m4 b/gnulib/import/m4/time_r.m4 index 713e93a..8a1ad9d 100644 --- a/gnulib/import/m4/time_r.m4 +++ b/gnulib/import/m4/time_r.m4 @@ -1,6 +1,6 @@ dnl Reentrant time functions: localtime_r, gmtime_r. -dnl Copyright (C) 2003, 2006-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2006-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -12,7 +12,7 @@ AC_DEFUN([gl_TIME_R], dnl Persuade glibc and Solaris to declare localtime_r. AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) + AC_REQUIRE([gl_TIME_H_DEFAULTS]) AC_REQUIRE([AC_C_RESTRICT]) dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is diff --git a/gnulib/import/m4/unistd-safer.m4 b/gnulib/import/m4/unistd-safer.m4 index c205446..33158a4 100644 --- a/gnulib/import/m4/unistd-safer.m4 +++ b/gnulib/import/m4/unistd-safer.m4 @@ -1,5 +1,5 @@ #serial 9 -dnl Copyright (C) 2002, 2005-2006, 2009-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2005-2006, 2009-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/unistd_h.m4 b/gnulib/import/m4/unistd_h.m4 index 0f26fb9..4c66ccc 100644 --- a/gnulib/import/m4/unistd_h.m4 +++ b/gnulib/import/m4/unistd_h.m4 @@ -1,15 +1,15 @@ -# unistd_h.m4 serial 85 -dnl Copyright (C) 2006-2021 Free Software Foundation, Inc. +# unistd_h.m4 serial 90 +dnl Copyright (C) 2006-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Simon Josefsson, Bruno Haible. -AC_DEFUN([gl_UNISTD_H], +AC_DEFUN_ONCE([gl_UNISTD_H], [ - dnl Use AC_REQUIRE here, so that the default behavior below is expanded - dnl once only, before all statements that occur in other macros. + dnl Ensure to expand the default settings once only, before all statements + dnl that occur in other macros. AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([unistd.h]) @@ -59,193 +59,212 @@ AC_DEFUN([gl_UNISTD_H], fi ]) +# gl_UNISTD_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_UNISTD_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_UNISTD_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_UNISTD_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_UNISTD_H_MODULE_INDICATOR_DEFAULTS], [ + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCESS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHDIR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHOWN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CLOSE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPY_FILE_RANGE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP2]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP3]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ENVIRON]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EUIDACCESS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECLE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECLP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECV]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVPE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FACCESSAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHDIR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHOWNAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDATASYNC]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSYNC]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTRUNCATE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCWD]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDOMAINNAME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDTABLESIZE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETENTROPY]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETGROUPS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETHOSTNAME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOGIN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOGIN_R]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETOPT_POSIX]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAGESIZE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPASS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPASS_GNU]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETUSERSHELL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GROUP_MEMBER]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISATTY]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LCHOWN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LINK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LINKAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LSEEK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PIPE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PIPE2]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PREAD]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PWRITE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READ]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READLINK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READLINKAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RMDIR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETHOSTNAME]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SLEEP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYMLINK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYMLINKAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCATE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TTYNAME_R]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_NONBLOCKING]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_SIGPIPE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLINK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLINKAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_USLEEP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WRITE]) + dnl Support Microsoft deprecated alias function names by default. + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ACCESS], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CHDIR], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CLOSE], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_DUP], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_DUP2], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECL], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECLE], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECLP], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECV], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVE], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVP], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVPE], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETCWD], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETPID], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ISATTY], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_LSEEK], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_READ], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_RMDIR], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_SWAB], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UNLINK], [1]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WRITE], [1]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_UNISTD_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) +]) + AC_DEFUN([gl_UNISTD_H_DEFAULTS], [ - GNULIB_ACCESS=0; AC_SUBST([GNULIB_ACCESS]) - GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR]) - GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN]) - GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE]) - GNULIB_COPY_FILE_RANGE=0; AC_SUBST([GNULIB_COPY_FILE_RANGE]) - GNULIB_DUP=0; AC_SUBST([GNULIB_DUP]) - GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2]) - GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) - GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) - GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) - GNULIB_EXECL=0; AC_SUBST([GNULIB_EXECL]) - GNULIB_EXECLE=0; AC_SUBST([GNULIB_EXECLE]) - GNULIB_EXECLP=0; AC_SUBST([GNULIB_EXECLP]) - GNULIB_EXECV=0; AC_SUBST([GNULIB_EXECV]) - GNULIB_EXECVE=0; AC_SUBST([GNULIB_EXECVE]) - GNULIB_EXECVP=0; AC_SUBST([GNULIB_EXECVP]) - GNULIB_EXECVPE=0; AC_SUBST([GNULIB_EXECVPE]) - GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) - GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) - GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) - GNULIB_FDATASYNC=0; AC_SUBST([GNULIB_FDATASYNC]) - GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC]) - GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) - GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) - GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) - GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) - GNULIB_GETENTROPY=0; AC_SUBST([GNULIB_GETENTROPY]) - GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) - GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) - GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) - GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) - GNULIB_GETOPT_POSIX=0; AC_SUBST([GNULIB_GETOPT_POSIX]) - GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) - GNULIB_GETPASS=0; AC_SUBST([GNULIB_GETPASS]) - GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) - GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER]) - GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY]) - GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) - GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) - GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT]) - GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) - GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE]) - GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2]) - GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD]) - GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE]) - GNULIB_READ=0; AC_SUBST([GNULIB_READ]) - GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) - GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT]) - GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR]) - GNULIB_SETHOSTNAME=0; AC_SUBST([GNULIB_SETHOSTNAME]) - GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) - GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK]) - GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT]) - GNULIB_TRUNCATE=0; AC_SUBST([GNULIB_TRUNCATE]) - GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R]) - GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING]) - GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE]) - GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK]) - GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) - GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) - GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) - dnl Support Microsoft deprecated alias function names by default. - GNULIB_MDA_ACCESS=1; AC_SUBST([GNULIB_MDA_ACCESS]) - GNULIB_MDA_CHDIR=1; AC_SUBST([GNULIB_MDA_CHDIR]) - GNULIB_MDA_CLOSE=1; AC_SUBST([GNULIB_MDA_CLOSE]) - GNULIB_MDA_DUP=1; AC_SUBST([GNULIB_MDA_DUP]) - GNULIB_MDA_DUP2=1; AC_SUBST([GNULIB_MDA_DUP2]) - GNULIB_MDA_EXECL=1; AC_SUBST([GNULIB_MDA_EXECL]) - GNULIB_MDA_EXECLE=1; AC_SUBST([GNULIB_MDA_EXECLE]) - GNULIB_MDA_EXECLP=1; AC_SUBST([GNULIB_MDA_EXECLP]) - GNULIB_MDA_EXECV=1; AC_SUBST([GNULIB_MDA_EXECV]) - GNULIB_MDA_EXECVE=1; AC_SUBST([GNULIB_MDA_EXECVE]) - GNULIB_MDA_EXECVP=1; AC_SUBST([GNULIB_MDA_EXECVP]) - GNULIB_MDA_EXECVPE=1; AC_SUBST([GNULIB_MDA_EXECVPE]) - GNULIB_MDA_GETCWD=1; AC_SUBST([GNULIB_MDA_GETCWD]) - GNULIB_MDA_GETPID=1; AC_SUBST([GNULIB_MDA_GETPID]) - GNULIB_MDA_ISATTY=1; AC_SUBST([GNULIB_MDA_ISATTY]) - GNULIB_MDA_LSEEK=1; AC_SUBST([GNULIB_MDA_LSEEK]) - GNULIB_MDA_READ=1; AC_SUBST([GNULIB_MDA_READ]) - GNULIB_MDA_RMDIR=1; AC_SUBST([GNULIB_MDA_RMDIR]) - GNULIB_MDA_SWAB=1; AC_SUBST([GNULIB_MDA_SWAB]) - GNULIB_MDA_UNLINK=1; AC_SUBST([GNULIB_MDA_UNLINK]) - GNULIB_MDA_WRITE=1; AC_SUBST([GNULIB_MDA_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) - HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE]) - HAVE_DUP3=1; AC_SUBST([HAVE_DUP3]) - HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) - HAVE_EXECVPE=1; AC_SUBST([HAVE_EXECVPE]) - HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) - HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR]) - HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) - HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC]) - HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) - HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) - HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) - HAVE_GETENTROPY=1; AC_SUBST([HAVE_GETENTROPY]) - HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS]) - HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) - HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) - HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) - HAVE_GETPASS=1; AC_SUBST([HAVE_GETPASS]) - HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER]) - HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) - HAVE_LINK=1; AC_SUBST([HAVE_LINK]) - HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT]) - HAVE_PIPE=1; AC_SUBST([HAVE_PIPE]) - HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2]) - HAVE_PREAD=1; AC_SUBST([HAVE_PREAD]) - HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE]) - HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) - HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT]) - HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME]) - HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) - HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) - HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) - HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) - HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) - HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) - HAVE_DECL_EXECVPE=1; AC_SUBST([HAVE_DECL_EXECVPE]) - HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) - HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) - HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) - HAVE_DECL_GETLOGIN=1; AC_SUBST([HAVE_DECL_GETLOGIN]) - HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) - HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) - HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) - HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME]) - HAVE_DECL_TRUNCATE=1; AC_SUBST([HAVE_DECL_TRUNCATE]) - HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R]) - HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) - HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) - REPLACE_ACCESS=0; AC_SUBST([REPLACE_ACCESS]) - REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) - REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) - REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) - REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) - REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL]) - REPLACE_EXECLE=0; AC_SUBST([REPLACE_EXECLE]) - REPLACE_EXECLP=0; AC_SUBST([REPLACE_EXECLP]) - REPLACE_EXECV=0; AC_SUBST([REPLACE_EXECV]) - REPLACE_EXECVE=0; AC_SUBST([REPLACE_EXECVE]) - REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP]) - REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE]) - REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT]) - REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) - REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) - REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) - REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME]) - REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE]) - REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R]) - REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS]) - REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) - REPLACE_GETPASS=0; AC_SUBST([REPLACE_GETPASS]) - REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY]) - REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) - REPLACE_LINK=0; AC_SUBST([REPLACE_LINK]) - REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT]) - REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) - REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD]) - REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) - REPLACE_READ=0; AC_SUBST([REPLACE_READ]) - REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) - REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT]) - REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) - REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) - REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK]) - REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT]) - REPLACE_TRUNCATE=0; AC_SUBST([REPLACE_TRUNCATE]) - REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R]) - REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK]) - REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT]) - REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP]) - REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE]) - UNISTD_H_HAVE_SYS_RANDOM_H=0; AC_SUBST([UNISTD_H_HAVE_SYS_RANDOM_H]) - UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) + HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) + HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE]) + HAVE_DUP3=1; AC_SUBST([HAVE_DUP3]) + HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) + HAVE_EXECVPE=1; AC_SUBST([HAVE_EXECVPE]) + HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) + HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR]) + HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) + HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC]) + HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) + HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) + HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) + HAVE_GETENTROPY=1; AC_SUBST([HAVE_GETENTROPY]) + HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS]) + HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) + HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) + HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) + HAVE_GETPASS=1; AC_SUBST([HAVE_GETPASS]) + HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER]) + HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN]) + HAVE_LINK=1; AC_SUBST([HAVE_LINK]) + HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT]) + HAVE_PIPE=1; AC_SUBST([HAVE_PIPE]) + HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2]) + HAVE_PREAD=1; AC_SUBST([HAVE_PREAD]) + HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE]) + HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) + HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT]) + HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME]) + HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) + HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK]) + HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT]) + HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) + HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) + HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) + HAVE_DECL_EXECVPE=1; AC_SUBST([HAVE_DECL_EXECVPE]) + HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) + HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) + HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) + HAVE_DECL_GETLOGIN=1; AC_SUBST([HAVE_DECL_GETLOGIN]) + HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) + HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) + HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) + HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME]) + HAVE_DECL_TRUNCATE=1; AC_SUBST([HAVE_DECL_TRUNCATE]) + HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R]) + HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) + HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) + REPLACE_ACCESS=0; AC_SUBST([REPLACE_ACCESS]) + REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) + REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) + REPLACE_COPY_FILE_RANGE=0; AC_SUBST([REPLACE_COPY_FILE_RANGE]) + REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) + REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) + REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL]) + REPLACE_EXECLE=0; AC_SUBST([REPLACE_EXECLE]) + REPLACE_EXECLP=0; AC_SUBST([REPLACE_EXECLP]) + REPLACE_EXECV=0; AC_SUBST([REPLACE_EXECV]) + REPLACE_EXECVE=0; AC_SUBST([REPLACE_EXECVE]) + REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP]) + REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE]) + REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT]) + REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) + REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) + REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) + REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME]) + REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE]) + REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R]) + REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS]) + REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) + REPLACE_GETPASS=0; AC_SUBST([REPLACE_GETPASS]) + REPLACE_GETPASS_FOR_GETPASS_GNU=0; AC_SUBST([REPLACE_GETPASS_FOR_GETPASS_GNU]) + REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY]) + REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN]) + REPLACE_LINK=0; AC_SUBST([REPLACE_LINK]) + REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT]) + REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) + REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD]) + REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) + REPLACE_READ=0; AC_SUBST([REPLACE_READ]) + REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) + REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT]) + REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) + REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) + REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK]) + REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT]) + REPLACE_TRUNCATE=0; AC_SUBST([REPLACE_TRUNCATE]) + REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R]) + REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK]) + REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT]) + REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP]) + REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE]) + UNISTD_H_HAVE_SYS_RANDOM_H=0; AC_SUBST([UNISTD_H_HAVE_SYS_RANDOM_H]) + UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) ]) diff --git a/gnulib/import/m4/vararrays.m4 b/gnulib/import/m4/vararrays.m4 new file mode 100644 index 0000000..28e22a4 --- /dev/null +++ b/gnulib/import/m4/vararrays.m4 @@ -0,0 +1,72 @@ +# Check for variable-length arrays. + +# serial 6 + +# From Paul Eggert + +# Copyright (C) 2001, 2009-2022 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. + +m4_version_prereq([2.70], [], [ + +# AC_C_VARARRAYS +# -------------- +# Check whether the C compiler supports variable-length arrays. +AC_DEFUN([AC_C_VARARRAYS], +[ + AC_CACHE_CHECK([for variable-length arrays], + ac_cv_c_vararrays, + [AC_EGREP_CPP([defined], + [#ifdef __STDC_NO_VLA__ + defined + #endif + ], + [ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined'], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + https://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + ]])], + [ac_cv_c_vararrays=yes], + [ac_cv_c_vararrays=no])])]) + if test "$ac_cv_c_vararrays" = yes; then + dnl This is for compatibility with Autoconf 2.61-2.69. + AC_DEFINE([HAVE_C_VARARRAYS], 1, + [Define to 1 if C supports variable-length arrays.]) + elif test "$ac_cv_c_vararrays" = no; then + AC_DEFINE([__STDC_NO_VLA__], 1, + [Define to 1 if C does not support variable-length arrays, and + if the compiler does not already define this.]) + fi +]) + +]) diff --git a/gnulib/import/m4/visibility.m4 b/gnulib/import/m4/visibility.m4 index 6e4b461..4a212a4 100644 --- a/gnulib/import/m4/visibility.m4 +++ b/gnulib/import/m4/visibility.m4 @@ -1,5 +1,5 @@ -# visibility.m4 serial 6 -dnl Copyright (C) 2005, 2008, 2010-2021 Free Software Foundation, Inc. +# visibility.m4 serial 8 +dnl Copyright (C) 2005, 2008, 2010-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -58,6 +58,11 @@ AC_DEFUN([gl_VISIBILITY], extern __attribute__((__visibility__("default"))) int exportedvar; extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); extern __attribute__((__visibility__("default"))) int exportedfunc (void); + void dummyfunc (void); + int hiddenvar; + int exportedvar; + int hiddenfunc (void) { return 51; } + int exportedfunc (void) { return 1225736919; } void dummyfunc (void) {} ]], [[]])], diff --git a/gnulib/import/m4/warn-on-use.m4 b/gnulib/import/m4/warn-on-use.m4 index 04edfe8..d43355a 100644 --- a/gnulib/import/m4/warn-on-use.m4 +++ b/gnulib/import/m4/warn-on-use.m4 @@ -1,5 +1,5 @@ # warn-on-use.m4 serial 9 -dnl Copyright (C) 2010-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/wchar_h.m4 b/gnulib/import/m4/wchar_h.m4 index 59c55fc..4baba1a 100644 --- a/gnulib/import/m4/wchar_h.m4 +++ b/gnulib/import/m4/wchar_h.m4 @@ -1,15 +1,15 @@ dnl A placeholder for ISO C99 , for platforms that have issues. -dnl Copyright (C) 2007-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Eric Blake. -# wchar_h.m4 serial 50 +# wchar_h.m4 serial 55 -AC_DEFUN([gl_WCHAR_H], +AC_DEFUN_ONCE([gl_WCHAR_H], [ AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) AC_REQUIRE([gl_WCHAR_H_INLINE_OK]) @@ -125,60 +125,77 @@ Configuration aborted.]) fi ]) +# gl_WCHAR_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_WCHAR_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_WCHAR_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_WCHAR_H_REQUIRE_DEFAULTS], +[ + m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCHAR_H_MODULE_INDICATOR_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_MBRTOWC]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRLEN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRTOWCS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNRTOWCS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCRTOMB]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSRTOMBS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNRTOMBS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCWIDTH]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCHR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCMP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCPY]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMMOVE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMPCPY]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMSET]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSLEN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNLEN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCPY]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCPCPY]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCPY]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCPNCPY]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCAT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCMP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCMP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCASECMP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCASECMP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCOLL]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSXFRM]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSDUP]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCHR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSRCHR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCSPN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSSPN]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSPBRK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSSTR]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSTOK]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSWIDTH]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSFTIME]) + dnl Support Microsoft deprecated alias function names by default. + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WCSDUP], [1]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_WCHAR_H_MODULE_INDICATOR_DEFAULTS]) + dnl Make sure the shell variable for GNULIB_FREE_POSIX is initialized. + gl_STDLIB_H_REQUIRE_DEFAULTS + AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) +]) + AC_DEFUN([gl_WCHAR_H_DEFAULTS], [ - GNULIB_BTOWC=0; AC_SUBST([GNULIB_BTOWC]) - GNULIB_WCTOB=0; AC_SUBST([GNULIB_WCTOB]) - GNULIB_MBSINIT=0; AC_SUBST([GNULIB_MBSINIT]) - GNULIB_MBRTOWC=0; AC_SUBST([GNULIB_MBRTOWC]) - GNULIB_MBRLEN=0; AC_SUBST([GNULIB_MBRLEN]) - GNULIB_MBSRTOWCS=0; AC_SUBST([GNULIB_MBSRTOWCS]) - GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS]) - GNULIB_WCRTOMB=0; AC_SUBST([GNULIB_WCRTOMB]) - GNULIB_WCSRTOMBS=0; AC_SUBST([GNULIB_WCSRTOMBS]) - GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS]) - GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) - GNULIB_WMEMCHR=0; AC_SUBST([GNULIB_WMEMCHR]) - GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP]) - GNULIB_WMEMCPY=0; AC_SUBST([GNULIB_WMEMCPY]) - GNULIB_WMEMMOVE=0; AC_SUBST([GNULIB_WMEMMOVE]) - GNULIB_WMEMPCPY=0; AC_SUBST([GNULIB_WMEMPCPY]) - GNULIB_WMEMSET=0; AC_SUBST([GNULIB_WMEMSET]) - GNULIB_WCSLEN=0; AC_SUBST([GNULIB_WCSLEN]) - GNULIB_WCSNLEN=0; AC_SUBST([GNULIB_WCSNLEN]) - GNULIB_WCSCPY=0; AC_SUBST([GNULIB_WCSCPY]) - GNULIB_WCPCPY=0; AC_SUBST([GNULIB_WCPCPY]) - GNULIB_WCSNCPY=0; AC_SUBST([GNULIB_WCSNCPY]) - GNULIB_WCPNCPY=0; AC_SUBST([GNULIB_WCPNCPY]) - GNULIB_WCSCAT=0; AC_SUBST([GNULIB_WCSCAT]) - GNULIB_WCSNCAT=0; AC_SUBST([GNULIB_WCSNCAT]) - GNULIB_WCSCMP=0; AC_SUBST([GNULIB_WCSCMP]) - GNULIB_WCSNCMP=0; AC_SUBST([GNULIB_WCSNCMP]) - GNULIB_WCSCASECMP=0; AC_SUBST([GNULIB_WCSCASECMP]) - GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP]) - GNULIB_WCSCOLL=0; AC_SUBST([GNULIB_WCSCOLL]) - GNULIB_WCSXFRM=0; AC_SUBST([GNULIB_WCSXFRM]) - GNULIB_WCSDUP=0; AC_SUBST([GNULIB_WCSDUP]) - GNULIB_WCSCHR=0; AC_SUBST([GNULIB_WCSCHR]) - GNULIB_WCSRCHR=0; AC_SUBST([GNULIB_WCSRCHR]) - GNULIB_WCSCSPN=0; AC_SUBST([GNULIB_WCSCSPN]) - GNULIB_WCSSPN=0; AC_SUBST([GNULIB_WCSSPN]) - GNULIB_WCSPBRK=0; AC_SUBST([GNULIB_WCSPBRK]) - GNULIB_WCSSTR=0; AC_SUBST([GNULIB_WCSSTR]) - GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK]) - GNULIB_WCSWIDTH=0; AC_SUBST([GNULIB_WCSWIDTH]) - GNULIB_WCSFTIME=0; AC_SUBST([GNULIB_WCSFTIME]) - dnl Support Microsoft deprecated alias function names by default. - GNULIB_MDA_WCSDUP=1; AC_SUBST([GNULIB_MDA_WCSDUP]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) diff --git a/gnulib/import/m4/wchar_t.m4 b/gnulib/import/m4/wchar_t.m4 index 34db10e..268e3e5 100644 --- a/gnulib/import/m4/wchar_t.m4 +++ b/gnulib/import/m4/wchar_t.m4 @@ -1,5 +1,5 @@ # wchar_t.m4 serial 4 (gettext-0.18.2) -dnl Copyright (C) 2002-2003, 2008-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2008-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/wctype_h.m4 b/gnulib/import/m4/wctype_h.m4 index 1ab0bc9..702cb39 100644 --- a/gnulib/import/m4/wctype_h.m4 +++ b/gnulib/import/m4/wctype_h.m4 @@ -1,15 +1,15 @@ -# wctype_h.m4 serial 26 +# wctype_h.m4 serial 30 dnl A placeholder for ISO C99 , for platforms that lack it. -dnl Copyright (C) 2006-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Paul Eggert. -AC_DEFUN([gl_WCTYPE_H], +AC_DEFUN_ONCE([gl_WCTYPE_H], [ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) AC_REQUIRE([AC_PROG_CC]) @@ -62,7 +62,7 @@ AC_DEFUN([gl_WCTYPE_H], fi AC_SUBST([HAVE_WCTYPE_H]) - if test $GNULIB_OVERRIDES_WINT_T = 1; then + if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then REPLACE_ISWCNTRL=1 else case "$gl_cv_func_iswcntrl_works" in @@ -157,24 +157,39 @@ AC_DEFUN([gl_WCTYPE_H], ]) ]) +# gl_WCTYPE_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_WCTYPE_MODULE_INDICATOR], [ - dnl Use AC_REQUIRE here, so that the default settings are expanded once only. - AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) + dnl Ensure to expand the default settings once only. + gl_WCTYPE_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_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_ISWXDIGIT]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTYPE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWCTYPE]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTRANS]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOWCTRANS]) + ]) + m4_require(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS]) + AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) +]) + AC_DEFUN([gl_WCTYPE_H_DEFAULTS], [ - GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK]) - GNULIB_ISWDIGIT=0; AC_SUBST([GNULIB_ISWDIGIT]) - GNULIB_ISWXDIGIT=0; AC_SUBST([GNULIB_ISWXDIGIT]) - GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE]) - GNULIB_ISWCTYPE=0; AC_SUBST([GNULIB_ISWCTYPE]) - GNULIB_WCTRANS=0; AC_SUBST([GNULIB_WCTRANS]) - GNULIB_TOWCTRANS=0; AC_SUBST([GNULIB_TOWCTRANS]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK]) HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T]) diff --git a/gnulib/import/m4/wint_t.m4 b/gnulib/import/m4/wint_t.m4 index 2fc7467..adc5866 100644 --- a/gnulib/import/m4/wint_t.m4 +++ b/gnulib/import/m4/wint_t.m4 @@ -1,5 +1,5 @@ -# wint_t.m4 serial 10 -dnl Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc. +# wint_t.m4 serial 11 +dnl Copyright (C) 2003, 2007-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -34,14 +34,14 @@ AC_DEFUN([gt_TYPE_WINT_T], [gl_cv_type_wint_t_large_enough=yes], [gl_cv_type_wint_t_large_enough=no])]) if test $gl_cv_type_wint_t_large_enough = no; then - GNULIB_OVERRIDES_WINT_T=1 + GNULIBHEADERS_OVERRIDE_WINT_T=1 else - GNULIB_OVERRIDES_WINT_T=0 + GNULIBHEADERS_OVERRIDE_WINT_T=0 fi else - GNULIB_OVERRIDES_WINT_T=0 + GNULIBHEADERS_OVERRIDE_WINT_T=0 fi - AC_SUBST([GNULIB_OVERRIDES_WINT_T]) + AC_SUBST([GNULIBHEADERS_OVERRIDE_WINT_T]) ]) dnl Prerequisites of the 'wint_t' override. diff --git a/gnulib/import/m4/wmemchr.m4 b/gnulib/import/m4/wmemchr.m4 index a5b4eb7..e75b551 100644 --- a/gnulib/import/m4/wmemchr.m4 +++ b/gnulib/import/m4/wmemchr.m4 @@ -1,5 +1,5 @@ # wmemchr.m4 serial 5 -dnl Copyright (C) 2011-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/wmempcpy.m4 b/gnulib/import/m4/wmempcpy.m4 index 9d774ae..9765039 100644 --- a/gnulib/import/m4/wmempcpy.m4 +++ b/gnulib/import/m4/wmempcpy.m4 @@ -1,5 +1,5 @@ # wmempcpy.m4 serial 1 -dnl Copyright (C) 2020-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff --git a/gnulib/import/m4/year2038.m4 b/gnulib/import/m4/year2038.m4 new file mode 100644 index 0000000..06db589 --- /dev/null +++ b/gnulib/import/m4/year2038.m4 @@ -0,0 +1,124 @@ +# year2038.m4 serial 7 +dnl Copyright (C) 2017-2022 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Attempt to ensure that 'time_t' can go past the year 2038 and that +dnl the functions 'time', 'stat', etc. work with post-2038 timestamps. + +AC_DEFUN([gl_YEAR2038_EARLY], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) + AC_DEFINE([__MINGW_USE_VC2005_COMPAT], [1], + [For 64-bit time_t on 32-bit mingw.]) + ;; + esac +]) + +# gl_YEAR2038_TEST_INCLUDES +# ------------------------- +AC_DEFUN([gl_YEAR2038_TEST_INCLUDES], +[[ + #include + /* Check that time_t can represent 2**32 - 1 correctly. */ + #define LARGE_TIME_T \\ + ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) + int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 + && LARGE_TIME_T % 65537 == 0) + ? 1 : -1]; +]]) + +# gl_YEAR2038_BODY(REQUIRE-YEAR2038-SAFE) +----------------------------------------- +AC_DEFUN([gl_YEAR2038_BODY], +[ + AC_ARG_ENABLE([year2038], + [ --disable-year2038 omit support for timestamps past the year 2038]) + AS_IF([test "$enable_year2038" != no], + [ + dnl On many systems, time_t is already a 64-bit type. + dnl On those systems where time_t is still 32-bit, it requires kernel + dnl and libc support to make it 64-bit. For glibc 2.34 and later on Linux, + dnl defining _TIME_BITS=64 and _FILE_OFFSET_BITS=64 is needed on x86 and ARM. + dnl + dnl On native Windows, the system include files define types __time32_t + dnl and __time64_t. By default, time_t is an alias of + dnl - __time32_t on 32-bit mingw, + dnl - __time64_t on 64-bit mingw and on MSVC (since MSVC 8). + dnl But when compiling with -D__MINGW_USE_VC2005_COMPAT, time_t is an + dnl alias of __time64_t. + dnl And when compiling with -D_USE_32BIT_TIME_T, time_t is an alias of + dnl __time32_t. + AC_CACHE_CHECK([for time_t past the year 2038], [gl_cv_type_time_t_y2038], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([gl_YEAR2038_TEST_INCLUDES])], + [gl_cv_type_time_t_y2038=yes], [gl_cv_type_time_t_y2038=no]) + ]) + if test "$gl_cv_type_time_t_y2038" = no; then + AC_CACHE_CHECK([for 64-bit time_t with _TIME_BITS=64], + [gl_cv_type_time_t_bits_macro], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([[#define _TIME_BITS 64 + #define _FILE_OFFSET_BITS 64 + ]gl_YEAR2038_TEST_INCLUDES])], + [gl_cv_type_time_t_bits_macro=yes], + [gl_cv_type_time_t_bits_macro=no]) + ]) + if test "$gl_cv_type_time_t_bits_macro" = yes; then + AC_DEFINE([_TIME_BITS], [64], + [Number of bits in a timestamp, on hosts where this is settable.]) + dnl AC_SYS_LARGFILE also defines this; it's OK if we do too. + AC_DEFINE([_FILE_OFFSET_BITS], [64], + [Number of bits in a file offset, on hosts where this is settable.]) + gl_cv_type_time_t_y2038=yes + fi + fi + if test $gl_cv_type_time_t_y2038 = no; then + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifdef _USE_32BIT_TIME_T + int ok; + #else + error fail + #endif + ]])], + [AC_MSG_FAILURE( + [The 'time_t' type stops working after January 2038. + Remove _USE_32BIT_TIME_T from the compiler flags.])], + [# If not cross-compiling and $1 says we should check, + # and 'touch' works with a large timestamp, then evidently wider time_t + # is desired and supported, so fail and ask the builder to fix the + # problem. Otherwise, just warn the builder. + m4_ifval([$1], + [if test $cross_compiling = no \ + && TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null; then + case `TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null` in + *'Feb 7 2106'* | *'Feb 7 17:10'*) + AC_MSG_FAILURE( + [The 'time_t' type stops working after January 2038, + and your system appears to support a wider 'time_t'. + Try configuring with 'CC="${CC} -m64"'. + To build with a 32-bit time_t anyway (not recommended), + configure with '--disable-year2038'.]);; + esac + rm -f conftest.time + fi]) + if test "$gl_warned_about_y2038" != yes; then + AC_MSG_WARN( + [The 'time_t' type stops working after January 2038, + and this package needs a wider 'time_t' type + if there is any way to access timestamps after that. + Configure with 'CC="${CC} -m64"' perhaps?]) + gl_warned_about_y2038=yes + fi + ]) + fi]) +]) + +AC_DEFUN([gl_YEAR2038], +[ + gl_YEAR2038_BODY([require-year2038-safe]) +]) diff --git a/gnulib/import/m4/zzgnulib.m4 b/gnulib/import/m4/zzgnulib.m4 index b953384..fd73a20 100644 --- a/gnulib/import/m4/zzgnulib.m4 +++ b/gnulib/import/m4/zzgnulib.m4 @@ -1,5 +1,5 @@ # zzgnulib.m4 serial 1 -dnl Copyright (C) 2020-2021 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2022 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -- cgit v1.1