summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2020-12-24 16:48:40 +0100
committerPhilipp Stephani <phst@google.com>2020-12-24 16:48:40 +0100
commit29064d02c31b08ae41d41a93fd1439718373b196 (patch)
tree6c976729d7c6f296b36965f235d2a58e8142393e /m4
parent26b8b30ff42568ff3e3f8599a20328a1efe93d2a (diff)
downloademacs-29064d02c31b08ae41d41a93fd1439718373b196.tar.gz
Update Gnulib.
All changes in this commit are autogenerated by running admin/merge-gnulib.
Diffstat (limited to 'm4')
-rw-r--r--m4/alloca.m44
-rw-r--r--m4/extensions.m4160
-rw-r--r--m4/fcntl.m452
-rw-r--r--m4/filemode.m43
-rw-r--r--m4/free.m449
-rw-r--r--m4/fsusage.m43
-rw-r--r--m4/gnulib-common.m463
-rw-r--r--m4/gnulib-comp.m492
-rw-r--r--m4/largefile.m42
-rw-r--r--m4/mbstate_t.m411
-rw-r--r--m4/pid_t.m438
-rw-r--r--m4/rawmemchr.m420
-rw-r--r--m4/readlink.m461
-rw-r--r--m4/readlinkat.m413
-rw-r--r--m4/std-gnu11.m45
-rw-r--r--m4/stdint.m410
-rw-r--r--m4/stdio_h.m48
-rw-r--r--m4/stdlib_h.m436
-rw-r--r--m4/sys_types_h.m422
-rw-r--r--m4/unistd_h.m411
-rw-r--r--m4/vararrays.m414
21 files changed, 481 insertions, 196 deletions
diff --git a/m4/alloca.m4 b/m4/alloca.m4
index d8414896308..e3c377c9e2c 100644
--- a/m4/alloca.m4
+++ b/m4/alloca.m4
@@ -1,4 +1,4 @@
-# alloca.m4 serial 18
+# alloca.m4 serial 20
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2020 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -104,5 +104,5 @@ AH_VERBATIM([STACK_DIRECTION],
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION])dnl
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
-])
+])# _AC_LIBOBJ_ALLOCA
])
diff --git a/m4/extensions.m4 b/m4/extensions.m4
index d7c95effdac..44be1d15cbf 100644
--- a/m4/extensions.m4
+++ b/m4/extensions.m4
@@ -1,4 +1,4 @@
-# serial 18 -*- Autoconf -*-
+# serial 21 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
# Copyright (C) 2003, 2006-2020 Free Software Foundation, Inc.
@@ -6,9 +6,14 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
+dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that
+dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+.
+m4_ifndef([AC_CHECK_INCLUDES_DEFAULT],
+ [AC_DEFUN([AC_CHECK_INCLUDES_DEFAULT], [])])
+
# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
# Autoconf. Perhaps we can remove this once we can assume Autoconf
-# 2.70 or later everywhere, but since Autoconf mutates rapidly
+# is recent-enough everywhere, but since Autoconf mutates rapidly
# enough in this area it's likely we'll need to redefine
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
@@ -26,36 +31,27 @@
# its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
# invocation occurs in gl_EARLY, not in gl_INIT.
+m4_version_prereq([2.70.1], [], [
+
# AC_USE_SYSTEM_EXTENSIONS
# ------------------------
# Enable extensions on systems that normally disable them,
# typically due to standards-conformance issues.
-#
-# Remember that #undef in AH_VERBATIM gets replaced with #define by
-# AC_DEFINE. The goal here is to define all known feature-enabling
-# macros, then, if reports of conflicts are made, disable macros that
-# cause problems on some platforms (such as __EXTENSIONS__).
+# We unconditionally define as many of the known feature-enabling
+# as possible, reserving conditional behavior for macros that are
+# known to cause problems on some platforms (such as __EXTENSIONS__).
AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
-[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+[AC_BEFORE([$0], [AC_PREPROC_IFELSE])dnl
+AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_LINK_IFELSE])dnl
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
-
- AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
- if test "$MINIX" = yes; then
- AC_DEFINE([_POSIX_SOURCE], [1],
- [Define to 1 if you need to in order for 'stat' and other
- things to work.])
- AC_DEFINE([_POSIX_1_SOURCE], [2],
- [Define to 2 if the system does not provide POSIX.1 features
- except with this defined.])
- AC_DEFINE([_MINIX], [1],
- [Define to 1 if on MINIX.])
- AC_DEFINE([_NETBSD_SOURCE], [1],
- [Define to 1 to make NetBSD features available. MINIX 3 needs this.])
- fi
-
+AC_BEFORE([$0], [AC_CHECK_INCLUDES_DEFAULT])dnl
+dnl #undef in AH_VERBATIM gets replaced with #define by AC_DEFINE.
dnl Use a different key than __EXTENSIONS__, as that name broke existing
dnl configure.ac when using autoheader 2.62.
- AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
+dnl The macros below are in alphabetical order ignoring leading _ or __
+dnl prefixes.
+AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
[/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
@@ -64,19 +60,44 @@ dnl configure.ac when using autoheader 2.62.
#ifndef _DARWIN_C_SOURCE
# undef _DARWIN_C_SOURCE
#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
-/* Enable NetBSD extensions on NetBSD. */
+/* Enable X/Open compliant socket functions that do not require linking
+ with -lxnet on HP-UX 11.11. */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+# undef _HPUX_ALT_XOPEN_SOCKET_API
+#endif
+/* Identify the host operating system as Minix.
+ This macro does not affect the system headers' behavior.
+ A future release of Autoconf may stop defining this macro. */
+#ifndef _MINIX
+# undef _MINIX
+#endif
+/* Enable general extensions on NetBSD.
+ Enable NetBSD compatibility extensions on Minix. */
#ifndef _NETBSD_SOURCE
# undef _NETBSD_SOURCE
#endif
-/* Enable OpenBSD extensions on NetBSD. */
+/* Enable OpenBSD compatibility extensions on NetBSD.
+ Oddly enough, this does nothing on OpenBSD. */
#ifndef _OPENBSD_SOURCE
# undef _OPENBSD_SOURCE
#endif
-/* Enable threading extensions on Solaris. */
+/* Define to 1 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_SOURCE
+# undef _POSIX_SOURCE
+#endif
+/* Define to 2 if needed for POSIX-compatible behavior. */
+#ifndef _POSIX_1_SOURCE
+# undef _POSIX_1_SOURCE
+#endif
+/* Enable POSIX-compatible threading on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
@@ -112,22 +133,19 @@ dnl configure.ac when using autoheader 2.62.
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
-/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
- mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
- whether compiling with -Ae or -D_HPUX_SOURCE=1. */
+/* Enable X/Open extensions. Define to 500 only if necessary
+ to make mbstate_t available. */
#ifndef _XOPEN_SOURCE
# undef _XOPEN_SOURCE
#endif
-/* Enable X/Open compliant socket functions that do not require linking
- with -lxnet on HP-UX 11.11. */
-#ifndef _HPUX_ALT_XOPEN_SOCKET_API
-# undef _HPUX_ALT_XOPEN_SOCKET_API
-#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-])
+])dnl
+
+ AC_REQUIRE([AC_CHECK_INCLUDES_DEFAULT])dnl
+ _AC_CHECK_HEADER_ONCE([wchar.h])
+ _AC_CHECK_HEADER_ONCE([minix/config.h])
+
+dnl Defining __EXTENSIONS__ may break the system headers on some systems.
+dnl (FIXME: Which ones?)
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
[ac_cv_safe_to_define___extensions__],
[AC_COMPILE_IFELSE(
@@ -136,11 +154,33 @@ dnl configure.ac when using autoheader 2.62.
]AC_INCLUDES_DEFAULT])],
[ac_cv_safe_to_define___extensions__=yes],
[ac_cv_safe_to_define___extensions__=no])])
- test $ac_cv_safe_to_define___extensions__ = yes &&
- AC_DEFINE([__EXTENSIONS__])
+
+dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to
+dnl 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1.
+dnl But defining _XOPEN_SOURCE may turn *off* extensions on platforms
+dnl not covered by turn-on-extensions macros (notably Dragonfly, Free,
+dnl and OpenBSD, which don't have any equivalent of _NETBSD_SOURCE) so
+dnl it should only be defined when necessary.
+ AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
+ [ac_cv_should_define__xopen_source],
+ [ac_cv_should_define__xopen_source=no
+ AS_IF([test $ac_cv_header_wchar_h = yes],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #define _XOPEN_SOURCE 500
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [ac_cv_should_define__xopen_source=yes])])])])
+
AC_DEFINE([_ALL_SOURCE])
AC_DEFINE([_DARWIN_C_SOURCE])
AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API])
AC_DEFINE([_NETBSD_SOURCE])
AC_DEFINE([_OPENBSD_SOURCE])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
@@ -152,24 +192,18 @@ dnl configure.ac when using autoheader 2.62.
AC_DEFINE([__STDC_WANT_LIB_EXT2__])
AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__])
AC_DEFINE([_TANDEM_SOURCE])
- AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
- [ac_cv_should_define__xopen_source],
- [ac_cv_should_define__xopen_source=no
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
- #include <wchar.h>
- mbstate_t x;]])],
- [],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
- #define _XOPEN_SOURCE 500
- #include <wchar.h>
- mbstate_t x;]])],
- [ac_cv_should_define__xopen_source=yes])])])
- test $ac_cv_should_define__xopen_source = yes &&
- AC_DEFINE([_XOPEN_SOURCE], [500])
- AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API])
+ AS_IF([test $ac_cv_header_minix_config_h = yes],
+ [MINIX=yes
+ AC_DEFINE([_MINIX])
+ AC_DEFINE([_POSIX_SOURCE])
+ AC_DEFINE([_POSIX_1_SOURCE], [2])],
+ [MINIX=])
+ AS_IF([test $ac_cv_safe_to_define___extensions__ = yes],
+ [AC_DEFINE([__EXTENSIONS__])])
+ AS_IF([test $ac_cv_should_define__xopen_source = yes],
+ [AC_DEFINE([_XOPEN_SOURCE], [500])])
])# AC_USE_SYSTEM_EXTENSIONS
+])
# gl_USE_SYSTEM_EXTENSIONS
# ------------------------
@@ -177,13 +211,5 @@ dnl configure.ac when using autoheader 2.62.
# typically due to standards-conformance issues.
AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
[
- dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
- dnl gnulib does not need it. But if it gets required by third-party macros
- dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
- dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
- dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
- dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
- AC_REQUIRE([AC_GNU_SOURCE])
-
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
])
diff --git a/m4/fcntl.m4 b/m4/fcntl.m4
index ea24f3d64ef..547ff40b804 100644
--- a/m4/fcntl.m4
+++ b/m4/fcntl.m4
@@ -1,4 +1,4 @@
-# fcntl.m4 serial 10
+# fcntl.m4 serial 11
dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -81,15 +81,29 @@ AC_DEFUN([gl_FUNC_FCNTL],
behavior does not match POSIX]) ;;
esac
- dnl Many systems lack F_DUPFD_CLOEXEC
+ dnl Many systems lack F_DUPFD_CLOEXEC.
+ dnl NetBSD 9.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD.
AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC],
[gl_cv_func_fcntl_f_dupfd_cloexec],
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <fcntl.h>
-#ifndef F_DUPFD_CLOEXEC
-choke me
-#endif
- ]])],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#include <fcntl.h>
+ #include <unistd.h>
+ int main (int argc, char *argv[])
+ {
+ if (argc == 1)
+ /* parent process */
+ {
+ if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0)
+ return 1;
+ return execl ("./conftest", "./conftest", "child", NULL);
+ }
+ else
+ /* child process */
+ return (fcntl (10, F_GETFL) < 0 ? 0 : 42);
+ }
+ ]])
+ ],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef __linux__
/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
@@ -98,12 +112,22 @@ choke me
#endif
]])],
[gl_cv_func_fcntl_f_dupfd_cloexec=yes],
- [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])],
- [gl_cv_func_fcntl_f_dupfd_cloexec=no])])
- if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then
- gl_REPLACE_FCNTL
- dnl No witness macro needed for this bug.
- fi
+ [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])
+ ],
+ [gl_cv_func_fcntl_f_dupfd_cloexec=no],
+ [case "$host_os" in
+ # Guess no on NetBSD.
+ netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;;
+ *) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_fcntl_f_dupfd_cloexec" in
+ *yes) ;;
+ *) gl_REPLACE_FCNTL
+ dnl No witness macro needed for this bug.
+ ;;
+ esac
fi
dnl Replace fcntl() for supporting the gnulib-defined fchdir() function,
dnl to keep fchdir's bookkeeping up-to-date.
diff --git a/m4/filemode.m4 b/m4/filemode.m4
index 5aaaa1a167d..8bbfcdbafe0 100644
--- a/m4/filemode.m4
+++ b/m4/filemode.m4
@@ -1,4 +1,4 @@
-# filemode.m4 serial 8
+# filemode.m4 serial 9
dnl Copyright (C) 2002, 2005-2006, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,6 +6,5 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FILEMODE],
[
- AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
AC_CHECK_DECLS_ONCE([strmode])
])
diff --git a/m4/free.m4 b/m4/free.m4
new file mode 100644
index 00000000000..bf9fc31d9b4
--- /dev/null
+++ b/m4/free.m4
@@ -0,0 +1,49 @@
+# free.m4 serial 5
+# Copyright (C) 2003-2005, 2009-2020 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 Bruno Haible.
+
+AC_DEFUN([gl_FUNC_FREE],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+
+ dnl In the next release of POSIX, free must preserve errno.
+ dnl https://www.austingroupbugs.net/view.php?id=385
+ dnl https://sourceware.org/bugzilla/show_bug.cgi?id=17924
+ dnl So far, we know of three platforms that do this:
+ dnl * glibc >= 2.33, thanks to the fix for this bug:
+ dnl <https://sourceware.org/bugzilla/show_bug.cgi?id=17924>
+ dnl * OpenBSD >= 4.5, thanks to this commit:
+ dnl <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/malloc.c.diff?r1=1.100&r2=1.101&f=h>
+ dnl * Solaris, because its malloc() implementation is based on brk(),
+ dnl not mmap(); hence its free() implementation makes no system calls.
+ dnl For other platforms, you can only be sure if they state it in their
+ dnl documentation, or by code inspection of the free() implementation in libc.
+ AC_CACHE_CHECK([whether free is known to preserve errno],
+ [gl_cv_func_free_preserves_errno],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ ]],
+ [[#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__)
+ #elif defined __OpenBSD__
+ #elif defined __sun
+ #else
+ #error "'free' is not known to preserve errno"
+ #endif
+ ]])],
+ [gl_cv_func_free_preserves_errno=yes],
+ [gl_cv_func_free_preserves_errno=no])
+ ])
+
+ case $gl_cv_func_free_preserves_errno in
+ *yes) ;;
+ *) REPLACE_FREE=1 ;;
+ esac
+])
+
+# Prerequisites of lib/free.c.
+AC_DEFUN([gl_PREREQ_FREE], [:])
diff --git a/m4/fsusage.m4 b/m4/fsusage.m4
index 0bc62066aab..c15cfca4d3e 100644
--- a/m4/fsusage.m4
+++ b/m4/fsusage.m4
@@ -1,4 +1,4 @@
-# serial 34
+# serial 35
# Obtaining file system usage information.
# Copyright (C) 1997-1998, 2000-2001, 2003-2020 Free Software Foundation, Inc.
@@ -36,7 +36,6 @@ AC_DEFUN([gl_FILE_SYSTEM_USAGE],
dnl Mac OS X >= 10.5 (32-bit mode).
AC_REQUIRE([AC_SYS_LARGEFILE])
- AC_MSG_CHECKING([how to get file system space usage])
ac_fsusage_space=no
# Perform only the link test since it seems there are no variants of the
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 33e56faa98e..2c0ae9bef40 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 57
+# gnulib-common.m4 serial 63
dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -483,23 +483,17 @@ AC_DEFUN([gl_FEATURES_H],
# gl_PROG_CC_C99
# Modifies the value of the shell variable CC in an attempt to make $CC
# understand ISO C99 source code.
-# This is like AC_PROG_CC_C99, except that
-# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
-# <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00367.html>,
-# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
-# <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00441.html>.
-# Remaining problems:
-# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
-# to CC twice
-# <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00431.html>.
-# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
AC_DEFUN([gl_PROG_CC_C99],
[
- dnl Change that version number to the minimum Autoconf version that supports
- dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls.
- m4_version_prereq([9.0],
- [AC_REQUIRE([AC_PROG_CC_C99])],
- [AC_REQUIRE([AC_PROG_CC_STDC])])
+ dnl Just use AC_PROG_CC_C99.
+ dnl When AC_PROG_CC_C99 and AC_PROG_CC_STDC are used together, the substituted
+ dnl value of CC will contain the C99 enabling options twice. But this is only
+ dnl a cosmetic problem.
+ dnl With Autoconf >= 2.70, use AC_PROG_CC since it implies AC_PROG_CC_C99;
+ dnl this avoids a "warning: The macro `AC_PROG_CC_C99' is obsolete."
+ m4_version_prereq([2.70],
+ [AC_REQUIRE([AC_PROG_CC])],
+ [AC_REQUIRE([AC_PROG_CC_C99])])
])
# gl_PROG_AR_RANLIB
@@ -573,16 +567,16 @@ Amsterdam
])
# AC_C_RESTRICT
-# This definition is copied from post-2.69 Autoconf and overrides the
-# AC_C_RESTRICT macro from autoconf 2.60..2.69. It can be removed
-# once autoconf >= 2.70 can be assumed. It's painful to check version
-# numbers, and in practice this macro is more up-to-date than Autoconf
-# is, so override Autoconf unconditionally.
+# This definition is copied from post-2.70 Autoconf and overrides the
+# AC_C_RESTRICT macro from autoconf 2.60..2.70.
+m4_version_prereq([2.70.1], [], [
AC_DEFUN([AC_C_RESTRICT],
[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
[ac_cv_c_restrict=no
- # The order here caters to the fact that C++ does not require restrict.
- for ac_kw in __restrict __restrict__ _Restrict restrict; do
+ # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see:
+ # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
+ # Put 'restrict' last, because C++ lacks it.
+ for ac_kw in __restrict__ __restrict _Restrict restrict; do
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[typedef int *int_ptr;
@@ -602,7 +596,7 @@ AC_DEFUN([AC_C_RESTRICT],
AH_VERBATIM([restrict],
[/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
- supported directly. */
+ supported only directly. */
#undef restrict
/* Work around a bug in older versions of Sun C++, which did not
#define __restrict__ or support _Restrict or __restrict__
@@ -620,6 +614,7 @@ AC_DEFUN([AC_C_RESTRICT],
*) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
esac
])# AC_C_RESTRICT
+])
# gl_BIGENDIAN
# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
@@ -630,13 +625,20 @@ AC_DEFUN([gl_BIGENDIAN],
AC_C_BIGENDIAN
])
+# A temporary file descriptor.
+# Must be less than 10, because dash 0.5.8 does not support redirections
+# with multi-digit file descriptors.
+m4_define([GL_TMP_FD], 9)
+
# gl_SILENT(command)
# executes command, but without the normal configure output.
+# This is useful when you want to invoke AC_CACHE_CHECK (or AC_CHECK_FUNC etc.)
+# inside another AC_CACHE_CHECK.
AC_DEFUN([gl_SILENT],
[
- {
- $1
- } AS_MESSAGE_FD>/dev/null
+ exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
+ $1
+ exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&-
])
# gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
@@ -646,10 +648,9 @@ AC_DEFUN([gl_SILENT],
# by an AC_MSG_CHECKING/AC_MSG_RESULT pair.
AC_DEFUN([gl_CACHE_VAL_SILENT],
[
- saved_as_echo_n="$as_echo_n"
- as_echo_n=':'
- AC_CACHE_VAL([$1], [$2])
- as_echo_n="$saved_as_echo_n"
+ gl_SILENT([
+ AC_CACHE_VAL([$1], [$2])
+ ])
])
dnl Expands to some code for use in .c programs that, on native Windows, defines
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index d2fdbd82e73..beb9817d266 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -94,6 +94,7 @@ AC_DEFUN([gl_EARLY],
# Code from module fpending:
# Code from module fpieee:
AC_REQUIRE([gl_FP_IEEE])
+ # Code from module free-posix:
# Code from module fstatat:
# Code from module fsusage:
# Code from module fsync:
@@ -109,6 +110,7 @@ AC_DEFUN([gl_EARLY],
# Code from module gettimeofday:
# Code from module gitlog-to-changelog:
# Code from module group-member:
+ # Code from module idx:
# Code from module ieee754-h:
# Code from module ignore-value:
# Code from module include_next:
@@ -121,7 +123,6 @@ AC_DEFUN([gl_EARLY],
# Code from module libgmp:
# Code from module limits-h:
# Code from module lstat:
- # Code from module malloca:
# Code from module manywarnings:
# Code from module memmem-simple:
# Code from module mempcpy:
@@ -140,10 +141,12 @@ AC_DEFUN([gl_EARLY],
# Code from module pselect:
# Code from module pthread_sigmask:
# Code from module qcopy-acl:
+ # Code from module rawmemchr:
# Code from module readlink:
# Code from module readlinkat:
# Code from module regex:
# Code from module root-uid:
+ # Code from module scratch_buffer:
# Code from module sig2str:
# Code from module sigdescr_np:
# Code from module signal-h:
@@ -508,16 +511,19 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_cloexec=false
gl_gnulib_enabled_dirfd=false
gl_gnulib_enabled_euidaccess=false
+ gl_gnulib_enabled_ef07dc4b3077c11ea9cef586db4e5955=false
gl_gnulib_enabled_getdtablesize=false
gl_gnulib_enabled_getgroups=false
gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false
+ gl_gnulib_enabled_idx=false
gl_gnulib_enabled_lchmod=false
- gl_gnulib_enabled_malloca=false
gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false
gl_gnulib_enabled_open=false
gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=false
+ gl_gnulib_enabled_rawmemchr=false
gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false
+ gl_gnulib_enabled_scratch_buffer=false
gl_gnulib_enabled_strtoll=false
gl_gnulib_enabled_utimens=false
gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=false
@@ -567,6 +573,18 @@ AC_DEFUN([gl_INIT],
func_gl_gnulib_m4code_6099e9737f757db36c47fa9d9f02e88c
fi
}
+ func_gl_gnulib_m4code_ef07dc4b3077c11ea9cef586db4e5955 ()
+ {
+ if ! $gl_gnulib_enabled_ef07dc4b3077c11ea9cef586db4e5955; then
+ gl_FUNC_FREE
+ if test $REPLACE_FREE = 1; then
+ AC_LIBOBJ([free])
+ gl_PREREQ_FREE
+ fi
+ gl_STDLIB_MODULE_INDICATOR([free-posix])
+ gl_gnulib_enabled_ef07dc4b3077c11ea9cef586db4e5955=true
+ fi
+ }
func_gl_gnulib_m4code_getdtablesize ()
{
if ! $gl_gnulib_enabled_getdtablesize; then
@@ -616,6 +634,12 @@ AC_DEFUN([gl_INIT],
fi
fi
}
+ func_gl_gnulib_m4code_idx ()
+ {
+ if ! $gl_gnulib_enabled_idx; then
+ gl_gnulib_enabled_idx=true
+ fi
+ }
func_gl_gnulib_m4code_lchmod ()
{
if ! $gl_gnulib_enabled_lchmod; then
@@ -628,14 +652,6 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_lchmod=true
fi
}
- func_gl_gnulib_m4code_malloca ()
- {
- if ! $gl_gnulib_enabled_malloca; then
- gl_MALLOCA
- gl_gnulib_enabled_malloca=true
- func_gl_gnulib_m4code_682e609604ccaac6be382e4ee3a4eaec
- fi
- }
func_gl_gnulib_m4code_5264294aa0a5557541b53c8c741f7f31 ()
{
if ! $gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31; then
@@ -668,12 +684,30 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7=true
fi
}
+ func_gl_gnulib_m4code_rawmemchr ()
+ {
+ if ! $gl_gnulib_enabled_rawmemchr; then
+ gl_FUNC_RAWMEMCHR
+ if test $HAVE_RAWMEMCHR = 0; then
+ AC_LIBOBJ([rawmemchr])
+ gl_PREREQ_RAWMEMCHR
+ fi
+ gl_STRING_MODULE_INDICATOR([rawmemchr])
+ gl_gnulib_enabled_rawmemchr=true
+ fi
+ }
func_gl_gnulib_m4code_6099e9737f757db36c47fa9d9f02e88c ()
{
if ! $gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c; then
gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=true
fi
}
+ func_gl_gnulib_m4code_scratch_buffer ()
+ {
+ if ! $gl_gnulib_enabled_scratch_buffer; then
+ gl_gnulib_enabled_scratch_buffer=true
+ fi
+ }
func_gl_gnulib_m4code_strtoll ()
{
if ! $gl_gnulib_enabled_strtoll; then
@@ -700,7 +734,16 @@ AC_DEFUN([gl_INIT],
fi
}
if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
- func_gl_gnulib_m4code_malloca
+ func_gl_gnulib_m4code_ef07dc4b3077c11ea9cef586db4e5955
+ fi
+ if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
+ func_gl_gnulib_m4code_idx
+ fi
+ if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
+ func_gl_gnulib_m4code_rawmemchr
+ fi
+ if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
+ func_gl_gnulib_m4code_scratch_buffer
fi
if test $HAVE_FACCESSAT = 0 || test $REPLACE_FACCESSAT = 1; then
func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
@@ -747,15 +790,18 @@ AC_DEFUN([gl_INIT],
if case $host_os in mingw*) false;; *) test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1;; esac; then
func_gl_gnulib_m4code_open
fi
- if test $HAVE_READLINKAT = 0; then
+ if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then
func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b
fi
- if test $HAVE_READLINKAT = 0; then
+ if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then
func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7
fi
if { test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes; then
func_gl_gnulib_m4code_strtoll
fi
+ if test $HAVE_TIMEZONE_T = 0; then
+ func_gl_gnulib_m4code_idx
+ fi
if test $HAVE_TIMEGM = 0 || test $REPLACE_TIMEGM = 1; then
func_gl_gnulib_m4code_5264294aa0a5557541b53c8c741f7f31
fi
@@ -773,16 +819,19 @@ AC_DEFUN([gl_INIT],
AM_CONDITIONAL([gl_GNULIB_ENABLED_cloexec], [$gl_gnulib_enabled_cloexec])
AM_CONDITIONAL([gl_GNULIB_ENABLED_dirfd], [$gl_gnulib_enabled_dirfd])
AM_CONDITIONAL([gl_GNULIB_ENABLED_euidaccess], [$gl_gnulib_enabled_euidaccess])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_ef07dc4b3077c11ea9cef586db4e5955], [$gl_gnulib_enabled_ef07dc4b3077c11ea9cef586db4e5955])
AM_CONDITIONAL([gl_GNULIB_ENABLED_getdtablesize], [$gl_gnulib_enabled_getdtablesize])
AM_CONDITIONAL([gl_GNULIB_ENABLED_getgroups], [$gl_gnulib_enabled_getgroups])
AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36])
AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_idx], [$gl_gnulib_enabled_idx])
AM_CONDITIONAL([gl_GNULIB_ENABLED_lchmod], [$gl_gnulib_enabled_lchmod])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_malloca], [$gl_gnulib_enabled_malloca])
AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31])
AM_CONDITIONAL([gl_GNULIB_ENABLED_open], [$gl_gnulib_enabled_open])
AM_CONDITIONAL([gl_GNULIB_ENABLED_03e0aaad4cb89ca757653bd367a6ccb7], [$gl_gnulib_enabled_03e0aaad4cb89ca757653bd367a6ccb7])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_rawmemchr], [$gl_gnulib_enabled_rawmemchr])
AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_scratch_buffer], [$gl_gnulib_enabled_scratch_buffer])
AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll])
AM_CONDITIONAL([gl_GNULIB_ENABLED_utimens], [$gl_gnulib_enabled_utimens])
AM_CONDITIONAL([gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec], [$gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec])
@@ -989,6 +1038,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/flexmember.h
lib/fpending.c
lib/fpending.h
+ lib/free.c
lib/fstatat.c
lib/fsusage.c
lib/fsusage.h
@@ -1015,6 +1065,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/gettimeofday.c
lib/gl_openssl.h
lib/group-member.c
+ lib/idx.h
lib/ieee754.in.h
lib/ignore-value.h
lib/intprops.h
@@ -1023,8 +1074,10 @@ AC_DEFUN([gl_FILE_LIST], [
lib/libc-config.h
lib/limits.in.h
lib/lstat.c
- lib/malloca.c
- lib/malloca.h
+ lib/malloc/scratch_buffer.h
+ lib/malloc/scratch_buffer_grow.c
+ lib/malloc/scratch_buffer_grow_preserve.c
+ lib/malloc/scratch_buffer_set_array_size.c
lib/md5.c
lib/md5.h
lib/memmem.c
@@ -1047,6 +1100,8 @@ AC_DEFUN([gl_FILE_LIST], [
lib/pselect.c
lib/pthread_sigmask.c
lib/qcopy-acl.c
+ lib/rawmemchr.c
+ lib/rawmemchr.valgrind
lib/readlink.c
lib/readlinkat.c
lib/regcomp.c
@@ -1056,6 +1111,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/regex_internal.h
lib/regexec.c
lib/root-uid.h
+ lib/scratch_buffer.h
lib/set-permissions.c
lib/sha1.c
lib/sha1.h
@@ -1145,6 +1201,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/flexmember.m4
m4/fpending.m4
m4/fpieee.m4
+ m4/free.m4
m4/fstatat.m4
m4/fsusage.m4
m4/fsync.m4
@@ -1168,7 +1225,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/libgmp.m4
m4/limits-h.m4
m4/lstat.m4
- m4/malloca.m4
m4/manywarnings-c++.m4
m4/manywarnings.m4
m4/mbstate_t.m4
@@ -1192,6 +1248,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/pipe2.m4
m4/pselect.m4
m4/pthread_sigmask.m4
+ m4/rawmemchr.m4
m4/readlink.m4
m4/readlinkat.m4
m4/regex.m4
@@ -1203,7 +1260,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/signal_h.m4
m4/socklen.m4
m4/ssize_t.m4
- m4/st_dm_mode.m4
m4/stat-time.m4
m4/std-gnu11.m4
m4/stdalign.m4
diff --git a/m4/largefile.m4 b/m4/largefile.m4
index f4c5d3a5cea..c4cc835bea0 100644
--- a/m4/largefile.m4
+++ b/m4/largefile.m4
@@ -25,7 +25,7 @@ AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
# The following implementation works 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], [] ,[
+m4_version_prereq([2.70], [], [
# _AC_SYS_LARGEFILE_TEST_INCLUDES
# -------------------------------
diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4
index 057ce12ebe6..226f1228dde 100644
--- a/m4/mbstate_t.m4
+++ b/m4/mbstate_t.m4
@@ -1,4 +1,4 @@
-# mbstate_t.m4 serial 13
+# mbstate_t.m4 serial 14
dnl Copyright (C) 2000-2002, 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -20,14 +20,7 @@ AC_DEFUN([AC_TYPE_MBSTATE_T],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[AC_INCLUDES_DEFAULT[
-/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
- <wchar.h>.
- BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
- included before <wchar.h>. */
-#include <stddef.h>
-#include <stdio.h>
-#include <time.h>
-#include <wchar.h>]],
+ #include <wchar.h>]],
[[mbstate_t x; return sizeof x;]])],
[ac_cv_type_mbstate_t=yes],
[ac_cv_type_mbstate_t=no])])
diff --git a/m4/pid_t.m4 b/m4/pid_t.m4
new file mode 100644
index 00000000000..c7abceeecba
--- /dev/null
+++ b/m4/pid_t.m4
@@ -0,0 +1,38 @@
+# pid_t.m4 serial 4
+dnl Copyright (C) 2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# The following implementation works around a problem in autoconf <= 2.69.
+m4_version_prereq([2.70], [], [
+
+dnl Define pid_t if the headers don't define it.
+AC_DEFUN([AC_TYPE_PID_T],
+[
+ AC_CHECK_TYPE([pid_t],
+ [],
+ [dnl On 64-bit native Windows, define it to the equivalent of 'intptr_t'
+ dnl (= 'long long' = '__int64'), because that is the return type
+ dnl of the _spawnv* functions
+ dnl <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnvp-wspawnvp>
+ dnl and the argument type of the _cwait function
+ dnl <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/cwait>.
+ dnl Otherwise (on 32-bit Windows and on old Unix platforms), define it
+ dnl to 'int'.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #if defined _WIN64 && !defined __CYGWIN__
+ LLP64
+ #endif
+ ]])
+ ],
+ [gl_pid_type='int'],
+ [gl_pid_type='__int64'])
+ AC_DEFINE_UNQUOTED([pid_t], [$gl_pid_type],
+ [Define as a signed integer type capable of holding a process identifier.])
+ ],
+ [AC_INCLUDES_DEFAULT])
+])
+
+])# m4_version_prereq 2.70
diff --git a/m4/rawmemchr.m4 b/m4/rawmemchr.m4
new file mode 100644
index 00000000000..c5bf04189c6
--- /dev/null
+++ b/m4/rawmemchr.m4
@@ -0,0 +1,20 @@
+# rawmemchr.m4 serial 2
+dnl Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free 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_RAWMEMCHR],
+[
+ dnl Persuade glibc <string.h> to declare rawmemchr().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ AC_CHECK_FUNCS([rawmemchr])
+ if test $ac_cv_func_rawmemchr = no; then
+ HAVE_RAWMEMCHR=0
+ fi
+])
+
+# Prerequisites of lib/strchrnul.c.
+AC_DEFUN([gl_PREREQ_RAWMEMCHR], [:])
diff --git a/m4/readlink.m4 b/m4/readlink.m4
index 9aa9e46da8c..c7f436a3125 100644
--- a/m4/readlink.m4
+++ b/m4/readlink.m4
@@ -1,4 +1,4 @@
-# readlink.m4 serial 15
+# readlink.m4 serial 16
dnl Copyright (C) 2003, 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -23,7 +23,7 @@ AC_DEFUN([gl_FUNC_READLINK],
dnl Solaris 9 ignores trailing slash.
dnl FreeBSD 7.2 dereferences only one level of links with trailing slash.
AC_CACHE_CHECK([whether readlink handles trailing slash correctly],
- [gl_cv_func_readlink_works],
+ [gl_cv_func_readlink_trailing_slash],
[# We have readlink, so assume ln -s works.
ln -s conftest.no-such conftest.link
ln -s conftest.link conftest.lnk2
@@ -32,18 +32,22 @@ AC_DEFUN([gl_FUNC_READLINK],
[[#include <unistd.h>
]], [[char buf[20];
return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])],
- [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no],
+ [gl_cv_func_readlink_trailing_slash=yes],
+ [gl_cv_func_readlink_trailing_slash=no],
[case "$host_os" in
- # Guess yes on Linux systems.
- linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;;
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;;
- # If we don't know, obey --enable-cross-guesses.
- *) gl_cv_func_readlink_works="$gl_cross_guess_normal" ;;
+ # Guess yes on Linux or glibc systems.
+ linux-* | linux | *-gnu* | gnu*)
+ gl_cv_func_readlink_trailing_slash="guessing yes" ;;
+ # Guess no on AIX or HP-UX.
+ aix* | hpux*)
+ gl_cv_func_readlink_trailing_slash="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_readlink_trailing_slash="$gl_cross_guess_normal" ;;
esac
])
rm -f conftest.link conftest.lnk2])
- case "$gl_cv_func_readlink_works" in
+ case "$gl_cv_func_readlink_trailing_slash" in
*yes)
if test "$gl_cv_decl_readlink_works" != yes; then
REPLACE_READLINK=1
@@ -55,6 +59,43 @@ AC_DEFUN([gl_FUNC_READLINK],
REPLACE_READLINK=1
;;
esac
+
+ AC_CACHE_CHECK([whether readlink truncates results correctly],
+ [gl_cv_func_readlink_truncate],
+ [# We have readlink, so assume ln -s works.
+ ln -s ab conftest.link
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>
+]], [[char c;
+ return readlink ("conftest.link", &c, 1) != 1;]])],
+ [gl_cv_func_readlink_truncate=yes],
+ [gl_cv_func_readlink_truncate=no],
+ [case "$host_os" in
+ # Guess yes on Linux or glibc systems.
+ linux-* | linux | *-gnu* | gnu*)
+ gl_cv_func_readlink_truncate="guessing yes" ;;
+ # Guess no on AIX or HP-UX.
+ aix* | hpux*)
+ gl_cv_func_readlink_truncate="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_readlink_truncate="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.link conftest.lnk2])
+ case $gl_cv_func_readlink_truncate in
+ *yes)
+ if test "$gl_cv_decl_readlink_works" != yes; then
+ REPLACE_READLINK=1
+ fi
+ ;;
+ *)
+ AC_DEFINE([READLINK_TRUNCATE_BUG], [1], [Define to 1 if readlink
+ sets errno instead of truncating a too-long link.])
+ REPLACE_READLINK=1
+ ;;
+ esac
fi
])
diff --git a/m4/readlinkat.m4 b/m4/readlinkat.m4
index 6ef1f590c06..73e343f746d 100644
--- a/m4/readlinkat.m4
+++ b/m4/readlinkat.m4
@@ -1,4 +1,4 @@
-# serial 5
+# serial 6
# See if we need to provide readlinkat replacement.
dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
@@ -26,13 +26,10 @@ AC_DEFUN([gl_FUNC_READLINKAT],
ssize_t readlinkat (int, char const *, char *, size_t);]])],
[gl_cv_decl_readlinkat_works=yes],
[gl_cv_decl_readlinkat_works=no])])
- # Assume readinkat has the same trailing slash bug as readlink,
- # as is the case on Mac Os X 10.10
- case "$gl_cv_func_readlink_works" in
- *yes)
- if test "$gl_cv_decl_readlinkat_works" != yes; then
- REPLACE_READLINKAT=1
- fi
+ # Assume readlinkat has the same bugs as readlink,
+ # as is the case on OS X 10.10 with trailing slashes.
+ case $gl_cv_decl_readlinkat_works,$gl_cv_func_readlink_trailing_slash,$gl_cv_func_readlink_truncate in
+ *yes,*yes,*yes)
;;
*)
REPLACE_READLINKAT=1
diff --git a/m4/std-gnu11.m4 b/m4/std-gnu11.m4
index db833d820f3..b5ab8abed02 100644
--- a/m4/std-gnu11.m4
+++ b/m4/std-gnu11.m4
@@ -6,6 +6,8 @@
# This implementation will be obsolete once we can assume Autoconf 2.70
# or later is installed everywhere a Gnulib program might be developed.
+m4_version_prereq([2.70], [], [
+
# Copyright (C) 2001-2020 Free Software Foundation, Inc.
@@ -822,3 +824,6 @@ dnl Tru64 N/A (no support)
dnl with extended modes being tried first.
[[-std=gnu++11 -std=c++11 -std=gnu++0x -std=c++0x -qlanglvl=extended0x -AA]], [$1], [$2])[]dnl
])# _AC_PROG_CXX_CXX11
+
+
+])# m4_version_prereq
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index d5f5d6133a9..adaea3e5826 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 56
+# stdint.m4 serial 58
dnl Copyright (C) 2001-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -34,7 +34,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
AC_SUBST([HAVE_WCHAR_H])
dnl Check for <inttypes.h>.
- dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
+ AC_CHECK_HEADERS_ONCE([inttypes.h])
if test $ac_cv_header_inttypes_h = yes; then
HAVE_INTTYPES_H=1
else
@@ -43,7 +43,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
AC_SUBST([HAVE_INTTYPES_H])
dnl Check for <sys/types.h>.
- dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h.
+ AC_CHECK_HEADERS_ONCE([sys/types.h])
if test $ac_cv_header_sys_types_h = yes; then
HAVE_SYS_TYPES_H=1
else
@@ -493,13 +493,9 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
dnl gl_STDINT_INCLUDES
AC_DEFUN([gl_STDINT_INCLUDES],
[[
- /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
- included before <wchar.h>. */
#include <stddef.h>
#include <signal.h>
#if HAVE_WCHAR_H
- # include <stdio.h>
- # include <time.h>
# include <wchar.h>
#endif
]])
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 5f968bc26a5..6003a31b382 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 50
+# stdio_h.m4 serial 51
dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -109,6 +109,11 @@ AC_DEFUN([gl_STDIO_H],
renameat snprintf tmpfile vdprintf vsnprintf])
AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_DECLS_ONCE([fcloseall])
+ if test $ac_cv_have_decl_fcloseall = no; then
+ HAVE_DECL_FCLOSEALL=0
+ fi
])
AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
@@ -176,6 +181,7 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
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])
HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO])
HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO])
diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4
index 743066a6336..7e03b9a6d58 100644
--- a/m4/stdlib_h.m4
+++ b/m4/stdlib_h.m4
@@ -1,4 +1,4 @@
-# stdlib_h.m4 serial 49
+# stdlib_h.m4 serial 54
dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -22,13 +22,28 @@ AC_DEFUN([gl_STDLIB_H],
#if HAVE_RANDOM_H
# include <random.h>
#endif
- ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
+ ]], [_Exit aligned_alloc atoll canonicalize_file_name free
+ getloadavg getsubopt grantpt
initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps
- 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])
+ 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])
AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_DECLS_ONCE([ecvt])
+ if test $ac_cv_have_decl_ecvt = no; then
+ HAVE_DECL_ECVT=0
+ fi
+ AC_CHECK_DECLS_ONCE([fcvt])
+ if test $ac_cv_have_decl_fcvt = no; then
+ HAVE_DECL_FCVT=0
+ fi
+ AC_CHECK_DECLS_ONCE([gcvt])
+ if test $ac_cv_have_decl_gcvt = no; then
+ HAVE_DECL_GCVT=0
+ fi
])
AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
@@ -43,9 +58,11 @@ AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
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])
@@ -56,6 +73,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
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])
@@ -79,8 +97,12 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB])
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])
HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL])
HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME])
+ HAVE_DECL_ECVT=1; AC_SUBST([HAVE_DECL_ECVT])
+ HAVE_DECL_FCVT=1; AC_SUBST([HAVE_DECL_FCVT])
+ HAVE_DECL_GCVT=1; AC_SUBST([HAVE_DECL_GCVT])
HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT])
@@ -92,6 +114,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS])
HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP])
HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS])
+ HAVE_POSIX_MEMALIGN=1; AC_SUBST([HAVE_POSIX_MEMALIGN])
HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT])
HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME])
HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R])
@@ -115,12 +138,15 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
+ REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC])
REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC])
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_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC])
REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
+ REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN])
REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME])
REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4
index be918dc0d8b..c3a691becdf 100644
--- a/m4/sys_types_h.m4
+++ b/m4/sys_types_h.m4
@@ -1,4 +1,4 @@
-# sys_types_h.m4 serial 9
+# sys_types_h.m4 serial 11
dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -36,25 +36,23 @@ AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
# This works around a buggy version in autoconf <= 2.69.
# See <https://lists.gnu.org/r/autoconf/2016-08/msg00014.html>
+# The 2.70 version isn't quoted properly, so override it too.
-m4_version_prereq([2.70], [], [
-
-# This is taken from the following Autoconf patch:
-# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=e17a30e987d7ee695fb4294a82d987ec3dc9b974
+m4_version_prereq([2.70.1], [], [
m4_undefine([AC_HEADER_MAJOR])
AC_DEFUN([AC_HEADER_MAJOR],
[AC_CHECK_HEADERS_ONCE([sys/types.h])
AC_CHECK_HEADER([sys/mkdev.h],
- [AC_DEFINE([MAJOR_IN_MKDEV], [1],
- [Define to 1 if `major', `minor', and `makedev' are declared in
- <mkdev.h>.])])
+ [AC_DEFINE([MAJOR_IN_MKDEV], [1],
+ [Define to 1 if `major', `minor', and `makedev' are
+ declared in <mkdev.h>.])])
if test $ac_cv_header_sys_mkdev_h = no; then
AC_CHECK_HEADER([sys/sysmacros.h],
- [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
- [Define to 1 if `major', `minor', and `makedev' are declared in
- <sysmacros.h>.])])
+ [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
+ [Define to 1 if `major', `minor', and `makedev'
+ are declared in <sysmacros.h>.])])
fi
-])
+])# AC_HEADER_MAJOR
])
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index b4734daf603..b26d2c88dde 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 81
+# unistd_h.m4 serial 83
dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -41,7 +41,8 @@ AC_DEFUN([gl_UNISTD_H],
# include <io.h>
# endif
#endif
- ]], [access chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir
+ ]], [access chdir chown copy_file_range dup dup2 dup3 environ euidaccess
+ faccessat fchdir
fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize
getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass
getusershell setusershell endusershell
@@ -50,6 +51,11 @@ AC_DEFUN([gl_UNISTD_H],
truncate ttyname_r unlink unlinkat usleep])
AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_DECLS_ONCE([execvpe])
+ if test $ac_cv_have_decl_execvpe = no; then
+ HAVE_DECL_EXECVPE=0
+ fi
])
AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -152,6 +158,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
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])
diff --git a/m4/vararrays.m4 b/m4/vararrays.m4
index 49ded2efe0d..9524a6ddd33 100644
--- a/m4/vararrays.m4
+++ b/m4/vararrays.m4
@@ -1,6 +1,6 @@
# Check for variable-length arrays.
-# serial 5
+# serial 6
# From Paul Eggert
@@ -9,9 +9,11 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# This is a copy of AC_C_VARARRAYS from a recent development version
-# of Autoconf. It replaces Autoconf's version, or for pre-2.61 autoconf
-# it defines the macro that Autoconf lacks.
+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],
@@ -27,7 +29,7 @@ AC_DEFUN([AC_C_VARARRAYS],
[[/* 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/r/bug-gnulib/2014-08/msg00014.html
+ https://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html
*/
#ifdef __STDC_NO_VLA__
syntax error;
@@ -66,3 +68,5 @@ AC_DEFUN([AC_C_VARARRAYS],
if the compiler does not already define this.])
fi
])
+
+])