summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2021-01-20 21:52:54 +0100
committerAndy Wingo <wingo@pobox.com>2021-01-20 23:03:56 +0100
commita91b95cca2d397c84f8b9bbd602d40209a7092ce (patch)
tree2c286a291f5a2b812d6e216be10936f2709d59cf /m4
parent758b31994cff582c7e8785b4cc2240dbf3573837 (diff)
downloadguile-a91b95cca2d397c84f8b9bbd602d40209a7092ce.tar.gz
Update Gnulib to v0.1-4379-g2ef5a9b4b
Also bump required autoconf version to 2.64, as required by Gnulib.
Diffstat (limited to 'm4')
-rw-r--r--m4/00gnulib.m4107
-rw-r--r--m4/__inline.m422
-rw-r--r--m4/absolute-header.m412
-rw-r--r--m4/accept4.m411
-rw-r--r--m4/alloca.m445
-rw-r--r--m4/arpa_inet_h.m46
-rw-r--r--m4/autobuild.m46
-rw-r--r--m4/btowc.m433
-rw-r--r--m4/builtin-expect.m42
-rw-r--r--m4/byteswap.m42
-rw-r--r--m4/canonicalize.m461
-rw-r--r--m4/ceil.m424
-rw-r--r--m4/check-math-lib.m42
-rw-r--r--m4/clock_time.m42
-rw-r--r--m4/close.m414
-rw-r--r--m4/codeset.m44
-rw-r--r--m4/configmake.m455
-rw-r--r--m4/copysign.m42
-rw-r--r--m4/dirent_h.m42
-rw-r--r--m4/dirfd.m411
-rw-r--r--m4/dirname.m419
-rw-r--r--m4/double-slash-root.m42
-rw-r--r--m4/dup2.m4184
-rw-r--r--m4/duplocale.m4109
-rw-r--r--m4/eealloc.m42
-rw-r--r--m4/environ.m422
-rw-r--r--m4/errno_h.m412
-rw-r--r--m4/exponentd.m42
-rw-r--r--m4/exponentf.m42
-rw-r--r--m4/exponentl.m434
-rw-r--r--m4/extensions.m4174
-rw-r--r--m4/extern-inline.m428
-rw-r--r--m4/fcntl-o.m422
-rw-r--r--m4/fcntl.m4151
-rw-r--r--m4/fcntl_h.m49
-rw-r--r--m4/flexmember.m417
-rw-r--r--m4/float_h.m436
-rw-r--r--m4/flock.m42
-rw-r--r--m4/floor.m424
-rw-r--r--m4/fpieee.m44
-rw-r--r--m4/free.m449
-rw-r--r--m4/frexp.m417
-rw-r--r--m4/fstat.m430
-rw-r--r--m4/fsync.m42
-rw-r--r--m4/func.m42
-rw-r--r--m4/getaddrinfo.m435
-rw-r--r--m4/getdtablesize.m463
-rw-r--r--m4/getlogin.m42
-rw-r--r--m4/getrandom.m468
-rw-r--r--m4/gettimeofday.m4138
-rw-r--r--m4/glibc21.m434
-rw-r--r--m4/gnulib-cache.m4121
-rw-r--r--m4/gnulib-common.m4605
-rw-r--r--m4/gnulib-comp.m4469
-rw-r--r--m4/gnulib-tool.m42
-rw-r--r--m4/hard-locale.m411
-rw-r--r--m4/host-cpu-c-abi.m4675
-rw-r--r--m4/hostent.m46
-rw-r--r--m4/iconv.m467
-rw-r--r--m4/iconv_h.m420
-rw-r--r--m4/iconv_open-utf.m414
-rw-r--r--m4/iconv_open.m432
-rw-r--r--m4/include_next.m439
-rw-r--r--m4/inet_ntop.m416
-rw-r--r--m4/inet_pton.m416
-rw-r--r--m4/intmax_t.m416
-rw-r--r--m4/inttypes.m4165
-rw-r--r--m4/inttypes_h.m42
-rw-r--r--m4/isfinite.m425
-rw-r--r--m4/isinf.m434
-rw-r--r--m4/isnan.m42
-rw-r--r--m4/isnand.m48
-rw-r--r--m4/isnanf.m431
-rw-r--r--m4/isnanl.m430
-rw-r--r--m4/langinfo_h.m425
-rw-r--r--m4/largefile.m456
-rw-r--r--m4/ld-version-script.m48
-rw-r--r--m4/ldexp.m42
-rw-r--r--m4/lib-ld.m4163
-rw-r--r--m4/lib-link.m4184
-rw-r--r--m4/lib-prefix.m4241
-rw-r--r--m4/libunistring.m421
-rw-r--r--m4/limits-h.m426
-rw-r--r--m4/link.m414
-rw-r--r--m4/localcharset.m410
-rw-r--r--m4/locale-fr.m443
-rw-r--r--m4/locale-ja.m445
-rw-r--r--m4/locale-zh.m445
-rw-r--r--m4/locale_h.m4109
-rw-r--r--m4/localeconv.m42
-rw-r--r--m4/log.m426
-rw-r--r--m4/log1p.m418
-rw-r--r--m4/longlong.m4113
-rw-r--r--m4/lstat.m422
-rw-r--r--m4/malloc.m437
-rw-r--r--m4/malloca.m45
-rw-r--r--m4/math_h.m4361
-rw-r--r--m4/mathfunc.m48
-rw-r--r--m4/mbrtowc.m4282
-rw-r--r--m4/mbsinit.m415
-rw-r--r--m4/mbstate_t.m413
-rw-r--r--m4/mbtowc.m413
-rw-r--r--m4/memchr.m472
-rw-r--r--m4/mempcpy.m426
-rw-r--r--m4/minmax.m444
-rw-r--r--m4/mkdir.m482
-rw-r--r--m4/mkostemp.m42
-rw-r--r--m4/mktime.m496
-rw-r--r--m4/mmap-anon.m48
-rw-r--r--m4/mode_t.m42
-rw-r--r--m4/msvc-inval.m42
-rw-r--r--m4/msvc-nothrow.m42
-rw-r--r--m4/multiarch.m469
-rw-r--r--m4/netdb_h.m45
-rw-r--r--m4/netinet_in_h.m42
-rw-r--r--m4/nl_langinfo.m437
-rw-r--r--m4/nocrash.m410
-rw-r--r--m4/nproc.m42
-rw-r--r--m4/nstrftime.m4 (renamed from m4/strftime.m4)14
-rw-r--r--m4/off_t.m42
-rw-r--r--m4/open-cloexec.m421
-rw-r--r--m4/open-slash.m460
-rw-r--r--m4/open.m449
-rw-r--r--m4/pathmax.m46
-rw-r--r--m4/pid_t.m438
-rw-r--r--m4/pipe.m42
-rw-r--r--m4/pipe2.m42
-rw-r--r--m4/poll.m427
-rw-r--r--m4/poll_h.m46
-rw-r--r--m4/printf.m4414
-rw-r--r--m4/putenv.m460
-rw-r--r--m4/raise.m414
-rw-r--r--m4/rawmemchr.m420
-rw-r--r--m4/read.m414
-rw-r--r--m4/readlink.m461
-rw-r--r--m4/regex.m4131
-rw-r--r--m4/rename.m4126
-rw-r--r--m4/rmdir.m435
-rw-r--r--m4/round.m442
-rw-r--r--m4/safe-read.m42
-rw-r--r--m4/safe-write.m42
-rw-r--r--m4/secure_getenv.m426
-rw-r--r--m4/select.m417
-rw-r--r--m4/servent.m46
-rw-r--r--m4/setenv.m476
-rw-r--r--m4/setlocale_null.m498
-rw-r--r--m4/signal_h.m46
-rw-r--r--m4/signbit.m4202
-rw-r--r--m4/size_max.m416
-rw-r--r--m4/snprintf.m42
-rw-r--r--m4/socketlib.m438
-rw-r--r--m4/sockets.m42
-rw-r--r--m4/socklen.m417
-rw-r--r--m4/sockpfaf.m419
-rw-r--r--m4/ssize_t.m42
-rw-r--r--m4/stat-time.m42
-rw-r--r--m4/stat.m4124
-rw-r--r--m4/std-gnu11.m4829
-rw-r--r--m4/stdalign.m48
-rw-r--r--m4/stdbool.m428
-rw-r--r--m4/stddef_h.m445
-rw-r--r--m4/stdint.m4154
-rw-r--r--m4/stdint_h.m42
-rw-r--r--m4/stdio_h.m421
-rw-r--r--m4/stdlib_h.m464
-rw-r--r--m4/strdup.m412
-rw-r--r--m4/string_h.m4109
-rw-r--r--m4/sys_file_h.m42
-rw-r--r--m4/sys_random_h.m453
-rw-r--r--m4/sys_select_h.m42
-rw-r--r--m4/sys_socket_h.m432
-rw-r--r--m4/sys_stat_h.m438
-rw-r--r--m4/sys_time_h.m45
-rw-r--r--m4/sys_times_h.m42
-rw-r--r--m4/sys_types_h.m437
-rw-r--r--m4/sys_uio_h.m42
-rw-r--r--m4/tempname.m42
-rw-r--r--m4/threadlib.m4622
-rw-r--r--m4/time_h.m437
-rw-r--r--m4/time_r.m447
-rw-r--r--m4/time_rz.m438
-rw-r--r--m4/timegm.m48
-rw-r--r--m4/times.m42
-rw-r--r--m4/tm_gmtoff.m42
-rw-r--r--m4/trunc.m424
-rw-r--r--m4/tzset.m418
-rw-r--r--m4/unistd_h.m479
-rw-r--r--m4/vasnprintf.m417
-rw-r--r--m4/visibility.m474
-rw-r--r--m4/vsnprintf.m42
-rw-r--r--m4/warn-on-use.m448
-rw-r--r--m4/warnings.m463
-rw-r--r--m4/wchar_h.m4129
-rw-r--r--m4/wchar_t.m42
-rw-r--r--m4/wcrtomb.m490
-rw-r--r--m4/wctype_h.m468
-rw-r--r--m4/wint_t.m451
-rw-r--r--m4/write.m414
-rw-r--r--m4/xsize.m42
-rw-r--r--m4/zzgnulib.m423
200 files changed, 8055 insertions, 3145 deletions
diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4
index bb3512fd5..9ba1743e6 100644
--- a/m4/00gnulib.m4
+++ b/m4/00gnulib.m4
@@ -1,43 +1,82 @@
-# 00gnulib.m4 serial 3
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# 00gnulib.m4 serial 8
+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.
dnl This file must be named something that sorts before all other
-dnl gnulib-provided .m4 files. It is needed until such time as we can
-dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and
-dnl m4_divert semantics.
+dnl gnulib-provided .m4 files. It is needed until the clang fix has
+dnl been included in Autoconf.
-# Until autoconf 2.63, handling of the diversion stack required m4_init
-# to be called first; but this does not happen with aclocal. Wrapping
-# the entire execution in another layer of the diversion stack fixes this.
-# Worse, prior to autoconf 2.62, m4_wrap depended on the underlying m4
-# for whether it was FIFO or LIFO; in order to properly balance with
-# m4_init, we need to undo our push just before anything wrapped within
-# the m4_init body. The way to ensure this is to wrap both sides of
-# m4_init with a one-shot macro that does the pop at the right time.
-m4_ifndef([_m4_divert_diversion],
-[m4_divert_push([KILL])
-m4_define([gl_divert_fixup], [m4_divert_pop()m4_define([$0])])
-m4_define([m4_init],
- [gl_divert_fixup()]m4_defn([m4_init])[gl_divert_fixup()])])
-
-
-# AC_DEFUN_ONCE([NAME], VALUE)
-# ----------------------------
-# Define NAME to expand to VALUE on the first use (whether by direct
-# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses.
-# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This
-# definition is slower than the version in Autoconf 2.64, because it
-# can only use interfaces that existed since 2.59; but it achieves the
-# same effect. Quoting is necessary to avoid confusing Automake.
-m4_version_prereq([2.63.263], [],
-[m4_define([AC][_DEFUN_ONCE],
- [AC][_DEFUN([$1],
- [AC_REQUIRE([_gl_DEFUN_ONCE([$1])],
- [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl
-[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])])
+# The following definitions arrange to use a compiler option
+# -Werror=implicit-function-declaration in AC_CHECK_DECL, when the
+# compiler is clang. Without it, clang implicitly declares "known"
+# library functions in C mode, but not in C++ mode, which would cause
+# Gnulib to omit a declaration and thus later produce an error in C++
+# mode. As of clang 9.0, these "known" functions are identified through
+# LIBBUILTIN invocations in the LLVM source file
+# llvm/tools/clang/include/clang/Basic/Builtins.def.
+# It's not possible to AC_REQUIRE the extra tests from AC_CHECK_DECL,
+# because AC_CHECK_DECL, like other Autoconf built-ins, is not supposed
+# to AC_REQUIRE anything: some configure.ac files have their first
+# AC_CHECK_DECL executed conditionally. Therefore append the extra tests
+# to AC_PROG_CC.
+AC_DEFUN([gl_COMPILER_CLANG],
+[
+dnl AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([whether the compiler is clang],
+ [gl_cv_compiler_clang],
+ [dnl Use _AC_COMPILE_IFELSE instead of AC_EGREP_CPP, to avoid error
+ dnl "circular dependency of AC_LANG_COMPILER(C)" if AC_PROG_CC has
+ dnl not yet been invoked.
+ _AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #ifdef __clang__
+ barfbarf
+ #endif
+ ]],[[]])
+ ],
+ [gl_cv_compiler_clang=no],
+ [gl_cv_compiler_clang=yes])
+ ])
+])
+AC_DEFUN([gl_COMPILER_PREPARE_CHECK_DECL],
+[
+dnl AC_REQUIRE([AC_PROG_CC])
+dnl AC_REQUIRE([gl_COMPILER_CLANG])
+ AC_CACHE_CHECK([for compiler option needed when checking for declarations],
+ [gl_cv_compiler_check_decl_option],
+ [if test $gl_cv_compiler_clang = yes; then
+ dnl Test whether the compiler supports the option
+ dnl '-Werror=implicit-function-declaration'.
+ save_ac_compile="$ac_compile"
+ ac_compile="$ac_compile -Werror=implicit-function-declaration"
+ dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a
+ dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
+ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
+ [gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'],
+ [gl_cv_compiler_check_decl_option=none])
+ ac_compile="$save_ac_compile"
+ else
+ gl_cv_compiler_check_decl_option=none
+ fi
+ ])
+ if test "x$gl_cv_compiler_check_decl_option" != xnone; then
+ ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
+ else
+ ac_compile_for_check_decl="$ac_compile"
+ fi
+])
+dnl Redefine _AC_CHECK_DECL_BODY so that it references ac_compile_for_check_decl
+dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC
+dnl in zzgnulib.m4 is inactive, use the original ac_compile.
+m4_define([_AC_CHECK_DECL_BODY],
+[ ac_save_ac_compile="$ac_compile"
+ if test -n "$ac_compile_for_check_decl"; then
+ ac_compile="$ac_compile_for_check_decl"
+ fi]
+m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile"
+])
# gl_00GNULIB
# -----------
diff --git a/m4/__inline.m4 b/m4/__inline.m4
new file mode 100644
index 000000000..b28cc6abc
--- /dev/null
+++ b/m4/__inline.m4
@@ -0,0 +1,22 @@
+# Test for __inline keyword
+dnl Copyright 2017-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___INLINE],
+[
+ AC_CACHE_CHECK([whether the compiler supports the __inline keyword],
+ [gl_cv_c___inline],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[typedef int foo_t;
+ static __inline foo_t foo (void) { return 0; }]],
+ [[return foo ();]])],
+ [gl_cv_c___inline=yes],
+ [gl_cv_c___inline=no])])
+ if test $gl_cv_c___inline = yes; then
+ AC_DEFINE([HAVE___INLINE], [1],
+ [Define to 1 if the compiler supports the keyword '__inline'.])
+ fi
+])
diff --git a/m4/absolute-header.m4 b/m4/absolute-header.m4
index c73adc82d..52d80d042 100644
--- a/m4/absolute-header.m4
+++ b/m4/absolute-header.m4
@@ -1,5 +1,5 @@
-# absolute-header.m4 serial 16
-dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
+# absolute-header.m4 serial 17
+dnl Copyright (C) 2006-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.
@@ -22,23 +22,21 @@ dnl From Derek Price.
AC_DEFUN([gl_ABSOLUTE_HEADER],
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_PREPROC_REQUIRE()dnl
-dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted
-dnl until we can assume autoconf 2.64 or newer.
m4_foreach_w([gl_HEADER_NAME], [$1],
[AS_VAR_PUSHDEF([gl_absolute_header],
[gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl
AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>],
- m4_defn([gl_absolute_header]),
+ [gl_absolute_header],
[AS_VAR_PUSHDEF([ac_header_exists],
[ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl
AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl
- if test AS_VAR_GET(ac_header_exists) = yes; then
+ if test AS_VAR_GET([ac_header_exists]) = yes; then
gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME]))
fi
AS_VAR_POPDEF([ac_header_exists])dnl
])dnl
AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])),
- ["AS_VAR_GET(gl_absolute_header)"],
+ ["AS_VAR_GET([gl_absolute_header])"],
[Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.])
AS_VAR_POPDEF([gl_absolute_header])dnl
])dnl
diff --git a/m4/accept4.m4 b/m4/accept4.m4
index 841e9b50f..c3f4cc00d 100644
--- a/m4/accept4.m4
+++ b/m4/accept4.m4
@@ -1,5 +1,5 @@
-# accept4.m4 serial 2
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# accept4.m4 serial 3
+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.
@@ -11,8 +11,11 @@ AC_DEFUN([gl_FUNC_ACCEPT4],
dnl Persuade glibc <sys/socket.h> to declare accept4().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_FUNCS_ONCE([accept4])
- if test $ac_cv_func_accept4 != yes; then
+ AC_CHECK_DECLS([accept4], , , [[
+#include <sys/types.h>
+#include <sys/socket.h>
+]])
+ if test $ac_cv_have_decl_accept4 != yes; then
HAVE_ACCEPT4=0
fi
])
diff --git a/m4/alloca.m4 b/m4/alloca.m4
index 7f0604cbd..ba2f679d8 100644
--- a/m4/alloca.m4
+++ b/m4/alloca.m4
@@ -1,5 +1,5 @@
-# alloca.m4 serial 14
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2017 Free Software Foundation,
+# alloca.m4 serial 20
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2021 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,
@@ -37,19 +37,26 @@ AC_DEFUN([gl_FUNC_ALLOCA],
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
+ else
+ HAVE_ALLOCA_H=0
+ fi
+ AC_SUBST([HAVE_ALLOCA_H])
])
# Prerequisites of lib/alloca.c.
# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
AC_DEFUN([gl_PREREQ_ALLOCA], [:])
-# This works around a bug in autoconf <= 2.68.
-# See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>.
+m4_version_prereq([2.70], [], [
-m4_version_prereq([2.69], [] ,[
-
-# This is taken from the following Autoconf patch:
-# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
+# This works around a bug in autoconf <= 2.68 and has simplifications
+# from 2.70. See:
+# https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html
+# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
+# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=15edf7fd8094fd14a89d9891dd72a9624762597a
# _AC_LIBOBJ_ALLOCA
# -----------------
@@ -65,26 +72,6 @@ AC_LIBSOURCES(alloca.c)
AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.])
-AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray,
-[AC_EGREP_CPP(webecray,
-[#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
-], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
-if test $ac_cv_os_cray = yes; then
- for ac_func in _getb67 GETB67 getb67; do
- AC_CHECK_FUNC($ac_func,
- [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
- [Define to one of '_getb67', 'GETB67',
- 'getb67' for Cray-2 and Cray-YMP
- systems. This function is required for
- 'alloca.c' support on those systems.])
- break])
- done
-fi
-
AC_CACHE_CHECK([stack direction for C alloca],
[ac_cv_c_stack_direction],
[AC_RUN_IFELSE([AC_LANG_SOURCE(
@@ -115,7 +102,7 @@ AH_VERBATIM([STACK_DIRECTION],
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
-@%:@undef STACK_DIRECTION])dnl
+#undef STACK_DIRECTION])dnl
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
])# _AC_LIBOBJ_ALLOCA
])
diff --git a/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4
index d6554554f..c4e386d1f 100644
--- a/m4/arpa_inet_h.m4
+++ b/m4/arpa_inet_h.m4
@@ -1,5 +1,5 @@
-# arpa_inet_h.m4 serial 13
-dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc.
+# arpa_inet_h.m4 serial 14
+dnl Copyright (C) 2006, 2008-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.
@@ -24,6 +24,8 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
AC_REQUIRE([gl_FEATURES_H])
+ gl_PREREQ_SYS_H_WS2TCPIP
+
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([[
diff --git a/m4/autobuild.m4 b/m4/autobuild.m4
index f5f2a1899..d931c7d9e 100644
--- a/m4/autobuild.m4
+++ b/m4/autobuild.m4
@@ -1,5 +1,5 @@
-# autobuild.m4 serial 7
-dnl Copyright (C) 2004, 2006-2017 Free Software Foundation, Inc.
+# autobuild.m4 serial 8
+dnl Copyright (C) 2004, 2006-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.
@@ -27,7 +27,7 @@ AC_DEFUN([AB_INIT],
AC_MSG_NOTICE([autobuild hostname... $hostname])
fi
- ifelse([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])])
+ m4_if([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])])
date=`TZ=UTC0 date +%Y%m%dT%H%M%SZ`
if test "$?" != 0; then
diff --git a/m4/btowc.m4 b/m4/btowc.m4
index 102180938..d2b2fe85a 100644
--- a/m4/btowc.m4
+++ b/m4/btowc.m4
@@ -1,5 +1,5 @@
-# btowc.m4 serial 10
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+# btowc.m4 serial 12
+dnl Copyright (C) 2008-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.
@@ -10,7 +10,7 @@ AC_DEFUN([gl_FUNC_BTOWC],
dnl Check whether <wchar.h> is usable at all, first. Otherwise the test
dnl program below may lead to an endless loop. See
- dnl <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>.
+ dnl <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>.
AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
AC_CHECK_FUNCS_ONCE([btowc])
@@ -28,14 +28,6 @@ AC_DEFUN([gl_FUNC_BTOWC],
[
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
-#include <string.h>
-/* 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>
int main ()
{
@@ -50,6 +42,8 @@ changequote(,)dnl
case "$host_os" in
# Guess no on Cygwin.
cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_btowc_nul="guessing yes" ;;
# Guess yes otherwise.
*) gl_cv_func_btowc_nul="guessing yes" ;;
esac
@@ -65,24 +59,19 @@ changequote([,])dnl
dnl is present.
changequote(,)dnl
case "$host_os" in
- # Guess no on IRIX.
- irix*) gl_cv_func_btowc_eof="guessing no" ;;
- # Guess yes otherwise.
- *) gl_cv_func_btowc_eof="guessing yes" ;;
+ # Guess no on IRIX.
+ irix*) gl_cv_func_btowc_eof="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_btowc_eof="guessing yes" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_btowc_eof="guessing yes" ;;
esac
changequote([,])dnl
if test $LOCALE_FR != none; then
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <locale.h>
-#include <string.h>
-/* 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>
int main ()
{
diff --git a/m4/builtin-expect.m4 b/m4/builtin-expect.m4
index aa3364bff..c58411643 100644
--- a/m4/builtin-expect.m4
+++ b/m4/builtin-expect.m4
@@ -1,6 +1,6 @@
dnl Check for __builtin_expect.
-dnl Copyright 2016-2017 Free Software Foundation, Inc.
+dnl Copyright 2016-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.
diff --git a/m4/byteswap.m4 b/m4/byteswap.m4
index f20d0f490..1083b4c9e 100644
--- a/m4/byteswap.m4
+++ b/m4/byteswap.m4
@@ -1,5 +1,5 @@
# byteswap.m4 serial 4
-dnl Copyright (C) 2005, 2007, 2009-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 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.
diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4
index c04ff8dd0..6821c70e6 100644
--- a/m4/canonicalize.m4
+++ b/m4/canonicalize.m4
@@ -1,6 +1,6 @@
-# canonicalize.m4 serial 28
+# canonicalize.m4 serial 36
-dnl Copyright (C) 2003-2007, 2009-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2007, 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,
@@ -11,7 +11,8 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
[
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_FUNCS_ONCE([canonicalize_file_name])
+ AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+ AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
if test $ac_cv_func_canonicalize_file_name = no; then
@@ -35,8 +36,8 @@ AC_DEFUN([gl_CANONICALIZE_LGPL],
HAVE_REALPATH=0
else
case "$gl_cv_func_realpath_works" in
- *yes) ;;
- *) REPLACE_REALPATH=1 ;;
+ *yes) ;;
+ *) REPLACE_REALPATH=1 ;;
esac
fi
else
@@ -56,7 +57,17 @@ AC_DEFUN([gl_CANONICALIZE_LGPL],
AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
[
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_FUNCS_ONCE([canonicalize_file_name getcwd readlink])
+ AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+ AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
+
+ dnl On native Windows, we use _getcwd(), regardless whether getcwd() is
+ dnl available through the linker option '-loldnames'.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*) ;;
+ *) AC_CHECK_FUNCS([getcwd]) ;;
+ esac
+
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
AC_CHECK_HEADERS_ONCE([sys/param.h])
@@ -70,6 +81,7 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
AC_CHECK_FUNCS_ONCE([realpath])
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
mkdir conftest.d
AC_RUN_IFELSE([
@@ -79,6 +91,7 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
#include <string.h>
]], [[
int result = 0;
+ /* This test fails on Solaris 10. */
{
char *name = realpath ("conftest.a", NULL);
if (!(name && *name == '/'))
@@ -91,12 +104,14 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
result |= 2;
free (name);
}
+ /* This test fails on Mac OS X 10.13, OpenBSD 6.0. */
{
char *name = realpath ("conftest.a/", NULL);
if (name != NULL)
result |= 4;
free (name);
}
+ /* This test fails on AIX 7, Solaris 10. */
{
char *name1 = realpath (".", NULL);
char *name2 = realpath ("conftest.d//./..", NULL);
@@ -105,25 +120,47 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
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 |= 16;
+ free (name);
+ }
+ #endif
return result;
]])
],
[gl_cv_func_realpath_works=yes],
- [gl_cv_func_realpath_works=no],
+ [case $? in
+ 16) 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" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_realpath_works="guessing no" ;;
+ # Guess 'nearly' on musl systems.
+ *-musl*) gl_cv_func_realpath_works="guessing nearly" ;;
+ # 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
])
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/m4/ceil.m4 b/m4/ceil.m4
index f58a99899..8d7b032a0 100644
--- a/m4/ceil.m4
+++ b/m4/ceil.m4
@@ -1,5 +1,5 @@
-# ceil.m4 serial 9
-dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
+# ceil.m4 serial 15
+dnl Copyright (C) 2007, 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.
@@ -32,7 +32,7 @@ AC_DEFUN([gl_FUNC_CEIL],
static double dummy (double f) { return 0; }
int main (int argc, char *argv[])
{
- double (*my_ceil) (double) = argc ? ceil : dummy;
+ double (* volatile my_ceil) (double) = argc ? ceil : dummy;
int result = 0;
/* Test whether ceil (-0.0) is -0.0. */
if (signbitd (minus_zerod) && !signbitd (my_ceil (minus_zerod)))
@@ -46,10 +46,14 @@ int main (int argc, char *argv[])
[gl_cv_func_ceil_ieee=yes],
[gl_cv_func_ceil_ieee=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_ceil_ieee="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_ceil_ieee="guessing no" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_ceil_ieee="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_ceil_ieee="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_ceil_ieee="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_ceil_ieee="$gl_cross_guess_normal" ;;
esac
])
LIBS="$save_LIBS"
@@ -79,8 +83,9 @@ AC_DEFUN([gl_FUNC_CEIL_LIBS],
# define __NO_MATH_INLINES 1 /* for glibc */
#endif
#include <math.h>
+ double (*funcptr) (double) = ceil;
double x;]],
- [[x = ceil(x);]])],
+ [[x = funcptr(x) + ceil(x);]])],
[gl_cv_func_ceil_libm=])
if test "$gl_cv_func_ceil_libm" = "?"; then
save_LIBS="$LIBS"
@@ -91,8 +96,9 @@ AC_DEFUN([gl_FUNC_CEIL_LIBS],
# define __NO_MATH_INLINES 1 /* for glibc */
#endif
#include <math.h>
+ double (*funcptr) (double) = ceil;
double x;]],
- [[x = ceil(x);]])],
+ [[x = funcptr(x) + ceil(x);]])],
[gl_cv_func_ceil_libm="-lm"])
LIBS="$save_LIBS"
fi
diff --git a/m4/check-math-lib.m4 b/m4/check-math-lib.m4
index 8241eedc3..600e23d7f 100644
--- a/m4/check-math-lib.m4
+++ b/m4/check-math-lib.m4
@@ -1,5 +1,5 @@
# check-math-lib.m4 serial 4
-dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 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.
diff --git a/m4/clock_time.m4 b/m4/clock_time.m4
index 12d95ffeb..829b224ed 100644
--- a/m4/clock_time.m4
+++ b/m4/clock_time.m4
@@ -1,5 +1,5 @@
# clock_time.m4 serial 10
-dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 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.
diff --git a/m4/close.m4 b/m4/close.m4
index 005a43ae1..77a504717 100644
--- a/m4/close.m4
+++ b/m4/close.m4
@@ -1,5 +1,5 @@
-# close.m4 serial 8
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+# close.m4 serial 9
+dnl Copyright (C) 2008-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.
@@ -7,10 +7,12 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_CLOSE],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([gl_MSVC_INVAL])
- if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
- REPLACE_CLOSE=1
- fi
+ m4_ifdef([gl_MSVC_INVAL], [
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_CLOSE=1
+ fi
+ ])
m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [
gl_PREREQ_SYS_H_WINSOCK2
if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
diff --git a/m4/codeset.m4 b/m4/codeset.m4
index bc98201e3..629f4ee31 100644
--- a/m4/codeset.m4
+++ b/m4/codeset.m4
@@ -1,6 +1,6 @@
# codeset.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016 Free Software Foundation,
-dnl Inc.
+dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2021 Free Software
+dnl Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/configmake.m4 b/m4/configmake.m4
deleted file mode 100644
index b783296b6..000000000
--- a/m4/configmake.m4
+++ /dev/null
@@ -1,55 +0,0 @@
-# configmake.m4 serial 2
-dnl Copyright (C) 2010-2017 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# gl_CONFIGMAKE_PREP
-# ------------------
-# Guarantee all of the standard directory variables, even when used with
-# autoconf 2.59 (datarootdir wasn't supported until 2.59c, and runstatedir
-# in 2.70) or automake 1.9.6 (pkglibexecdir wasn't supported until 1.10b,
-# and runstatedir in 1.14.1).
-AC_DEFUN([gl_CONFIGMAKE_PREP],
-[
- dnl Technically, datadir should default to datarootdir. But if
- dnl autoconf is too old to provide datarootdir, then reversing the
- dnl definition is a reasonable compromise. Only AC_SUBST a variable
- dnl if it was not already defined earlier by autoconf.
- if test "x$datarootdir" = x; then
- AC_SUBST([datarootdir], ['${datadir}'])
- fi
- dnl Copy the approach used in autoconf 2.60.
- if test "x$docdir" = x; then
- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
- ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
- ['${datarootdir}/doc/${PACKAGE}'])])
- fi
- dnl The remaining variables missing from autoconf 2.59 are easier.
- if test "x$htmldir" = x; then
- AC_SUBST([htmldir], ['${docdir}'])
- fi
- if test "x$dvidir" = x; then
- AC_SUBST([dvidir], ['${docdir}'])
- fi
- if test "x$pdfdir" = x; then
- AC_SUBST([pdfdir], ['${docdir}'])
- fi
- if test "x$psdir" = x; then
- AC_SUBST([psdir], ['${docdir}'])
- fi
- if test "x$lispdir" = x; then
- AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp'])
- fi
- if test "x$localedir" = x; then
- AC_SUBST([localedir], ['${datarootdir}/locale'])
- fi
- dnl Added in autoconf 2.70
- if test "x$runstatedir" = x; then
- AC_SUBST([runstatedir], ['${localstatedir}/run'])
- fi
-
- dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely
- dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe.
- AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}'])
-])
diff --git a/m4/copysign.m4 b/m4/copysign.m4
index a39de0171..d2fc992a3 100644
--- a/m4/copysign.m4
+++ b/m4/copysign.m4
@@ -1,5 +1,5 @@
# copysign.m4 serial 1
-dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-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.
diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4
index 1f9c4f31f..6d8614258 100644
--- a/m4/dirent_h.m4
+++ b/m4/dirent_h.m4
@@ -1,5 +1,5 @@
# dirent_h.m4 serial 16
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-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.
diff --git a/m4/dirfd.m4 b/m4/dirfd.m4
index b4ec3d191..3c9ce5dc6 100644
--- a/m4/dirfd.m4
+++ b/m4/dirfd.m4
@@ -1,8 +1,8 @@
-# serial 24 -*- Autoconf -*-
+# serial 26 -*- Autoconf -*-
dnl Find out how to get the file descriptor associated with an open DIR*.
-# Copyright (C) 2001-2006, 2008-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2006, 2008-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -12,6 +12,7 @@ dnl From Jim Meyering
AC_DEFUN([gl_FUNC_DIRFD],
[
AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
dnl Persuade glibc <dirent.h> to declare dirfd().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
@@ -25,15 +26,15 @@ AC_DEFUN([gl_FUNC_DIRFD],
fi
AC_CACHE_CHECK([whether dirfd is a macro],
- gl_cv_func_dirfd_macro,
+ [gl_cv_func_dirfd_macro],
[AC_EGREP_CPP([dirent_header_defines_dirfd], [
#include <sys/types.h>
#include <dirent.h>
#ifdef dirfd
dirent_header_defines_dirfd
#endif],
- gl_cv_func_dirfd_macro=yes,
- gl_cv_func_dirfd_macro=no)])
+ [gl_cv_func_dirfd_macro=yes],
+ [gl_cv_func_dirfd_macro=no])])
# Use the replacement if we have no function or macro with that name,
# or if OS/2 kLIBC whose dirfd() does not work.
diff --git a/m4/dirname.m4 b/m4/dirname.m4
deleted file mode 100644
index 46f5394c7..000000000
--- a/m4/dirname.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-#serial 10 -*- autoconf -*-
-dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc.
-dnl This file is free software; the Free 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_DIRNAME],
-[
- AC_REQUIRE([gl_DIRNAME_LGPL])
-])
-
-AC_DEFUN([gl_DIRNAME_LGPL],
-[
- dnl Prerequisites of lib/dirname.h.
- AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
-
- dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c,
- dnl lib/stripslash.c.
-])
diff --git a/m4/double-slash-root.m4 b/m4/double-slash-root.m4
index c80f9eada..c9bbcef67 100644
--- a/m4/double-slash-root.m4
+++ b/m4/double-slash-root.m4
@@ -1,5 +1,5 @@
# double-slash-root.m4 serial 4 -*- Autoconf -*-
-dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-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.
diff --git a/m4/dup2.m4 b/m4/dup2.m4
index bdb9ae250..0753a3249 100644
--- a/m4/dup2.m4
+++ b/m4/dup2.m4
@@ -1,5 +1,5 @@
-#serial 25
-dnl Copyright (C) 2002, 2005, 2007, 2009-2017 Free Software Foundation, Inc.
+#serial 27
+dnl Copyright (C) 2002, 2005, 2007, 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.
@@ -8,107 +8,95 @@ AC_DEFUN([gl_FUNC_DUP2],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
- m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [
- AC_CHECK_FUNCS_ONCE([dup2])
- if test $ac_cv_func_dup2 = no; then
- HAVE_DUP2=0
- fi
- ], [
- AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.])
- ])
- if test $HAVE_DUP2 = 1; then
- AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
- [AC_RUN_IFELSE([
- AC_LANG_PROGRAM(
- [[#include <errno.h>
- #include <fcntl.h>
- #include <limits.h>
- #include <sys/resource.h>
- #include <unistd.h>
- #ifndef RLIM_SAVED_CUR
- # define RLIM_SAVED_CUR RLIM_INFINITY
- #endif
- #ifndef RLIM_SAVED_MAX
- # define RLIM_SAVED_MAX RLIM_INFINITY
- #endif
- ]],
- [[int result = 0;
- int bad_fd = INT_MAX;
- struct rlimit rlim;
- if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
- && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
- && rlim.rlim_cur != RLIM_INFINITY
- && rlim.rlim_cur != RLIM_SAVED_MAX
- && rlim.rlim_cur != RLIM_SAVED_CUR)
- bad_fd = rlim.rlim_cur;
- #ifdef FD_CLOEXEC
- if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
- result |= 1;
- #endif
- if (dup2 (1, 1) != 1)
- result |= 2;
- #ifdef FD_CLOEXEC
- if (fcntl (1, F_GETFD) != FD_CLOEXEC)
- result |= 4;
- #endif
- close (0);
- if (dup2 (0, 0) != -1)
- result |= 8;
- /* Many gnulib modules require POSIX conformance of EBADF. */
- if (dup2 (2, bad_fd) == -1 && errno != EBADF)
- result |= 16;
- /* Flush out some cygwin core dumps. */
- if (dup2 (2, -1) != -1 || errno != EBADF)
- result |= 32;
- dup2 (2, 255);
- dup2 (2, 256);
- /* On OS/2 kLIBC, dup2() does not work on a directory fd. */
- {
- int fd = open (".", O_RDONLY);
- if (fd == -1)
- result |= 64;
- else if (dup2 (fd, fd + 1) == -1)
- result |= 128;
-
- close (fd);
- }
- return result;]])
- ],
- [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
- [case "$host_os" in
- mingw*) # on this platform, dup2 always returns 0 for success
- gl_cv_func_dup2_works="guessing no" ;;
- cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
- gl_cv_func_dup2_works="guessing no" ;;
- aix* | freebsd*)
- # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
- # not EBADF.
- gl_cv_func_dup2_works="guessing no" ;;
- haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
- gl_cv_func_dup2_works="guessing no" ;;
- *-android*) # implemented using dup3(), which fails if oldfd == newfd
- gl_cv_func_dup2_works="guessing no" ;;
- os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
- gl_cv_func_dup2_works="guessing no" ;;
- *) gl_cv_func_dup2_works="guessing yes" ;;
- esac])
- ])
- case "$gl_cv_func_dup2_works" in
- *yes) ;;
- *)
- REPLACE_DUP2=1
- AC_CHECK_FUNCS([setdtablesize])
- ;;
- esac
- fi
+ AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
+ [AC_RUN_IFELSE([
+ AC_LANG_PROGRAM(
+ [[#include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <sys/resource.h>
+ #include <unistd.h>
+ ]GL_MDA_DEFINES[
+ #ifndef RLIM_SAVED_CUR
+ # define RLIM_SAVED_CUR RLIM_INFINITY
+ #endif
+ #ifndef RLIM_SAVED_MAX
+ # define RLIM_SAVED_MAX RLIM_INFINITY
+ #endif
+ ]],
+ [[int result = 0;
+ int bad_fd = INT_MAX;
+ struct rlimit rlim;
+ if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
+ && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
+ && rlim.rlim_cur != RLIM_INFINITY
+ && rlim.rlim_cur != RLIM_SAVED_MAX
+ && rlim.rlim_cur != RLIM_SAVED_CUR)
+ bad_fd = rlim.rlim_cur;
+ #ifdef FD_CLOEXEC
+ if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
+ result |= 1;
+ #endif
+ if (dup2 (1, 1) != 1)
+ result |= 2;
+ #ifdef FD_CLOEXEC
+ if (fcntl (1, F_GETFD) != FD_CLOEXEC)
+ result |= 4;
+ #endif
+ close (0);
+ if (dup2 (0, 0) != -1)
+ result |= 8;
+ /* Many gnulib modules require POSIX conformance of EBADF. */
+ if (dup2 (2, bad_fd) == -1 && errno != EBADF)
+ result |= 16;
+ /* Flush out some cygwin core dumps. */
+ if (dup2 (2, -1) != -1 || errno != EBADF)
+ result |= 32;
+ dup2 (2, 255);
+ dup2 (2, 256);
+ /* On OS/2 kLIBC, dup2() does not work on a directory fd. */
+ {
+ int fd = open (".", O_RDONLY);
+ if (fd == -1)
+ result |= 64;
+ else if (dup2 (fd, fd + 1) == -1)
+ result |= 128;
+ close (fd);
+ }
+ return result;]])
+ ],
+ [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
+ [case "$host_os" in
+ mingw*) # on this platform, dup2 always returns 0 for success
+ gl_cv_func_dup2_works="guessing no" ;;
+ cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
+ gl_cv_func_dup2_works="guessing no" ;;
+ aix* | freebsd*)
+ # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
+ # not EBADF.
+ gl_cv_func_dup2_works="guessing no" ;;
+ haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
+ gl_cv_func_dup2_works="guessing no" ;;
+ *-android*) # implemented using dup3(), which fails if oldfd == newfd
+ gl_cv_func_dup2_works="guessing no" ;;
+ os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
+ gl_cv_func_dup2_works="guessing no" ;;
+ *) gl_cv_func_dup2_works="guessing yes" ;;
+ esac])
+ ])
+ case "$gl_cv_func_dup2_works" in
+ *yes) ;;
+ *)
+ REPLACE_DUP2=1
+ AC_CHECK_FUNCS([setdtablesize])
+ ;;
+ esac
dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
dnl to keep fchdir's bookkeeping up-to-date.
m4_ifdef([gl_FUNC_FCHDIR], [
gl_TEST_FCHDIR
if test $HAVE_FCHDIR = 0; then
- if test $HAVE_DUP2 = 1; then
- REPLACE_DUP2=1
- fi
+ REPLACE_DUP2=1
fi
])
])
diff --git a/m4/duplocale.m4 b/m4/duplocale.m4
index b5efd246b..8fcd15509 100644
--- a/m4/duplocale.m4
+++ b/m4/duplocale.m4
@@ -1,5 +1,5 @@
-# duplocale.m4 serial 8
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# duplocale.m4 serial 12
+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.
@@ -8,36 +8,79 @@ AC_DEFUN([gl_FUNC_DUPLOCALE],
[
AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
AC_CHECK_FUNCS_ONCE([duplocale])
if test $ac_cv_func_duplocale = yes; then
dnl Check against glibc bug where duplocale crashes.
- dnl See <http://sourceware.org/bugzilla/show_bug.cgi?id=10969>.
+ dnl See <https://sourceware.org/bugzilla/show_bug.cgi?id=10969>.
dnl Also, on AIX 7.1, duplocale(LC_GLOBAL_LOCALE) returns (locale_t)0 with
dnl errno set to EINVAL.
+ dnl Also, on NetBSD 7.0, duplocale(LC_GLOBAL_LOCALE) returns a locale that
+ dnl corresponds to the C locale.
AC_REQUIRE([gl_LOCALE_H])
- AC_CACHE_CHECK([whether duplocale(LC_GLOBAL_LOCALE) works],
- [gl_cv_func_duplocale_works],
- [AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
+ if test $HAVE_LOCALE_T = 1; then
+ AC_CHECK_FUNCS_ONCE([snprintf_l nl_langinfo_l])
+ AC_CACHE_CHECK([whether duplocale(LC_GLOBAL_LOCALE) works],
+ [gl_cv_func_duplocale_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <locale.h>
#if HAVE_XLOCALE_H
# include <xlocale.h>
#endif
+#if HAVE_SNPRINTF_L
+# include <stdio.h>
+#endif
+#if HAVE_NL_LANGINFO_L
+# include <langinfo.h>
+#endif
+#include <string.h>
+struct locale_dependent_values
+{
+ char numeric[100];
+ char time[100];
+};
int main ()
{
- locale_t loc = duplocale (LC_GLOBAL_LOCALE);
+ struct locale_dependent_values expected_result;
+ struct locale_dependent_values result;
+ locale_t loc;
+ setlocale (LC_ALL, "en_US.UTF-8");
+ setlocale (LC_NUMERIC, "de_DE.UTF-8");
+ setlocale (LC_TIME, "fr_FR.UTF-8");
+#if HAVE_SNPRINTF_L
+ snprintf (expected_result.numeric, sizeof (expected_result.numeric), "%g", 3.5);
+#endif
+#if HAVE_NL_LANGINFO_L
+ strcpy (expected_result.time, nl_langinfo (MON_1));
+#endif
+ loc = duplocale (LC_GLOBAL_LOCALE);
if (!loc)
return 1;
+#if HAVE_SNPRINTF_L
+ snprintf_l (result.numeric, sizeof (result.numeric), loc, "%g", 3.5);
+#endif
+#if HAVE_NL_LANGINFO_L
+ strcpy (result.time, nl_langinfo_l (MON_1, loc));
+#endif
+#if HAVE_SNPRINTF_L
+ if (strcmp (result.numeric, expected_result.numeric) != 0)
+ return 2;
+#endif
+#if HAVE_NL_LANGINFO_L
+ if (strcmp (result.time, expected_result.time) != 0)
+ return 3;
+#endif
freelocale (loc);
return 0;
}]])],
- [gl_cv_func_duplocale_works=yes],
- [gl_cv_func_duplocale_works=no],
- [dnl Guess it works except on glibc < 2.12, uClibc, and AIX.
- case "$host_os" in
- aix*) gl_cv_func_duplocale_works="guessing no";;
- *-gnu*)
- AC_EGREP_CPP([Unlucky], [
+ [gl_cv_func_duplocale_works=yes],
+ [gl_cv_func_duplocale_works=no],
+ [dnl Guess it works except on glibc < 2.12, uClibc, AIX, and NetBSD.
+ case "$host_os" in
+ aix* | netbsd*) gl_cv_func_duplocale_works="guessing no";;
+ *-gnu* | gnu*)
+ AC_EGREP_CPP([Unlucky], [
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 12)
@@ -47,20 +90,34 @@ int main ()
#ifdef __UCLIBC__
Unlucky user
#endif
- ],
- [gl_cv_func_duplocale_works="guessing no"],
- [gl_cv_func_duplocale_works="guessing yes"])
- ;;
- *) gl_cv_func_duplocale_works="guessing yes";;
- esac
- ])
- ])
- case "$gl_cv_func_duplocale_works" in
- *no) REPLACE_DUPLOCALE=1 ;;
- esac
+ ],
+ [gl_cv_func_duplocale_works="guessing no"],
+ [gl_cv_func_duplocale_works="guessing yes"])
+ ;;
+ *) gl_cv_func_duplocale_works="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_duplocale_works" in
+ *no) REPLACE_DUPLOCALE=1 ;;
+ esac
+ else
+ dnl In 2019, some versions of z/OS lack the locale_t type and have broken
+ dnl newlocale, duplocale, freelocale functions. In this situation, we
+ dnl cannot use nor override duplocale.
+ HAVE_DUPLOCALE=0
+ fi
else
HAVE_DUPLOCALE=0
fi
+ if test $REPLACE_DUPLOCALE = 1; then
+ LIB_DUPLOCALE="$LIB_SETLOCALE_NULL"
+ else
+ LIB_DUPLOCALE=
+ fi
+ dnl LIB_DUPLOCALE is expected to be '-pthread' or '-lpthread' on AIX
+ dnl with gcc or xlc, and empty otherwise.
+ AC_SUBST([LIB_DUPLOCALE])
])
# Prerequisites of lib/duplocale.c.
diff --git a/m4/eealloc.m4 b/m4/eealloc.m4
index 96b9bca5a..002f0c867 100644
--- a/m4/eealloc.m4
+++ b/m4/eealloc.m4
@@ -1,5 +1,5 @@
# eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 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.
diff --git a/m4/environ.m4 b/m4/environ.m4
index 3b9fa5f58..d97177086 100644
--- a/m4/environ.m4
+++ b/m4/environ.m4
@@ -1,5 +1,5 @@
-# environ.m4 serial 6
-dnl Copyright (C) 2001-2004, 2006-2017 Free Software Foundation, Inc.
+# environ.m4 serial 7
+dnl Copyright (C) 2001-2004, 2006-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.
@@ -29,16 +29,14 @@ AC_DEFUN_ONCE([gl_ENVIRON],
AC_DEFUN([gt_CHECK_VAR_DECL],
[
define([gt_cv_var], [gt_cv_var_]$2[_declaration])
- AC_MSG_CHECKING([if $2 is properly declared])
- AC_CACHE_VAL([gt_cv_var], [
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[$1
- extern struct { int foo; } $2;]],
- [[$2.foo = 1;]])],
- [gt_cv_var=no],
- [gt_cv_var=yes])])
- AC_MSG_RESULT([$gt_cv_var])
+ AC_CACHE_CHECK([if $2 is properly declared], [gt_cv_var],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[$1
+ extern struct { int foo; } $2;]],
+ [[$2.foo = 1;]])],
+ [gt_cv_var=no],
+ [gt_cv_var=yes])])
if test $gt_cv_var = yes; then
AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
[Define if you have the declaration of $2.])
diff --git a/m4/errno_h.m4 b/m4/errno_h.m4
index 9f0f2f2fb..51dfe9293 100644
--- a/m4/errno_h.m4
+++ b/m4/errno_h.m4
@@ -1,9 +1,11 @@
-# errno_h.m4 serial 12
-dnl Copyright (C) 2004, 2006, 2008-2017 Free Software Foundation, Inc.
+# errno_h.m4 serial 13
+dnl Copyright (C) 2004, 2006, 2008-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_PREREQ([2.61])
+
AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
[
AC_REQUIRE([AC_PROG_CC])
@@ -129,9 +131,3 @@ yes
AC_SUBST($1[_VALUE])
fi
])
-
-dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
-dnl Remove this when we can assume autoconf >= 2.61.
-m4_ifdef([AC_COMPUTE_INT], [], [
- AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
-])
diff --git a/m4/exponentd.m4 b/m4/exponentd.m4
index cd64b92d0..fb136f477 100644
--- a/m4/exponentd.m4
+++ b/m4/exponentd.m4
@@ -1,5 +1,5 @@
# exponentd.m4 serial 3
-dnl Copyright (C) 2007-2008, 2010-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2008, 2010-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.
diff --git a/m4/exponentf.m4 b/m4/exponentf.m4
index 54f609e5a..308d02387 100644
--- a/m4/exponentf.m4
+++ b/m4/exponentf.m4
@@ -1,5 +1,5 @@
# exponentf.m4 serial 2
-dnl Copyright (C) 2007-2008, 2010-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2008, 2010-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.
diff --git a/m4/exponentl.m4 b/m4/exponentl.m4
index c9cb81dd8..508fe9315 100644
--- a/m4/exponentl.m4
+++ b/m4/exponentl.m4
@@ -1,11 +1,12 @@
-# exponentl.m4 serial 3
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# exponentl.m4 serial 5
+dnl Copyright (C) 2007-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_LONG_DOUBLE_EXPONENT_LOCATION],
[
AC_REQUIRE([gl_BIGENDIAN])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([where to find the exponent in a 'long double'],
[gl_cv_cc_long_double_expbit0],
[
@@ -21,14 +22,14 @@ typedef union { long double value; unsigned int word[NWORDS]; }
memory_long_double;
static unsigned int ored_words[NWORDS];
static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (long double x)
+static void add_to_ored_words (long double *x)
{
memory_long_double m;
size_t i;
/* Clear it first, in case
sizeof (long double) < sizeof (memory_long_double). */
memset (&m, 0, sizeof (memory_long_double));
- m.value = x;
+ m.value = *x;
for (i = 0; i < NWORDS; i++)
{
ored_words[i] |= m.word[i];
@@ -37,17 +38,15 @@ static void add_to_ored_words (long double x)
}
int main ()
{
+ static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L };
size_t j;
FILE *fp = fopen ("conftest.out", "w");
if (fp == NULL)
return 1;
for (j = 0; j < NWORDS; j++)
anded_words[j] = ~ (unsigned int) 0;
- add_to_ored_words (0.25L);
- add_to_ored_words (0.5L);
- add_to_ored_words (1.0L);
- add_to_ored_words (2.0L);
- add_to_ored_words (4.0L);
+ for (j = 0; j < 5; j++)
+ add_to_ored_words (&samples[j]);
/* Remove bits that are common (e.g. if representation of the first mantissa
bit is explicit). */
for (j = 0; j < NWORDS; j++)
@@ -79,9 +78,24 @@ int main ()
[gl_cv_cc_long_double_expbit0=`cat conftest.out`],
[gl_cv_cc_long_double_expbit0="unknown"],
[
- dnl When cross-compiling, we don't know. It depends on the
+ dnl When cross-compiling, in general we don't know. It depends on the
dnl ABI and compiler version. There are too many cases.
gl_cv_cc_long_double_expbit0="unknown"
+ case "$host_os" in
+ mingw*) # On native Windows (little-endian), we know the result
+ # in two cases: mingw, MSVC.
+ AC_EGREP_CPP([Known], [
+#ifdef __MINGW32__
+ Known
+#endif
+ ], [gl_cv_cc_long_double_expbit0="word 2 bit 0"])
+ AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ], [gl_cv_cc_long_double_expbit0="word 1 bit 20"])
+ ;;
+ esac
])
rm -f conftest.out
])
diff --git a/m4/extensions.m4 b/m4/extensions.m4
index c60f537db..5792a9557 100644
--- a/m4/extensions.m4
+++ b/m4/extensions.m4
@@ -1,14 +1,19 @@
-# serial 15 -*- Autoconf -*-
+# serial 22 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2017 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2021 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.
+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,11 +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 threading extensions on Solaris. */
+/* 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 compatibility extensions on NetBSD.
+ Oddly enough, this does nothing on OpenBSD. */
+#ifndef _OPENBSD_SOURCE
+# undef _OPENBSD_SOURCE
+#endif
+/* 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
@@ -104,17 +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 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(
@@ -123,11 +154,35 @@ 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])
AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__])
AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__])
@@ -137,23 +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])
+ 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
# ------------------------
@@ -161,13 +211,17 @@ 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])
+
+ dnl On OpenBSD 6.8 with GCC, the include files contain a couple of
+ dnl definitions that are only activated with an explicit -D_ISOC11_SOURCE.
+ dnl That's because this version of GCC (4.2.1) supports the option
+ dnl '-std=gnu99' but not the option '-std=gnu11'.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ openbsd*)
+ AC_DEFINE([_ISOC11_SOURCE], [1],
+ [Define to enable the declarations of ISO C 11 types and functions.])
+ ;;
+ esac
])
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index 00f960968..a2acf126c 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -1,6 +1,6 @@
dnl 'extern inline' a la ISO C99.
-dnl Copyright 2012-2017 Free Software Foundation, Inc.
+dnl Copyright 2012-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.
@@ -11,7 +11,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
[/* 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
- <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
+ <https://lists.gnu.org/r/bug-texinfo/2013-02/msg00030.html>.
Suppress extern inline with Sun C in standards-conformance mode, as it
mishandles inline functions that call each other. E.g., for 'inline void f
@@ -25,20 +25,32 @@ AC_DEFUN([gl_EXTERN_INLINE],
if isdigit is mistakenly implemented via a static inline function,
a program containing an extern inline function that calls isdigit
may not work since the C standard prohibits extern inline functions
- from calling static functions. This bug is known to occur on:
+ from calling static functions (ISO C 99 section 6.7.4.(3).
+ This bug is known to occur on:
OS X 10.8 and earlier; see:
- http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
+ https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
DragonFly; see
- http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
+ http://muscles.dragonflybsd.org/bulk/clang-master-potential/20141111_102002/logs/ah-tty-0.3.12.log
FreeBSD; see:
- http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
+ https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html
OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
- for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
- Assume DragonFly and FreeBSD will be similar. */
+ for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
+ Assume DragonFly and FreeBSD will be similar.
+
+ GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. It defines a macro
+ __GNUC_STDC_INLINE__ to indicate this situation or a macro
+ __GNUC_GNU_INLINE__ to indicate the opposite situation.
+ GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
+ semantics but warns, unless -fgnu89-inline is used:
+ warning: C99 inline functions are not supported; using GNU89
+ warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
+ It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
+ */
#if (((defined __APPLE__ && defined __MACH__) \
|| defined __DragonFly__ || defined __FreeBSD__) \
&& (defined __header_inline \
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4
index 3c3b63c52..7c459ad13 100644
--- a/m4/fcntl-o.m4
+++ b/m4/fcntl-o.m4
@@ -1,23 +1,22 @@
-# fcntl-o.m4 serial 4
-dnl Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc.
+# fcntl-o.m4 serial 7
+dnl Copyright (C) 2006, 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.
dnl Written by Paul Eggert.
+AC_PREREQ([2.60])
+
# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
AC_DEFUN([gl_FCNTL_O_FLAGS],
[
dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
- dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
- dnl AC_GNU_SOURCE.
- m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
- [AC_REQUIRE([AC_GNU_SOURCE])])
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CHECK_FUNCS_ONCE([symlink])
AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
@@ -33,6 +32,7 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
# defined sleep(n) _sleep ((n) * 1000)
#endif
#include <fcntl.h>
+ ]GL_MDA_DEFINES[
#ifndef O_NOATIME
#define O_NOATIME 0
#endif
@@ -116,7 +116,13 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
*) gl_cv_header_working_fcntl_h='no';;
esac],
- [gl_cv_header_working_fcntl_h=cross-compiling])])
+ [case "$host_os" in
+ # Guess 'no' on native Windows.
+ mingw*) gl_cv_header_working_fcntl_h='no' ;;
+ *) gl_cv_header_working_fcntl_h=cross-compiling ;;
+ esac
+ ])
+ ])
case $gl_cv_header_working_fcntl_h in #(
*O_NOATIME* | no | cross-compiling) ac_val=0;; #(
diff --git a/m4/fcntl.m4 b/m4/fcntl.m4
new file mode 100644
index 000000000..f6264345c
--- /dev/null
+++ b/m4/fcntl.m4
@@ -0,0 +1,151 @@
+# fcntl.m4 serial 11
+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.
+
+# For now, this module ensures that fcntl()
+# - supports F_DUPFD correctly
+# - supports or emulates F_DUPFD_CLOEXEC
+# - supports F_GETFD
+# Still to be ported to mingw:
+# - F_SETFD
+# - F_GETFL, F_SETFL
+# - F_GETOWN, F_SETOWN
+# - F_GETLK, F_SETLK, F_SETLKW
+AC_DEFUN([gl_FUNC_FCNTL],
+[
+ dnl Persuade glibc to expose F_DUPFD_CLOEXEC.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS_ONCE([fcntl])
+ if test $ac_cv_func_fcntl = no; then
+ gl_REPLACE_FCNTL
+ else
+ dnl cygwin 1.5.x F_DUPFD has wrong errno, and allows negative target
+ dnl haiku alpha 2 F_DUPFD has wrong errno
+ AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly],
+ [gl_cv_func_fcntl_f_dupfd_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <sys/resource.h>
+ #include <unistd.h>
+ ]GL_MDA_DEFINES[
+ #ifndef RLIM_SAVED_CUR
+ # define RLIM_SAVED_CUR RLIM_INFINITY
+ #endif
+ #ifndef RLIM_SAVED_MAX
+ # define RLIM_SAVED_MAX RLIM_INFINITY
+ #endif
+ ]],
+ [[int result = 0;
+ int bad_fd = INT_MAX;
+ struct rlimit rlim;
+ if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
+ && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
+ && rlim.rlim_cur != RLIM_INFINITY
+ && rlim.rlim_cur != RLIM_SAVED_MAX
+ && rlim.rlim_cur != RLIM_SAVED_CUR)
+ bad_fd = rlim.rlim_cur;
+ if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
+ if (errno != EINVAL) result |= 2;
+ if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
+ if (errno != EINVAL) result |= 8;
+ /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
+ {
+ int fd;
+ fd = open (".", O_RDONLY);
+ if (fd == -1)
+ result |= 16;
+ else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
+ result |= 32;
+
+ close (fd);
+ }
+ return result;]])],
+ [gl_cv_func_fcntl_f_dupfd_works=yes],
+ [gl_cv_func_fcntl_f_dupfd_works=no],
+ [case $host_os in
+ aix* | cygwin* | haiku*)
+ gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
+ *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
+ esac])])
+ case $gl_cv_func_fcntl_f_dupfd_works in
+ *yes) ;;
+ *) gl_REPLACE_FCNTL
+ AC_DEFINE([FCNTL_DUPFD_BUGGY], [1], [Define this to 1 if F_DUPFD
+ behavior does not match POSIX]) ;;
+ esac
+
+ 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_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
+ it to support the semantics on older kernels that failed with EINVAL. */
+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],
+ [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.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ gl_REPLACE_FCNTL
+ fi
+ ])
+])
+
+AC_DEFUN([gl_REPLACE_FCNTL],
+[
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([fcntl])
+ if test $ac_cv_func_fcntl = no; then
+ HAVE_FCNTL=0
+ else
+ REPLACE_FCNTL=1
+ fi
+])
diff --git a/m4/fcntl_h.m4 b/m4/fcntl_h.m4
index 09c21eff9..e63a82f10 100644
--- a/m4/fcntl_h.m4
+++ b/m4/fcntl_h.m4
@@ -1,6 +1,6 @@
-# serial 15
+# serial 17
# Configure fcntl.h.
-dnl Copyright (C) 2006-2007, 2009-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2007, 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.
@@ -37,13 +37,18 @@ AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
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])
+ REPLACE_CREAT=0; AC_SUBST([REPLACE_CREAT])
REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
diff --git a/m4/flexmember.m4 b/m4/flexmember.m4
index 35580ac27..49b1c752d 100644
--- a/m4/flexmember.m4
+++ b/m4/flexmember.m4
@@ -1,7 +1,7 @@
-# serial 4
+# serial 5
# Check for flexible array member support.
-# Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009-2021 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.
@@ -17,12 +17,15 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
[[#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
- struct s { int n; double d[]; };]],
+ struct m { struct m *next, **list; char name[]; };
+ struct s { struct s *p; struct m *m; int n; double d[]; };]],
[[int m = getchar ();
size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
nbytes += sizeof (struct s) - 1;
nbytes -= nbytes % sizeof (struct s);
struct s *p = malloc (nbytes);
+ p->p = p;
+ p->m = NULL;
p->d[0] = 0.0;
return p->d != (double *) NULL;]])],
[ac_cv_c_flexmember=yes],
@@ -31,12 +34,10 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [],
[Define to nothing if C supports flexible array members, and to
1 if it does not. That way, with a declaration like 'struct s
- { int n; double d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack
+ { int n; short d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack
can be used with pre-C99 compilers.
- When computing the size of such an object, don't use 'sizeof (struct s)'
- as it overestimates the size. Use 'offsetof (struct s, d)' instead.
- Don't use 'offsetof (struct s, d@<:@0@:>@)', as this doesn't work with
- MSVC and with C++ compilers.])
+ Use 'FLEXSIZEOF (struct s, d, N * sizeof (short))' to calculate
+ the size in bytes of such a struct containing an N-element array.])
else
AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [1])
fi
diff --git a/m4/float_h.m4 b/m4/float_h.m4
index e8522ab11..ba38a2890 100644
--- a/m4/float_h.m4
+++ b/m4/float_h.m4
@@ -1,5 +1,5 @@
-# float_h.m4 serial 9
-dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
+# float_h.m4 serial 12
+dnl Copyright (C) 2007, 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.
@@ -14,7 +14,7 @@ AC_DEFUN([gl_FLOAT_H],
aix* | beos* | openbsd* | mirbsd* | irix*)
FLOAT_H=float.h
;;
- freebsd*)
+ freebsd* | dragonfly*)
case "$host_cpu" in
changequote(,)dnl
i[34567]86 )
@@ -24,10 +24,14 @@ changequote([,])dnl
x86_64 )
# On x86_64 systems, the C compiler may still be generating
# 32-bit code.
- AC_EGREP_CPP([yes],
- [#if defined __LP64__ || defined __x86_64__ || defined __amd64__
- yes
- #endif],
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __x86_64__ || defined __amd64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
[],
[FLOAT_H=float.h])
;;
@@ -42,7 +46,7 @@ changequote([,])dnl
;;
esac
case "$host_os" in
- aix* | freebsd* | linux*)
+ aix* | freebsd* | dragonfly* | linux*)
if test -n "$FLOAT_H"; then
REPLACE_FLOAT_LDBL=1
fi
@@ -69,14 +73,20 @@ int main ()
[gl_cv_func_itold_works=no],
[case "$host" in
sparc*-*-linux*)
- AC_EGREP_CPP([yes],
- [#if defined __LP64__ || defined __arch64__
- yes
- #endif],
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
[gl_cv_func_itold_works="guessing no"],
[gl_cv_func_itold_works="guessing yes"])
;;
- *) gl_cv_func_itold_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_itold_works="guessing yes" ;;
+ *) gl_cv_func_itold_works="guessing yes" ;;
esac
])
])
diff --git a/m4/flock.m4 b/m4/flock.m4
index 5b3544df2..eb46642d8 100644
--- a/m4/flock.m4
+++ b/m4/flock.m4
@@ -1,5 +1,5 @@
# flock.m4 serial 3
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-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.
diff --git a/m4/floor.m4 b/m4/floor.m4
index 713e7b346..e54d2c7f5 100644
--- a/m4/floor.m4
+++ b/m4/floor.m4
@@ -1,5 +1,5 @@
-# floor.m4 serial 8
-dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
+# floor.m4 serial 14
+dnl Copyright (C) 2007, 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.
@@ -32,7 +32,7 @@ AC_DEFUN([gl_FUNC_FLOOR],
static double dummy (double f) { return 0; }
int main (int argc, char *argv[])
{
- double (*my_floor) (double) = argc ? floor : dummy;
+ double (* volatile my_floor) (double) = argc ? floor : dummy;
/* Test whether floor (-0.0) is -0.0. */
if (signbitd (minus_zerod) && !signbitd (my_floor (minus_zerod)))
return 1;
@@ -42,10 +42,14 @@ int main (int argc, char *argv[])
[gl_cv_func_floor_ieee=yes],
[gl_cv_func_floor_ieee=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_floor_ieee="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_floor_ieee="guessing no" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_floor_ieee="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_floor_ieee="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_floor_ieee="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_floor_ieee="$gl_cross_guess_normal" ;;
esac
])
LIBS="$save_LIBS"
@@ -75,8 +79,9 @@ AC_DEFUN([gl_FUNC_FLOOR_LIBS],
# define __NO_MATH_INLINES 1 /* for glibc */
#endif
#include <math.h>
+ double (*funcptr) (double) = floor;
double x;]],
- [[x = floor(x);]])],
+ [[x = funcptr(x) + floor(x);]])],
[gl_cv_func_floor_libm=])
if test "$gl_cv_func_floor_libm" = "?"; then
save_LIBS="$LIBS"
@@ -87,8 +92,9 @@ AC_DEFUN([gl_FUNC_FLOOR_LIBS],
# define __NO_MATH_INLINES 1 /* for glibc */
#endif
#include <math.h>
+ double (*funcptr) (double) = floor;
double x;]],
- [[x = floor(x);]])],
+ [[x = funcptr(x) + floor(x);]])],
[gl_cv_func_floor_libm="-lm"])
LIBS="$save_LIBS"
fi
diff --git a/m4/fpieee.m4 b/m4/fpieee.m4
index 69579d82a..3f16957fb 100644
--- a/m4/fpieee.m4
+++ b/m4/fpieee.m4
@@ -1,5 +1,5 @@
# fpieee.m4 serial 2 -*- coding: utf-8 -*-
-dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 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.
@@ -33,7 +33,7 @@ AC_DEFUN([gl_FP_IEEE],
alpha*)
# On Alpha systems, a compiler option provides the behaviour.
# See the ieee(3) manual page, also available at
- # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM>
+ # <https://backdrift.org/man/tru64/man3/ieee.3.html>
if test -n "$GCC"; then
# GCC has the option -mieee.
# For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
diff --git a/m4/free.m4 b/m4/free.m4
new file mode 100644
index 000000000..d671376b0
--- /dev/null
+++ b/m4/free.m4
@@ -0,0 +1,49 @@
+# free.m4 serial 5
+# Copyright (C) 2003-2005, 2009-2021 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/frexp.m4 b/m4/frexp.m4
index 73f50b3e3..04248b04f 100644
--- a/m4/frexp.m4
+++ b/m4/frexp.m4
@@ -1,5 +1,5 @@
-# frexp.m4 serial 15
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# frexp.m4 serial 16
+dnl Copyright (C) 2007-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.
@@ -164,8 +164,17 @@ int main()
[gl_cv_func_frexp_works=yes],
[gl_cv_func_frexp_works=no],
[case "$host_os" in
- netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
- *) gl_cv_func_frexp_works="guessing yes";;
+ netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
+ mingw*) # Guess yes with MSVC, no with mingw.
+ AC_EGREP_CPP([Good], [
+#ifdef _MSC_VER
+ Good
+#endif
+ ],
+ [gl_cv_func_frexp_works="guessing yes"],
+ [gl_cv_func_frexp_works="guessing no"])
+ ;;
+ *) gl_cv_func_frexp_works="guessing yes" ;;
esac
])
])
diff --git a/m4/fstat.m4 b/m4/fstat.m4
index 14c871a8b..3b5b238fa 100644
--- a/m4/fstat.m4
+++ b/m4/fstat.m4
@@ -1,22 +1,22 @@
-# fstat.m4 serial 4
-dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# fstat.m4 serial 7
+dnl Copyright (C) 2011-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_FUNC_FSTAT],
[
+ AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
- AC_REQUIRE([gl_MSVC_INVAL])
- if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
- REPLACE_FSTAT=1
- fi
-
- AC_REQUIRE([gl_HEADER_SYS_STAT_H])
- if test $WINDOWS_64_BIT_ST_SIZE = 1; then
- REPLACE_FSTAT=1
- fi
+ case "$host_os" in
+ mingw* | solaris*)
+ dnl On MinGW, the original stat() returns st_atime, st_mtime,
+ dnl st_ctime values that are affected by the time zone.
+ dnl Solaris stat can return a negative tv_nsec.
+ REPLACE_FSTAT=1
+ ;;
+ esac
dnl Replace fstat() for supporting the gnulib-defined open() on directories.
m4_ifdef([gl_FUNC_FCHDIR], [
@@ -32,5 +32,9 @@ AC_DEFUN([gl_FUNC_FSTAT],
])
])
-# Prerequisites of lib/fstat.c.
-AC_DEFUN([gl_PREREQ_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_PREREQ_STAT_W32])
+ :
+])
diff --git a/m4/fsync.m4 b/m4/fsync.m4
index f1399de39..6dc8cd1c0 100644
--- a/m4/fsync.m4
+++ b/m4/fsync.m4
@@ -1,5 +1,5 @@
# fsync.m4 serial 2
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-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.
diff --git a/m4/func.m4 b/m4/func.m4
index bd429eeae..63fdd611b 100644
--- a/m4/func.m4
+++ b/m4/func.m4
@@ -1,5 +1,5 @@
# func.m4 serial 2
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-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.
diff --git a/m4/getaddrinfo.m4 b/m4/getaddrinfo.m4
index f5e228471..97889a8b5 100644
--- a/m4/getaddrinfo.m4
+++ b/m4/getaddrinfo.m4
@@ -1,5 +1,5 @@
-# getaddrinfo.m4 serial 31
-dnl Copyright (C) 2004-2017 Free Software Foundation, Inc.
+# getaddrinfo.m4 serial 33
+dnl Copyright (C) 2004-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.
@@ -8,7 +8,6 @@ AC_DEFUN([gl_GETADDRINFO],
[
AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
AC_REQUIRE([gl_HEADER_NETDB])dnl for HAVE_NETDB_H
- AC_MSG_CHECKING([how to do getaddrinfo, freeaddrinfo and getnameinfo])
GETADDRINFO_LIB=
gai_saved_LIBS="$LIBS"
@@ -55,10 +54,40 @@ AC_DEFUN([gl_GETADDRINFO],
if test "$gl_cv_w32_getaddrinfo" = "yes"; then
GETADDRINFO_LIB="-lws2_32"
LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
+ dnl Check for correct signature, in particular for a cdecl-compatible
+ dnl calling convention.
+ AC_CACHE_CHECK([for getaddrinfo with POSIX signature],
+ [gl_cv_func_getaddrinfo_posix_signature],
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#include <stddef.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int getaddrinfo (const char *, const char *, const struct addrinfo *, struct addrinfo **);
+]])],
+ [gl_cv_func_getaddrinfo_posix_signature=yes],
+ [gl_cv_func_getaddrinfo_posix_signature=no])
+ ])
+ if test $gl_cv_func_getaddrinfo_posix_signature = no; then
+ REPLACE_GETADDRINFO=1
+ fi
else
HAVE_GETADDRINFO=0
fi
fi
+ AC_DEFINE_UNQUOTED([HAVE_GETADDRINFO], [$HAVE_GETADDRINFO],
+ [Define to 1 if getaddrinfo exists, or to 0 otherwise.])
# We can't use AC_REPLACE_FUNCS here because gai_strerror may be an
# inline function declared in ws2tcpip.h, so we need to get that
diff --git a/m4/getdtablesize.m4 b/m4/getdtablesize.m4
new file mode 100644
index 000000000..8fbc94189
--- /dev/null
+++ b/m4/getdtablesize.m4
@@ -0,0 +1,63 @@
+# getdtablesize.m4 serial 8
+dnl Copyright (C) 2008-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_FUNC_GETDTABLESIZE],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS_ONCE([getdtablesize])
+ AC_CHECK_DECLS_ONCE([getdtablesize])
+ if test $ac_cv_func_getdtablesize = yes &&
+ test $ac_cv_have_decl_getdtablesize = yes; then
+ AC_CACHE_CHECK([whether getdtablesize works],
+ [gl_cv_func_getdtablesize_works],
+ [dnl There are two concepts: the "maximum possible file descriptor value + 1"
+ dnl and the "maximum number of open file descriptors in a process".
+ dnl Per SUSv2 and POSIX, getdtablesize() should return the first one.
+ dnl On most platforms, the first and the second concept are the same.
+ dnl On OpenVMS, however, they are different and getdtablesize() returns
+ dnl the second one; thus the test below fails. But we don't care
+ dnl because there's no good way to write a replacement getdtablesize().
+ case "$host_os" in
+ vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
+ *)
+ dnl Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft
+ dnl limit up to an unchangeable hard limit; all other platforms
+ dnl correctly require setrlimit before getdtablesize() can report
+ dnl a larger value.
+ AC_RUN_IFELSE([
+ AC_LANG_PROGRAM(
+ [[#include <unistd.h>]
+ GL_MDA_DEFINES
+ ],
+ [[int size = getdtablesize();
+ if (dup2 (0, getdtablesize()) != -1)
+ return 1;
+ if (size != getdtablesize())
+ return 2;
+ ]])],
+ [gl_cv_func_getdtablesize_works=yes],
+ [gl_cv_func_getdtablesize_works=no],
+ [case "$host_os" in
+ cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
+ gl_cv_func_getdtablesize_works="guessing no" ;;
+ *) gl_cv_func_getdtablesize_works="guessing yes" ;;
+ esac
+ ])
+ ;;
+ esac
+ ])
+ case "$gl_cv_func_getdtablesize_works" in
+ *yes | "no (limitation)") ;;
+ *) REPLACE_GETDTABLESIZE=1 ;;
+ esac
+ else
+ HAVE_GETDTABLESIZE=0
+ fi
+])
+
+# Prerequisites of lib/getdtablesize.c.
+AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [:])
diff --git a/m4/getlogin.m4 b/m4/getlogin.m4
index c013fdd47..c5b7f1aae 100644
--- a/m4/getlogin.m4
+++ b/m4/getlogin.m4
@@ -1,5 +1,5 @@
# getlogin.m4 serial 5
-dnl Copyright (C) 2010-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-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.
diff --git a/m4/getrandom.m4 b/m4/getrandom.m4
new file mode 100644
index 000000000..5f174dc7e
--- /dev/null
+++ b/m4/getrandom.m4
@@ -0,0 +1,68 @@
+# getrandom.m4 serial 8
+dnl Copyright 2020-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.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl_FUNC_GETRANDOM],
+[
+ AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([getrandom])
+ if test "$ac_cv_func_getrandom" != yes; then
+ HAVE_GETRANDOM=0
+ else
+ dnl On Solaris 11.4 the return type is 'int', not 'ssize_t'.
+ AC_CACHE_CHECK([whether getrandom is compatible with its GNU+BSD signature],
+ [gl_cv_func_getrandom_ok],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Additional includes are needed before <sys/random.h> on uClibc
+ and Mac OS X. */
+ #include <sys/types.h>
+ #include <stdlib.h>
+ #include <sys/random.h>
+ ssize_t getrandom (void *, size_t, unsigned int);
+ ]],
+ [[]])
+ ],
+ [gl_cv_func_getrandom_ok=yes],
+ [gl_cv_func_getrandom_ok=no])
+ ])
+ if test $gl_cv_func_getrandom_ok = no; then
+ REPLACE_GETRANDOM=1
+ fi
+ fi
+
+ case "$host_os" in
+ mingw*)
+ AC_CHECK_HEADERS([bcrypt.h], [], [],
+ [[#include <windows.h>
+ ]])
+ AC_CACHE_CHECK([whether the bcrypt library is guaranteed to be present],
+ [gl_cv_lib_assume_bcrypt],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <windows.h>]],
+ [[#if !(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
+ cannot assume it
+ #endif
+ ]])
+ ],
+ [gl_cv_lib_assume_bcrypt=yes],
+ [gl_cv_lib_assume_bcrypt=no])
+ ])
+ if test $gl_cv_lib_assume_bcrypt = yes; then
+ AC_DEFINE([HAVE_LIB_BCRYPT], [1],
+ [Define to 1 if the bcrypt library is guaranteed to be present.])
+ LIB_GETRANDOM='-lbcrypt'
+ else
+ LIB_GETRANDOM='-ladvapi32'
+ fi
+ ;;
+ *)
+ LIB_GETRANDOM= ;;
+ esac
+ AC_SUBST([LIB_GETRANDOM])
+])
diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4
deleted file mode 100644
index 4f501e5bf..000000000
--- a/m4/gettimeofday.m4
+++ /dev/null
@@ -1,138 +0,0 @@
-# serial 21
-
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2017 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.
-
-dnl From Jim Meyering.
-
-AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
-[
- AC_REQUIRE([AC_C_RESTRICT])
- AC_REQUIRE([gl_HEADER_SYS_TIME_H])
- AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([gettimeofday])
-
- gl_gettimeofday_timezone=void
- if test $ac_cv_func_gettimeofday != yes; then
- HAVE_GETTIMEOFDAY=0
- else
- gl_FUNC_GETTIMEOFDAY_CLOBBER
- AC_CACHE_CHECK([for gettimeofday with POSIX signature],
- [gl_cv_func_gettimeofday_posix_signature],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <sys/time.h>
- struct timeval c;
- int gettimeofday (struct timeval *restrict, void *restrict);
- ]],
- [[/* glibc uses struct timezone * rather than the POSIX void *
- if _GNU_SOURCE is defined. However, since the only portable
- use of gettimeofday uses NULL as the second parameter, and
- since the glibc definition is actually more typesafe, it is
- not worth wrapping this to get a compliant signature. */
- int (*f) (struct timeval *restrict, void *restrict)
- = gettimeofday;
- int x = f (&c, 0);
- return !(x | c.tv_sec | c.tv_usec);
- ]])],
- [gl_cv_func_gettimeofday_posix_signature=yes],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <sys/time.h>
-int gettimeofday (struct timeval *restrict, struct timezone *restrict);
- ]])],
- [gl_cv_func_gettimeofday_posix_signature=almost],
- [gl_cv_func_gettimeofday_posix_signature=no])])])
- if test $gl_cv_func_gettimeofday_posix_signature = almost; then
- gl_gettimeofday_timezone='struct timezone'
- elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
- REPLACE_GETTIMEOFDAY=1
- fi
- dnl If we override 'struct timeval', we also have to override gettimeofday.
- if test $REPLACE_STRUCT_TIMEVAL = 1; then
- REPLACE_GETTIMEOFDAY=1
- fi
- m4_ifdef([gl_FUNC_TZSET_CLOBBER], [
- gl_FUNC_TZSET_CLOBBER
- case "$gl_cv_func_tzset_clobber" in
- *yes)
- REPLACE_GETTIMEOFDAY=1
- gl_GETTIMEOFDAY_REPLACE_LOCALTIME
- AC_DEFINE([tzset], [rpl_tzset],
- [Define to rpl_tzset if the wrapper function should be used.])
- AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1],
- [Define if tzset clobbers localtime's static buffer.])
- ;;
- esac
- ])
- fi
- AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone],
- [Define this to 'void' or 'struct timezone' to match the system's
- declaration of the second argument to gettimeofday.])
-])
-
-
-dnl See if gettimeofday clobbers the static buffer that localtime uses
-dnl for its return value. The gettimeofday function from Mac OS X 10.0.4
-dnl (i.e., Darwin 1.3.7) has this problem.
-dnl
-dnl If it does, then arrange to use gettimeofday and localtime only via
-dnl the wrapper functions that work around the problem.
-
-AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
-[
- AC_REQUIRE([gl_HEADER_SYS_TIME_H])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-
- AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
- [gl_cv_func_gettimeofday_clobber],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <string.h>
- #include <sys/time.h>
- #include <time.h>
- #include <stdlib.h>
- ]],
- [[
- time_t t = 0;
- struct tm *lt;
- struct tm saved_lt;
- struct timeval tv;
- lt = localtime (&t);
- saved_lt = *lt;
- gettimeofday (&tv, NULL);
- return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
- ]])],
- [gl_cv_func_gettimeofday_clobber=no],
- [gl_cv_func_gettimeofday_clobber=yes],
- [# When cross-compiling:
- case "$host_os" in
- # Guess all is fine on glibc systems.
- *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
- esac
- ])])
-
- case "$gl_cv_func_gettimeofday_clobber" in
- *yes)
- REPLACE_GETTIMEOFDAY=1
- gl_GETTIMEOFDAY_REPLACE_LOCALTIME
- AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
- [Define if gettimeofday clobbers the localtime buffer.])
- ;;
- esac
-])
-
-AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [
- REPLACE_GMTIME=1
- REPLACE_LOCALTIME=1
-])
-
-# Prerequisites of lib/gettimeofday.c.
-AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [
- AC_CHECK_HEADERS([sys/timeb.h])
- AC_CHECK_FUNCS([_ftime])
-])
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
deleted file mode 100644
index 2e30ed688..000000000
--- a/m4/glibc21.m4
+++ /dev/null
@@ -1,34 +0,0 @@
-# glibc21.m4 serial 5
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2017 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,
-dnl with or without modifications, as long as this notice is preserved.
-
-# Test for the GNU C Library, version 2.1 or newer, or uClibc.
-# From Bruno Haible.
-
-AC_DEFUN([gl_GLIBC21],
- [
- AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
- [ac_cv_gnu_library_2_1],
- [AC_EGREP_CPP([Lucky],
- [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
- Lucky GNU user
- #endif
-#endif
-#ifdef __UCLIBC__
- Lucky user
-#endif
- ],
- [ac_cv_gnu_library_2_1=yes],
- [ac_cv_gnu_library_2_1=no])
- ]
- )
- AC_SUBST([GLIBC21])
- GLIBC21="$ac_cv_gnu_library_2_1"
- ]
-)
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
index 01f82d59b..84544610a 100644
--- a/m4/gnulib-cache.m4
+++ b/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2017 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 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
@@ -11,7 +11,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this file. If not, see <http://www.gnu.org/licenses/>.
+# along with this file. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License,
# this file may be distributed as part of a program that
@@ -27,7 +27,121 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=lock --avoid=unistr/base --avoid=unistr/u8-mbtouc --avoid=unistr/u8-mbtouc-unsafe --avoid=unistr/u8-mbtoucr --avoid=unistr/u8-prev --avoid=unistr/u8-uctomb --avoid=unitypes --lgpl=3 --conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept4 alignof alloca-opt announce-gen autobuild bind byteswap c-strcase canonicalize-lgpl ceil clock-time close connect copysign dirfd dirname-lgpl duplocale environ extensions flock floor fpieee frexp fstat fsync full-read full-write func gendocs getaddrinfo getlogin getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isfinite isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring link listen localcharset locale log1p lstat maintainer-makefile malloc-gnu malloca mkdir mkostemp nl_langinfo nproc open pipe-posix pipe2 poll putenv readlink recv recvfrom regex rename rmdir select send sendto setenv setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat time times trunc unistd verify vsnprintf warnings wchar
+# gnulib-tool --import --local-dir=gnulib-local \
+# --lib=libgnu \
+# --source-base=lib \
+# --m4-base=m4 \
+# --doc-base=doc \
+# --tests-base=tests \
+# --aux-dir=build-aux \
+# --lgpl=3 \
+# --conditional-dependencies \
+# --libtool \
+# --macro-prefix=gl \
+# --no-vc-files \
+# --avoid=lock \
+# --avoid=unistr/base \
+# --avoid=unistr/u8-mbtouc \
+# --avoid=unistr/u8-mbtouc-unsafe \
+# --avoid=unistr/u8-mbtoucr \
+# --avoid=unistr/u8-prev \
+# --avoid=unistr/u8-uctomb \
+# --avoid=unitypes \
+# accept4 \
+# alignof \
+# alloca-opt \
+# announce-gen \
+# autobuild \
+# bind \
+# byteswap \
+# c-strcase \
+# canonicalize-lgpl \
+# ceil \
+# clock-time \
+# close \
+# connect \
+# copysign \
+# dirfd \
+# dirname-lgpl \
+# duplocale \
+# environ \
+# extensions \
+# flexmember \
+# flock \
+# floor \
+# fpieee \
+# frexp \
+# fstat \
+# fsync \
+# full-read \
+# full-write \
+# func \
+# gendocs \
+# getaddrinfo \
+# getlogin \
+# getpeername \
+# getsockname \
+# getsockopt \
+# git-version-gen \
+# gitlog-to-changelog \
+# gnu-web-doc-update \
+# gnupload \
+# havelib \
+# iconv_open-utf \
+# inet_ntop \
+# inet_pton \
+# isfinite \
+# isinf \
+# isnan \
+# ldexp \
+# lib-symbol-versions \
+# lib-symbol-visibility \
+# libunistring \
+# link \
+# listen \
+# localcharset \
+# locale \
+# log1p \
+# lstat \
+# maintainer-makefile \
+# malloc-gnu \
+# malloca \
+# mkdir \
+# mkostemp \
+# nl_langinfo \
+# nproc \
+# open \
+# pipe-posix \
+# pipe2 \
+# poll \
+# putenv \
+# readlink \
+# recv \
+# recvfrom \
+# regex \
+# rename \
+# rmdir \
+# select \
+# send \
+# sendto \
+# setenv \
+# setsockopt \
+# shutdown \
+# socket \
+# stat-time \
+# stdlib \
+# strftime \
+# striconveh \
+# string \
+# sys_stat \
+# time \
+# times \
+# trunc \
+# unistd \
+# verify \
+# vsnprintf \
+# warnings \
+# wchar
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([gnulib-local])
@@ -51,6 +165,7 @@ gl_MODULES([
duplocale
environ
extensions
+ flexmember
flock
floor
fpieee
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 7d9b40b79..3d87fd840 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,25 +1,54 @@
-# gnulib-common.m4 serial 36
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 63
+dnl Copyright (C) 2007-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_PREREQ([2.62])
+
# gl_COMMON
# is expanded unconditionally through gnulib-tool magic.
AC_DEFUN([gl_COMMON], [
dnl Use AC_REQUIRE here, so that the code is expanded once only.
AC_REQUIRE([gl_00GNULIB])
AC_REQUIRE([gl_COMMON_BODY])
+ AC_REQUIRE([gl_ZZGNULIB])
])
AC_DEFUN([gl_COMMON_BODY], [
+ AH_VERBATIM([_GL_GNUC_PREREQ],
+[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define _GL_GNUC_PREREQ(major, minor) \
+ ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
+#else
+# define _GL_GNUC_PREREQ(major, minor) 0
+#endif
+])
AH_VERBATIM([_Noreturn],
[/* The _Noreturn keyword of C11. */
-#if ! (defined _Noreturn \
- || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
-# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
- || 0x5110 <= __SUNPRO_C)
+#ifndef _Noreturn
+# if (defined __cplusplus \
+ && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+ || (defined _MSC_VER && 1900 <= _MSC_VER)) \
+ && 0)
+ /* [[noreturn]] is not practically usable, because with it the syntax
+ extern _Noreturn void func (...);
+ would not be valid; such a declaration would only be valid with 'extern'
+ and '_Noreturn' swapped, or without the 'extern' keyword. However, some
+ AIX system header files and several gnulib header files use precisely
+ this syntax with 'extern'. */
+# define _Noreturn [[noreturn]]
+# elif ((!defined __cplusplus || defined __clang__) \
+ && (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__))
-# elif defined _MSC_VER && 1200 <= _MSC_VER
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
# define _Noreturn __declspec (noreturn)
# else
# define _Noreturn
@@ -36,43 +65,288 @@ AC_DEFUN([gl_COMMON_BODY], [
#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
# define __GNUC_STDC_INLINE__ 1
#endif])
- AH_VERBATIM([unused_parameter],
-[/* Define as a marker that can be attached to declarations that might not
- be used. This helps to reduce warnings, such as from
- GCC -Wunused-parameter. */
-#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_UNUSED __attribute__ ((__unused__))
+ AH_VERBATIM([attribute],
+[/* Attributes. */
+#ifdef __has_attribute
+# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
#else
-# define _GL_UNUSED
+# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
+# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
+# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
+# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_diagnose_if 0
+# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
+# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
+# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
+# 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)
+# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
+# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
+# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
+# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
#endif
-/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
- is a misnomer outside of parameter lists. */
-#define _UNUSED_PARAMETER_ _GL_UNUSED
-
-/* gcc supports the "unused" attribute on possibly unused labels, and
- g++ has since version 4.5. Note to support C++ as well as C,
- _GL_UNUSED_LABEL should be used with a trailing ; */
-#if !defined __cplusplus || __GNUC__ > 4 \
- || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-# define _GL_UNUSED_LABEL _GL_UNUSED
+
+]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's _Alignas instead.
+[
+#if _GL_HAS_ATTRIBUTE (alloc_size)
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
#else
-# define _GL_UNUSED_LABEL
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
#endif
-/* The __pure__ attribute was added in gcc 2.96. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#if _GL_HAS_ATTRIBUTE (always_inline)
+# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
+#else
+# define _GL_ATTRIBUTE_ALWAYS_INLINE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (artificial)
+# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
#else
-# define _GL_ATTRIBUTE_PURE /* empty */
+# define _GL_ATTRIBUTE_ARTIFICIAL
#endif
-/* The __const__ attribute was added in gcc 2.95. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
+ <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>.
+ Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */
+#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
+# ifndef __SUNPRO_C
+# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+# else
+# define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
+# endif
+#else
+# define _GL_ATTRIBUTE_COLD
+#endif
+
+#if _GL_HAS_ATTRIBUTE (const)
# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
#else
-# define _GL_ATTRIBUTE_CONST /* empty */
+# define _GL_ATTRIBUTE_CONST
+#endif
+
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
+#elif _GL_HAS_ATTRIBUTE (deprecated)
+# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
+#else
+# define _GL_ATTRIBUTE_DEPRECATED
+#endif
+
+#if _GL_HAS_ATTRIBUTE (error)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg)))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg)))
+#elif _GL_HAS_ATTRIBUTE (diagnose_if)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error")))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning")))
+#else
+# define _GL_ATTRIBUTE_ERROR(msg)
+# define _GL_ATTRIBUTE_WARNING(msg)
+#endif
+
+#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__
+# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
+#elif _GL_HAS_ATTRIBUTE (fallthrough)
+# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
+#else
+# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (format)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (leaf)
+# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
+#else
+# define _GL_ATTRIBUTE_LEAF
+#endif
+
+/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */
+#if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
+# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
+#else
+# define _GL_ATTRIBUTE_MAY_ALIAS
+#endif
+
+#if 201710L < __STDC_VERSION__
+# 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
+#endif
+/* Earlier spellings of this macro. */
+#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+#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__
+# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
+#elif _GL_HAS_ATTRIBUTE (warn_unused_result)
+# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
+#else
+# define _GL_ATTRIBUTE_NODISCARD
+#endif
+
+#if _GL_HAS_ATTRIBUTE (noinline)
+# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
+#else
+# define _GL_ATTRIBUTE_NOINLINE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (nonnull)
+# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
+#else
+# define _GL_ATTRIBUTE_NONNULL(args)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (nonstring)
+# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
+#else
+# define _GL_ATTRIBUTE_NONSTRING
+#endif
+
+/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */
+
+#if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
+# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
+#else
+# define _GL_ATTRIBUTE_NOTHROW
+#endif
+
+#if _GL_HAS_ATTRIBUTE (packed)
+# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
+#else
+# define _GL_ATTRIBUTE_PACKED
+#endif
+
+#if _GL_HAS_ATTRIBUTE (pure)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (returns_nonnull)
+# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
+#else
+# define _GL_ATTRIBUTE_RETURNS_NONNULL
+#endif
+
+#if _GL_HAS_ATTRIBUTE (sentinel)
+# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
+#else
+# define _GL_ATTRIBUTE_SENTINEL(pos)
+#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
+#else
+# define _GL_UNUSED_LABEL
#endif
])
+ AH_VERBATIM([async_safe],
+[/* The _GL_ASYNC_SAFE marker should be attached to functions that are
+ signal handlers (for signals other than SIGABRT, SIGPIPE) or can be
+ invoked from such signal handlers. Such functions have some restrictions:
+ * All functions that it calls should be marked _GL_ASYNC_SAFE as well,
+ or should be listed as async-signal-safe in POSIX
+ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04>
+ section 2.4.3. Note that malloc(), sprintf(), and fwrite(), in
+ particular, are NOT async-signal-safe.
+ * All memory locations (variables and struct fields) that these functions
+ access must be marked 'volatile'. This holds for both read and write
+ accesses. Otherwise the compiler might optimize away stores to and
+ reads from such locations that occur in the program, depending on its
+ data flow analysis. For example, when the program contains a loop
+ that is intended to inspect a variable set from within a signal handler
+ while (!signal_occurred)
+ ;
+ the compiler is allowed to transform this into an endless loop if the
+ variable 'signal_occurred' is not declared 'volatile'.
+ Additionally, recall that:
+ * A signal handler should not modify errno (except if it is a handler
+ for a fatal signal and ends by raising the same signal again, thus
+ provoking the termination of the process). If it invokes a function
+ that may clobber errno, it needs to save and restore the value of
+ errno. */
+#define _GL_ASYNC_SAFE
+])
+ AH_VERBATIM([micro_optimizations],
+[/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where
+ n1 and n2 are expressions without side effects, that evaluate to real
+ numbers (excluding NaN).
+ It returns
+ 1 if n1 > n2
+ 0 if n1 == n2
+ -1 if n1 < n2
+ The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional
+ jump with nearly all GCC versions up to GCC 10.
+ This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional with many
+ GCC versions up to GCC 9.
+ The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9
+ avoids conditional jumps in all GCC versions >= 3.4. */
+#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))
+])
+ dnl Hint which direction to take regarding cross-compilation guesses:
+ dnl When a user installs a program on a platform they are not intimately
+ dnl familiar with, --enable-cross-guesses=conservative is the appropriate
+ dnl choice. It implements the "If we don't know, assume the worst" principle.
+ dnl However, when an operating system developer (on a platform which is not
+ dnl yet known to gnulib) builds packages for their platform, they want to
+ dnl expose, not hide, possible platform bugs; in this case,
+ dnl --enable-cross-guesses=risky is the appropriate choice.
+ dnl Sets the variables
+ dnl gl_cross_guess_normal (to be used when 'yes' is good and 'no' is bad),
+ dnl gl_cross_guess_inverted (to be used when 'no' is good and 'yes' is bad).
+ AC_ARG_ENABLE([cross-guesses],
+ [AS_HELP_STRING([--enable-cross-guesses={conservative|risky}],
+ [specify policy for cross-compilation guesses])],
+ [if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
+ AC_MSG_WARN([invalid argument supplied to --enable-cross-guesses])
+ enableval=conservative
+ fi
+ gl_cross_guesses="$enableval"],
+ [gl_cross_guesses=conservative])
+ if test $gl_cross_guesses = risky; then
+ gl_cross_guess_normal="guessing yes"
+ gl_cross_guess_inverted="guessing no"
+ else
+ gl_cross_guess_normal="guessing no"
+ gl_cross_guess_inverted="guessing yes"
+ fi
dnl Preparation for running test programs:
dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
dnl to /dev/tty, so they can be redirected to log files. Such diagnostics
@@ -207,42 +481,20 @@ AC_DEFUN([gl_FEATURES_H],
AC_SUBST([HAVE_FEATURES_H])
])
-# m4_foreach_w
-# is a backport of autoconf-2.59c's m4_foreach_w.
-# Remove this macro when we can assume autoconf >= 2.60.
-m4_ifndef([m4_foreach_w],
- [m4_define([m4_foreach_w],
- [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
-
-# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH])
-# ----------------------------------------------------
-# Backport of autoconf-2.63b's macro.
-# Remove this macro when we can assume autoconf >= 2.64.
-m4_ifndef([AS_VAR_IF],
-[m4_define([AS_VAR_IF],
-[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
-
# 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 did not exist in Autoconf versions < 2.60,
-# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
-# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>,
-# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
-# <http://lists.gnu.org/archive/html/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
-# <http://lists.gnu.org/archive/html/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
@@ -256,7 +508,8 @@ AC_DEFUN([gl_PROG_AR_RANLIB],
dnl library formats. In particular, the GNU binutils programs ar and ranlib
dnl produce libraries that work only with gcc, not with cc.
AC_REQUIRE([AC_PROG_CC])
- AC_BEFORE([$0], [AM_PROG_AR])
+ dnl The '][' hides this use from 'aclocal'.
+ AC_BEFORE([$0], [A][M_PROG_AR])
AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
[
AC_EGREP_CPP([Amsterdam],
@@ -288,7 +541,9 @@ Amsterdam
dnl __ACK__. It may seem like its easier to avoid calling the macro here,
dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good
dnl default value and automake should usually know them).
- m4_ifdef([AM_PROG_AR], [AM_PROG_AR], [:])
+ dnl
+ dnl The '][' hides this use from 'aclocal'.
+ m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:])
fi
dnl In case the code above has not helped with setting AR/ARFLAGS, use
@@ -312,48 +567,29 @@ Amsterdam
AC_SUBST([RANLIB])
])
-# AC_PROG_MKDIR_P
-# is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
-# for interoperability with automake-1.9.6 from autoconf-2.62.
-# Remove this macro when we can assume autoconf >= 2.62 or
-# autoconf >= 2.60 && automake >= 1.10.
-# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
-m4_ifndef([AC_AUTOCONF_VERSION],[
-m4_ifdef([AC_PROG_MKDIR_P], [
- dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
- m4_define([AC_PROG_MKDIR_P],
- m4_defn([AC_PROG_MKDIR_P])[
- AC_SUBST([MKDIR_P])])], [
- dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P.
- AC_DEFUN_ONCE([AC_PROG_MKDIR_P],
- [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
- MKDIR_P='$(mkdir_p)'
- AC_SUBST([MKDIR_P])])])
-])
-
# 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;
- int foo (int_ptr $ac_kw ip) { return ip[0]; }
- int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
- int bar (int ip[$ac_kw]) { return ip[0]; }
- ]],
- [[int s[1];
- int *$ac_kw t = s;
- t[0] = 0;
- return foo (t) + bar (t);
- ]])],
+ [[typedef int *int_ptr;
+ int foo (int_ptr $ac_kw ip) { return ip[0]; }
+ int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
+ int bar (int ip[$ac_kw]) { return ip[0]; }
+ ]],
+ [[int s[1];
+ int *$ac_kw t = s;
+ t[0] = 0;
+ return foo (t) + bar (t);
+ ]])],
[ac_cv_c_restrict=$ac_kw])
test "$ac_cv_c_restrict" != no && break
done
@@ -361,14 +597,15 @@ 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 Sun C++: it does not support _Restrict or
- __restrict__, even though the corresponding Sun C compiler ends up with
- "#define restrict _Restrict" or "#define restrict __restrict__" in the
- previous line. Perhaps some future version of Sun C++ will work with
- restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
-#if defined __SUNPRO_CC && !defined __RESTRICT
+/* Work around a bug in older versions of Sun C++, which did not
+ #define __restrict__ or support _Restrict or __restrict__
+ even though the corresponding Sun C compiler ended up with
+ "#define restrict _Restrict" or "#define restrict __restrict__"
+ in the previous line. This workaround can be removed once
+ we assume Oracle Developer Studio 12.5 (2016) or later. */
+#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
# define _Restrict
# define __restrict__
#endif])
@@ -378,6 +615,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.
@@ -388,6 +626,22 @@ 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],
+[
+ 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)
# is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not
# output a spurious "(cached)" mark in the midst of other configure output.
@@ -395,68 +649,77 @@ AC_DEFUN([gl_BIGENDIAN],
# 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])
+ ])
])
-# AS_VAR_COPY was added in autoconf 2.63b
-m4_define_default([AS_VAR_COPY],
-[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
-
-# AC_PROG_SED was added in autoconf 2.59b
-m4_ifndef([AC_PROG_SED],
-[AC_DEFUN([AC_PROG_SED],
-[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
- [dnl ac_script should not contain more than 99 commands (for HP-UX sed),
- dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed.
- ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
- for ac_i in 1 2 3 4 5 6 7; do
- ac_script="$ac_script$as_nl$ac_script"
- done
- echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
- AS_UNSET([ac_script])
- if test -z "$SED"; then
- ac_path_SED_found=false
- _AS_PATH_WALK([], [
- for ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
- AS_EXECUTABLE_P(["$ac_path_SED"]) || continue
- case `"$ac_path_SED" --version 2>&1` in
- *GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;;
- *)
- ac_count=0
- _AS_ECHO_N([0123456789]) >conftest.in
- while :
- do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >> conftest.nl
- "$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
- diff conftest.out conftest.nl >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_SED_max-0}; then
- # Best so far, but keep looking for better
- ac_cv_path_SED=$ac_path_SED
- ac_path_SED_max=$ac_count
- fi
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
- esac
- $ac_path_SED_found && break 3
- done
- done])
- if test -z "$ac_cv_path_SED"; then
- AC_ERROR([no acceptable sed could be found in \$PATH])
- fi
- else
- ac_cv_path_SED=$SED
- fi
- SED="$ac_cv_path_SED"
- AC_SUBST([SED])dnl
- rm -f conftest.sed
-])])])
+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
+dnl without linking with '-loldnames' and without generating warnings.
+dnl Usage: Use it after all system header files are included.
+dnl #include <...>
+dnl #include <...>
+dnl ]GL_MDA_DEFINES[
+dnl ...
+AC_DEFUN([GL_MDA_DEFINES],[
+AC_REQUIRE([_GL_MDA_DEFINES])
+[$gl_mda_defines]
+])
+AC_DEFUN([_GL_MDA_DEFINES],
+[gl_mda_defines='
+#if defined _WIN32 && !defined __CYGWIN__
+#define access _access
+#define chdir _chdir
+#define chmod _chmod
+#define close _close
+#define creat _creat
+#define dup _dup
+#define dup2 _dup2
+#define ecvt _ecvt
+#define execl _execl
+#define execle _execle
+#define execlp _execlp
+#define execv _execv
+#define execve _execve
+#define execvp _execvp
+#define execvpe _execvpe
+#define fcloseall _fcloseall
+#define fcvt _fcvt
+#define fdopen _fdopen
+#define fileno _fileno
+#define gcvt _gcvt
+#define getcwd _getcwd
+#define getpid _getpid
+#define getw _getw
+#define isatty _isatty
+#define j0 _j0
+#define j1 _j1
+#define jn _jn
+#define lfind _lfind
+#define lsearch _lsearch
+#define lseek _lseek
+#define memccpy _memccpy
+#define mkdir _mkdir
+#define mktemp _mktemp
+#define open _open
+#define putenv _putenv
+#define putw _putw
+#define read _read
+#define rmdir _rmdir
+#define strdup _strdup
+#define swab _swab
+#define tempnam _tempnam
+#define tzset _tzset
+#define umask _umask
+#define unlink _unlink
+#define utime _utime
+#define wcsdup _wcsdup
+#define write _write
+#define y0 _y0
+#define y1 _y1
+#define yn _yn
+#endif
+'
+])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 290d77933..9d6023c6b 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2017 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 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
@@ -12,7 +12,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this file. If not, see <http://www.gnu.org/licenses/>.
+# along with this file. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License,
# this file may be distributed as part of a program that
@@ -42,6 +42,7 @@ 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 accept4:
@@ -51,8 +52,10 @@ AC_DEFUN([gl_EARLY],
# Code from module announce-gen:
# Code from module arpa_inet:
# Code from module assure:
+ # Code from module attribute:
# Code from module autobuild:
AB_INIT
+ # Code from module basename-lgpl:
# Code from module binary-io:
# Code from module bind:
# Code from module btowc:
@@ -61,33 +64,38 @@ AC_DEFUN([gl_EARLY],
# Code from module c-ctype:
# Code from module c-strcase:
# Code from module c-strcaseeq:
+ # Code from module c99:
# Code from module canonicalize-lgpl:
# Code from module ceil:
# Code from module chdir:
# Code from module clock-time:
+ # Code from module cloexec:
# Code from module close:
- # Code from module configmake:
# Code from module connect:
# Code from module copysign:
# Code from module dirent:
# Code from module dirfd:
# Code from module dirname-lgpl:
- # Code from module dosname:
# Code from module double-slash-root:
# Code from module dup2:
# Code from module duplocale:
+ # Code from module dynarray:
+ # Code from module eloop-threshold:
# Code from module environ:
# Code from module errno:
# Code from module extensions:
# Code from module extern-inline:
+ # Code from module fcntl:
# Code from module fcntl-h:
# Code from module fd-hook:
+ # Code from module filename:
# Code from module flexmember:
# Code from module float:
# Code from module flock:
# Code from module floor:
# Code from module fpieee:
AC_REQUIRE([gl_FP_IEEE])
+ # Code from module free-posix:
# Code from module frexp:
# Code from module fstat:
# Code from module fsync:
@@ -96,12 +104,13 @@ AC_DEFUN([gl_EARLY],
# Code from module func:
# Code from module gendocs:
# Code from module getaddrinfo:
+ # Code from module getdtablesize:
# Code from module getlogin:
# Code from module getpeername:
+ # Code from module getrandom:
# Code from module getsockname:
# Code from module getsockopt:
# Code from module gettext-h:
- # Code from module gettimeofday:
# Code from module git-version-gen:
# Code from module gitlog-to-changelog:
# Code from module gnu-web-doc-update:
@@ -115,10 +124,12 @@ AC_DEFUN([gl_EARLY],
# Code from module iconv-h:
# Code from module iconv_open:
# Code from module iconv_open-utf:
+ # Code from module idx:
# Code from module include_next:
# Code from module inet_ntop:
# Code from module inet_pton:
# Code from module intprops:
+ # Code from module inttypes-incomplete:
# Code from module isfinite:
# Code from module isinf:
# Code from module isnan:
@@ -134,6 +145,7 @@ AC_DEFUN([gl_EARLY],
# Code from module ldexp:
# Code from module lib-symbol-versions:
# Code from module lib-symbol-visibility:
+ # Code from module libc-config:
# Code from module libunistring:
# Code from module limits-h:
# Code from module link:
@@ -153,6 +165,8 @@ AC_DEFUN([gl_EARLY],
# Code from module mbsinit:
# Code from module mbtowc:
# Code from module memchr:
+ # Code from module mempcpy:
+ # Code from module minmax:
# Code from module mkdir:
# Code from module mkostemp:
# Code from module mktime:
@@ -165,6 +179,7 @@ AC_DEFUN([gl_EARLY],
# Code from module nl_langinfo:
# Code from module nocrash:
# Code from module nproc:
+ # Code from module nstrftime:
# Code from module open:
# Code from module pathmax:
# Code from module pipe-posix:
@@ -173,6 +188,7 @@ AC_DEFUN([gl_EARLY],
# Code from module poll-h:
# Code from module putenv:
# Code from module raise:
+ # Code from module rawmemchr:
# Code from module read:
# Code from module readlink:
# Code from module recv:
@@ -184,12 +200,13 @@ AC_DEFUN([gl_EARLY],
# Code from module safe-read:
# Code from module safe-write:
# Code from module same-inode:
- # Code from module secure_getenv:
+ # Code from module scratch_buffer:
# Code from module select:
# Code from module send:
# Code from module sendto:
# Code from module servent:
# Code from module setenv:
+ # Code from module setlocale-null:
# Code from module setsockopt:
# Code from module shutdown:
# Code from module signal-h:
@@ -207,6 +224,7 @@ AC_DEFUN([gl_EARLY],
# Code from module ssize_t:
# Code from module stat:
# Code from module stat-time:
+ # Code from module std-gnu11:
# Code from module stdalign:
# Code from module stdbool:
# Code from module stddef:
@@ -219,6 +237,7 @@ AC_DEFUN([gl_EARLY],
# Code from module striconveh:
# Code from module string:
# Code from module sys_file:
+ # Code from module sys_random:
# Code from module sys_select:
# Code from module sys_socket:
# Code from module sys_stat:
@@ -233,6 +252,7 @@ AC_DEFUN([gl_EARLY],
# Code from module timegm:
# Code from module times:
# Code from module trunc:
+ # Code from module tzset:
# Code from module unistd:
# Code from module unsetenv:
# Code from module useless-if-before-free:
@@ -297,7 +317,6 @@ AC_DEFUN([gl_INIT],
AC_LIBOBJ([close])
fi
gl_UNISTD_MODULE_INDICATOR([close])
- gl_CONFIGMAKE_PREP
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
if test "$ac_cv_header_winsock2_h" = yes; then
AC_LIBOBJ([connect])
@@ -316,7 +335,6 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_DIRFD
fi
gl_DIRENT_MODULE_INDICATOR([dirfd])
- gl_DIRNAME_LGPL
gl_DOUBLE_SLASH_ROOT
gl_FUNC_DUPLOCALE
if test $REPLACE_DUPLOCALE = 1; then
@@ -329,6 +347,7 @@ AC_DEFUN([gl_INIT],
gl_HEADER_ERRNO_H
AC_REQUIRE([gl_EXTERN_INLINE])
gl_FCNTL_H
+ AC_C_FLEXIBLE_ARRAY_MEMBER
gl_FLOAT_H
if test $REPLACE_FLOAT_LDBL = 1; then
AC_LIBOBJ([float])
@@ -342,7 +361,7 @@ AC_DEFUN([gl_INIT],
gl_PREREQ_FLOCK
fi
gl_HEADER_SYS_FILE_MODULE_INDICATOR([flock])
- gl_FUNC_FLOOR
+ AC_REQUIRE([gl_FUNC_FLOOR])
if test $REPLACE_FLOOR = 1; then
AC_LIBOBJ([floor])
fi
@@ -355,6 +374,11 @@ AC_DEFUN([gl_INIT],
gl_FUNC_FSTAT
if test $REPLACE_FSTAT = 1; then
AC_LIBOBJ([fstat])
+ case "$host_os" in
+ mingw*)
+ AC_LIBOBJ([stat-w32])
+ ;;
+ esac
gl_PREREQ_FSTAT
fi
gl_SYS_STAT_MODULE_INDICATOR([fstat])
@@ -366,7 +390,7 @@ AC_DEFUN([gl_INIT],
gl_UNISTD_MODULE_INDICATOR([fsync])
gl_FUNC
gl_GETADDRINFO
- if test $HAVE_GETADDRINFO = 0; then
+ if test $HAVE_GETADDRINFO = 0 || test $REPLACE_GETADDRINFO = 1; then
AC_LIBOBJ([getaddrinfo])
fi
if test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then
@@ -394,12 +418,6 @@ AC_DEFUN([gl_INIT],
AC_LIBOBJ([getsockopt])
fi
gl_SYS_SOCKET_MODULE_INDICATOR([getsockopt])
- gl_FUNC_GETTIMEOFDAY
- if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
- AC_LIBOBJ([gettimeofday])
- gl_PREREQ_GETTIMEOFDAY
- fi
- gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
# Autoconf 2.61a.99 and earlier don't support linking a file only
# in VPATH builds. But since GNUmakefile is for maintainer use
# only, it does not matter if we skip the link with older autoconf.
@@ -410,6 +428,7 @@ AC_DEFUN([gl_INIT],
m4_defn([m4_PACKAGE_VERSION])), [1], [],
[AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
[GNUmakefile=$GNUmakefile])])
+ AC_DEFUN([gl_HAVE_MODULE_HAVELIB])
AM_ICONV
m4_ifdef([gl_ICONV_MODULE_INDICATOR],
[gl_ICONV_MODULE_INDICATOR([iconv])])
@@ -430,11 +449,12 @@ AC_DEFUN([gl_INIT],
fi
gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
gl_FUNC_INET_PTON
- if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then
+ if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_PTON = 1; then
AC_LIBOBJ([inet_pton])
gl_PREREQ_INET_PTON
fi
gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
+ gl_INTTYPES_INCOMPLETE
gl_ISFINITE
if test $REPLACE_ISFINITE = 1; then
AC_LIBOBJ([isfinite])
@@ -492,7 +512,8 @@ AC_DEFUN([gl_INIT],
fi
gl_SYS_SOCKET_MODULE_INDICATOR([listen])
gl_LOCALCHARSET
- LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
+ dnl For backward compatibility. Some packages still use this.
+ LOCALCHARSET_TESTS_ENVIRONMENT=
AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
gl_LOCALE_H
gl_FUNC_LOG1P
@@ -509,6 +530,7 @@ AC_DEFUN([gl_INIT],
AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
[AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
AC_REQUIRE([AC_PROG_SED])
+ AC_REQUIRE([AC_PROG_GREP])
gl_FUNC_MALLOC_GNU
if test $REPLACE_MALLOC = 1; then
AC_LIBOBJ([malloc])
@@ -521,10 +543,12 @@ AC_DEFUN([gl_INIT],
gl_STDLIB_MODULE_INDICATOR([malloc-posix])
gl_MALLOCA
gl_MATH_H
+ gl_MINMAX
gl_FUNC_MKDIR
if test $REPLACE_MKDIR = 1; then
AC_LIBOBJ([mkdir])
fi
+ gl_SYS_STAT_MODULE_INDICATOR([mkdir])
gl_FUNC_MKOSTEMP
if test $HAVE_MKOSTEMP = 0; then
AC_LIBOBJ([mkostemp])
@@ -540,6 +564,7 @@ AC_DEFUN([gl_INIT],
if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
AC_LIBOBJ([msvc-nothrow])
fi
+ gl_MODULE_INDICATOR([msvc-nothrow])
gl_MULTIARCH
gl_HEADER_NETDB
gl_HEADER_NETINET_IN
@@ -548,8 +573,13 @@ AC_DEFUN([gl_INIT],
if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
AC_LIBOBJ([nl_langinfo])
fi
+ if test $REPLACE_NL_LANGINFO = 1 && test $NL_LANGINFO_MTSAFE = 0; then
+ AC_LIBOBJ([nl_langinfo-lock])
+ gl_PREREQ_NL_LANGINFO_LOCK
+ fi
gl_LANGINFO_MODULE_INDICATOR([nl_langinfo])
gl_NPROC
+ gl_FUNC_GNU_STRFTIME
gl_FUNC_OPEN
if test $REPLACE_OPEN = 1; then
AC_LIBOBJ([open])
@@ -671,7 +701,6 @@ AC_DEFUN([gl_INIT],
gl_STDINT_H
gl_STDIO_H
gl_STDLIB_H
- gl_FUNC_GNU_STRFTIME
if test $gl_cond_libtool = false; then
gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV"
gl_libdeps="$gl_libdeps $LIBICONV"
@@ -679,7 +708,7 @@ AC_DEFUN([gl_INIT],
gl_HEADER_STRING_H
gl_HEADER_SYS_FILE_H
AC_PROG_MKDIR_P
- gl_HEADER_SYS_SELECT
+ AC_REQUIRE([gl_HEADER_SYS_SELECT])
AC_PROG_MKDIR_P
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
AC_PROG_MKDIR_P
@@ -695,7 +724,7 @@ AC_DEFUN([gl_INIT],
AC_PROG_MKDIR_P
gl_HEADER_TIME_H
gl_TIME_RZ
- if test "$HAVE_TIMEZONE_T" = 0; then
+ if test $HAVE_TIMEZONE_T = 0; then
AC_LIBOBJ([time_rz])
fi
gl_TIME_MODULE_INDICATOR([time_rz])
@@ -724,30 +753,40 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_btowc=false
gl_gnulib_enabled_37f71b604aa9c54446783d80f42fe547=false
gl_gnulib_enabled_chdir=false
+ gl_gnulib_enabled_cloexec=false
gl_gnulib_enabled_dup2=false
+ gl_gnulib_enabled_dynarray=false
+ gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c=false
+ gl_gnulib_enabled_fcntl=false
gl_gnulib_enabled_43fe87a341d9b4b93c47c3ad819a5239=false
- gl_gnulib_enabled_flexmember=false
+ gl_gnulib_enabled_ef07dc4b3077c11ea9cef586db4e5955=false
+ gl_gnulib_enabled_getdtablesize=false
+ gl_gnulib_enabled_getrandom=false
gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false
gl_gnulib_enabled_30838f5439487421042f2225bed3af76=false
gl_gnulib_enabled_hostent=false
- gl_gnulib_enabled_intprops=false
+ gl_gnulib_enabled_idx=false
gl_gnulib_enabled_b1df7117b479d2da59d76deba468ee21=false
gl_gnulib_enabled_3f0e593033d1fc2c127581960f641b66=false
gl_gnulib_enabled_dbdf22868a5367f28bf18e0013ac6f8f=false
+ gl_gnulib_enabled_21ee726a3540c09237a8e70c0baf7467=false
gl_gnulib_enabled_localeconv=false
gl_gnulib_enabled_log=false
gl_gnulib_enabled_mbrtowc=false
gl_gnulib_enabled_mbsinit=false
gl_gnulib_enabled_mbtowc=false
gl_gnulib_enabled_memchr=false
+ gl_gnulib_enabled_mempcpy=false
gl_gnulib_enabled_mktime=false
gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31=false
gl_gnulib_enabled_pathmax=false
gl_gnulib_enabled_raise=false
+ gl_gnulib_enabled_rawmemchr=false
gl_gnulib_enabled_round=false
gl_gnulib_enabled_9bc5f216d57e231e4834049d67d0db62=false
- gl_gnulib_enabled_secure_getenv=false
+ gl_gnulib_enabled_scratch_buffer=false
gl_gnulib_enabled_servent=false
+ gl_gnulib_enabled_e7e881d32ca02f1c997b13c737c64bbd=false
gl_gnulib_enabled_signbit=false
gl_gnulib_enabled_size_max=false
gl_gnulib_enabled_snprintf=false
@@ -755,9 +794,11 @@ AC_DEFUN([gl_INIT],
gl_gnulib_enabled_stat=false
gl_gnulib_enabled_f9850631dca91859e9cddac9359921c0=false
gl_gnulib_enabled_streq=false
+ gl_gnulib_enabled_sys_random=false
gl_gnulib_enabled_tempname=false
gl_gnulib_enabled_time_r=false
gl_gnulib_enabled_timegm=false
+ gl_gnulib_enabled_tzset=false
gl_gnulib_enabled_unsetenv=false
gl_gnulib_enabled_vasnprintf=false
gl_gnulib_enabled_wcrtomb=false
@@ -808,11 +849,20 @@ AC_SUBST([LTALLOCA])
gl_gnulib_enabled_chdir=true
fi
}
+ func_gl_gnulib_m4code_cloexec ()
+ {
+ if ! $gl_gnulib_enabled_cloexec; then
+ gl_MODULE_INDICATOR_FOR_TESTS([cloexec])
+ gl_gnulib_enabled_cloexec=true
+ func_gl_gnulib_m4code_dup2
+ func_gl_gnulib_m4code_fcntl
+ fi
+ }
func_gl_gnulib_m4code_dup2 ()
{
if ! $gl_gnulib_enabled_dup2; then
gl_FUNC_DUP2
- if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
+ if test $REPLACE_DUP2 = 1; then
AC_LIBOBJ([dup2])
gl_PREREQ_DUP2
fi
@@ -820,17 +870,77 @@ AC_SUBST([LTALLOCA])
gl_gnulib_enabled_dup2=true
fi
}
+ func_gl_gnulib_m4code_dynarray ()
+ {
+ if ! $gl_gnulib_enabled_dynarray; then
+ gl_gnulib_enabled_dynarray=true
+ func_gl_gnulib_m4code_21ee726a3540c09237a8e70c0baf7467
+ fi
+ }
+ func_gl_gnulib_m4code_925677f0343de64b89a9f0c790b4104c ()
+ {
+ if ! $gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c; then
+ gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c=true
+ fi
+ }
+ func_gl_gnulib_m4code_fcntl ()
+ {
+ if ! $gl_gnulib_enabled_fcntl; then
+ gl_FUNC_FCNTL
+ if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
+ AC_LIBOBJ([fcntl])
+ fi
+ gl_FCNTL_MODULE_INDICATOR([fcntl])
+ gl_gnulib_enabled_fcntl=true
+ if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
+ func_gl_gnulib_m4code_dup2
+ fi
+ if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
+ func_gl_gnulib_m4code_getdtablesize
+ fi
+ fi
+ }
func_gl_gnulib_m4code_43fe87a341d9b4b93c47c3ad819a5239 ()
{
if ! $gl_gnulib_enabled_43fe87a341d9b4b93c47c3ad819a5239; then
gl_gnulib_enabled_43fe87a341d9b4b93c47c3ad819a5239=true
fi
}
- func_gl_gnulib_m4code_flexmember ()
+ 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_flexmember; then
- AC_C_FLEXIBLE_ARRAY_MEMBER
- gl_gnulib_enabled_flexmember=true
+ if ! $gl_gnulib_enabled_getdtablesize; then
+ gl_FUNC_GETDTABLESIZE
+ if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
+ AC_LIBOBJ([getdtablesize])
+ gl_PREREQ_GETDTABLESIZE
+ fi
+ gl_UNISTD_MODULE_INDICATOR([getdtablesize])
+ gl_gnulib_enabled_getdtablesize=true
+ fi
+ }
+ func_gl_gnulib_m4code_getrandom ()
+ {
+ if ! $gl_gnulib_enabled_getrandom; then
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ gl_FUNC_GETRANDOM
+ if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then
+ AC_LIBOBJ([getrandom])
+ fi
+ gl_SYS_RANDOM_MODULE_INDICATOR([getrandom])
+ gl_gnulib_enabled_getrandom=true
+ func_gl_gnulib_m4code_sys_random
fi
}
func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 ()
@@ -844,8 +954,11 @@ AC_SUBST([LTALLOCA])
func_gl_gnulib_m4code_30838f5439487421042f2225bed3af76 ()
{
if ! $gl_gnulib_enabled_30838f5439487421042f2225bed3af76; then
- gl_HARD_LOCALE
+ AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
+ LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
+ AC_SUBST([LIB_HARD_LOCALE])
gl_gnulib_enabled_30838f5439487421042f2225bed3af76=true
+ func_gl_gnulib_m4code_e7e881d32ca02f1c997b13c737c64bbd
fi
}
func_gl_gnulib_m4code_hostent ()
@@ -855,10 +968,10 @@ AC_SUBST([LTALLOCA])
gl_gnulib_enabled_hostent=true
fi
}
- func_gl_gnulib_m4code_intprops ()
+ func_gl_gnulib_m4code_idx ()
{
- if ! $gl_gnulib_enabled_intprops; then
- gl_gnulib_enabled_intprops=true
+ if ! $gl_gnulib_enabled_idx; then
+ gl_gnulib_enabled_idx=true
fi
}
func_gl_gnulib_m4code_b1df7117b479d2da59d76deba468ee21 ()
@@ -894,6 +1007,13 @@ AC_SUBST([LTALLOCA])
gl_gnulib_enabled_dbdf22868a5367f28bf18e0013ac6f8f=true
fi
}
+ func_gl_gnulib_m4code_21ee726a3540c09237a8e70c0baf7467 ()
+ {
+ if ! $gl_gnulib_enabled_21ee726a3540c09237a8e70c0baf7467; then
+ gl___INLINE
+ gl_gnulib_enabled_21ee726a3540c09237a8e70c0baf7467=true
+ fi
+ }
func_gl_gnulib_m4code_localeconv ()
{
if ! $gl_gnulib_enabled_localeconv; then
@@ -923,14 +1043,19 @@ AC_SUBST([LTALLOCA])
gl_FUNC_MBRTOWC
if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
AC_LIBOBJ([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_gnulib_enabled_mbrtowc=true
- if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
+ if { test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; } && test $REPLACE_MBSTATE_T = 0; then
func_gl_gnulib_m4code_30838f5439487421042f2225bed3af76
fi
- if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
+ if { test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; } && test $REPLACE_MBSTATE_T = 0; then
func_gl_gnulib_m4code_mbsinit
fi
if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
@@ -957,13 +1082,13 @@ AC_SUBST([LTALLOCA])
{
if ! $gl_gnulib_enabled_mbtowc; then
gl_FUNC_MBTOWC
- if test $REPLACE_MBTOWC = 1; then
+ if test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1; then
AC_LIBOBJ([mbtowc])
gl_PREREQ_MBTOWC
fi
gl_STDLIB_MODULE_INDICATOR([mbtowc])
gl_gnulib_enabled_mbtowc=true
- if test $REPLACE_MBTOWC = 1; then
+ if test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1; then
func_gl_gnulib_m4code_mbrtowc
fi
fi
@@ -972,7 +1097,7 @@ AC_SUBST([LTALLOCA])
{
if ! $gl_gnulib_enabled_memchr; then
gl_FUNC_MEMCHR
- if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+ if test $REPLACE_MEMCHR = 1; then
AC_LIBOBJ([memchr])
gl_PREREQ_MEMCHR
fi
@@ -980,6 +1105,18 @@ AC_SUBST([LTALLOCA])
gl_gnulib_enabled_memchr=true
fi
}
+ func_gl_gnulib_m4code_mempcpy ()
+ {
+ if ! $gl_gnulib_enabled_mempcpy; then
+ gl_FUNC_MEMPCPY
+ if test $HAVE_MEMPCPY = 0; then
+ AC_LIBOBJ([mempcpy])
+ gl_PREREQ_MEMPCPY
+ fi
+ gl_STRING_MODULE_INDICATOR([mempcpy])
+ gl_gnulib_enabled_mempcpy=true
+ fi
+ }
func_gl_gnulib_m4code_mktime ()
{
if ! $gl_gnulib_enabled_mktime; then
@@ -991,7 +1128,7 @@ AC_SUBST([LTALLOCA])
gl_TIME_MODULE_INDICATOR([mktime])
gl_gnulib_enabled_mktime=true
if test $REPLACE_MKTIME = 1; then
- func_gl_gnulib_m4code_intprops
+ func_gl_gnulib_m4code_21ee726a3540c09237a8e70c0baf7467
fi
if test $REPLACE_MKTIME = 1; then
func_gl_gnulib_m4code_time_r
@@ -1002,7 +1139,7 @@ AC_SUBST([LTALLOCA])
{
if ! $gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31; then
gl_FUNC_MKTIME_INTERNAL
- if test $REPLACE_MKTIME = 1; then
+ if test $WANT_MKTIME_INTERNAL = 1; then
AC_LIBOBJ([mktime])
gl_PREREQ_MKTIME
fi
@@ -1029,6 +1166,18 @@ AC_SUBST([LTALLOCA])
gl_gnulib_enabled_raise=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_round ()
{
if ! $gl_gnulib_enabled_round; then
@@ -1046,16 +1195,11 @@ AC_SUBST([LTALLOCA])
gl_gnulib_enabled_9bc5f216d57e231e4834049d67d0db62=true
fi
}
- func_gl_gnulib_m4code_secure_getenv ()
+ func_gl_gnulib_m4code_scratch_buffer ()
{
- if ! $gl_gnulib_enabled_secure_getenv; then
- gl_FUNC_SECURE_GETENV
- if test $HAVE_SECURE_GETENV = 0; then
- AC_LIBOBJ([secure_getenv])
- gl_PREREQ_SECURE_GETENV
- fi
- gl_STDLIB_MODULE_INDICATOR([secure_getenv])
- gl_gnulib_enabled_secure_getenv=true
+ if ! $gl_gnulib_enabled_scratch_buffer; then
+ gl_gnulib_enabled_scratch_buffer=true
+ func_gl_gnulib_m4code_21ee726a3540c09237a8e70c0baf7467
fi
}
func_gl_gnulib_m4code_servent ()
@@ -1065,6 +1209,18 @@ AC_SUBST([LTALLOCA])
gl_gnulib_enabled_servent=true
fi
}
+ func_gl_gnulib_m4code_e7e881d32ca02f1c997b13c737c64bbd ()
+ {
+ if ! $gl_gnulib_enabled_e7e881d32ca02f1c997b13c737c64bbd; then
+ gl_FUNC_SETLOCALE_NULL
+ if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+ AC_LIBOBJ([setlocale-lock])
+ gl_PREREQ_SETLOCALE_LOCK
+ fi
+ gl_LOCALE_MODULE_INDICATOR([setlocale_null])
+ gl_gnulib_enabled_e7e881d32ca02f1c997b13c737c64bbd=true
+ fi
+ }
func_gl_gnulib_m4code_signbit ()
{
if ! $gl_gnulib_enabled_signbit; then
@@ -1120,6 +1276,11 @@ AC_SUBST([LTALLOCA])
gl_FUNC_STAT
if test $REPLACE_STAT = 1; then
AC_LIBOBJ([stat])
+ case "$host_os" in
+ mingw*)
+ AC_LIBOBJ([stat-w32])
+ ;;
+ esac
gl_PREREQ_STAT
fi
gl_SYS_STAT_MODULE_INDICATOR([stat])
@@ -1133,7 +1294,7 @@ AC_SUBST([LTALLOCA])
{
if ! $gl_gnulib_enabled_f9850631dca91859e9cddac9359921c0; then
gl_FUNC_STRDUP_POSIX
- if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
+ if test $REPLACE_STRDUP = 1; then
AC_LIBOBJ([strdup])
gl_PREREQ_STRDUP
fi
@@ -1147,12 +1308,22 @@ AC_SUBST([LTALLOCA])
gl_gnulib_enabled_streq=true
fi
}
+ func_gl_gnulib_m4code_sys_random ()
+ {
+ if ! $gl_gnulib_enabled_sys_random; then
+ gl_HEADER_SYS_RANDOM
+ AC_PROG_MKDIR_P
+ gl_gnulib_enabled_sys_random=true
+ fi
+ }
func_gl_gnulib_m4code_tempname ()
{
if ! $gl_gnulib_enabled_tempname; then
gl_FUNC_GEN_TEMPNAME
+ gl_MODULE_INDICATOR([tempname])
gl_gnulib_enabled_tempname=true
- func_gl_gnulib_m4code_secure_getenv
+ func_gl_gnulib_m4code_getrandom
+ func_gl_gnulib_m4code_21ee726a3540c09237a8e70c0baf7467
fi
}
func_gl_gnulib_m4code_time_r ()
@@ -1185,6 +1356,17 @@ AC_SUBST([LTALLOCA])
fi
fi
}
+ func_gl_gnulib_m4code_tzset ()
+ {
+ if ! $gl_gnulib_enabled_tzset; then
+ gl_FUNC_TZSET
+ if test $REPLACE_TZSET = 1; then
+ AC_LIBOBJ([tzset])
+ fi
+ gl_TIME_MODULE_INDICATOR([tzset])
+ gl_gnulib_enabled_tzset=true
+ fi
+ }
func_gl_gnulib_m4code_unsetenv ()
{
if ! $gl_gnulib_enabled_unsetenv; then
@@ -1200,6 +1382,7 @@ AC_SUBST([LTALLOCA])
func_gl_gnulib_m4code_vasnprintf ()
{
if ! $gl_gnulib_enabled_vasnprintf; then
+ AC_REQUIRE([AC_C_RESTRICT])
gl_FUNC_VASNPRINTF
gl_gnulib_enabled_vasnprintf=true
func_gl_gnulib_m4code_memchr
@@ -1237,30 +1420,63 @@ AC_SUBST([LTALLOCA])
fi
}
if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
+ func_gl_gnulib_m4code_925677f0343de64b89a9f0c790b4104c
+ fi
+ if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
+ 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_21ee726a3540c09237a8e70c0baf7467
+ fi
+ if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
+ func_gl_gnulib_m4code_mempcpy
+ fi
+ if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
func_gl_gnulib_m4code_pathmax
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_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
+ func_gl_gnulib_m4code_stat
+ fi
if test $REPLACE_CLOSE = 1; then
func_gl_gnulib_m4code_43fe87a341d9b4b93c47c3ad819a5239
fi
if test $HAVE_COPYSIGN = 0; then
func_gl_gnulib_m4code_signbit
fi
+ if test $REPLACE_DUPLOCALE = 1; then
+ func_gl_gnulib_m4code_e7e881d32ca02f1c997b13c737c64bbd
+ fi
if test $gl_func_frexp != yes; then
func_gl_gnulib_m4code_b1df7117b479d2da59d76deba468ee21
fi
- if test $HAVE_GETADDRINFO = 0 || test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then
+ if test $REPLACE_FSTAT = 1; then
+ func_gl_gnulib_m4code_pathmax
+ fi
+ if test $REPLACE_FSTAT = 1; then
+ func_gl_gnulib_m4code_stat
+ fi
+ if test $HAVE_GETADDRINFO = 0 || test $REPLACE_GETADDRINFO = 1 || test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then
func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36
fi
- if test $HAVE_GETADDRINFO = 0; then
+ if test $HAVE_GETADDRINFO = 0 || test $REPLACE_GETADDRINFO = 1; then
func_gl_gnulib_m4code_hostent
fi
- if test $HAVE_GETADDRINFO = 0; then
+ if test $HAVE_GETADDRINFO = 0 || test $REPLACE_GETADDRINFO = 1; then
func_gl_gnulib_m4code_servent
fi
- if test $HAVE_GETADDRINFO = 0; then
+ if test $HAVE_GETADDRINFO = 0 || test $REPLACE_GETADDRINFO = 1; then
func_gl_gnulib_m4code_snprintf
fi
- if test $HAVE_GETADDRINFO = 0; then
+ if test $HAVE_GETADDRINFO = 0 || test $REPLACE_GETADDRINFO = 1; then
func_gl_gnulib_m4code_sockets
fi
if test $REPLACE_ISFINITE = 1; then
@@ -1287,12 +1503,21 @@ AC_SUBST([LTALLOCA])
if test $REPLACE_LSTAT = 1; then
func_gl_gnulib_m4code_stat
fi
+ if test $REPLACE_MKDIR = 1; then
+ func_gl_gnulib_m4code_stat
+ fi
if test $HAVE_MKOSTEMP = 0; then
func_gl_gnulib_m4code_tempname
fi
if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
func_gl_gnulib_m4code_localeconv
fi
+ if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then
+ func_gl_gnulib_m4code_e7e881d32ca02f1c997b13c737c64bbd
+ fi
+ if test $REPLACE_OPEN = 1; then
+ func_gl_gnulib_m4code_cloexec
+ fi
if test $REPLACE_OPEN = 1; then
func_gl_gnulib_m4code_stat
fi
@@ -1315,10 +1540,10 @@ AC_SUBST([LTALLOCA])
func_gl_gnulib_m4code_37f71b604aa9c54446783d80f42fe547
fi
if test $ac_use_included_regex = yes; then
- func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36
+ func_gl_gnulib_m4code_dynarray
fi
if test $ac_use_included_regex = yes; then
- func_gl_gnulib_m4code_intprops
+ func_gl_gnulib_m4code_21ee726a3540c09237a8e70c0baf7467
fi
if test $ac_use_included_regex = yes; then
func_gl_gnulib_m4code_mbrtowc
@@ -1338,6 +1563,9 @@ AC_SUBST([LTALLOCA])
if test $REPLACE_RENAME = 1; then
func_gl_gnulib_m4code_9bc5f216d57e231e4834049d67d0db62
fi
+ if test $REPLACE_RENAME = 1; then
+ func_gl_gnulib_m4code_stat
+ fi
if test $REPLACE_SELECT = 1; then
func_gl_gnulib_m4code_alloca
fi
@@ -1350,16 +1578,19 @@ AC_SUBST([LTALLOCA])
if test "$ac_cv_header_winsock2_h" = yes; then
func_gl_gnulib_m4code_sockets
fi
- if test "$HAVE_TIMEZONE_T" = 0; then
- func_gl_gnulib_m4code_flexmember
+ if test $HAVE_TIMEZONE_T = 0; then
+ func_gl_gnulib_m4code_idx
fi
- if test "$HAVE_TIMEZONE_T" = 0; then
+ if test $HAVE_TIMEZONE_T = 0; then
func_gl_gnulib_m4code_time_r
fi
- if test "$HAVE_TIMEZONE_T" = 0; then
+ if test $HAVE_TIMEZONE_T = 0; then
func_gl_gnulib_m4code_timegm
fi
- if test "$HAVE_TIMEZONE_T" = 0; then
+ if test $HAVE_TIMEZONE_T = 0; then
+ func_gl_gnulib_m4code_tzset
+ fi
+ if test $HAVE_TIMEZONE_T = 0; then
func_gl_gnulib_m4code_unsetenv
fi
if test $ac_cv_func_vsnprintf = no || test $REPLACE_VSNPRINTF = 1; then
@@ -1374,30 +1605,40 @@ AC_SUBST([LTALLOCA])
AM_CONDITIONAL([gl_GNULIB_ENABLED_btowc], [$gl_gnulib_enabled_btowc])
AM_CONDITIONAL([gl_GNULIB_ENABLED_37f71b604aa9c54446783d80f42fe547], [$gl_gnulib_enabled_37f71b604aa9c54446783d80f42fe547])
AM_CONDITIONAL([gl_GNULIB_ENABLED_chdir], [$gl_gnulib_enabled_chdir])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_cloexec], [$gl_gnulib_enabled_cloexec])
AM_CONDITIONAL([gl_GNULIB_ENABLED_dup2], [$gl_gnulib_enabled_dup2])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_dynarray], [$gl_gnulib_enabled_dynarray])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_925677f0343de64b89a9f0c790b4104c], [$gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_fcntl], [$gl_gnulib_enabled_fcntl])
AM_CONDITIONAL([gl_GNULIB_ENABLED_43fe87a341d9b4b93c47c3ad819a5239], [$gl_gnulib_enabled_43fe87a341d9b4b93c47c3ad819a5239])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_flexmember], [$gl_gnulib_enabled_flexmember])
+ 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_getrandom], [$gl_gnulib_enabled_getrandom])
AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36])
AM_CONDITIONAL([gl_GNULIB_ENABLED_30838f5439487421042f2225bed3af76], [$gl_gnulib_enabled_30838f5439487421042f2225bed3af76])
AM_CONDITIONAL([gl_GNULIB_ENABLED_hostent], [$gl_gnulib_enabled_hostent])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_intprops], [$gl_gnulib_enabled_intprops])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_idx], [$gl_gnulib_enabled_idx])
AM_CONDITIONAL([gl_GNULIB_ENABLED_b1df7117b479d2da59d76deba468ee21], [$gl_gnulib_enabled_b1df7117b479d2da59d76deba468ee21])
AM_CONDITIONAL([gl_GNULIB_ENABLED_3f0e593033d1fc2c127581960f641b66], [$gl_gnulib_enabled_3f0e593033d1fc2c127581960f641b66])
AM_CONDITIONAL([gl_GNULIB_ENABLED_dbdf22868a5367f28bf18e0013ac6f8f], [$gl_gnulib_enabled_dbdf22868a5367f28bf18e0013ac6f8f])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_21ee726a3540c09237a8e70c0baf7467], [$gl_gnulib_enabled_21ee726a3540c09237a8e70c0baf7467])
AM_CONDITIONAL([gl_GNULIB_ENABLED_localeconv], [$gl_gnulib_enabled_localeconv])
AM_CONDITIONAL([gl_GNULIB_ENABLED_log], [$gl_gnulib_enabled_log])
AM_CONDITIONAL([gl_GNULIB_ENABLED_mbrtowc], [$gl_gnulib_enabled_mbrtowc])
AM_CONDITIONAL([gl_GNULIB_ENABLED_mbsinit], [$gl_gnulib_enabled_mbsinit])
AM_CONDITIONAL([gl_GNULIB_ENABLED_mbtowc], [$gl_gnulib_enabled_mbtowc])
AM_CONDITIONAL([gl_GNULIB_ENABLED_memchr], [$gl_gnulib_enabled_memchr])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_mempcpy], [$gl_gnulib_enabled_mempcpy])
AM_CONDITIONAL([gl_GNULIB_ENABLED_mktime], [$gl_gnulib_enabled_mktime])
AM_CONDITIONAL([gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31], [$gl_gnulib_enabled_5264294aa0a5557541b53c8c741f7f31])
AM_CONDITIONAL([gl_GNULIB_ENABLED_pathmax], [$gl_gnulib_enabled_pathmax])
AM_CONDITIONAL([gl_GNULIB_ENABLED_raise], [$gl_gnulib_enabled_raise])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_rawmemchr], [$gl_gnulib_enabled_rawmemchr])
AM_CONDITIONAL([gl_GNULIB_ENABLED_round], [$gl_gnulib_enabled_round])
AM_CONDITIONAL([gl_GNULIB_ENABLED_9bc5f216d57e231e4834049d67d0db62], [$gl_gnulib_enabled_9bc5f216d57e231e4834049d67d0db62])
- AM_CONDITIONAL([gl_GNULIB_ENABLED_secure_getenv], [$gl_gnulib_enabled_secure_getenv])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_scratch_buffer], [$gl_gnulib_enabled_scratch_buffer])
AM_CONDITIONAL([gl_GNULIB_ENABLED_servent], [$gl_gnulib_enabled_servent])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_e7e881d32ca02f1c997b13c737c64bbd], [$gl_gnulib_enabled_e7e881d32ca02f1c997b13c737c64bbd])
AM_CONDITIONAL([gl_GNULIB_ENABLED_signbit], [$gl_gnulib_enabled_signbit])
AM_CONDITIONAL([gl_GNULIB_ENABLED_size_max], [$gl_gnulib_enabled_size_max])
AM_CONDITIONAL([gl_GNULIB_ENABLED_snprintf], [$gl_gnulib_enabled_snprintf])
@@ -1405,9 +1646,11 @@ AC_SUBST([LTALLOCA])
AM_CONDITIONAL([gl_GNULIB_ENABLED_stat], [$gl_gnulib_enabled_stat])
AM_CONDITIONAL([gl_GNULIB_ENABLED_f9850631dca91859e9cddac9359921c0], [$gl_gnulib_enabled_f9850631dca91859e9cddac9359921c0])
AM_CONDITIONAL([gl_GNULIB_ENABLED_streq], [$gl_gnulib_enabled_streq])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_sys_random], [$gl_gnulib_enabled_sys_random])
AM_CONDITIONAL([gl_GNULIB_ENABLED_tempname], [$gl_gnulib_enabled_tempname])
AM_CONDITIONAL([gl_GNULIB_ENABLED_time_r], [$gl_gnulib_enabled_time_r])
AM_CONDITIONAL([gl_GNULIB_ENABLED_timegm], [$gl_gnulib_enabled_timegm])
+ AM_CONDITIONAL([gl_GNULIB_ENABLED_tzset], [$gl_gnulib_enabled_tzset])
AM_CONDITIONAL([gl_GNULIB_ENABLED_unsetenv], [$gl_gnulib_enabled_unsetenv])
AM_CONDITIONAL([gl_GNULIB_ENABLED_vasnprintf], [$gl_gnulib_enabled_vasnprintf])
AM_CONDITIONAL([gl_GNULIB_ENABLED_wcrtomb], [$gl_gnulib_enabled_wcrtomb])
@@ -1557,28 +1800,29 @@ AC_DEFUN([gl_FILE_LIST], [
build-aux/gitlog-to-changelog
build-aux/gnu-web-doc-update
build-aux/gnupload
- build-aux/snippet/_Noreturn.h
- build-aux/snippet/arg-nonnull.h
- build-aux/snippet/c++defs.h
- build-aux/snippet/warn-on-use.h
build-aux/useless-if-before-free
build-aux/vc-list-files
doc/gendocs_template
doc/gendocs_template_min
+ lib/_Noreturn.h
lib/accept.c
lib/accept4.c
lib/alignof.h
lib/alloca.c
lib/alloca.in.h
+ lib/arg-nonnull.h
lib/arpa_inet.in.h
lib/asnprintf.c
lib/assure.h
+ lib/attribute.h
lib/basename-lgpl.c
+ lib/basename-lgpl.h
lib/binary-io.c
lib/binary-io.h
lib/bind.c
lib/btowc.c
lib/byteswap.in.h
+ lib/c++defs.h
lib/c-ctype.c
lib/c-ctype.h
lib/c-strcase.h
@@ -1586,28 +1830,34 @@ AC_DEFUN([gl_FILE_LIST], [
lib/c-strcaseeq.h
lib/c-strncasecmp.c
lib/canonicalize-lgpl.c
+ lib/cdefs.h
lib/ceil.c
+ lib/cloexec.c
+ lib/cloexec.h
lib/close.c
- lib/config.charset
lib/connect.c
lib/copysign.c
lib/dirent.in.h
lib/dirfd.c
lib/dirname-lgpl.c
lib/dirname.h
- lib/dosname.h
lib/dup2.c
lib/duplocale.c
+ lib/dynarray.h
+ lib/eloop-threshold.h
lib/errno.in.h
+ lib/fcntl.c
lib/fcntl.in.h
lib/fd-hook.c
lib/fd-hook.h
+ lib/filename.h
lib/flexmember.h
lib/float+.h
lib/float.c
lib/float.in.h
lib/flock.c
lib/floor.c
+ lib/free.c
lib/frexp.c
lib/fstat.c
lib/fsync.c
@@ -1617,12 +1867,13 @@ AC_DEFUN([gl_FILE_LIST], [
lib/full-write.h
lib/gai_strerror.c
lib/getaddrinfo.c
+ lib/getdtablesize.c
lib/getlogin.c
lib/getpeername.c
+ lib/getrandom.c
lib/getsockname.c
lib/getsockopt.c
lib/gettext.h
- lib/gettimeofday.c
lib/hard-locale.c
lib/hard-locale.h
lib/iconv.c
@@ -1633,11 +1884,14 @@ AC_DEFUN([gl_FILE_LIST], [
lib/iconv_open-irix.gperf
lib/iconv_open-osf.gperf
lib/iconv_open-solaris.gperf
+ lib/iconv_open-zos.gperf
lib/iconv_open.c
lib/iconveh.h
+ lib/idx.h
lib/inet_ntop.c
lib/inet_pton.c
lib/intprops.h
+ lib/inttypes.in.h
lib/isfinite.c
lib/isinf.c
lib/isnan.c
@@ -1649,6 +1903,9 @@ AC_DEFUN([gl_FILE_LIST], [
lib/isnanl.c
lib/itold.c
lib/langinfo.in.h
+ lib/lc-charset-dispatch.c
+ lib/lc-charset-dispatch.h
+ lib/libc-config.h
lib/libunistring.valgrind
lib/limits.in.h
lib/link.c
@@ -1661,17 +1918,34 @@ AC_DEFUN([gl_FILE_LIST], [
lib/log1p.c
lib/lstat.c
lib/malloc.c
+ lib/malloc/dynarray-skeleton.c
+ lib/malloc/dynarray.h
+ lib/malloc/dynarray_at_failure.c
+ lib/malloc/dynarray_emplace_enlarge.c
+ lib/malloc/dynarray_finalize.c
+ lib/malloc/dynarray_resize.c
+ lib/malloc/dynarray_resize_clear.c
+ lib/malloc/scratch_buffer.h
+ lib/malloc/scratch_buffer_dupfree.c
+ lib/malloc/scratch_buffer_grow.c
+ lib/malloc/scratch_buffer_grow_preserve.c
+ lib/malloc/scratch_buffer_set_array_size.c
lib/malloca.c
lib/malloca.h
- lib/malloca.valgrind
lib/math.c
lib/math.in.h
+ lib/mbrtowc-impl-utf8.h
+ lib/mbrtowc-impl.h
lib/mbrtowc.c
lib/mbsinit.c
lib/mbtowc-impl.h
+ lib/mbtowc-lock.c
+ lib/mbtowc-lock.h
lib/mbtowc.c
lib/memchr.c
lib/memchr.valgrind
+ lib/mempcpy.c
+ lib/minmax.h
lib/mkdir.c
lib/mkostemp.c
lib/mktime-internal.h
@@ -1682,9 +1956,11 @@ AC_DEFUN([gl_FILE_LIST], [
lib/msvc-nothrow.h
lib/netdb.in.h
lib/netinet_in.in.h
+ lib/nl_langinfo-lock.c
lib/nl_langinfo.c
lib/nproc.c
lib/nproc.h
+ lib/nstrftime.c
lib/open.c
lib/pathmax.h
lib/pipe.c
@@ -1697,12 +1973,12 @@ AC_DEFUN([gl_FILE_LIST], [
lib/printf-parse.h
lib/putenv.c
lib/raise.c
+ lib/rawmemchr.c
+ lib/rawmemchr.valgrind
lib/read.c
lib/readlink.c
lib/recv.c
lib/recvfrom.c
- lib/ref-add.sin
- lib/ref-del.sin
lib/regcomp.c
lib/regex.c
lib/regex.h
@@ -1717,11 +1993,14 @@ AC_DEFUN([gl_FILE_LIST], [
lib/safe-write.c
lib/safe-write.h
lib/same-inode.h
- lib/secure_getenv.c
+ lib/scratch_buffer.h
lib/select.c
lib/send.c
lib/sendto.c
lib/setenv.c
+ lib/setlocale-lock.c
+ lib/setlocale_null.c
+ lib/setlocale_null.h
lib/setsockopt.c
lib/shutdown.c
lib/signal.in.h
@@ -1735,6 +2014,8 @@ AC_DEFUN([gl_FILE_LIST], [
lib/sockets.h
lib/stat-time.c
lib/stat-time.h
+ lib/stat-w32.c
+ lib/stat-w32.h
lib/stat.c
lib/stdalign.in.h
lib/stdbool.in.h
@@ -1744,13 +2025,14 @@ AC_DEFUN([gl_FILE_LIST], [
lib/stdlib.in.h
lib/strdup.c
lib/streq.h
- lib/strftime.c
lib/strftime.h
lib/striconveh.c
lib/striconveh.h
lib/string.in.h
lib/stripslash.c
+ lib/sys-limits.h
lib/sys_file.in.h
+ lib/sys_random.in.h
lib/sys_select.in.h
lib/sys_socket.c
lib/sys_socket.in.h
@@ -1768,6 +2050,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/timegm.c
lib/times.c
lib/trunc.c
+ lib/tzset.c
lib/unistd.c
lib/unistd.in.h
lib/unsetenv.c
@@ -1776,15 +2059,18 @@ AC_DEFUN([gl_FILE_LIST], [
lib/verify.h
lib/vsnprintf.c
lib/w32sock.h
+ lib/warn-on-use.h
lib/wchar.in.h
lib/wcrtomb.c
lib/wctype-h.c
lib/wctype.in.h
+ lib/windows-initguard.h
lib/write.c
lib/xalloc-oversized.h
lib/xsize.c
lib/xsize.h
m4/00gnulib.m4
+ m4/__inline.m4
m4/absolute-header.m4
m4/accept4.m4
m4/alloca.m4
@@ -1799,11 +2085,9 @@ AC_DEFUN([gl_FILE_LIST], [
m4/clock_time.m4
m4/close.m4
m4/codeset.m4
- m4/configmake.m4
m4/copysign.m4
m4/dirent_h.m4
m4/dirfd.m4
- m4/dirname.m4
m4/double-slash-root.m4
m4/dup2.m4
m4/duplocale.m4
@@ -1816,22 +2100,24 @@ AC_DEFUN([gl_FILE_LIST], [
m4/extensions.m4
m4/extern-inline.m4
m4/fcntl-o.m4
+ m4/fcntl.m4
m4/fcntl_h.m4
m4/flexmember.m4
m4/float_h.m4
m4/flock.m4
m4/floor.m4
m4/fpieee.m4
+ m4/free.m4
m4/frexp.m4
m4/fstat.m4
m4/fsync.m4
m4/func.m4
m4/getaddrinfo.m4
+ m4/getdtablesize.m4
m4/getlogin.m4
- m4/gettimeofday.m4
- m4/glibc21.m4
+ m4/getrandom.m4
m4/gnulib-common.m4
- m4/hard-locale.m4
+ m4/host-cpu-c-abi.m4
m4/hostent.m4
m4/iconv.m4
m4/iconv_h.m4
@@ -1841,6 +2127,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/inet_ntop.m4
m4/inet_pton.m4
m4/intmax_t.m4
+ m4/inttypes.m4
m4/inttypes_h.m4
m4/isfinite.m4
m4/isinf.m4
@@ -1866,7 +2153,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/localeconv.m4
m4/log.m4
m4/log1p.m4
- m4/longlong.m4
m4/lstat.m4
m4/malloc.m4
m4/malloca.m4
@@ -1877,6 +2163,8 @@ AC_DEFUN([gl_FILE_LIST], [
m4/mbstate_t.m4
m4/mbtowc.m4
m4/memchr.m4
+ m4/mempcpy.m4
+ m4/minmax.m4
m4/mkdir.m4
m4/mkostemp.m4
m4/mktime.m4
@@ -1890,9 +2178,13 @@ AC_DEFUN([gl_FILE_LIST], [
m4/nl_langinfo.m4
m4/nocrash.m4
m4/nproc.m4
+ m4/nstrftime.m4
m4/off_t.m4
+ m4/open-cloexec.m4
+ m4/open-slash.m4
m4/open.m4
m4/pathmax.m4
+ m4/pid_t.m4
m4/pipe.m4
m4/pipe2.m4
m4/poll.m4
@@ -1900,6 +2192,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/printf.m4
m4/putenv.m4
m4/raise.m4
+ m4/rawmemchr.m4
m4/read.m4
m4/readlink.m4
m4/regex.m4
@@ -1908,10 +2201,10 @@ AC_DEFUN([gl_FILE_LIST], [
m4/round.m4
m4/safe-read.m4
m4/safe-write.m4
- m4/secure_getenv.m4
m4/select.m4
m4/servent.m4
m4/setenv.m4
+ m4/setlocale_null.m4
m4/signal_h.m4
m4/signbit.m4
m4/size_max.m4
@@ -1923,6 +2216,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/ssize_t.m4
m4/stat-time.m4
m4/stat.m4
+ m4/std-gnu11.m4
m4/stdalign.m4
m4/stdbool.m4
m4/stddef_h.m4
@@ -1931,9 +2225,9 @@ AC_DEFUN([gl_FILE_LIST], [
m4/stdio_h.m4
m4/stdlib_h.m4
m4/strdup.m4
- m4/strftime.m4
m4/string_h.m4
m4/sys_file_h.m4
+ m4/sys_random_h.m4
m4/sys_select_h.m4
m4/sys_socket_h.m4
m4/sys_stat_h.m4
@@ -1942,6 +2236,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/sys_types_h.m4
m4/sys_uio_h.m4
m4/tempname.m4
+ m4/threadlib.m4
m4/time_h.m4
m4/time_r.m4
m4/time_rz.m4
@@ -1949,6 +2244,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/times.m4
m4/tm_gmtoff.m4
m4/trunc.m4
+ m4/tzset.m4
m4/unistd_h.m4
m4/vasnprintf.m4
m4/visibility.m4
@@ -1962,6 +2258,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/wint_t.m4
m4/write.m4
m4/xsize.m4
+ m4/zzgnulib.m4
top/GNUmakefile
top/maint.mk
])
diff --git a/m4/gnulib-tool.m4 b/m4/gnulib-tool.m4
index 2e2d8f6dc..3d56d83f1 100644
--- a/m4/gnulib-tool.m4
+++ b/m4/gnulib-tool.m4
@@ -1,5 +1,5 @@
# gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 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.
diff --git a/m4/hard-locale.m4 b/m4/hard-locale.m4
deleted file mode 100644
index d79acd658..000000000
--- a/m4/hard-locale.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-# hard-locale.m4 serial 8
-dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc.
-dnl This file is free software; the Free 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 No prerequisites of lib/hard-locale.c.
-AC_DEFUN([gl_HARD_LOCALE],
-[
- :
-])
diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4
new file mode 100644
index 000000000..7dc830eff
--- /dev/null
+++ b/m4/host-cpu-c-abi.m4
@@ -0,0 +1,675 @@
+# host-cpu-c-abi.m4 serial 13
+dnl Copyright (C) 2002-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.
+
+dnl From Bruno Haible and Sam Steingold.
+
+dnl Sets the HOST_CPU variable to the canonical name of the CPU.
+dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its
+dnl C language ABI (application binary interface).
+dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in
+dnl config.h.
+dnl
+dnl This canonical name can be used to select a particular assembly language
+dnl source file that will interoperate with C code on the given host.
+dnl
+dnl For example:
+dnl * 'i386' and 'sparc' are different canonical names, because code for i386
+dnl will not run on SPARC CPUs and vice versa. They have different
+dnl instruction sets.
+dnl * 'sparc' and 'sparc64' are different canonical names, because code for
+dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code
+dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit
+dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit
+dnl mode, but not both.
+dnl * 'mips' and 'mipsn32' are different canonical names, because they use
+dnl different argument passing and return conventions for C functions, and
+dnl although the instruction set of 'mips' is a large subset of the
+dnl instruction set of 'mipsn32'.
+dnl * 'mipsn32' and 'mips64' are different canonical names, because they use
+dnl different sizes for the C types like 'int' and 'void *', and although
+dnl the instruction sets of 'mipsn32' and 'mips64' are the same.
+dnl * The same canonical name is used for different endiannesses. You can
+dnl determine the endianness through preprocessor symbols:
+dnl - 'arm': test __ARMEL__.
+dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
+dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
+dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
+dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
+dnl - Instructions that do not exist on all of these CPUs (cmpxchg,
+dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your
+dnl assembly language source files use such instructions, you will
+dnl need to make the distinction.
+dnl - Speed of execution of the common instruction set is reasonable across
+dnl the entire family of CPUs. If you have assembly language source files
+dnl that are optimized for particular CPU types (like GNU gmp has), you
+dnl will need to make the distinction.
+dnl See <https://en.wikipedia.org/wiki/X86_instruction_listings>.
+AC_DEFUN([gl_HOST_CPU_C_ABI],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_C_ASM])
+ AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi],
+ [case "$host_cpu" in
+
+changequote(,)dnl
+ i[34567]86 )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi=i386
+ ;;
+
+ x86_64 )
+ # On x86_64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+ # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+ # with native Windows (mingw, MSVC).
+ # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (defined __x86_64__ || defined __amd64__ \
+ || defined _M_X64 || defined _M_AMD64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __ILP32__ || defined _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=x86_64-x32],
+ [gl_cv_host_cpu_c_abi=x86_64])],
+ [gl_cv_host_cpu_c_abi=i386])
+ ;;
+
+changequote(,)dnl
+ alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi=alpha
+ ;;
+
+ arm* | aarch64 )
+ # Assume arm with EABI.
+ # On arm64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+ # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __aarch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __ILP32__ || defined _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=arm64-ilp32],
+ [gl_cv_host_cpu_c_abi=arm64])],
+ [# Don't distinguish little-endian and big-endian arm, since they
+ # don't require different machine code for simple operations and
+ # since the user can distinguish them through the preprocessor
+ # defines __ARMEL__ vs. __ARMEB__.
+ # But distinguish arm which passes floating-point arguments and
+ # return values in integer registers (r0, r1, ...) - this is
+ # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
+ # passes them in float registers (s0, s1, ...) and double registers
+ # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
+ # sets the preprocessor defines __ARM_PCS (for the first case) and
+ # __ARM_PCS_VFP (for the second case), but older GCC does not.
+ echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
+ # Look for a reference to the register d0 in the .s file.
+ AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
+ if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
+ gl_cv_host_cpu_c_abi=armhf
+ else
+ gl_cv_host_cpu_c_abi=arm
+ fi
+ rm -f conftest*
+ ])
+ ;;
+
+ hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+ # On hppa, the C compiler may be generating 32-bit code or 64-bit
+ # code. In the latter case, it defines _LP64 and __LP64__.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=hppa64],
+ [gl_cv_host_cpu_c_abi=hppa])
+ ;;
+
+ ia64* )
+ # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+ # 32-bit code. In the latter case, it defines _ILP32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=ia64-ilp32],
+ [gl_cv_host_cpu_c_abi=ia64])
+ ;;
+
+ mips* )
+ # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+ # at 32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=mips64],
+ [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
+ # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
+ # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
+ # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (_MIPS_SIM == _ABIN32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=mipsn32],
+ [gl_cv_host_cpu_c_abi=mips])])
+ ;;
+
+ powerpc* )
+ # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+ # No need to distinguish them here; the caller may distinguish
+ # them based on the OS.
+ # On powerpc64 systems, the C compiler may still be generating
+ # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+ # be generating 64-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [# On powerpc64, there are two ABIs on Linux: The AIX compatible
+ # one and the ELFv2 one. The latter defines _CALL_ELF=2.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _CALL_ELF && _CALL_ELF == 2
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=powerpc64-elfv2],
+ [gl_cv_host_cpu_c_abi=powerpc64])
+ ],
+ [gl_cv_host_cpu_c_abi=powerpc])
+ ;;
+
+ rs6000 )
+ gl_cv_host_cpu_c_abi=powerpc
+ ;;
+
+ riscv32 | riscv64 )
+ # There are 2 architectures (with variants): rv32* and rv64*.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if __riscv_xlen == 64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [cpu=riscv64],
+ [cpu=riscv32])
+ # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+ # Size of 'long' and 'void *':
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [main_abi=lp64],
+ [main_abi=ilp32])
+ # Float ABIs:
+ # __riscv_float_abi_double:
+ # 'float' and 'double' are passed in floating-point registers.
+ # __riscv_float_abi_single:
+ # 'float' are passed in floating-point registers.
+ # __riscv_float_abi_soft:
+ # No values are passed in floating-point registers.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __riscv_float_abi_double
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [float_abi=d],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __riscv_float_abi_single
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [float_abi=f],
+ [float_abi=''])
+ ])
+ gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
+ ;;
+
+ s390* )
+ # On s390x, the C compiler may be generating 64-bit (= s390x) code
+ # or 31-bit (= s390) code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __s390x__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=s390x],
+ [gl_cv_host_cpu_c_abi=s390])
+ ;;
+
+ sparc | sparc64 )
+ # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+ # C compiler still generates 32-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=sparc64],
+ [gl_cv_host_cpu_c_abi=sparc])
+ ;;
+
+ *)
+ gl_cv_host_cpu_c_abi="$host_cpu"
+ ;;
+ esac
+ ])
+
+ dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same.
+ HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
+ HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
+ AC_SUBST([HOST_CPU])
+ AC_SUBST([HOST_CPU_C_ABI])
+
+ # This was
+ # AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
+ # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
+ # earlier, but KAI C++ 3.2d doesn't like this.
+ sed -e 's/-/_/g' >> confdefs.h <<EOF
+#ifndef __${HOST_CPU}__
+#define __${HOST_CPU}__ 1
+#endif
+#ifndef __${HOST_CPU_C_ABI}__
+#define __${HOST_CPU_C_ABI}__ 1
+#endif
+EOF
+ AH_TOP([/* CPU and C ABI indicator */
+#ifndef __i386__
+#undef __i386__
+#endif
+#ifndef __x86_64_x32__
+#undef __x86_64_x32__
+#endif
+#ifndef __x86_64__
+#undef __x86_64__
+#endif
+#ifndef __alpha__
+#undef __alpha__
+#endif
+#ifndef __arm__
+#undef __arm__
+#endif
+#ifndef __armhf__
+#undef __armhf__
+#endif
+#ifndef __arm64_ilp32__
+#undef __arm64_ilp32__
+#endif
+#ifndef __arm64__
+#undef __arm64__
+#endif
+#ifndef __hppa__
+#undef __hppa__
+#endif
+#ifndef __hppa64__
+#undef __hppa64__
+#endif
+#ifndef __ia64_ilp32__
+#undef __ia64_ilp32__
+#endif
+#ifndef __ia64__
+#undef __ia64__
+#endif
+#ifndef __m68k__
+#undef __m68k__
+#endif
+#ifndef __mips__
+#undef __mips__
+#endif
+#ifndef __mipsn32__
+#undef __mipsn32__
+#endif
+#ifndef __mips64__
+#undef __mips64__
+#endif
+#ifndef __powerpc__
+#undef __powerpc__
+#endif
+#ifndef __powerpc64__
+#undef __powerpc64__
+#endif
+#ifndef __powerpc64_elfv2__
+#undef __powerpc64_elfv2__
+#endif
+#ifndef __riscv32__
+#undef __riscv32__
+#endif
+#ifndef __riscv64__
+#undef __riscv64__
+#endif
+#ifndef __riscv32_ilp32__
+#undef __riscv32_ilp32__
+#endif
+#ifndef __riscv32_ilp32f__
+#undef __riscv32_ilp32f__
+#endif
+#ifndef __riscv32_ilp32d__
+#undef __riscv32_ilp32d__
+#endif
+#ifndef __riscv64_ilp32__
+#undef __riscv64_ilp32__
+#endif
+#ifndef __riscv64_ilp32f__
+#undef __riscv64_ilp32f__
+#endif
+#ifndef __riscv64_ilp32d__
+#undef __riscv64_ilp32d__
+#endif
+#ifndef __riscv64_lp64__
+#undef __riscv64_lp64__
+#endif
+#ifndef __riscv64_lp64f__
+#undef __riscv64_lp64f__
+#endif
+#ifndef __riscv64_lp64d__
+#undef __riscv64_lp64d__
+#endif
+#ifndef __s390__
+#undef __s390__
+#endif
+#ifndef __s390x__
+#undef __s390x__
+#endif
+#ifndef __sh__
+#undef __sh__
+#endif
+#ifndef __sparc__
+#undef __sparc__
+#endif
+#ifndef __sparc64__
+#undef __sparc64__
+#endif
+])
+
+])
+
+
+dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
+dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
+dnl one, or to 'unknown' if unknown.
+dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
+AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
+ [if test -n "$gl_cv_host_cpu_c_abi"; then
+ case "$gl_cv_host_cpu_c_abi" in
+ i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+ gl_cv_host_cpu_c_abi_32bit=yes ;;
+ x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+ gl_cv_host_cpu_c_abi_32bit=no ;;
+ *)
+ gl_cv_host_cpu_c_abi_32bit=unknown ;;
+ esac
+ else
+ case "$host_cpu" in
+
+ # CPUs that only support a 32-bit ABI.
+ arc \
+ | bfin \
+ | cris* \
+ | csky \
+ | epiphany \
+ | ft32 \
+ | h8300 \
+ | m68k \
+ | microblaze | microblazeel \
+ | nds32 | nds32le | nds32be \
+ | nios2 | nios2eb | nios2el \
+ | or1k* \
+ | or32 \
+ | sh | sh[1234] | sh[1234]e[lb] \
+ | tic6x \
+ | xtensa* )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ # CPUs that only support a 64-bit ABI.
+changequote(,)dnl
+ alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+ | mmix )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi_32bit=no
+ ;;
+
+changequote(,)dnl
+ i[34567]86 )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ x86_64 )
+ # On x86_64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+ # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+ # with native Windows (mingw, MSVC).
+ # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (defined __x86_64__ || defined __amd64__ \
+ || defined _M_X64 || defined _M_AMD64) \
+ && !(defined __ILP32__ || defined _ILP32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ arm* | aarch64 )
+ # Assume arm with EABI.
+ # On arm64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+ # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+ # On hppa, the C compiler may be generating 32-bit code or 64-bit
+ # code. In the latter case, it defines _LP64 and __LP64__.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ ia64* )
+ # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+ # 32-bit code. In the latter case, it defines _ILP32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=yes],
+ [gl_cv_host_cpu_c_abi_32bit=no])
+ ;;
+
+ mips* )
+ # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+ # at 32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ powerpc* )
+ # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+ # No need to distinguish them here; the caller may distinguish
+ # them based on the OS.
+ # On powerpc64 systems, the C compiler may still be generating
+ # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+ # be generating 64-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ rs6000 )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ riscv32 | riscv64 )
+ # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+ # Size of 'long' and 'void *':
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ s390* )
+ # On s390x, the C compiler may be generating 64-bit (= s390x) code
+ # or 31-bit (= s390) code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __s390x__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ sparc | sparc64 )
+ # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+ # C compiler still generates 32-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ *)
+ gl_cv_host_cpu_c_abi_32bit=unknown
+ ;;
+ esac
+ fi
+ ])
+
+ HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+])
diff --git a/m4/hostent.m4 b/m4/hostent.m4
index 595a68d0c..641d72fa3 100644
--- a/m4/hostent.m4
+++ b/m4/hostent.m4
@@ -1,5 +1,5 @@
-# hostent.m4 serial 2
-dnl Copyright (C) 2008, 2010-2017 Free Software Foundation, Inc.
+# hostent.m4 serial 3
+dnl Copyright (C) 2008, 2010-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.
@@ -8,7 +8,7 @@ AC_DEFUN([gl_HOSTENT],
[
dnl Where are gethostent(), sethostent(), endhostent(), gethostbyname(),
dnl gethostbyaddr() defined?
- dnl - On Solaris, they are in libnsl. Ignore libxnet.
+ dnl - On Solaris < 11.4, they are in libnsl. Ignore libxnet.
dnl - On Haiku, they are in libnetwork.
dnl - On BeOS, they are in libnet.
dnl - On native Windows, they are in ws2_32.dll.
diff --git a/m4/iconv.m4 b/m4/iconv.m4
index 877d8822d..d0e61de26 100644
--- a/m4/iconv.m4
+++ b/m4/iconv.m4
@@ -1,5 +1,5 @@
-# iconv.m4 serial 21
-dnl Copyright (C) 2000-2002, 2007-2014, 2016-2018 Free Software Foundation,
+# iconv.m4 serial 24
+dnl Copyright (C) 2000-2002, 2007-2014, 2016-2021 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,6 +7,12 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
+AC_PREREQ([2.64])
+
+dnl Note: AM_ICONV is documented in the GNU gettext manual
+dnl <https://www.gnu.org/software/gettext/manual/html_node/AM_005fICONV.html>.
+dnl Don't make changes that are incompatible with that documentation!
+
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
[
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
@@ -86,8 +92,9 @@ AC_DEFUN([AM_ICONV_LINK],
#endif
]],
[[int result = 0;
- /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
- returns. */
+ /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from
+ successful returns. This is even documented in
+ <https://www.ibm.com/support/knowledgecenter/ssw_aix_72/i_bostechref/iconv.html> */
{
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
if (cd_utf8_to_88591 != (iconv_t)(-1))
@@ -225,8 +232,7 @@ AC_DEFUN([AM_ICONV_LINK],
AC_SUBST([LTLIBICONV])
])
-dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
-dnl avoid warnings like
+dnl Define AM_ICONV using AC_DEFUN_ONCE, in order to avoid warnings like
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
dnl This is tricky because of the way 'aclocal' is implemented:
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
@@ -234,54 +240,43 @@ dnl Otherwise aclocal's initial scan pass would miss the macro definition.
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
dnl warnings.
-m4_define([gl_iconv_AC_DEFUN],
- m4_version_prereq([2.64],
- [[AC_DEFUN_ONCE(
- [$1], [$2])]],
- [m4_ifdef([gl_00GNULIB],
- [[AC_DEFUN_ONCE(
- [$1], [$2])]],
- [[AC_DEFUN(
- [$1], [$2])]])]))
-gl_iconv_AC_DEFUN([AM_ICONV],
+AC_DEFUN_ONCE([AM_ICONV],
[
AM_ICONV_LINK
if test "$am_cv_func_iconv" = yes; then
- AC_MSG_CHECKING([for iconv declaration])
- AC_CACHE_VAL([am_cv_proto_iconv], [
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
+ AC_CACHE_CHECK([whether iconv is compatible with its POSIX signature],
+ [gl_cv_iconv_nonconst],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
-#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
-#else
-size_t iconv();
-#endif
- ]],
- [[]])],
- [am_cv_proto_iconv_arg1=""],
- [am_cv_proto_iconv_arg1="const"])
- am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
- am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
- AC_MSG_RESULT([
- $am_cv_proto_iconv])
+ ]],
+ [[]])],
+ [gl_cv_iconv_nonconst=yes],
+ [gl_cv_iconv_nonconst=no])
+ ])
else
dnl When compiling GNU libiconv on a system that does not have iconv yet,
dnl pick the POSIX compliant declaration without 'const'.
- am_cv_proto_iconv_arg1=""
+ gl_cv_iconv_nonconst=yes
+ fi
+ if test $gl_cv_iconv_nonconst = yes; then
+ iconv_arg1=""
+ else
+ iconv_arg1="const"
fi
- AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
+ AC_DEFINE_UNQUOTED([ICONV_CONST], [$iconv_arg1],
[Define as const if the declaration of iconv() needs const.])
dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
m4_ifdef([gl_ICONV_H_DEFAULTS],
[AC_REQUIRE([gl_ICONV_H_DEFAULTS])
- if test -n "$am_cv_proto_iconv_arg1"; then
+ if test $gl_cv_iconv_nonconst != yes; then
ICONV_CONST="const"
fi
])
diff --git a/m4/iconv_h.m4 b/m4/iconv_h.m4
index d4ac24357..ab8e2837a 100644
--- a/m4/iconv_h.m4
+++ b/m4/iconv_h.m4
@@ -1,5 +1,5 @@
-# iconv_h.m4 serial 8
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# iconv_h.m4 serial 12
+dnl Copyright (C) 2007-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.
@@ -11,6 +11,14 @@ AC_DEFUN([gl_ICONV_H],
dnl Execute this unconditionally, because ICONV_H may be set by other
dnl modules, after this code is executed.
gl_CHECK_NEXT_HEADERS([iconv.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, and which is not
+ dnl guaranteed by C89.
+ gl_WARN_ON_USE_PREPARE([[#include <iconv.h>
+ ]], [iconv iconv_open])
+
+ AC_REQUIRE([AC_C_RESTRICT])
])
dnl Unconditionally enables the replacement of <iconv.h>.
@@ -30,6 +38,7 @@ AC_DEFUN([gl_ICONV_MODULE_INDICATOR],
AC_DEFUN([gl_ICONV_H_DEFAULTS],
[
+ m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])])
GNULIB_ICONV=0; AC_SUBST([GNULIB_ICONV])
dnl Assume proper GNU behavior unless another module says otherwise.
ICONV_CONST=; AC_SUBST([ICONV_CONST])
@@ -37,5 +46,12 @@ AC_DEFUN([gl_ICONV_H_DEFAULTS],
REPLACE_ICONV_OPEN=0; AC_SUBST([REPLACE_ICONV_OPEN])
REPLACE_ICONV_UTF=0; AC_SUBST([REPLACE_ICONV_UTF])
ICONV_H=''; AC_SUBST([ICONV_H])
+ m4_ifdef([gl_POSIXCHECK],
+ [ICONV_H='iconv.h'],
+ [if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then
+ dnl Override <fnmatch.h> always, to support the C++ GNULIB_NAMESPACE.
+ ICONV_H='iconv.h'
+ fi
+ ])
AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"])
])
diff --git a/m4/iconv_open-utf.m4 b/m4/iconv_open-utf.m4
index 4a3211cee..68efaf9da 100644
--- a/m4/iconv_open-utf.m4
+++ b/m4/iconv_open-utf.m4
@@ -1,5 +1,5 @@
-# iconv_open-utf.m4 serial 1
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# iconv_open-utf.m4 serial 4
+dnl Copyright (C) 2007-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.
@@ -211,16 +211,18 @@ int main ()
[gl_cv_func_iconv_supports_utf=yes],
[gl_cv_func_iconv_supports_utf=no],
[
- dnl We know that GNU libiconv, GNU libc, and Solaris >= 9 do.
+ dnl We know that GNU libiconv, GNU libc, musl libc, and Solaris >= 9 do.
dnl OSF/1 5.1 has these encodings, but inserts a BOM in the "to"
dnl direction.
- gl_cv_func_iconv_supports_utf=no
+ gl_cv_func_iconv_supports_utf="$gl_cross_guess_normal"
if test $gl_func_iconv_gnu = yes; then
- gl_cv_func_iconv_supports_utf=yes
+ gl_cv_func_iconv_supports_utf="guessing yes"
else
changequote(,)dnl
case "$host_os" in
- solaris2.9 | solaris2.1[0-9]) gl_cv_func_iconv_supports_utf=yes ;;
+ *-musl*) gl_cv_func_iconv_supports_utf="guessing yes" ;;
+ solaris2.9 | solaris2.1[0-9])
+ gl_cv_func_iconv_supports_utf="guessing yes" ;;
esac
changequote([,])dnl
fi
diff --git a/m4/iconv_open.m4 b/m4/iconv_open.m4
index 2517a5bba..61b6af487 100644
--- a/m4/iconv_open.m4
+++ b/m4/iconv_open.m4
@@ -1,5 +1,5 @@
-# iconv_open.m4 serial 14
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# iconv_open.m4 serial 16
+dnl Copyright (C) 2007-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.
@@ -23,11 +23,12 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN],
if test $gl_func_iconv_gnu = no; then
iconv_flavor=
case "$host_os" in
- aix*) iconv_flavor=ICONV_FLAVOR_AIX ;;
- irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;;
- hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;;
- osf*) iconv_flavor=ICONV_FLAVOR_OSF ;;
- solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
+ aix*) iconv_flavor=ICONV_FLAVOR_AIX ;;
+ irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;;
+ hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;;
+ osf*) iconv_flavor=ICONV_FLAVOR_OSF ;;
+ solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
+ openedition*) iconv_flavor=ICONV_FLAVOR_ZOS ;;
esac
if test -n "$iconv_flavor"; then
AC_DEFINE_UNQUOTED([ICONV_FLAVOR], [$iconv_flavor],
@@ -38,13 +39,16 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN],
fi
m4_ifdef([gl_FUNC_ICONV_OPEN_UTF_SUPPORT], [
gl_FUNC_ICONV_OPEN_UTF_SUPPORT
- if test $gl_cv_func_iconv_supports_utf = no; then
- REPLACE_ICONV_UTF=1
- AC_DEFINE([REPLACE_ICONV_UTF], [1],
- [Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.])
- REPLACE_ICONV=1
- gl_REPLACE_ICONV_OPEN
- fi
+ case "$gl_cv_func_iconv_supports_utf" in
+ *yes) ;;
+ *)
+ REPLACE_ICONV_UTF=1
+ AC_DEFINE([REPLACE_ICONV_UTF], [1],
+ [Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.])
+ REPLACE_ICONV=1
+ gl_REPLACE_ICONV_OPEN
+ ;;
+ esac
])
fi
])
diff --git a/m4/include_next.m4 b/m4/include_next.m4
index e687e232a..bdd542bc6 100644
--- a/m4/include_next.m4
+++ b/m4/include_next.m4
@@ -1,12 +1,13 @@
-# include_next.m4 serial 23
-dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
+# include_next.m4 serial 26
+dnl Copyright (C) 2006-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.
dnl From Paul Eggert and Derek Price.
-dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER.
+dnl Sets INCLUDE_NEXT, INCLUDE_NEXT_AS_FIRST_DIRECTIVE, PRAGMA_SYSTEM_HEADER,
+dnl and PRAGMA_COLUMNS.
dnl
dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to
dnl 'include' otherwise.
@@ -105,19 +106,21 @@ dnl We intentionally avoid using AC_LANG_SOURCE here.
AC_SUBST([INCLUDE_NEXT])
AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE])
AC_SUBST([PRAGMA_SYSTEM_HEADER])
- AC_CACHE_CHECK([whether system header files limit the line length],
- [gl_cv_pragma_columns],
- [dnl HP NonStop systems, which define __TANDEM, have this misfeature.
- AC_EGREP_CPP([choke me],
+
+ dnl HP NonStop systems, which define __TANDEM, limit the line length
+ dnl after including some system header files.
+ AC_CACHE_CHECK([whether source code line length is unlimited],
+ [gl_cv_source_line_length_unlimited],
+ [AC_EGREP_CPP([choke me],
[
#ifdef __TANDEM
choke me
#endif
],
- [gl_cv_pragma_columns=yes],
- [gl_cv_pragma_columns=no])
+ [gl_cv_source_line_length_unlimited=no],
+ [gl_cv_source_line_length_unlimited=yes])
])
- if test $gl_cv_pragma_columns = yes; then
+ if test $gl_cv_source_line_length_unlimited = no; then
PRAGMA_COLUMNS="#pragma COLUMNS 10000"
else
PRAGMA_COLUMNS=
@@ -175,42 +178,40 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
[AC_CHECK_HEADERS_ONCE([$1])
])
-dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
-dnl until we can assume autoconf 2.64 or newer.
m4_foreach_w([gl_HEADER_NAME], [$1],
[AS_VAR_PUSHDEF([gl_next_header],
[gl_cv_next_]m4_defn([gl_HEADER_NAME]))
if test $gl_cv_have_include_next = yes; then
- AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
+ AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
else
AC_CACHE_CHECK(
[absolute name of <]m4_defn([gl_HEADER_NAME])[>],
- m4_defn([gl_next_header]),
+ [gl_next_header],
[m4_if([$2], [check],
[AS_VAR_PUSHDEF([gl_header_exists],
[ac_cv_header_]m4_defn([gl_HEADER_NAME]))
- if test AS_VAR_GET(gl_header_exists) = yes; then
+ 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'"'])
+ AS_VAR_SET([gl_next_header], ['"'$gl_header'"'])
m4_if([$2], [check],
[else
- AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
+ AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
fi
])
])
fi
AC_SUBST(
AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
- [AS_VAR_GET(gl_next_header)])
+ [AS_VAR_GET([gl_next_header])])
if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
gl_next_as_first_directive='<'gl_HEADER_NAME'>'
else
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=AS_VAR_GET(gl_next_header)
+ gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
fi
AC_SUBST(
AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
diff --git a/m4/inet_ntop.m4 b/m4/inet_ntop.m4
index f4ac237ce..171f53ee7 100644
--- a/m4/inet_ntop.m4
+++ b/m4/inet_ntop.m4
@@ -1,5 +1,5 @@
-# inet_ntop.m4 serial 19
-dnl Copyright (C) 2005-2006, 2008-2017 Free Software Foundation, Inc.
+# inet_ntop.m4 serial 21
+dnl Copyright (C) 2005-2006, 2008-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.
@@ -16,6 +16,7 @@ AC_DEFUN([gl_FUNC_INET_NTOP],
dnl Most platforms that provide inet_ntop define it in libc.
dnl Solaris 8..10 provide inet_ntop in libnsl instead.
dnl Solaris 2.6..7 provide inet_ntop in libresolv instead.
+ dnl Haiku provides it in -lnetwork.
dnl Native Windows provides it in -lws2_32 instead, with a declaration in
dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl
dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it).
@@ -23,19 +24,20 @@ AC_DEFUN([gl_FUNC_INET_NTOP],
INET_NTOP_LIB=
gl_PREREQ_SYS_H_WINSOCK2
if test $HAVE_WINSOCK2_H = 1; then
+ dnl It needs to be overridden, because the stdcall calling convention
+ dnl is not compliant with POSIX. Set REPLACE_INET_NTOP in order to avoid
+ dnl a name conflict at the linker level, even though the header file
+ dnl <ws2tcpip.h> declares inet_ntop only if _WIN32_WINNT >= 0x0600.
+ REPLACE_INET_NTOP=1
AC_CHECK_DECLS([inet_ntop],,, [[#include <ws2tcpip.h>]])
if test $ac_cv_have_decl_inet_ntop = yes; then
- dnl It needs to be overridden, because the stdcall calling convention
- dnl is not compliant with POSIX.
- REPLACE_INET_NTOP=1
INET_NTOP_LIB="-lws2_32"
else
HAVE_DECL_INET_NTOP=0
- HAVE_INET_NTOP=0
fi
else
gl_save_LIBS=$LIBS
- AC_SEARCH_LIBS([inet_ntop], [nsl resolv], [],
+ AC_SEARCH_LIBS([inet_ntop], [nsl resolv network], [],
[AC_CHECK_FUNCS([inet_ntop])
if test $ac_cv_func_inet_ntop = no; then
HAVE_INET_NTOP=0
diff --git a/m4/inet_pton.m4 b/m4/inet_pton.m4
index 407c29c2c..197917910 100644
--- a/m4/inet_pton.m4
+++ b/m4/inet_pton.m4
@@ -1,5 +1,5 @@
-# inet_pton.m4 serial 17
-dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc.
+# inet_pton.m4 serial 19
+dnl Copyright (C) 2006, 2008-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.
@@ -16,6 +16,7 @@ AC_DEFUN([gl_FUNC_INET_PTON],
dnl Most platforms that provide inet_pton define it in libc.
dnl Solaris 8..10 provide inet_pton in libnsl instead.
dnl Solaris 2.6..7 provide inet_pton in libresolv instead.
+ dnl Haiku provides it in -lnetwork.
dnl Native Windows provides it in -lws2_32 instead, with a declaration in
dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl
dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it).
@@ -23,19 +24,20 @@ AC_DEFUN([gl_FUNC_INET_PTON],
INET_PTON_LIB=
gl_PREREQ_SYS_H_WINSOCK2
if test $HAVE_WINSOCK2_H = 1; then
+ dnl It needs to be overridden, because the stdcall calling convention
+ dnl is not compliant with POSIX. Set REPLACE_INET_PTON in order to avoid
+ dnl a name conflict at the linker level, even though the header file
+ dnl <ws2tcpip.h> declares inet_pton only if _WIN32_WINNT >= 0x0600.
+ REPLACE_INET_PTON=1
AC_CHECK_DECLS([inet_pton],,, [[#include <ws2tcpip.h>]])
if test $ac_cv_have_decl_inet_pton = yes; then
- dnl It needs to be overridden, because the stdcall calling convention
- dnl is not compliant with POSIX.
- REPLACE_INET_PTON=1
INET_PTON_LIB="-lws2_32"
else
HAVE_DECL_INET_PTON=0
- HAVE_INET_PTON=0
fi
else
gl_save_LIBS=$LIBS
- AC_SEARCH_LIBS([inet_pton], [nsl resolv], [],
+ AC_SEARCH_LIBS([inet_pton], [nsl resolv network], [],
[AC_CHECK_FUNCS([inet_pton])
if test $ac_cv_func_inet_pton = no; then
HAVE_INET_PTON=0
diff --git a/m4/intmax_t.m4 b/m4/intmax_t.m4
index ff143e9d8..63c4b415d 100644
--- a/m4/intmax_t.m4
+++ b/m4/intmax_t.m4
@@ -1,5 +1,5 @@
-# intmax_t.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2017 Free Software Foundation,
+# intmax_t.m4 serial 9
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2021 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,
@@ -19,11 +19,7 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T],
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
- test $ac_cv_type_long_long_int = yes \
- && ac_type='long long' \
- || ac_type='long'
- AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
+ AC_DEFINE_UNQUOTED([intmax_t], [long long],
[Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
else
AC_DEFINE([HAVE_INTMAX_T], [1],
@@ -57,11 +53,7 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
AC_DEFINE([HAVE_INTMAX_T], [1],
[Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
else
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
- test $ac_cv_type_long_long_int = yes \
- && ac_type='long long' \
- || ac_type='long'
- AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
+ AC_DEFINE_UNQUOTED([intmax_t], [long long],
[Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
fi
])
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
new file mode 100644
index 000000000..f56e94a88
--- /dev/null
+++ b/m4/inttypes.m4
@@ -0,0 +1,165 @@
+# inttypes.m4 serial 32
+dnl Copyright (C) 2006-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.
+
+dnl From Derek Price, Bruno Haible.
+dnl Test whether <inttypes.h> is supported or must be substituted.
+
+AC_DEFUN([gl_INTTYPES_H],
+[
+ AC_REQUIRE([gl_INTTYPES_INCOMPLETE])
+ gl_INTTYPES_PRI_SCN
+])
+
+AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE],
+[
+ AC_REQUIRE([gl_STDINT_H])
+ AC_CHECK_HEADERS_ONCE([inttypes.h])
+
+ dnl Override <inttypes.h> always, so that the portability warnings work.
+ AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+ gl_CHECK_NEXT_HEADERS([inttypes.h])
+
+ AC_REQUIRE([gl_MULTIARCH])
+
+ 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 <inttypes.h>
+ ]], [imaxabs imaxdiv strtoimax strtoumax])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
+
+# Ensure that the PRI* and SCN* macros are defined appropriately.
+AC_DEFUN([gl_INTTYPES_PRI_SCN],
+[
+ PRIPTR_PREFIX=
+ if test -n "$STDINT_H"; then
+ dnl Using the gnulib <stdint.h>. It defines intptr_t to 'long' or
+ dnl 'long long', depending on _WIN64.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #ifdef _WIN64
+ LLP64
+ #endif
+ ]])
+ ],
+ [PRIPTR_PREFIX='"l"'],
+ [PRIPTR_PREFIX='"ll"'])
+ else
+ dnl Using the system's <stdint.h>.
+ for glpfx in '' l ll I64; do
+ case $glpfx in
+ '') gltype1='int';;
+ l) gltype1='long int';;
+ ll) gltype1='long long int';;
+ I64) gltype1='__int64';;
+ esac
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <stdint.h>
+ extern intptr_t foo;
+ extern $gltype1 foo;]])],
+ [PRIPTR_PREFIX='"'$glpfx'"'])
+ test -n "$PRIPTR_PREFIX" && break
+ done
+ fi
+ AC_SUBST([PRIPTR_PREFIX])
+
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [INT32_MAX_LT_INTMAX_MAX],
+ [defined INT32_MAX && defined INTMAX_MAX],
+ [INT32_MAX < INTMAX_MAX],
+ [sizeof (int) < sizeof (long long int)])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [INT64_MAX_EQ_LONG_MAX],
+ [defined INT64_MAX],
+ [INT64_MAX == LONG_MAX],
+ [sizeof (long long int) == sizeof (long int)])
+ else
+ INT64_MAX_EQ_LONG_MAX=-1
+ fi
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [UINT32_MAX_LT_UINTMAX_MAX],
+ [defined UINT32_MAX && defined UINTMAX_MAX],
+ [UINT32_MAX < UINTMAX_MAX],
+ [sizeof (unsigned int) < sizeof (unsigned long long int)])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [UINT64_MAX_EQ_ULONG_MAX],
+ [defined UINT64_MAX],
+ [UINT64_MAX == ULONG_MAX],
+ [sizeof (unsigned long long int) == sizeof (unsigned long int)])
+ else
+ UINT64_MAX_EQ_ULONG_MAX=-1
+ fi
+])
+
+# Define the symbol $1 to be 1 if the condition is true, 0 otherwise.
+# If $2 is true, the condition is $3; otherwise if long long int is supported
+# approximate the condition with $4; otherwise, assume the condition is false.
+# The condition should work on all C99 platforms; the approximations should be
+# good enough to work on all practical pre-C99 platforms.
+# $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants.
+AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
+[
+ AC_CACHE_CHECK([whether $3],
+ [gl_cv_test_$1],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Work also in C++ mode. */
+ #define __STDC_LIMIT_MACROS 1
+
+ /* Work if build is not clean. */
+ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+
+ #include <limits.h>
+ #if HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
+
+ #if $2
+ #define CONDITION ($3)
+ #else
+ #define CONDITION ($4)
+ #endif
+ int test[CONDITION ? 1 : -1];]])],
+ [gl_cv_test_$1=yes],
+ [gl_cv_test_$1=no])])
+ if test $gl_cv_test_$1 = yes; then
+ $1=1;
+ else
+ $1=0;
+ fi
+ AC_SUBST([$1])
+])
+
+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])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+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])
+ HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
+ HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
+ HAVE_IMAXDIV_T=1; AC_SUBST([HAVE_IMAXDIV_T])
+ REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX])
+ REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX])
+ INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
+ INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX])
+ PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX])
+ UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX])
+ UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX])
+])
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4
index 924030505..672a93e09 100644
--- a/m4/inttypes_h.m4
+++ b/m4/inttypes_h.m4
@@ -1,5 +1,5 @@
# inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-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.
diff --git a/m4/isfinite.m4 b/m4/isfinite.m4
index fab12be86..2b8902d4a 100644
--- a/m4/isfinite.m4
+++ b/m4/isfinite.m4
@@ -1,5 +1,5 @@
-# isfinite.m4 serial 15
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# isfinite.m4 serial 17
+dnl Copyright (C) 2007-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.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_ISFINITE],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
dnl Persuade glibc <math.h> to declare isfinite.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_DECLS([isfinite], , , [[#include <math.h>]])
@@ -25,8 +26,13 @@ AC_DEFUN([gl_ISFINITE],
dnl isfinite(long double) also does not work in this situation.
fi
fi
- if test "$ac_cv_have_decl_isfinite" != yes ||
- test "$ISFINITE_LIBM" = missing; then
+ dnl On Solaris 10, with CC in C++ mode, isfinite is not available although
+ dnl is with cc in C mode. This cannot be worked around by defining
+ dnl _XOPEN_SOURCE=600, because the latter does not work in C++ mode on
+ dnl Solaris 11.0. Therefore use the replacement functions on Solaris.
+ if test "$ac_cv_have_decl_isfinite" != yes \
+ || test "$ISFINITE_LIBM" = missing \
+ || { case "$host_os" in solaris*) true;; *) false;; esac; }; then
REPLACE_ISFINITE=1
dnl No libraries are needed to link lib/isfinite.c.
ISFINITE_LIBM=
@@ -143,7 +149,14 @@ int main ()
#endif
return result;
-}]])], [gl_cv_func_isfinitel_works=yes], [gl_cv_func_isfinitel_works=no],
- [gl_cv_func_isfinitel_works="guessing yes"])
+}]])],
+ [gl_cv_func_isfinitel_works=yes],
+ [gl_cv_func_isfinitel_works=no],
+ [case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_isfinitel_works="guessing no" ;;
+ *) gl_cv_func_isfinitel_works="guessing yes" ;;
+ esac
+ ])
])
])
diff --git a/m4/isinf.m4 b/m4/isinf.m4
index 146529d9d..ad6ef47ce 100644
--- a/m4/isinf.m4
+++ b/m4/isinf.m4
@@ -1,5 +1,5 @@
-# isinf.m4 serial 11
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# isinf.m4 serial 13
+dnl Copyright (C) 2007-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.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_ISINF],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
dnl Persuade glibc <math.h> to declare isinf.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_DECLS([isinf], , ,
@@ -26,8 +27,13 @@ AC_DEFUN([gl_ISINF],
esac
fi
fi
- if test "$ac_cv_have_decl_isinf" != yes ||
- test "$ISINF_LIBM" = missing; then
+ dnl On Solaris 10, with CC in C++ mode, isinf is not available although
+ dnl is with cc in C mode. This cannot be worked around by defining
+ dnl _XOPEN_SOURCE=600, because the latter does not work in C++ mode on
+ dnl Solaris 11.0. Therefore use the replacement functions on Solaris.
+ if test "$ac_cv_have_decl_isinf" != yes \
+ || test "$ISINF_LIBM" = missing \
+ || { case "$host_os" in solaris*) true;; *) false;; esac; }; then
REPLACE_ISINF=1
dnl No libraries are needed to link lib/isinf.c.
ISINF_LIBM=
@@ -150,7 +156,23 @@ int main ()
#endif
return result;
-}]])], [gl_cv_func_isinfl_works=yes], [gl_cv_func_isinfl_works=no],
- [gl_cv_func_isinfl_works="guessing yes"])
+}]])],
+ [gl_cv_func_isinfl_works=yes],
+ [gl_cv_func_isinfl_works=no],
+ [case "$host_os" in
+ mingw*) # Guess yes on mingw, no on MSVC.
+ AC_EGREP_CPP([Known], [
+#ifdef __MINGW32__
+ Known
+#endif
+ ],
+ [gl_cv_func_isinfl_works="guessing yes"],
+ [gl_cv_func_isinfl_works="guessing no"])
+ ;;
+ *)
+ gl_cv_func_isinfl_works="guessing yes"
+ ;;
+ esac
+ ])
])
])
diff --git a/m4/isnan.m4 b/m4/isnan.m4
index 844aac279..e0bc03f98 100644
--- a/m4/isnan.m4
+++ b/m4/isnan.m4
@@ -1,5 +1,5 @@
# isnan.m4 serial 5
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-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.
diff --git a/m4/isnand.m4 b/m4/isnand.m4
index cbe6a38e1..fc79f0b0c 100644
--- a/m4/isnand.m4
+++ b/m4/isnand.m4
@@ -1,5 +1,5 @@
-# isnand.m4 serial 11
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# isnand.m4 serial 12
+dnl Copyright (C) 2007-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.
@@ -58,7 +58,7 @@ AC_DEFUN([gl_HAVE_ISNAND_IN_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
- #if __GNUC__ >= 4
+ #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnand
# define isnand(x) __builtin_isnan ((double)(x))
#elif defined isnan
@@ -81,7 +81,7 @@ AC_DEFUN([gl_HAVE_ISNAND_NO_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
- #if __GNUC__ >= 4
+ #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnand
# define isnand(x) __builtin_isnan ((double)(x))
#else
diff --git a/m4/isnanf.m4 b/m4/isnanf.m4
index 1a0d03e63..d0f6a5623 100644
--- a/m4/isnanf.m4
+++ b/m4/isnanf.m4
@@ -1,5 +1,5 @@
-# isnanf.m4 serial 14
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# isnanf.m4 serial 18
+dnl Copyright (C) 2007-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.
@@ -74,9 +74,9 @@ AC_DEFUN([gl_HAVE_ISNANF_NO_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
- #if __GNUC__ >= 4
+ #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnanf
- # define isnanf(x) __builtin_isnanf ((float)(x))
+ # define isnanf(x) __builtin_isnan ((float)(x))
#elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
@@ -99,9 +99,9 @@ AC_DEFUN([gl_HAVE_ISNANF_IN_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
- #if __GNUC__ >= 4
+ #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnanf
- # define isnanf(x) __builtin_isnanf ((float)(x))
+ # define isnanf(x) __builtin_isnan ((float)(x))
#elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
@@ -127,9 +127,9 @@ AC_DEFUN([gl_ISNANF_WORKS],
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <math.h>
-#if __GNUC__ >= 4
+#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnanf
-# define isnanf(x) __builtin_isnanf ((float)(x))
+# define isnanf(x) __builtin_isnan ((float)(x))
#elif defined isnan
# undef isnanf
# define isnanf(x) isnan ((float)(x))
@@ -169,7 +169,7 @@ int main()
m.value = NaN ();
/* Set the bits below the exponent to 01111...111. */
m.word[0] &= -1U << FLT_EXPBIT0_BIT;
- m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1;
+ m.word[0] |= (1U << (FLT_EXPBIT0_BIT - 1)) - 1;
if (!isnanf (m.value))
result |= 4;
}
@@ -180,8 +180,17 @@ int main()
[gl_cv_func_isnanf_works=yes],
[gl_cv_func_isnanf_works=no],
[case "$host_os" in
- irix* | solaris*) gl_cv_func_isnanf_works="guessing no";;
- *) gl_cv_func_isnanf_works="guessing yes";;
+ irix* | solaris*) gl_cv_func_isnanf_works="guessing no" ;;
+ mingw*) # Guess yes on mingw, no on MSVC.
+ AC_EGREP_CPP([Known], [
+#ifdef __MINGW32__
+ Known
+#endif
+ ],
+ [gl_cv_func_isnanf_works="guessing yes"],
+ [gl_cv_func_isnanf_works="guessing no"])
+ ;;
+ *) gl_cv_func_isnanf_works="guessing yes" ;;
esac
])
])
diff --git a/m4/isnanl.m4 b/m4/isnanl.m4
index a42cfc075..1ef16f5e3 100644
--- a/m4/isnanl.m4
+++ b/m4/isnanl.m4
@@ -1,5 +1,5 @@
-# isnanl.m4 serial 19
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# isnanl.m4 serial 22
+dnl Copyright (C) 2007-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.
@@ -68,9 +68,9 @@ AC_DEFUN([gl_HAVE_ISNANL_NO_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
- #if __GNUC__ >= 4
+ #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnanl
- # define isnanl(x) __builtin_isnanl ((long double)(x))
+ # define isnanl(x) __builtin_isnan ((long double)(x))
#elif defined isnan
# undef isnanl
# define isnanl(x) isnan ((long double)(x))
@@ -93,9 +93,9 @@ AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>
- #if __GNUC__ >= 4
+ #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnanl
- # define isnanl(x) __builtin_isnanl ((long double)(x))
+ # define isnanl(x) __builtin_isnan ((long double)(x))
#elif defined isnan
# undef isnanl
# define isnanl(x) isnan ((long double)(x))
@@ -123,9 +123,9 @@ AC_DEFUN([gl_FUNC_ISNANL_WORKS],
#include <float.h>
#include <limits.h>
#include <math.h>
-#if __GNUC__ >= 4
+#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# undef isnanl
-# define isnanl(x) __builtin_isnanl ((long double)(x))
+# define isnanl(x) __builtin_isnan ((long double)(x))
#elif defined isnan
# undef isnanl
# define isnanl(x) isnan ((long double)(x))
@@ -231,6 +231,18 @@ int main ()
}]])],
[gl_cv_func_isnanl_works=yes],
[gl_cv_func_isnanl_works=no],
- [gl_cv_func_isnanl_works="guessing yes"])
+ [case "$host_os" in
+ mingw*) # Guess yes on mingw, no on MSVC.
+ AC_EGREP_CPP([Known], [
+#ifdef __MINGW32__
+ Known
+#endif
+ ],
+ [gl_cv_func_isnanl_works="guessing yes"],
+ [gl_cv_func_isnanl_works="guessing no"])
+ ;;
+ *) gl_cv_func_isnanl_works="guessing yes" ;;
+ esac
+ ])
])
])
diff --git a/m4/langinfo_h.m4 b/m4/langinfo_h.m4
index ea94b4ed2..950fe20af 100644
--- a/m4/langinfo_h.m4
+++ b/m4/langinfo_h.m4
@@ -1,5 +1,5 @@
-# langinfo_h.m4 serial 7
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# langinfo_h.m4 serial 9
+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.
@@ -17,13 +17,17 @@ AC_DEFUN([gl_LANGINFO_H],
dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS.
HAVE_LANGINFO_CODESET=0
HAVE_LANGINFO_T_FMT_AMPM=0
+ HAVE_LANGINFO_ALTMON=0
HAVE_LANGINFO_ERA=0
HAVE_LANGINFO_YESEXPR=0
AC_CHECK_HEADERS_ONCE([langinfo.h])
if test $ac_cv_header_langinfo_h = yes; then
HAVE_LANGINFO_H=1
- dnl Determine what <langinfo.h> defines. CODESET and ERA etc. are missing
- dnl on OpenBSD 3.8. T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3.
+ dnl Determine what <langinfo.h> defines.
+ dnl CODESET is missing on OpenBSD 3.8.
+ dnl ERA etc. are missing on OpenBSD 6.7.
+ dnl T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3.
+ dnl ALTMON_* are missing on glibc 2.26 and many other systems.
AC_CACHE_CHECK([whether langinfo.h defines CODESET],
[gl_cv_header_langinfo_codeset],
[AC_COMPILE_IFELSE(
@@ -48,6 +52,18 @@ int a = T_FMT_AMPM;
if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then
HAVE_LANGINFO_T_FMT_AMPM=1
fi
+ AC_CACHE_CHECK([whether langinfo.h defines ALTMON_1],
+ [gl_cv_header_langinfo_altmon],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = ALTMON_1;
+]])],
+ [gl_cv_header_langinfo_altmon=yes],
+ [gl_cv_header_langinfo_altmon=no])
+ ])
+ if test $gl_cv_header_langinfo_altmon = yes; then
+ HAVE_LANGINFO_ALTMON=1
+ fi
AC_CACHE_CHECK([whether langinfo.h defines ERA],
[gl_cv_header_langinfo_era],
[AC_COMPILE_IFELSE(
@@ -78,6 +94,7 @@ int a = YESEXPR;
AC_SUBST([HAVE_LANGINFO_H])
AC_SUBST([HAVE_LANGINFO_CODESET])
AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM])
+ AC_SUBST([HAVE_LANGINFO_ALTMON])
AC_SUBST([HAVE_LANGINFO_ERA])
AC_SUBST([HAVE_LANGINFO_YESEXPR])
diff --git a/m4/largefile.m4 b/m4/largefile.m4
index 790f7c0ad..cadb16dc9 100644
--- a/m4/largefile.m4
+++ b/m4/largefile.m4
@@ -1,24 +1,41 @@
# 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-2017 Free Software Foundation, Inc.
+# Copyright 1992-1996, 1998-2021 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.
+# The following macro works around a problem in Autoconf's AC_FUNC_FSEEKO:
+# It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this
+# setting of _LARGEFILE_SOURCE is needed so that <stdio.h> declares fseeko
+# and ftello in C++ mode as well.
+AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_FUNC_FSEEKO
+ case "$host_os" in
+ hpux*)
+ AC_DEFINE([_LARGEFILE_SOURCE], [1],
+ [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).])
+ ;;
+ esac
+])
+
# 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
# -------------------------------
m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
-[@%:@include <sys/types.h>
+[#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1]];[]dnl
@@ -37,7 +54,7 @@ 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([#define $1 $2
$5], [$6])],
[$3=$2; break])
$3=unknown
@@ -56,7 +73,10 @@ rm -rf conftest*[]dnl
# By default, many hosts won't let programs access large files;
# one must use special compiler options to get large-file access to work.
# For more details about this brain damage please see:
-# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html
+# http://www.unix.org/version2/whatsnew/lfs20mar.html
+# Additionally, on Linux file systems with 64-bit inodes a file that happens
+# to have a 64-bit inode number cannot be accessed by 32-bit applications on
+# Linux x86/x86_64. This can occur with file systems such as XFS and NFS.
AC_DEFUN([AC_SYS_LARGEFILE],
[AC_ARG_ENABLE(largefile,
[ --disable-largefile omit support for large files])
@@ -93,9 +113,6 @@ if test "$enable_largefile" != no; then
[Define for large files, on AIX-style hosts.],
[_AC_SYS_LARGEFILE_TEST_INCLUDES])
fi
-
- AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1],
- [Enable large inode numbers on Mac OS X 10.5.])
fi
])# AC_SYS_LARGEFILE
])# m4_version_prereq 2.70
@@ -126,9 +143,24 @@ AC_DEFUN([gl_LARGEFILE],
else
WINDOWS_64_BIT_OFF_T=0
fi
- dnl But all native Windows platforms (including mingw64) have a 32-bit
- dnl st_size member in 'struct stat'.
- WINDOWS_64_BIT_ST_SIZE=1
+ dnl Some mingw versions define, if _FILE_OFFSET_BITS=64, 'struct stat'
+ dnl to 'struct _stat32i64' or 'struct _stat64' (depending on
+ dnl _USE_32BIT_TIME_T), which has a 32-bit st_size member.
+ AC_CACHE_CHECK([for 64-bit st_size], [gl_cv_member_st_size_64],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ struct stat buf;
+ int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
+ ]],
+ [[]])],
+ [gl_cv_member_st_size_64=yes], [gl_cv_member_st_size_64=no])
+ ])
+ if test $gl_cv_member_st_size_64 = no; then
+ WINDOWS_64_BIT_ST_SIZE=1
+ else
+ WINDOWS_64_BIT_ST_SIZE=0
+ fi
;;
*)
dnl Nothing to do on gnulib's side.
diff --git a/m4/ld-version-script.m4 b/m4/ld-version-script.m4
index caccec11b..98126d9af 100644
--- a/m4/ld-version-script.m4
+++ b/m4/ld-version-script.m4
@@ -1,5 +1,5 @@
-# ld-version-script.m4 serial 4
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+# ld-version-script.m4 serial 5
+dnl Copyright (C) 2008-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.
@@ -27,7 +27,7 @@ AC_DEFUN([gl_LD_VERSION_SCRIPT],
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
echo foo >conftest.map
- AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[],
[cat > conftest.map <<EOF
VERS_1 {
@@ -38,7 +38,7 @@ VERS_2 {
global: sym;
} VERS_1;
EOF
- AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[gl_cv_sys_ld_version_script=yes])])
rm -f conftest.map
LDFLAGS=$save_LDFLAGS])
diff --git a/m4/ldexp.m4 b/m4/ldexp.m4
index 151a6777f..cb7ce6422 100644
--- a/m4/ldexp.m4
+++ b/m4/ldexp.m4
@@ -1,5 +1,5 @@
# ldexp.m4 serial 1
-dnl Copyright (C) 2010-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-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.
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
index a7733e47d..aa07cb4bc 100644
--- a/m4/lib-ld.m4
+++ b/m4/lib-ld.m4
@@ -1,5 +1,5 @@
-# lib-ld.m4 serial 6
-dnl Copyright (C) 1996-2003, 2009-2017 Free Software Foundation, Inc.
+# lib-ld.m4 serial 9
+dnl Copyright (C) 1996-2003, 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.
@@ -47,73 +47,122 @@ if test "${PATH_SEPARATOR+set}" != set; then
}
fi
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
+if test -n "$LD"; then
+ AC_MSG_CHECKING([for ld])
+elif test "$GCC" = yes; then
AC_MSG_CHECKING([for ld used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
- while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
-AC_CACHE_VAL([acl_cv_path_LD],
-[if test -z "$LD"; then
- acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$acl_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- acl_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
+if test -n "$LD"; then
+ # Let the user override the test with a path.
+ :
+else
+ AC_CACHE_VAL([acl_cv_path_LD],
+ [
+ acl_cv_path_LD= # Final result of this test
+ ac_prog=ld # Program to search in $PATH
+ if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $acl_output in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
+ while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
+ acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
+ done
+ # Got the pathname. No search in PATH is needed.
+ acl_cv_path_LD="$acl_output"
+ ac_prog=
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
esac
fi
- done
- IFS="$acl_save_ifs"
-else
- acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$acl_cv_path_LD"
+ if test -n "$ac_prog"; then
+ # Search for $ac_prog in $PATH.
+ acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$acl_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_ifs"
+ fi
+ case $host in
+ *-*-aix*)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [# The compiler produces 64-bit code. Add option '-b64' so that the
+ # linker groks 64-bit object files.
+ case "$acl_cv_path_LD " in
+ *" -b64 "*) ;;
+ *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
+ esac
+ ], [])
+ ;;
+ sparc64-*-netbsd*)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [],
+ [# The compiler produces 32-bit code. Add option '-m elf32_sparc'
+ # so that the linker groks 32-bit object files.
+ case "$acl_cv_path_LD " in
+ *" -m elf32_sparc "*) ;;
+ *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
+ esac
+ ])
+ ;;
+ esac
+ ])
+ LD="$acl_cv_path_LD"
+fi
if test -n "$LD"; then
AC_MSG_RESULT([$LD])
else
AC_MSG_RESULT([no])
+ AC_MSG_ERROR([no acceptable ld found in \$PATH])
fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_LIB_PROG_LD_GNU
])
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
index 1ce9a5ab3..787efab2d 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -1,12 +1,12 @@
-# lib-link.m4 serial 26 (gettext-0.18.2)
-dnl Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# lib-link.m4 serial 32
+dnl Copyright (C) 2001-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.
dnl From Bruno Haible.
-AC_PREREQ([2.54])
+AC_PREREQ([2.61])
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
dnl the libraries corresponding to explicit and implicit dependencies.
@@ -124,8 +124,8 @@ dnl acl_hardcode_direct,
dnl acl_hardcode_minus_L.
AC_DEFUN([AC_LIB_RPATH],
[
- dnl Tell automake >= 1.10 to complain if config.rpath is missing.
- m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
+ dnl Complain if config.rpath is missing.
+ AC_REQUIRE_AUX_FILE([config.rpath])
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
@@ -187,17 +187,17 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
- dnl Autoconf >= 2.61 supports dots in --with options.
- pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
+ eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+ eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
])
- AC_ARG_WITH(P_A_C_K[-prefix],
-[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
- --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
+ AC_ARG_WITH(PACK[-prefix],
+[[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
+ --without-]]PACK[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
[
if test "X$withval" = "Xno"; then
use_additional=no
@@ -206,17 +206,23 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
+ eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+ eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
])
else
additional_includedir="$withval/include"
additional_libdir="$withval/$acl_libdirstem"
- if test "$acl_libdirstem2" != "$acl_libdirstem" \
- && ! test -d "$withval/$acl_libdirstem"; then
- additional_libdir="$withval/$acl_libdirstem2"
- fi
+ additional_libdir2="$withval/$acl_libdirstem2"
+ additional_libdir3="$withval/$acl_libdirstem3"
fi
fi
])
+ if test "X$additional_libdir2" = "X$additional_libdir"; then
+ additional_libdir2=
+ fi
+ if test "X$additional_libdir3" = "X$additional_libdir"; then
+ additional_libdir3=
+ fi
dnl Search the library and its dependencies in $additional_libdir and
dnl $LDFLAGS. Using breadth-first-seach.
LIB[]NAME=
@@ -272,48 +278,54 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
shrext=
fi
if test $use_additional = yes; then
- dir="$additional_libdir"
- dnl The same code as in the loop below:
- dnl First look for a shared library.
- if test -n "$acl_shlibext"; then
- if test -f "$dir/$libname$shrext"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext"
- else
- if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
- ver=`(cd "$dir" && \
- for f in "$libname$shrext".*; do echo "$f"; done \
- | sed -e "s,^$libname$shrext\\\\.,," \
- | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
- | sed 1q ) 2>/dev/null`
- if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext.$ver"
+ for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+ if test "X$found_dir" = "X"; then
+ eval dir=\$$additional_libdir_variable
+ if test -n "$dir"; then
+ dnl The same code as in the loop below:
+ dnl First look for a shared library.
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
fi
- else
- eval library_names=\"$acl_library_names_spec\"
- for f in $library_names; do
- if test -f "$dir/$f"; then
+ dnl Then look for a static library.
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
found_dir="$dir"
- found_so="$dir/$f"
- break
+ found_a="$dir/$libname.$acl_libext"
fi
- done
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
fi
fi
- fi
- dnl Then look for a static library.
- if test "X$found_dir" = "X"; then
- if test -f "$dir/$libname.$acl_libext"; then
- found_dir="$dir"
- found_a="$dir/$libname.$acl_libext"
- fi
- fi
- if test "X$found_dir" != "X"; then
- if test -f "$dir/$libname.la"; then
- found_la="$dir/$libname.la"
- fi
- fi
+ done
fi
if test "X$found_dir" = "X"; then
for x in $LDFLAGS $LTLIB[]NAME; do
@@ -323,7 +335,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dir=`echo "X$x" | sed -e 's/^X-L//'`
dnl First look for a shared library.
if test -n "$acl_shlibext"; then
- if test -f "$dir/$libname$shrext"; then
+ if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
found_dir="$dir"
found_so="$dir/$libname$shrext"
else
@@ -333,14 +345,14 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
| sed -e "s,^$libname$shrext\\\\.,," \
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
| sed 1q ) 2>/dev/null`
- if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
found_dir="$dir"
found_so="$dir/$libname$shrext.$ver"
fi
else
eval library_names=\"$acl_library_names_spec\"
for f in $library_names; do
- if test -f "$dir/$f"; then
+ if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
found_dir="$dir"
found_so="$dir/$f"
break
@@ -351,7 +363,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
fi
dnl Then look for a static library.
if test "X$found_dir" = "X"; then
- if test -f "$dir/$libname.$acl_libext"; then
+ if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
found_dir="$dir"
found_a="$dir/$libname.$acl_libext"
fi
@@ -377,7 +389,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl standard /usr/lib.
if test "$enable_rpath" = no \
|| test "X$found_dir" = "X/usr/$acl_libdirstem" \
- || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
dnl No hardcoding is needed.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
@@ -477,6 +490,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
fi
additional_includedir="$basedir/include"
;;
+ */$acl_libdirstem3 | */$acl_libdirstem3/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
esac
if test "X$additional_includedir" != "X"; then
dnl Potentially add $additional_includedir to $INCNAME.
@@ -527,19 +547,21 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
for dep in $dependency_libs; do
case "$dep" in
-L*)
- additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
- dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+ dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME.
dnl But don't add it
dnl 1. if it's the standard /usr/lib,
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
dnl 3. if it's already present in $LDFLAGS or the already
dnl constructed $LIBNAME,
dnl 4. if it doesn't exist as a directory.
- if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
- && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+ if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
haveit=
- if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
- || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+ if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
@@ -550,29 +572,29 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
haveit=
for x in $LDFLAGS $LIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
- if test "X$x" = "X-L$additional_libdir"; then
+ if test "X$x" = "X-L$dependency_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
- if test -d "$additional_libdir"; then
- dnl Really add $additional_libdir to $LIBNAME.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+ if test -d "$dependency_libdir"; then
+ dnl Really add $dependency_libdir to $LIBNAME.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir"
fi
fi
haveit=
for x in $LDFLAGS $LTLIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
- if test "X$x" = "X-L$additional_libdir"; then
+ if test "X$x" = "X-L$dependency_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
- if test -d "$additional_libdir"; then
- dnl Really add $additional_libdir to $LTLIBNAME.
- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+ if test -d "$dependency_libdir"; then
+ dnl Really add $dependency_libdir to $LTLIBNAME.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir"
fi
fi
fi
@@ -609,7 +631,20 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
;;
-l*)
dnl Handle this in the next round.
- names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+ dnl But on GNU systems, ignore -lc options, because
+ dnl - linking with libc is the default anyway,
+ dnl - linking with libc.a may produce an error
+ dnl "/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie"
+ dnl or may produce an executable that always crashes, see
+ dnl <https://lists.gnu.org/archive/html/grep-devel/2020-09/msg00052.html>.
+ dep=`echo "X$dep" | sed -e 's/^X-l//'`
+ if test "X$dep" != Xc \
+ || case $host_os in
+ linux* | gnu* | k*bsd*-gnu) false ;;
+ *) true ;;
+ esac; then
+ names_next_round="$names_next_round $dep"
+ fi
;;
*.la)
dnl Handle this in the next round. Throw away the .la's
@@ -670,7 +705,6 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
done
fi
- popdef([P_A_C_K])
popdef([PACKLIBS])
popdef([PACKUP])
popdef([PACK])
@@ -721,7 +755,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
dir="$next"
dnl No need to hardcode the standard /usr/lib.
if test "X$dir" != "X/usr/$acl_libdirstem" \
- && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+ && test "X$dir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dir" != "X/usr/$acl_libdirstem3"; then
rpathdirs="$rpathdirs $dir"
fi
next=
@@ -731,7 +766,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
-L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
dnl No need to hardcode the standard /usr/lib.
if test "X$dir" != "X/usr/$acl_libdirstem" \
- && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+ && test "X$dir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dir" != "X/usr/$acl_libdirstem3"; then
rpathdirs="$rpathdirs $dir"
fi
next= ;;
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
index 68a0835c6..3c94db0ac 100644
--- a/m4/lib-prefix.m4
+++ b/m4/lib-prefix.m4
@@ -1,18 +1,11 @@
-# lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2017 Free Software Foundation, Inc.
+# lib-prefix.m4 serial 19
+dnl Copyright (C) 2001-2005, 2008-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.
dnl From Bruno Haible.
-dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
-dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
-dnl require excessive bracketing.
-ifdef([AC_HELP_STRING],
-[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
-[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
-
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
dnl to access previously installed libraries. The basic assumption is that
dnl a user will want packages to use other packages he previously installed
@@ -32,9 +25,9 @@ AC_DEFUN([AC_LIB_PREFIX],
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
- AC_LIB_ARG_WITH([lib-prefix],
-[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
- --without-lib-prefix don't search for libraries in includedir and libdir],
+ AC_ARG_WITH([lib-prefix],
+[[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+ --without-lib-prefix don't search for libraries in includedir and libdir]],
[
if test "X$withval" = "Xno"; then
use_additional=no
@@ -154,71 +147,177 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
])
dnl AC_LIB_PREPARE_MULTILIB creates
-dnl - a variable acl_libdirstem, containing the basename of the libdir, either
-dnl "lib" or "lib64" or "lib/64",
-dnl - a variable acl_libdirstem2, as a secondary possible value for
-dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
-dnl "lib/amd64".
+dnl - a function acl_is_expected_elfclass, that tests whether standard input
+dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI,
+dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing
+dnl the basename of the libdir to try in turn, either "lib" or "lib64" or
+dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar.
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
[
- dnl There is no formal standard regarding lib and lib64.
- dnl On glibc systems, the current practice is that on a system supporting
+ dnl There is no formal standard regarding lib, lib32, and lib64.
+ dnl On most glibc systems, the current practice is that on a system supporting
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
- dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
- dnl the compiler's default mode by looking at the compiler's library search
- dnl path. If at least one of its elements ends in /lib64 or points to a
- dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
- dnl Otherwise we use the default, namely "lib".
+ dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on
+ dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go
+ dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib.
+ dnl We determine the compiler's default mode by looking at the compiler's
+ dnl library search path. If at least one of its elements ends in /lib64 or
+ dnl points to a directory whose absolute pathname ends in /lib64, we use that
+ dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default,
+ dnl namely "lib".
dnl On Solaris systems, the current practice is that on a system supporting
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
AC_REQUIRE([AC_CANONICAL_HOST])
- acl_libdirstem=lib
- acl_libdirstem2=
- case "$host_os" in
- solaris*)
- dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
- dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
- dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
- dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
- dnl symlink is missing, so we set acl_libdirstem2 too.
- AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
- [AC_EGREP_CPP([sixtyfour bits], [
-#ifdef _LP64
-sixtyfour bits
-#endif
- ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
- ])
- if test $gl_cv_solaris_64bit = yes; then
- acl_libdirstem=lib/64
- case "$host_cpu" in
- sparc*) acl_libdirstem2=lib/sparcv9 ;;
- i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
- esac
- fi
- ;;
- *)
- searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
- if test -n "$searchpath"; then
- acl_save_IFS="${IFS= }"; IFS=":"
- for searchdir in $searchpath; do
- if test -d "$searchdir"; then
- case "$searchdir" in
- */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
- */../ | */.. )
- # Better ignore directories of this form. They are misleading.
- ;;
- *) searchdir=`cd "$searchdir" && pwd`
- case "$searchdir" in
- */lib64 ) acl_libdirstem=lib64 ;;
- esac ;;
- esac
- fi
- done
- IFS="$acl_save_IFS"
- fi
- ;;
- esac
- test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+ AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
+
+ AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
+ [AC_EGREP_CPP([Extensible Linking Format],
+ [#ifdef __ELF__
+ Extensible Linking Format
+ #endif
+ ],
+ [gl_cv_elf=yes],
+ [gl_cv_elf=no])
+ ])
+ if test $gl_cv_elf = yes; then
+ # Extract the ELF class of a file (5th byte) in decimal.
+ # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
+ if od -A x < /dev/null >/dev/null 2>/dev/null; then
+ # Use POSIX od.
+ func_elfclass ()
+ {
+ od -A n -t d1 -j 4 -N 1
+ }
+ else
+ # Use BSD hexdump.
+ func_elfclass ()
+ {
+ dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
+ echo
+ }
+ fi
+ # Use 'expr', not 'test', to compare the values of func_elfclass, because on
+ # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002,
+ # not 1 or 2.
+changequote(,)dnl
+ case $HOST_CPU_C_ABI_32BIT in
+ yes)
+ # 32-bit ABI.
+ acl_is_expected_elfclass ()
+ {
+ expr "`func_elfclass | sed -e 's/[ ]//g'`" = 1 > /dev/null
+ }
+ ;;
+ no)
+ # 64-bit ABI.
+ acl_is_expected_elfclass ()
+ {
+ expr "`func_elfclass | sed -e 's/[ ]//g'`" = 2 > /dev/null
+ }
+ ;;
+ *)
+ # Unknown.
+ acl_is_expected_elfclass ()
+ {
+ :
+ }
+ ;;
+ esac
+changequote([,])dnl
+ else
+ acl_is_expected_elfclass ()
+ {
+ :
+ }
+ fi
+
+ dnl Allow the user to override the result by setting acl_cv_libdirstems.
+ AC_CACHE_CHECK([for the common suffixes of directories in the library search path],
+ [acl_cv_libdirstems],
+ [dnl Try 'lib' first, because that's the default for libdir in GNU, see
+ dnl <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html>.
+ acl_libdirstem=lib
+ acl_libdirstem2=
+ acl_libdirstem3=
+ case "$host_os" in
+ solaris*)
+ dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
+ dnl <https://docs.oracle.com/cd/E19253-01/816-5138/dev-env/index.html>.
+ dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
+ dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
+ dnl symlink is missing, so we set acl_libdirstem2 too.
+ if test $HOST_CPU_C_ABI_32BIT = no; then
+ acl_libdirstem2=lib/64
+ case "$host_cpu" in
+ sparc*) acl_libdirstem3=lib/sparcv9 ;;
+ i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
+ esac
+ fi
+ ;;
+ *)
+ dnl If $CC generates code for a 32-bit ABI, the libraries are
+ dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64.
+ dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries
+ dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32.
+ dnl Find the compiler's search path. However, non-system compilers
+ dnl sometimes have odd library search paths. But we can't simply invoke
+ dnl '/usr/bin/gcc -print-search-dirs' because that would not take into
+ dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS.
+ searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
+ | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test $HOST_CPU_C_ABI_32BIT != no; then
+ # 32-bit or unknown ABI.
+ if test -d /usr/lib32; then
+ acl_libdirstem2=lib32
+ fi
+ fi
+ if test $HOST_CPU_C_ABI_32BIT != yes; then
+ # 64-bit or unknown ABI.
+ if test -d /usr/lib64; then
+ acl_libdirstem3=lib64
+ fi
+ fi
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
+ */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
+ */../ | */.. )
+ # Better ignore directories of this form. They are misleading.
+ ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib32 ) acl_libdirstem2=lib32 ;;
+ */lib64 ) acl_libdirstem3=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ if test $HOST_CPU_C_ABI_32BIT = yes; then
+ # 32-bit ABI.
+ acl_libdirstem3=
+ fi
+ if test $HOST_CPU_C_ABI_32BIT = no; then
+ # 64-bit ABI.
+ acl_libdirstem2=
+ fi
+ fi
+ ;;
+ esac
+ test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+ test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
+ acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
+ ])
+ dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and
+ dnl acl_libdirstem3.
+changequote(,)dnl
+ acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
+ acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
+ acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
+changequote([,])dnl
])
diff --git a/m4/libunistring.m4 b/m4/libunistring.m4
index 024989693..e3d944793 100644
--- a/m4/libunistring.m4
+++ b/m4/libunistring.m4
@@ -1,9 +1,11 @@
-# libunistring.m4 serial 11
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# libunistring.m4 serial 12
+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_PREREQ([2.64])
+
dnl gl_LIBUNISTRING
dnl Searches for an installed libunistring.
dnl If found, it sets and AC_SUBSTs HAVE_LIBUNISTRING=yes and the LIBUNISTRING
@@ -12,8 +14,8 @@ dnl augments the CPPFLAGS variable, and #defines HAVE_LIBUNISTRING to 1.
dnl Otherwise, it sets and AC_SUBSTs HAVE_LIBUNISTRING=no and LIBUNISTRING and
dnl LTLIBUNISTRING to empty.
-dnl Define gl_LIBUNISTRING using AC_DEFUN_ONCE for Autoconf >= 2.64, in order
-dnl to avoid warnings like
+dnl Define gl_LIBUNISTRING using AC_DEFUN_ONCE, in order dnl to avoid warnings
+dnl like
dnl "warning: AC_REQUIRE: `gl_LIBUNISTRING' was expanded before it was required".
dnl This is tricky because of the way 'aclocal' is implemented:
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
@@ -21,16 +23,7 @@ dnl Otherwise aclocal's initial scan pass would miss the macro definition.
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
dnl warnings.
-m4_define([gl_libunistring_AC_DEFUN],
- m4_version_prereq([2.64],
- [[AC_DEFUN_ONCE(
- [$1], [$2])]],
- [m4_ifdef([gl_00GNULIB],
- [[AC_DEFUN_ONCE(
- [$1], [$2])]],
- [[AC_DEFUN(
- [$1], [$2])]])]))
-gl_libunistring_AC_DEFUN([gl_LIBUNISTRING],
+AC_DEFUN_ONCE([gl_LIBUNISTRING],
[
AC_BEFORE([$0], [gl_LIBUNISTRING_MODULE])
AC_BEFORE([$0], [gl_LIBUNISTRING_LIBHEADER])
diff --git a/m4/limits-h.m4 b/m4/limits-h.m4
index 443f91b4d..70dbb7dcf 100644
--- a/m4/limits-h.m4
+++ b/m4/limits-h.m4
@@ -1,6 +1,6 @@
dnl Check whether limits.h has needed features.
-dnl Copyright 2016-2017 Free Software Foundation, Inc.
+dnl Copyright 2016-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.
@@ -11,14 +11,18 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
[
gl_CHECK_NEXT_HEADERS([limits.h])
- AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.],
+ AC_CACHE_CHECK([whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.],
[gl_cv_header_limits_width],
[AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
- #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
- #endif
- #include <limits.h>
- int ullw = ULLONG_WIDTH;]])],
+ [AC_LANG_PROGRAM(
+ [[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+ #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+ #endif
+ #include <limits.h>
+ long long llm = LLONG_MAX;
+ int wb = WORD_BIT;
+ int ullw = ULLONG_WIDTH;
+ ]])],
[gl_cv_header_limits_width=yes],
[gl_cv_header_limits_width=no])])
if test "$gl_cv_header_limits_width" = yes; then
@@ -29,3 +33,11 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
AC_SUBST([LIMITS_H])
AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
])
+
+dnl Unconditionally enables the replacement of <limits.h>.
+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"])
+])
diff --git a/m4/link.m4 b/m4/link.m4
index 021c30140..55a8a8d13 100644
--- a/m4/link.m4
+++ b/m4/link.m4
@@ -1,5 +1,5 @@
-# link.m4 serial 8
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# link.m4 serial 11
+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.
@@ -39,10 +39,12 @@ AC_DEFUN([gl_FUNC_LINK],
]])],
[gl_cv_func_link_works=yes], [gl_cv_func_link_works=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_link_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_link_works="guessing no" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_link_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_link_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_link_works="$gl_cross_guess_normal" ;;
esac
])
rm -f conftest.a conftest.b conftest.lnk])
diff --git a/m4/localcharset.m4 b/m4/localcharset.m4
index 0c1ff3868..04389fcbd 100644
--- a/m4/localcharset.m4
+++ b/m4/localcharset.m4
@@ -1,5 +1,5 @@
-# localcharset.m4 serial 7
-dnl Copyright (C) 2002, 2004, 2006, 2009-2017 Free Software Foundation, Inc.
+# localcharset.m4 serial 8
+dnl Copyright (C) 2002, 2004, 2006, 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.
@@ -8,10 +8,4 @@ AC_DEFUN([gl_LOCALCHARSET],
[
dnl Prerequisites of lib/localcharset.c.
AC_REQUIRE([AM_LANGINFO_CODESET])
- AC_REQUIRE([gl_FCNTL_O_FLAGS])
- AC_CHECK_DECLS_ONCE([getc_unlocked])
-
- dnl Prerequisites of the lib/Makefile.am snippet.
- AC_REQUIRE([AC_CANONICAL_HOST])
- AC_REQUIRE([gl_GLIBC21])
])
diff --git a/m4/locale-fr.m4 b/m4/locale-fr.m4
index 93d3da7d7..b61df7ec9 100644
--- a/m4/locale-fr.m4
+++ b/m4/locale-fr.m4
@@ -1,5 +1,5 @@
-# locale-fr.m4 serial 17
-dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc.
+# locale-fr.m4 serial 20
+dnl Copyright (C) 2003, 2005-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.
@@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_FR],
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [
- AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <locale.h>
#include <time.h>
#if HAVE_LANGINFO_CODESET
@@ -24,8 +23,14 @@ changequote(,)dnl
struct tm t;
char buf[16];
int main () {
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if defined __BEOS__ || defined __HAIKU__
+ return 1;
+#else
/* Check whether the given locale name is recognized by the system. */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -33,9 +38,9 @@ int main () {
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
return 1;
-#else
+# else
if (setlocale (LC_ALL, "") == NULL) return 1;
-#endif
+# endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@@ -44,35 +49,35 @@ int main () {
some unit tests fail.
On MirBSD 10, when an unsupported locale is specified, setlocale()
succeeds but then nl_langinfo(CODESET) is "UTF-8". */
-#if HAVE_LANGINFO_CODESET
+# if HAVE_LANGINFO_CODESET
{
const char *cs = nl_langinfo (CODESET);
if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
|| strcmp (cs, "UTF-8") == 0)
return 1;
}
-#endif
-#ifdef __CYGWIN__
+# endif
+# ifdef __CYGWIN__
/* On Cygwin, avoid locale names without encoding suffix, because the
locale_charset() function relies on the encoding suffix. Note that
LC_ALL is set on the command line. */
if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
+# endif
/* Check whether in the abbreviation of the second month, the second
character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
one byte long. This excludes the UTF-8 encoding. */
t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
/* Check whether the decimal separator is a comma.
On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
are nl_langinfo(RADIXCHAR) are both ".". */
if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
+# endif
return 0;
+#endif
}
-changequote([,])dnl
- ])])
+ ]])])
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
case "$host_os" in
# Handle native Windows specially, because there setlocale() interprets
@@ -136,8 +141,7 @@ AC_DEFUN([gt_LOCALE_FR_UTF8],
[
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
- AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <locale.h>
#include <time.h>
#if HAVE_LANGINFO_CODESET
@@ -153,7 +157,7 @@ int main () {
variables, and all locales use the UTF-8 encoding. */
#if !(defined __BEOS__ || defined __HAIKU__)
/* Check whether the given locale name is recognized by the system. */
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -199,8 +203,7 @@ int main () {
#endif
return 0;
}
-changequote([,])dnl
- ])])
+ ]])])
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
case "$host_os" in
# Handle native Windows specially, because there setlocale() interprets
diff --git a/m4/locale-ja.m4 b/m4/locale-ja.m4
index c1d1154b9..cd94288cc 100644
--- a/m4/locale-ja.m4
+++ b/m4/locale-ja.m4
@@ -1,5 +1,5 @@
-# locale-ja.m4 serial 12
-dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc.
+# locale-ja.m4 serial 15
+dnl Copyright (C) 2003, 2005-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.
@@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_JA],
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [
- AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <locale.h>
#include <time.h>
#if HAVE_LANGINFO_CODESET
@@ -25,9 +24,14 @@ struct tm t;
char buf[16];
int main ()
{
- const char *p;
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if defined __BEOS__ || defined __HAIKU__
+ return 1;
+#else
/* Check whether the given locale name is recognized by the system. */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -35,9 +39,9 @@ int main ()
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
return 1;
-#else
+# else
if (setlocale (LC_ALL, "") == NULL) return 1;
-#endif
+# endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@@ -46,35 +50,38 @@ int main ()
some unit tests fail.
On MirBSD 10, when an unsupported locale is specified, setlocale()
succeeds but then nl_langinfo(CODESET) is "UTF-8". */
-#if HAVE_LANGINFO_CODESET
+# if HAVE_LANGINFO_CODESET
{
const char *cs = nl_langinfo (CODESET);
if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
|| strcmp (cs, "UTF-8") == 0)
return 1;
}
-#endif
-#ifdef __CYGWIN__
+# endif
+# ifdef __CYGWIN__
/* On Cygwin, avoid locale names without encoding suffix, because the
locale_charset() function relies on the encoding suffix. Note that
LC_ALL is set on the command line. */
if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
+# endif
/* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales
on Cygwin 1.5.x. */
if (MB_CUR_MAX == 1)
return 1;
/* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
This excludes the UTF-8 encoding (except on MirBSD). */
- t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
- if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
- for (p = buf; *p != '\0'; p++)
- if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
- return 1;
+ {
+ const char *p;
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+ for (p = buf; *p != '\0'; p++)
+ if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+ return 1;
+ }
return 0;
+#endif
}
-changequote([,])dnl
- ])])
+ ]])])
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
case "$host_os" in
# Handle native Windows specially, because there setlocale() interprets
diff --git a/m4/locale-zh.m4 b/m4/locale-zh.m4
index 14594182c..1228be828 100644
--- a/m4/locale-zh.m4
+++ b/m4/locale-zh.m4
@@ -1,5 +1,5 @@
-# locale-zh.m4 serial 12
-dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc.
+# locale-zh.m4 serial 15
+dnl Copyright (C) 2003, 2005-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.
@@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_ZH_CN],
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AM_LANGINFO_CODESET])
AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [
- AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
#include <locale.h>
#include <stdlib.h>
#include <time.h>
@@ -26,9 +25,14 @@ struct tm t;
char buf[16];
int main ()
{
- const char *p;
+ /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl
+ imitates locale dependent behaviour by looking at the environment
+ variables, and all locales use the UTF-8 encoding. */
+#if defined __BEOS__ || defined __HAIKU__
+ return 1;
+#else
/* Check whether the given locale name is recognized by the system. */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -36,9 +40,9 @@ int main ()
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
return 1;
-#else
+# else
if (setlocale (LC_ALL, "") == NULL) return 1;
-#endif
+# endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@@ -47,35 +51,38 @@ int main ()
some unit tests fail.
On MirBSD 10, when an unsupported locale is specified, setlocale()
succeeds but then nl_langinfo(CODESET) is "UTF-8". */
-#if HAVE_LANGINFO_CODESET
+# if HAVE_LANGINFO_CODESET
{
const char *cs = nl_langinfo (CODESET);
if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
|| strcmp (cs, "UTF-8") == 0)
return 1;
}
-#endif
-#ifdef __CYGWIN__
+# endif
+# ifdef __CYGWIN__
/* On Cygwin, avoid locale names without encoding suffix, because the
locale_charset() function relies on the encoding suffix. Note that
LC_ALL is set on the command line. */
if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
+# endif
/* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
This excludes the UTF-8 encoding (except on MirBSD). */
- t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
- if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
- for (p = buf; *p != '\0'; p++)
- if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
- return 1;
+ {
+ const char *p;
+ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+ if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+ for (p = buf; *p != '\0'; p++)
+ if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+ return 1;
+ }
/* Check whether a typical GB18030 multibyte sequence is recognized as a
single wide character. This excludes the GB2312 and GBK encodings. */
if (mblen ("\203\062\332\066", 5) != 4)
return 1;
return 0;
+#endif
}
-changequote([,])dnl
- ])])
+ ]])])
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
case "$host_os" in
# Handle native Windows specially, because there setlocale() interprets
diff --git a/m4/locale_h.m4 b/m4/locale_h.m4
index 7426a6528..7b50aa7a8 100644
--- a/m4/locale_h.m4
+++ b/m4/locale_h.m4
@@ -1,5 +1,5 @@
-# locale_h.m4 serial 19
-dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
+# locale_h.m4 serial 25
+dnl Copyright (C) 2007, 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.
@@ -17,7 +17,9 @@ AC_DEFUN([gl_LOCALE_H],
dnl If <stddef.h> is replaced, then <locale.h> must also be replaced.
AC_REQUIRE([gl_STDDEF_H])
- dnl Solaris 11 2011-11 defines the int_p_*, int_n_* members of 'struct lconv'
+ AC_REQUIRE([gl_LOCALE_T])
+
+ dnl Solaris 11.0 defines the int_p_*, int_n_* members of 'struct lconv'
dnl only if _LCONV_C99 is defined.
AC_REQUIRE([AC_CANONICAL_HOST])
case "$host_os" in
@@ -37,34 +39,6 @@ AC_DEFUN([gl_LOCALE_H],
[gl_cv_header_locale_h_posix2001=yes],
[gl_cv_header_locale_h_posix2001=no])])
- dnl Check for <xlocale.h>.
- AC_CHECK_HEADERS_ONCE([xlocale.h])
- if test $ac_cv_header_xlocale_h = yes; then
- HAVE_XLOCALE_H=1
- dnl Check whether use of locale_t requires inclusion of <xlocale.h>,
- dnl e.g. on Mac OS X 10.5. If <locale.h> does not define locale_t by
- dnl itself, we assume that <xlocale.h> will do so.
- AC_CACHE_CHECK([whether locale.h defines locale_t],
- [gl_cv_header_locale_has_locale_t],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <locale.h>
- locale_t x;]],
- [[]])],
- [gl_cv_header_locale_has_locale_t=yes],
- [gl_cv_header_locale_has_locale_t=no])
- ])
- if test $gl_cv_header_locale_has_locale_t = yes; then
- gl_cv_header_locale_h_needs_xlocale_h=no
- else
- gl_cv_header_locale_h_needs_xlocale_h=yes
- fi
- else
- HAVE_XLOCALE_H=0
- gl_cv_header_locale_h_needs_xlocale_h=no
- fi
- AC_SUBST([HAVE_XLOCALE_H])
-
dnl Check whether 'struct lconv' is complete.
dnl Bionic libc's 'struct lconv' is just a dummy.
dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x,
@@ -82,7 +56,20 @@ AC_DEFUN([gl_LOCALE_H],
[gl_cv_sys_struct_lconv_ok=no])
])
if test $gl_cv_sys_struct_lconv_ok = no; then
- REPLACE_STRUCT_LCONV=1
+ dnl On native Windows with MSVC, merely define these member names as macros.
+ dnl This avoids trouble in C++ mode.
+ case "$host_os" in
+ mingw*)
+ AC_EGREP_CPP([Special], [
+#ifdef _MSC_VER
+ Special
+#endif
+ ],
+ [],
+ [REPLACE_STRUCT_LCONV=1])
+ ;;
+ *) REPLACE_STRUCT_LCONV=1 ;;
+ esac
fi
dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK.
@@ -96,7 +83,50 @@ AC_DEFUN([gl_LOCALE_H],
# include <xlocale.h>
#endif
]],
- [setlocale duplocale])
+ [setlocale newlocale duplocale freelocale])
+])
+
+dnl Checks to determine whether the system has the locale_t type,
+dnl and how to obtain it.
+AC_DEFUN([gl_LOCALE_T],
+[
+ dnl Persuade glibc and Solaris <locale.h> to define locale_t.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ dnl Check whether use of locale_t requires inclusion of <xlocale.h>,
+ dnl e.g. on Mac OS X 10.5. If <locale.h> does not define locale_t by
+ dnl itself, we assume that <xlocale.h> will do so.
+ AC_CACHE_CHECK([whether locale.h defines locale_t],
+ [gl_cv_header_locale_has_locale_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ locale_t x;]],
+ [[]])],
+ [gl_cv_header_locale_has_locale_t=yes],
+ [gl_cv_header_locale_has_locale_t=no])
+ ])
+
+ dnl Check for <xlocale.h>.
+ AC_CHECK_HEADERS_ONCE([xlocale.h])
+ if test $ac_cv_header_xlocale_h = yes; then
+ HAVE_XLOCALE_H=1
+ if test $gl_cv_header_locale_has_locale_t = yes; then
+ gl_cv_header_locale_h_needs_xlocale_h=no
+ else
+ gl_cv_header_locale_h_needs_xlocale_h=yes
+ fi
+ HAVE_LOCALE_T=1
+ else
+ HAVE_XLOCALE_H=0
+ gl_cv_header_locale_h_needs_xlocale_h=no
+ if test $gl_cv_header_locale_has_locale_t = yes; then
+ HAVE_LOCALE_T=1
+ else
+ HAVE_LOCALE_T=0
+ fi
+ fi
+ AC_SUBST([HAVE_XLOCALE_H])
])
AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
@@ -110,13 +140,20 @@ AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
AC_DEFUN([gl_LOCALE_H_DEFAULTS],
[
- GNULIB_LOCALECONV=0; AC_SUBST([GNULIB_LOCALECONV])
- GNULIB_SETLOCALE=0; AC_SUBST([GNULIB_SETLOCALE])
- GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE])
+ 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])
+ HAVE_FREELOCALE=1; AC_SUBST([HAVE_FREELOCALE])
REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV])
REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE])
+ REPLACE_NEWLOCALE=0; AC_SUBST([REPLACE_NEWLOCALE])
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/m4/localeconv.m4 b/m4/localeconv.m4
index c287aa526..e29c7c329 100644
--- a/m4/localeconv.m4
+++ b/m4/localeconv.m4
@@ -1,5 +1,5 @@
# localeconv.m4 serial 1
-dnl Copyright (C) 2012-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-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.
diff --git a/m4/log.m4 b/m4/log.m4
index 90dee2403..2c1683c9a 100644
--- a/m4/log.m4
+++ b/m4/log.m4
@@ -1,5 +1,5 @@
-# log.m4 serial 4
-dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# log.m4 serial 11
+dnl Copyright (C) 2011-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.
@@ -46,9 +46,9 @@ numeric_equal (double x, double y)
static double dummy (double x) { return 0; }
int main (int argc, char *argv[])
{
- double (*my_log) (double) = argc ? log : dummy;
+ double (* volatile my_log) (double) = argc ? log : dummy;
/* Test log(negative).
- This test fails on NetBSD 5.1, Solaris 11 2011-11. */
+ This test fails on NetBSD 5.1, Solaris 11.4. */
double y = my_log (-1.0);
if (numeric_equal (y, y))
return 1;
@@ -58,10 +58,14 @@ int main (int argc, char *argv[])
[gl_cv_func_log_ieee=yes],
[gl_cv_func_log_ieee=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_log_ieee="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_log_ieee="guessing no" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_log_ieee="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_log_ieee="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_log_ieee="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_log_ieee="$gl_cross_guess_normal" ;;
esac
])
LIBS="$save_LIBS"
@@ -99,8 +103,10 @@ int main ()
[gl_cv_func_log_works=yes],
[gl_cv_func_log_works=no],
[case "$host_os" in
- osf*) gl_cv_func_log_works="guessing no";;
- *) gl_cv_func_log_works="guessing yes";;
+ osf*) gl_cv_func_log_works="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_log_works="guessing yes" ;;
+ *) gl_cv_func_log_works="guessing yes" ;;
esac
])
])
diff --git a/m4/log1p.m4 b/m4/log1p.m4
index f55ac549e..a1cf0f0de 100644
--- a/m4/log1p.m4
+++ b/m4/log1p.m4
@@ -1,5 +1,5 @@
-# log1p.m4 serial 3
-dnl Copyright (C) 2012-2017 Free Software Foundation, Inc.
+# log1p.m4 serial 8
+dnl Copyright (C) 2012-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.
@@ -41,7 +41,7 @@ AC_DEFUN([gl_FUNC_LOG1P],
static double dummy (double x) { return 0; }
int main (int argc, char *argv[])
{
- double (*my_log1p) (double) = argc ? log1p : dummy;
+ double (* volatile my_log1p) (double) = argc ? log1p : dummy;
/* This test fails on AIX, HP-UX 11. */
double y = my_log1p (minus_zerod);
if (!(y == 0.0) || (signbitd (minus_zerod) && !signbitd (y)))
@@ -52,10 +52,14 @@ int main (int argc, char *argv[])
[gl_cv_func_log1p_ieee=yes],
[gl_cv_func_log1p_ieee=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_log1p_ieee="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_log1p_ieee="guessing no" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_log1p_ieee="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_log1p_ieee="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_log1p_ieee="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_log1p_ieee="$gl_cross_guess_normal" ;;
esac
])
LIBS="$save_LIBS"
diff --git a/m4/longlong.m4 b/m4/longlong.m4
deleted file mode 100644
index 9a3294bc2..000000000
--- a/m4/longlong.m4
+++ /dev/null
@@ -1,113 +0,0 @@
-# longlong.m4 serial 17
-dnl Copyright (C) 1999-2007, 2009-2017 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Paul Eggert.
-
-# Define HAVE_LONG_LONG_INT if 'long long int' works.
-# This fixes a bug in Autoconf 2.61, and can be faster
-# than what's in Autoconf 2.62 through 2.68.
-
-# Note: If the type 'long long int' exists but is only 32 bits large
-# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
-# defined. In this case you can treat 'long long int' like 'long int'.
-
-AC_DEFUN([AC_TYPE_LONG_LONG_INT],
-[
- AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
- AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
- [ac_cv_type_long_long_int=yes
- if test "x${ac_cv_prog_cc_c99-no}" = xno; then
- ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
- if test $ac_cv_type_long_long_int = yes; then
- dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
- dnl If cross compiling, assume the bug is not important, since
- dnl nobody cross compiles for this platform as far as we know.
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[@%:@include <limits.h>
- @%:@ifndef LLONG_MAX
- @%:@ define HALF \
- (1LL << (sizeof (long long int) * CHAR_BIT - 2))
- @%:@ define LLONG_MAX (HALF - 1 + HALF)
- @%:@endif]],
- [[long long int n = 1;
- int i;
- for (i = 0; ; i++)
- {
- long long int m = n << i;
- if (m >> i != n)
- return 1;
- if (LLONG_MAX / 2 < m)
- break;
- }
- return 0;]])],
- [],
- [ac_cv_type_long_long_int=no],
- [:])
- fi
- fi])
- if test $ac_cv_type_long_long_int = yes; then
- AC_DEFINE([HAVE_LONG_LONG_INT], [1],
- [Define to 1 if the system has the type 'long long int'.])
- fi
-])
-
-# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
-# This fixes a bug in Autoconf 2.61, and can be faster
-# than what's in Autoconf 2.62 through 2.68.
-
-# Note: If the type 'unsigned long long int' exists but is only 32 bits
-# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
-# will not be defined. In this case you can treat 'unsigned long long int'
-# like 'unsigned long int'.
-
-AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
-[
- AC_CACHE_CHECK([for unsigned long long int],
- [ac_cv_type_unsigned_long_long_int],
- [ac_cv_type_unsigned_long_long_int=yes
- if test "x${ac_cv_prog_cc_c99-no}" = xno; then
- AC_LINK_IFELSE(
- [_AC_TYPE_LONG_LONG_SNIPPET],
- [],
- [ac_cv_type_unsigned_long_long_int=no])
- fi])
- if test $ac_cv_type_unsigned_long_long_int = yes; then
- AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
- [Define to 1 if the system has the type 'unsigned long long int'.])
- fi
-])
-
-# Expands to a C program that can be used to test for simultaneous support
-# of 'long long' and 'unsigned long long'. We don't want to say that
-# 'long long' is available if 'unsigned long long' is not, or vice versa,
-# because too many programs rely on the symmetry between signed and unsigned
-# integer types (excluding 'bool').
-AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
-[
- AC_LANG_PROGRAM(
- [[/* For now, do not test the preprocessor; as of 2007 there are too many
- implementations with broken preprocessors. Perhaps this can
- be revisited in 2012. In the meantime, code should not expect
- #if to work with literals wider than 32 bits. */
- /* Test literals. */
- long long int ll = 9223372036854775807ll;
- long long int nll = -9223372036854775807LL;
- unsigned long long int ull = 18446744073709551615ULL;
- /* Test constant expressions. */
- typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
- ? 1 : -1)];
- typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
- ? 1 : -1)];
- int i = 63;]],
- [[/* Test availability of runtime routines for shift and division. */
- long long int llmax = 9223372036854775807ll;
- unsigned long long int ullmax = 18446744073709551615ull;
- return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
- | (llmax / ll) | (llmax % ll)
- | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
- | (ullmax / ull) | (ullmax % ull));]])
-])
diff --git a/m4/lstat.m4 b/m4/lstat.m4
index 953c117d8..62e9db29a 100644
--- a/m4/lstat.m4
+++ b/m4/lstat.m4
@@ -1,6 +1,6 @@
-# serial 27
+# serial 33
-# Copyright (C) 1997-2001, 2003-2017 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -10,14 +10,15 @@ dnl From Jim Meyering.
AC_DEFUN([gl_FUNC_LSTAT],
[
+ AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
dnl If lstat does not exist, the replacement <sys/stat.h> does
dnl "#define lstat stat", and lstat.c is a no-op.
AC_CHECK_FUNCS_ONCE([lstat])
if test $ac_cv_func_lstat = yes; then
AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
- case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
- *no)
+ case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
+ solaris* | *no)
REPLACE_LSTAT=1
;;
esac
@@ -33,6 +34,7 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
[
dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it
dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ.
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether lstat correctly handles trailing slash],
[gl_cv_func_lstat_dereferences_slashed_symlink],
[rm -f conftest.sym conftest.file
@@ -51,12 +53,18 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
[gl_cv_func_lstat_dereferences_slashed_symlink=yes],
[gl_cv_func_lstat_dereferences_slashed_symlink=no],
[case "$host_os" in
- *-gnu*)
+ linux-* | linux)
+ # Guess yes on Linux systems.
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+ *-gnu* | gnu*)
# Guess yes on glibc systems.
gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
- *)
- # If we don't know, assume the worst.
+ mingw*)
+ # Guess no on native Windows.
gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
+ *)
+ # If we don't know, obey --enable-cross-guesses.
+ gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;;
esac
])
rm -f conftest.sym conftest.file
diff --git a/m4/malloc.m4 b/m4/malloc.m4
index e1d2ec687..514d19a90 100644
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -1,27 +1,19 @@
-# malloc.m4 serial 15
-dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
+# malloc.m4 serial 21
+dnl Copyright (C) 2007, 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.
-m4_version_prereq([2.70], [] ,[
-
# This is adapted with modifications from upstream Autoconf here:
-# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
+# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
AC_DEFUN([_AC_FUNC_MALLOC_IF],
[
- AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
- AC_CHECK_HEADERS([stdlib.h])
AC_CACHE_CHECK([for GNU libc compatible malloc],
[ac_cv_func_malloc_0_nonnull],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
- [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
- # include <stdlib.h>
- #else
- char *malloc ();
- #endif
+ [[#include <stdlib.h>
]],
[[char *p = malloc (0);
int result = !p;
@@ -32,19 +24,24 @@ 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* | freebsd* | netbsd* | openbsd* \
+ *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
| hpux* | solaris* | cygwin* | mingw*)
- ac_cv_func_malloc_0_nonnull=yes ;;
- # If we don't know, assume the worst.
- *) ac_cv_func_malloc_0_nonnull=no ;;
+ 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
])
])
- AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2])
+ case "$ac_cv_func_malloc_0_nonnull" in
+ *yes)
+ $1
+ ;;
+ *)
+ $2
+ ;;
+ esac
])# _AC_FUNC_MALLOC_IF
-])
-
# gl_FUNC_MALLOC_GNU
# ------------------
# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if
@@ -91,7 +88,7 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[]],
- [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ [[#if defined _WIN32 && ! defined __CYGWIN__
choke me
#endif
]])],
diff --git a/m4/malloca.m4 b/m4/malloca.m4
index 6956baf20..06ed2c6b7 100644
--- a/m4/malloca.m4
+++ b/m4/malloca.m4
@@ -1,5 +1,5 @@
-# malloca.m4 serial 1
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2017 Free Software Foundation,
+# malloca.m4 serial 2
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2021 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,
@@ -11,5 +11,4 @@ AC_DEFUN([gl_MALLOCA],
dnl @ALLOCA@ and @LTALLOCA@.
dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies.
AC_REQUIRE([gl_EEMALLOC])
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
])
diff --git a/m4/math_h.m4 b/m4/math_h.m4
index 6db72ca63..a9ba5e655 100644
--- a/m4/math_h.m4
+++ b/m4/math_h.m4
@@ -1,5 +1,5 @@
-# math_h.m4 serial 115
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# math_h.m4 serial 122
+dnl Copyright (C) 2007-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.
@@ -10,7 +10,7 @@ AC_DEFUN([gl_MATH_H],
gl_CHECK_NEXT_HEADERS([math.h])
AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works],
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
[[/* Solaris 10 has a broken definition of NAN. Other platforms
fail to provide NAN, or provide it only in C99 mode; this
test only needs to fail when NAN is provided but wrong. */
@@ -25,7 +25,7 @@ AC_DEFUN([gl_MATH_H],
REPLACE_NAN=1
fi
AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works],
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
[[/* Solaris 10 has a broken definition of HUGE_VAL. */
double d = HUGE_VAL;
return d == 0;]])],
@@ -159,178 +159,189 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
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])
- HAVE_ASINF=1; AC_SUBST([HAVE_ASINF])
- HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
- HAVE_ATANF=1; AC_SUBST([HAVE_ATANF])
- HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
- HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F])
- HAVE_CBRT=1; AC_SUBST([HAVE_CBRT])
- HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF])
- HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL])
- HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN])
- HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL])
- HAVE_COSF=1; AC_SUBST([HAVE_COSF])
- HAVE_COSL=1; AC_SUBST([HAVE_COSL])
- HAVE_COSHF=1; AC_SUBST([HAVE_COSHF])
- HAVE_EXPF=1; AC_SUBST([HAVE_EXPF])
- HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
- HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1])
- HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F])
- HAVE_FABSF=1; AC_SUBST([HAVE_FABSF])
- HAVE_FABSL=1; AC_SUBST([HAVE_FABSL])
- HAVE_FMA=1; AC_SUBST([HAVE_FMA])
- HAVE_FMAF=1; AC_SUBST([HAVE_FMAF])
- HAVE_FMAL=1; AC_SUBST([HAVE_FMAL])
- HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
- HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
- HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
- HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
- HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
- HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
- HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF])
- HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL])
- HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
- HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
- HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
- HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF])
- HAVE_LOGF=1; AC_SUBST([HAVE_LOGF])
- HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
- HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F])
- HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L])
- HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P])
- HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF])
- HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
- HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
- HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
- HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
- HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
- HAVE_POWF=1; AC_SUBST([HAVE_POWF])
- HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER])
- HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
- HAVE_RINT=1; AC_SUBST([HAVE_RINT])
- HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
- HAVE_SINF=1; AC_SUBST([HAVE_SINF])
- HAVE_SINL=1; AC_SUBST([HAVE_SINL])
- HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
- HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF])
- HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
- HAVE_TANF=1; AC_SUBST([HAVE_TANF])
- HAVE_TANL=1; AC_SUBST([HAVE_TANL])
- HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
- HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
- HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
- HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
- HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF])
- HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL])
- HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF])
- HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL])
- HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF])
- HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
- HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
- HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2])
- HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F])
- HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L])
- HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L])
- HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
- HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
- HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
- HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
- HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
- HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L])
- HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2])
- HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F])
- HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L])
- HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
- HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER])
- HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL])
- HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF])
- HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND])
- HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
- HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
- HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL])
- HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL])
- HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL])
- HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
- HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
- HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
- REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF])
- REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF])
- REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF])
- REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F])
- REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF])
- REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL])
- REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL])
- REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
- REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
- REPLACE_COSF=0; AC_SUBST([REPLACE_COSF])
- REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF])
- REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF])
- REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
- REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
- REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
- REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L])
- REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL])
- REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR])
- REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
- REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
- REPLACE_FMA=0; AC_SUBST([REPLACE_FMA])
- REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF])
- REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL])
- REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD])
- REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF])
- REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL])
- REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
- REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
- REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
- REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
- REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
- REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
- REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL])
- REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB])
- REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF])
- REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
- REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
- REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
- REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
- REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
- REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
- REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL])
- REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10])
- REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F])
- REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L])
- REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P])
- REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF])
- REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL])
- REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2])
- REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F])
- REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L])
- REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB])
- REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF])
- REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL])
- REPLACE_MODF=0; AC_SUBST([REPLACE_MODF])
- REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF])
- REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL])
- REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
- REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER])
- REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF])
- REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL])
- REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
- REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
- REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
- REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
- REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
- REPLACE_SINF=0; AC_SUBST([REPLACE_SINF])
- REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF])
- REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF])
- REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
- REPLACE_TANF=0; AC_SUBST([REPLACE_TANF])
- REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF])
- REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
- REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
- REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
+ HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF])
+ HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL])
+ HAVE_ASINF=1; AC_SUBST([HAVE_ASINF])
+ HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
+ HAVE_ATANF=1; AC_SUBST([HAVE_ATANF])
+ HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
+ HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F])
+ HAVE_CBRT=1; AC_SUBST([HAVE_CBRT])
+ HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF])
+ HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL])
+ HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN])
+ HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL])
+ HAVE_COSF=1; AC_SUBST([HAVE_COSF])
+ HAVE_COSL=1; AC_SUBST([HAVE_COSL])
+ HAVE_COSHF=1; AC_SUBST([HAVE_COSHF])
+ HAVE_EXPF=1; AC_SUBST([HAVE_EXPF])
+ HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
+ HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1])
+ HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F])
+ HAVE_FABSF=1; AC_SUBST([HAVE_FABSF])
+ HAVE_FABSL=1; AC_SUBST([HAVE_FABSL])
+ HAVE_FMA=1; AC_SUBST([HAVE_FMA])
+ HAVE_FMAF=1; AC_SUBST([HAVE_FMAF])
+ HAVE_FMAL=1; AC_SUBST([HAVE_FMAL])
+ HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
+ HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
+ HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
+ HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
+ HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
+ HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
+ HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF])
+ HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL])
+ HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
+ HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
+ HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
+ HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF])
+ HAVE_LOGF=1; AC_SUBST([HAVE_LOGF])
+ HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
+ HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F])
+ HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L])
+ HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P])
+ HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF])
+ HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
+ HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
+ HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
+ HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
+ HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
+ HAVE_POWF=1; AC_SUBST([HAVE_POWF])
+ HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER])
+ HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
+ HAVE_RINT=1; AC_SUBST([HAVE_RINT])
+ HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
+ HAVE_SINF=1; AC_SUBST([HAVE_SINF])
+ HAVE_SINL=1; AC_SUBST([HAVE_SINL])
+ HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
+ HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF])
+ HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
+ HAVE_TANF=1; AC_SUBST([HAVE_TANF])
+ HAVE_TANL=1; AC_SUBST([HAVE_TANL])
+ HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
+ HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
+ HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
+ HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
+ HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF])
+ HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL])
+ HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF])
+ HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL])
+ HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF])
+ HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
+ HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
+ HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2])
+ HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F])
+ HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L])
+ HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L])
+ HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
+ HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
+ HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
+ HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
+ HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
+ HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L])
+ HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2])
+ HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F])
+ HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L])
+ HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
+ HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER])
+ HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL])
+ HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF])
+ HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND])
+ HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
+ HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
+ HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL])
+ HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL])
+ HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL])
+ HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
+ HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
+ HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
+ REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF])
+ REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF])
+ REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF])
+ REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F])
+ REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF])
+ REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL])
+ REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL])
+ REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
+ REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
+ REPLACE_COSF=0; AC_SUBST([REPLACE_COSF])
+ REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF])
+ REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF])
+ REPLACE_EXPL=0; AC_SUBST([REPLACE_EXPL])
+ REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
+ REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
+ REPLACE_EXPM1L=0; AC_SUBST([REPLACE_EXPM1L])
+ REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
+ REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L])
+ REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL])
+ REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR])
+ REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
+ REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
+ REPLACE_FMA=0; AC_SUBST([REPLACE_FMA])
+ REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF])
+ REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL])
+ REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD])
+ REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF])
+ REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL])
+ REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
+ REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
+ REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
+ REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
+ REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
+ REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
+ REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL])
+ REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB])
+ REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF])
+ REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL])
+ REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
+ REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
+ REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
+ REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
+ REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
+ REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
+ REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL])
+ REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10])
+ REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F])
+ REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L])
+ REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P])
+ REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF])
+ REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL])
+ REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2])
+ REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F])
+ REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L])
+ REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB])
+ REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF])
+ REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL])
+ REPLACE_MODF=0; AC_SUBST([REPLACE_MODF])
+ REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF])
+ REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL])
+ REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
+ REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER])
+ REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF])
+ REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL])
+ REPLACE_RINTL=0; AC_SUBST([REPLACE_RINTL])
+ REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
+ REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
+ REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
+ REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
+ REPLACE_SIGNBIT_USING_BUILTINS=0; AC_SUBST([REPLACE_SIGNBIT_USING_BUILTINS])
+ REPLACE_SINF=0; AC_SUBST([REPLACE_SINF])
+ REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF])
+ REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF])
+ REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
+ REPLACE_TANF=0; AC_SUBST([REPLACE_TANF])
+ REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF])
+ REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
+ REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
+ REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
])
# gl_LONG_DOUBLE_VS_DOUBLE
diff --git a/m4/mathfunc.m4 b/m4/mathfunc.m4
index b55ebc772..92b374baa 100644
--- a/m4/mathfunc.m4
+++ b/m4/mathfunc.m4
@@ -1,5 +1,5 @@
-# mathfunc.m4 serial 11
-dnl Copyright (C) 2010-2017 Free Software Foundation, Inc.
+# mathfunc.m4 serial 12
+dnl Copyright (C) 2010-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.
@@ -60,7 +60,7 @@ AC_DEFUN([gl_MATHFUNC],
#endif
#include <math.h>
$4
- $2 (*funcptr) $3 = ]func[;
+ $2 (* volatile funcptr) $3 = ]func[;
int i_ret;
float f_ret;
double d_ret;
@@ -85,7 +85,7 @@ AC_DEFUN([gl_MATHFUNC],
#endif
#include <math.h>
$4
- $2 (*funcptr) $3 = ]func[;
+ $2 (* volatile funcptr) $3 = ]func[;
int i_ret;
float f_ret;
double d_ret;
diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4
index 536183f4f..1d4e73d72 100644
--- a/m4/mbrtowc.m4
+++ b/m4/mbrtowc.m4
@@ -1,5 +1,5 @@
-# mbrtowc.m4 serial 27 -*- coding: utf-8 -*-
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2017 Free Software Foundation,
+# mbrtowc.m4 serial 38 -*- coding: utf-8 -*-
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2021 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,
@@ -8,6 +8,8 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_MBRTOWC],
[
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([gl_PTHREADLIB])
+ AC_CHECK_HEADERS_ONCE([threads.h])
AC_REQUIRE([AC_TYPE_MBSTATE_T])
gl_MBSTATE_T_BROKEN
@@ -16,15 +18,8 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
if test $ac_cv_func_mbrtowc = no; then
HAVE_MBRTOWC=0
AC_CHECK_DECLS([mbrtowc],,, [[
-/* 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>
+ ]])
if test $ac_cv_have_decl_mbrtowc = yes; then
dnl On Minix 3.1.8, the system's <wchar.h> declares mbrtowc() although
dnl it does not have the function. Avoid a collision with gnulib's
@@ -39,6 +34,7 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
gl_MBRTOWC_NULL_ARG2
gl_MBRTOWC_RETVAL
gl_MBRTOWC_NUL_RETVAL
+ gl_MBRTOWC_STORES_INCOMPLETE
gl_MBRTOWC_EMPTY_INPUT
gl_MBRTOWC_C_LOCALE
case "$gl_cv_func_mbrtowc_null_arg1" in
@@ -69,6 +65,13 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
REPLACE_MBRTOWC=1
;;
esac
+ case "$gl_cv_func_mbrtowc_stores_incomplete" in
+ *no) ;;
+ *) AC_DEFINE([MBRTOWC_STORES_INCOMPLETE_BUG], [1],
+ [Define if the mbrtowc function stores a wide character when reporting incomplete input.])
+ REPLACE_MBRTOWC=1
+ ;;
+ esac
case "$gl_cv_func_mbrtowc_empty_input" in
*yes) ;;
*) AC_DEFINE([MBRTOWC_EMPTY_INPUT_BUG], [1],
@@ -77,15 +80,32 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
REPLACE_MBRTOWC=1
;;
esac
- case $gl_cv_C_locale_sans_EILSEQ in
+ case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
*yes) ;;
- *) AC_DEFINE([C_LOCALE_MAYBE_EILSEQ], [1],
- [Define to 1 if the C locale may have encoding errors.])
+ *) AC_DEFINE([MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ], [1],
+ [Define if the mbrtowc function may signal encoding errors in the C locale.])
REPLACE_MBRTOWC=1
;;
esac
fi
fi
+ if test $REPLACE_MBSTATE_T = 1; then
+ case "$host_os" in
+ mingw*) LIB_MBRTOWC= ;;
+ *)
+ gl_WEAK_SYMBOLS
+ case "$gl_cv_have_weak" in
+ *yes) LIB_MBRTOWC= ;;
+ *) LIB_MBRTOWC="$LIBPTHREAD" ;;
+ esac
+ ;;
+ esac
+ else
+ LIB_MBRTOWC=
+ fi
+ dnl LIB_MBRTOWC is expected to be '-pthread' or '-lpthread' on AIX
+ dnl with gcc or xlc, and empty otherwise.
+ AC_SUBST([LIB_MBRTOWC])
])
dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that
@@ -97,11 +117,19 @@ dnl avoid inconsistencies.
AC_DEFUN([gl_MBSTATE_T_BROKEN],
[
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_TYPE_MBSTATE_T])
AC_CHECK_FUNCS_ONCE([mbsinit])
AC_CHECK_FUNCS_ONCE([mbrtowc])
- if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
+ dnl On native Windows, we know exactly how mbsinit() behaves and don't need
+ dnl to override it, even if - like on MSVC - mbsinit() is only defined as
+ dnl an inline function, not as a global function.
+ if case "$host_os" in
+ mingw*) true ;;
+ *) test $ac_cv_func_mbsinit = yes ;;
+ esac \
+ && test $ac_cv_func_mbrtowc = yes; then
gl_MBRTOWC_INCOMPLETE_STATE
gl_MBRTOWC_SANITYCHECK
REPLACE_MBSTATE_T=0
@@ -126,6 +154,7 @@ AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([gt_LOCALE_JA])
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether mbrtowc handles incomplete characters],
[gl_cv_func_mbrtowc_incomplete_state],
@@ -145,13 +174,6 @@ changequote([,])dnl
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
-/* 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>
int main ()
{
@@ -171,6 +193,32 @@ int main ()
[gl_cv_func_mbrtowc_incomplete_state=yes],
[gl_cv_func_mbrtowc_incomplete_state=no],
[:])
+ else
+ if test $LOCALE_FR_UTF8 != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ const char input[] = "B\303\274\303\237er"; /* "Büßer" */
+ mbstate_t state;
+ wchar_t wc;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+ if (mbsinit (&state))
+ return 2;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_incomplete_state=yes],
+ [gl_cv_func_mbrtowc_incomplete_state=no],
+ [:])
+ fi
fi
])
])
@@ -202,13 +250,6 @@ changequote([,])dnl
#include <locale.h>
#include <stdlib.h>
#include <string.h>
-/* 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>
int main ()
{
@@ -262,13 +303,6 @@ changequote([,])dnl
#include <locale.h>
#include <stdlib.h>
#include <string.h>
-/* 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>
int main ()
{
@@ -331,13 +365,6 @@ changequote([,])dnl
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
-/* 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>
int main ()
{
@@ -393,13 +420,6 @@ changequote([,])dnl
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
-/* 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>
int main ()
{
@@ -521,13 +541,6 @@ changequote([,])dnl
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
-/* 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>
int main ()
{
@@ -550,6 +563,112 @@ int main ()
])
])
+dnl Test whether mbrtowc stores a wide character when reporting incomplete
+dnl input.
+
+AC_DEFUN([gl_MBRTOWC_STORES_INCOMPLETE],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether mbrtowc stores incomplete characters],
+ [gl_cv_func_mbrtowc_stores_incomplete],
+ [
+ dnl Initial guess, used when cross-compiling or when no suitable locale
+ dnl is present.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
+ *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
+ esac
+changequote([,])dnl
+ case "$host_os" in
+ mingw*)
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ int result = 0;
+ if (setlocale (LC_ALL, "French_France.65001") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 1;
+ }
+ if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 2;
+ }
+ if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 4;
+ }
+ if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ result |= 8;
+ }
+ return result;
+}]])],
+ [gl_cv_func_mbrtowc_stores_incomplete=no],
+ [gl_cv_func_mbrtowc_stores_incomplete=yes],
+ [:])
+ ;;
+ *)
+ AC_REQUIRE([gt_LOCALE_FR_UTF8])
+ if test $LOCALE_FR_UTF8 != none; then
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+ if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ mbstate_t state;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+ if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
+ && wc != (wchar_t) 0xBADFACE)
+ return 1;
+ }
+ return 0;
+}]])],
+ [gl_cv_func_mbrtowc_stores_incomplete=no],
+ [gl_cv_func_mbrtowc_stores_incomplete=yes],
+ [:])
+ fi
+ ;;
+ esac
+ ])
+])
+
dnl Test whether mbrtowc returns the correct value on empty input.
AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT],
@@ -563,10 +682,11 @@ AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT],
dnl is present.
changequote(,)dnl
case "$host_os" in
- # Guess no on AIX and glibc systems.
- aix* | *-gnu*)
- gl_cv_func_mbrtowc_empty_input="guessing no" ;;
- *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+ # Guess no on AIX and glibc systems.
+ aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+ *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
esac
changequote([,])dnl
AC_RUN_IFELSE(
@@ -592,12 +712,13 @@ dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932
AC_DEFUN([gl_MBRTOWC_C_LOCALE],
[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether the C locale is free of encoding errors],
- [gl_cv_C_locale_sans_EILSEQ],
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ],
[
dnl Initial guess, used when cross-compiling or when no suitable locale
dnl is present.
- gl_cv_C_locale_sans_EILSEQ="guessing no"
+ gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
@@ -620,16 +741,28 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
}
return 0;
]])],
- [gl_cv_C_locale_sans_EILSEQ=yes],
- [gl_cv_C_locale_sans_EILSEQ=no],
- [:])])
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes],
+ [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no],
+ [case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
+ esac
+ ])
+ ])
])
-# Prerequisites of lib/mbrtowc.c.
+# Prerequisites of lib/mbrtowc.c and lib/lc-charset-dispatch.c.
AC_DEFUN([gl_PREREQ_MBRTOWC], [
+ AC_REQUIRE([AC_C_INLINE])
:
])
+# Prerequisites of lib/mbtowc-lock.c.
+AC_DEFUN([gl_PREREQ_MBTOWC_LOCK],
+[
+ gl_VISIBILITY
+])
+
dnl From Paul Eggert
@@ -639,24 +772,17 @@ AC_DEFUN([AC_FUNC_MBRTOWC],
[
dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
- gl_cv_func_mbrtowc,
+ [gl_cv_func_mbrtowc],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
- [[/* 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>]],
[[wchar_t wc;
char const s[] = "";
size_t n = 1;
mbstate_t state;
return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
- gl_cv_func_mbrtowc=yes,
- gl_cv_func_mbrtowc=no)])
+ [gl_cv_func_mbrtowc=yes],
+ [gl_cv_func_mbrtowc=no])])
if test $gl_cv_func_mbrtowc = yes; then
AC_DEFINE([HAVE_MBRTOWC], [1],
[Define to 1 if mbrtowc and mbstate_t are properly declared.])
diff --git a/m4/mbsinit.m4 b/m4/mbsinit.m4
index 5904a5107..dc6e10d7f 100644
--- a/m4/mbsinit.m4
+++ b/m4/mbsinit.m4
@@ -1,5 +1,5 @@
-# mbsinit.m4 serial 8
-dnl Copyright (C) 2008, 2010-2017 Free Software Foundation, Inc.
+# mbsinit.m4 serial 9
+dnl Copyright (C) 2008, 2010-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.
@@ -16,15 +16,8 @@ AC_DEFUN([gl_FUNC_MBSINIT],
if test $ac_cv_func_mbsinit = no; then
HAVE_MBSINIT=0
AC_CHECK_DECLS([mbsinit],,, [[
-/* 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>
+ ]])
if test $ac_cv_have_decl_mbsinit = yes; then
dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although
dnl it does not have the function. Avoid a collision with gnulib's
diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4
index 6325cf3a4..e7fe3580d 100644
--- a/m4/mbstate_t.m4
+++ b/m4/mbstate_t.m4
@@ -1,5 +1,5 @@
-# mbstate_t.m4 serial 13
-dnl Copyright (C) 2000-2002, 2008-2017 Free Software Foundation, Inc.
+# mbstate_t.m4 serial 14
+dnl Copyright (C) 2000-2002, 2008-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.
@@ -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/mbtowc.m4 b/m4/mbtowc.m4
index 378a4e258..7fc74c945 100644
--- a/m4/mbtowc.m4
+++ b/m4/mbtowc.m4
@@ -1,5 +1,5 @@
-# mbtowc.m4 serial 2
-dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# mbtowc.m4 serial 3
+dnl Copyright (C) 2011-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.
@@ -8,8 +8,13 @@ AC_DEFUN([gl_FUNC_MBTOWC],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- if false; then
- REPLACE_MBTOWC=1
+ AC_CHECK_FUNCS([mbtowc])
+ if test $ac_cv_func_mbtowc = no; then
+ HAVE_MBTOWC=0
+ else
+ if false; then
+ REPLACE_MBTOWC=1
+ fi
fi
])
diff --git a/m4/memchr.m4 b/m4/memchr.m4
index b6ec81401..64470ded5 100644
--- a/m4/memchr.m4
+++ b/m4/memchr.m4
@@ -1,35 +1,30 @@
-# memchr.m4 serial 12
-dnl Copyright (C) 2002-2004, 2009-2017 Free Software Foundation, Inc.
+# memchr.m4 serial 17
+dnl Copyright (C) 2002-2004, 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_ONCE([gl_FUNC_MEMCHR],
[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
dnl Check for prerequisites for memory fence checks.
gl_FUNC_MMAP_ANON
AC_CHECK_HEADERS_ONCE([sys/mman.h])
AC_CHECK_FUNCS_ONCE([mprotect])
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [
- dnl These days, we assume memchr is present. But if support for old
- dnl platforms is desired:
- AC_CHECK_FUNCS_ONCE([memchr])
- if test $ac_cv_func_memchr = no; then
- HAVE_MEMCHR=0
- fi
- ])
- if test $HAVE_MEMCHR = 1; then
- # Detect platform-specific bugs in some versions of glibc:
- # memchr should not dereference anything with length 0
- # http://bugzilla.redhat.com/499689
- # memchr should not dereference overestimated length after a match
- # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
- # http://sourceware.org/bugzilla/show_bug.cgi?id=10162
- # Assume that memchr works on platforms that lack mprotect.
- AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ # 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
+ # memchr should not dereference overestimated length after a match
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
+ # https://sourceware.org/bugzilla/show_bug.cgi?id=10162
+ # memchr should cast the second argument to 'unsigned char'.
+ # This bug exists in Android 4.3.
+ # Assume that memchr works on platforms that lack mprotect.
+ AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <string.h>
#if HAVE_SYS_MMAN_H
# include <fcntl.h>
@@ -64,6 +59,7 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
#endif
if (fence)
{
+ /* Test against bugs on glibc systems. */
if (memchr (fence, 0, 0))
result |= 1;
strcpy (fence - 9, "12345678");
@@ -71,15 +67,37 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
result |= 2;
if (memchr (fence - 1, 0, 3) != fence - 1)
result |= 4;
+ /* Test against bug on AIX 7.2. */
+ if (memchr (fence - 4, '6', 16) != fence - 4)
+ result |= 8;
}
+ /* Test against bug on Android 4.3. */
+ {
+ char input[3];
+ input[0] = 'a';
+ input[1] = 'b';
+ input[2] = 'c';
+ if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
+ result |= 16;
+ }
return result;
-]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no],
- [dnl Be pessimistic for now.
- gl_cv_func_memchr_works="guessing no"])])
- if test "$gl_cv_func_memchr_works" != yes; then
- REPLACE_MEMCHR=1
- fi
- fi
+]])],
+ [gl_cv_func_memchr_works=yes],
+ [gl_cv_func_memchr_works=no],
+ [case "$host_os" in
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_memchr_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_memchr_works" in
+ *yes) ;;
+ *) REPLACE_MEMCHR=1 ;;
+ esac
])
# Prerequisites of lib/memchr.c.
diff --git a/m4/mempcpy.m4 b/m4/mempcpy.m4
new file mode 100644
index 000000000..c5ee2af8c
--- /dev/null
+++ b/m4/mempcpy.m4
@@ -0,0 +1,26 @@
+# mempcpy.m4 serial 11
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2021 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,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_MEMPCPY],
+[
+ dnl Persuade glibc <string.h> to declare mempcpy().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl The mempcpy() declaration in lib/string.in.h uses 'restrict'.
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ AC_CHECK_FUNCS([mempcpy])
+ if test $ac_cv_func_mempcpy = no; then
+ HAVE_MEMPCPY=0
+ fi
+])
+
+# Prerequisites of lib/mempcpy.c.
+AC_DEFUN([gl_PREREQ_MEMPCPY], [
+ :
+])
diff --git a/m4/minmax.m4 b/m4/minmax.m4
new file mode 100644
index 000000000..e21a6879a
--- /dev/null
+++ b/m4/minmax.m4
@@ -0,0 +1,44 @@
+# minmax.m4 serial 4
+dnl Copyright (C) 2005, 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_PREREQ([2.53])
+
+AC_DEFUN([gl_MINMAX],
+[
+ AC_REQUIRE([gl_PREREQ_MINMAX])
+])
+
+# Prerequisites of lib/minmax.h.
+AC_DEFUN([gl_PREREQ_MINMAX],
+[
+ gl_MINMAX_IN_HEADER([limits.h])
+ gl_MINMAX_IN_HEADER([sys/param.h])
+])
+
+dnl gl_MINMAX_IN_HEADER(HEADER)
+dnl The parameter has to be a literal header name; it cannot be macro,
+dnl nor a shell variable. (Because autoheader collects only AC_DEFINE
+dnl invocations with a literal macro name.)
+AC_DEFUN([gl_MINMAX_IN_HEADER],
+[
+ m4_pushdef([header], AS_TR_SH([$1]))
+ m4_pushdef([HEADER], AS_TR_CPP([$1]))
+ AC_CACHE_CHECK([whether <$1> defines MIN and MAX],
+ [gl_cv_minmax_in_]header,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <$1>
+ int x = MIN (42, 17);]],
+ [[]])],
+ [gl_cv_minmax_in_]header[=yes],
+ [gl_cv_minmax_in_]header[=no])])
+ if test $gl_cv_minmax_in_[]header = yes; then
+ AC_DEFINE([HAVE_MINMAX_IN_]HEADER, 1,
+ [Define to 1 if <$1> defines the MIN and MAX macros.])
+ fi
+ m4_popdef([HEADER])
+ m4_popdef([header])
+])
diff --git a/m4/mkdir.m4 b/m4/mkdir.m4
index 5eec622ef..031fd291b 100644
--- a/m4/mkdir.m4
+++ b/m4/mkdir.m4
@@ -1,6 +1,6 @@
-# serial 11
+# serial 17
-# Copyright (C) 2001, 2003-2004, 2006, 2008-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003-2004, 2006, 2008-2021 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.
@@ -16,22 +16,34 @@ AC_DEFUN([gl_FUNC_MKDIR],
AC_CACHE_CHECK([whether mkdir handles trailing slash],
[gl_cv_func_mkdir_trailing_slash_works],
[rm -rf conftest.dir
- AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-# include <sys/types.h>
-# include <sys/stat.h>
-]], [return mkdir ("conftest.dir/", 0700);])],
- [gl_cv_func_mkdir_trailing_slash_works=yes],
- [gl_cv_func_mkdir_trailing_slash_works=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_mkdir_trailing_slash_works="guessing no" ;;
- esac
- ])
- rm -rf conftest.dir
- ]
- )
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ ]GL_MDA_DEFINES],
+ [[return mkdir ("conftest.dir/", 0700);]])],
+ [gl_cv_func_mkdir_trailing_slash_works=yes],
+ [gl_cv_func_mkdir_trailing_slash_works=no],
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_mkdir_trailing_slash_works="guessing yes"],
+ [gl_cv_func_mkdir_trailing_slash_works="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -rf conftest.dir
+ ])
case "$gl_cv_func_mkdir_trailing_slash_works" in
*yes) ;;
*)
@@ -42,20 +54,26 @@ AC_DEFUN([gl_FUNC_MKDIR],
AC_CACHE_CHECK([whether mkdir handles trailing dot],
[gl_cv_func_mkdir_trailing_dot_works],
[rm -rf conftest.dir
- AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-# include <sys/types.h>
-# include <sys/stat.h>
-]], [return !mkdir ("conftest.dir/./", 0700);])],
- [gl_cv_func_mkdir_trailing_dot_works=yes],
- [gl_cv_func_mkdir_trailing_dot_works=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
- esac
- ])
- rm -rf conftest.dir
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ ]GL_MDA_DEFINES],
+ [[return !mkdir ("conftest.dir/./", 0700);]])],
+ [gl_cv_func_mkdir_trailing_dot_works=yes],
+ [gl_cv_func_mkdir_trailing_dot_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -rf conftest.dir
]
)
case "$gl_cv_func_mkdir_trailing_dot_works" in
diff --git a/m4/mkostemp.m4 b/m4/mkostemp.m4
index 337f17b5c..46534d48e 100644
--- a/m4/mkostemp.m4
+++ b/m4/mkostemp.m4
@@ -1,5 +1,5 @@
# mkostemp.m4 serial 2
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+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.
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index d594ddc58..245649e77 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,5 +1,5 @@
-# serial 27
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2017 Free Software Foundation,
+# serial 35
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2021 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,
@@ -21,26 +21,26 @@ AC_DEFUN([gl_TIME_T_IS_SIGNED],
fi
])
-AC_DEFUN([gl_FUNC_MKTIME],
+dnl Test whether mktime works. Set gl_cv_func_working_mktime.
+AC_DEFUN([gl_FUNC_MKTIME_WORKS],
[
- AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
AC_REQUIRE([gl_TIME_T_IS_SIGNED])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
dnl We don't use AC_FUNC_MKTIME any more, because it is no longer maintained
dnl in Autoconf and because it invokes AC_LIBOBJ.
AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CHECK_DECLS_ONCE([alarm])
- AC_CHECK_FUNCS_ONCE([tzset])
AC_REQUIRE([gl_MULTIARCH])
- if test $APPLE_UNIVERSAL_BUILD = 1; then
- # A universal build on Apple Mac OS X platforms.
- # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
- # But we need a configuration result that is valid in both modes.
- gl_cv_func_working_mktime=no
- fi
AC_CACHE_CHECK([for working mktime], [gl_cv_func_working_mktime],
- [AC_RUN_IFELSE(
- [AC_LANG_SOURCE(
+ [if test $APPLE_UNIVERSAL_BUILD = 1; then
+ # A universal build on Apple Mac OS X platforms.
+ # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
+ # But we need a configuration result that is valid in both modes.
+ gl_cv_func_working_mktime="guessing no"
+ else
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
[[/* Test program from Paul Eggert and Tony Leneis. */
#include <limits.h>
#include <stdlib.h>
@@ -54,8 +54,11 @@ AC_DEFUN([gl_FUNC_MKTIME],
# include <signal.h>
#endif
-/* Work around redefinition to rpl_putenv by other config tests. */
-#undef putenv
+]GL_MDA_DEFINES[
+
+#ifndef TIME_T_IS_SIGNED
+# define TIME_T_IS_SIGNED 0
+#endif
static time_t time_t_max;
static time_t time_t_min;
@@ -237,31 +240,58 @@ main ()
result |= 64;
return result;
}]])],
- [gl_cv_func_working_mktime=yes],
- [gl_cv_func_working_mktime=no],
- [gl_cv_func_working_mktime=no])
+ [gl_cv_func_working_mktime=yes],
+ [gl_cv_func_working_mktime=no],
+ [case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_working_mktime="guessing no" ;;
+ *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ fi
])
+])
- if test $gl_cv_func_working_mktime = no; then
+dnl Main macro of module 'mktime'.
+AC_DEFUN([gl_FUNC_MKTIME],
+[
+ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
+
+ REPLACE_MKTIME=0
+ if test "$gl_cv_func_working_mktime" != yes; then
REPLACE_MKTIME=1
- else
- REPLACE_MKTIME=0
+ AC_DEFINE([NEED_MKTIME_WORKING], [1],
+ [Define if the compilation of mktime.c should define 'mktime'
+ with the algorithmic workarounds.])
fi
+ case "$host_os" in
+ mingw*)
+ REPLACE_MKTIME=1
+ AC_DEFINE([NEED_MKTIME_WINDOWS], [1],
+ [Define if the compilation of mktime.c should define 'mktime'
+ with the native Windows TZ workaround.])
+ ;;
+ esac
])
+dnl Main macro of module 'mktime-internal'.
AC_DEFUN([gl_FUNC_MKTIME_INTERNAL], [
- AC_REQUIRE([gl_FUNC_MKTIME])
- if test $REPLACE_MKTIME = 0; then
- dnl BeOS has __mktime_internal in libc, but other platforms don't.
- AC_CHECK_FUNC([__mktime_internal],
- [AC_DEFINE([mktime_internal], [__mktime_internal],
- [Define to the real name of the mktime_internal function.])
- ],
- [dnl mktime works but it doesn't export __mktime_internal,
- dnl so we need to substitute our own mktime implementation.
- REPLACE_MKTIME=1
- ])
- fi
+ AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
+
+ WANT_MKTIME_INTERNAL=0
+ dnl BeOS has __mktime_internal in libc, but other platforms don't.
+ AC_CHECK_FUNC([__mktime_internal],
+ [AC_DEFINE([mktime_internal], [__mktime_internal],
+ [Define to the real name of the mktime_internal function.])
+ ],
+ [dnl mktime works but it doesn't export __mktime_internal,
+ dnl so we need to substitute our own mktime implementation.
+ WANT_MKTIME_INTERNAL=1
+ AC_DEFINE([NEED_MKTIME_INTERNAL], [1],
+ [Define if the compilation of mktime.c should define 'mktime_internal'.])
+ ])
])
# Prerequisites of lib/mktime.c.
diff --git a/m4/mmap-anon.m4 b/m4/mmap-anon.m4
index 263687d1a..e47aa2d2f 100644
--- a/m4/mmap-anon.m4
+++ b/m4/mmap-anon.m4
@@ -1,5 +1,5 @@
-# mmap-anon.m4 serial 10
-dnl Copyright (C) 2005, 2007, 2009-2017 Free Software Foundation, Inc.
+# mmap-anon.m4 serial 12
+dnl Copyright (C) 2005, 2007, 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.
@@ -9,11 +9,11 @@ dnl with or without modifications, as long as this notice is preserved.
# - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS
# and MAP_ANON exist and have the same value.
# - On HP-UX, only MAP_ANONYMOUS exists.
-# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
+# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, only MAP_ANON exists.
# - 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 <sys/mman.h> to define MAP_ANONYMOUS.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
diff --git a/m4/mode_t.m4 b/m4/mode_t.m4
index 75d372a4a..3bd4b89fe 100644
--- a/m4/mode_t.m4
+++ b/m4/mode_t.m4
@@ -1,5 +1,5 @@
# mode_t.m4 serial 2
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+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.
diff --git a/m4/msvc-inval.m4 b/m4/msvc-inval.m4
index 332437511..3ba5b4e98 100644
--- a/m4/msvc-inval.m4
+++ b/m4/msvc-inval.m4
@@ -1,5 +1,5 @@
# msvc-inval.m4 serial 1
-dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-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.
diff --git a/m4/msvc-nothrow.m4 b/m4/msvc-nothrow.m4
index 3014661f0..aae25ce7c 100644
--- a/m4/msvc-nothrow.m4
+++ b/m4/msvc-nothrow.m4
@@ -1,5 +1,5 @@
# msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-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.
diff --git a/m4/multiarch.m4 b/m4/multiarch.m4
index 30006cb33..f1678d9f6 100644
--- a/m4/multiarch.m4
+++ b/m4/multiarch.m4
@@ -1,5 +1,5 @@
-# multiarch.m4 serial 7
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+# multiarch.m4 serial 9
+dnl Copyright (C) 2008-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.
@@ -21,37 +21,40 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN_ONCE([gl_MULTIARCH],
[
dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
- gl_cv_c_multiarch=no
- AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#ifndef __APPLE_CC__
- not a universal capable compiler
- #endif
- typedef int dummy;
- ]])],
- [
- dnl Check for potential -arch flags. It is not universal unless
- dnl there are at least two -arch flags with different values.
- arch=
- prev=
- for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
- if test -n "$prev"; then
- case $word in
- i?86 | x86_64 | ppc | ppc64)
- if test -z "$arch" || test "$arch" = "$word"; then
- arch="$word"
- else
- gl_cv_c_multiarch=yes
- fi
- ;;
- esac
- prev=
- else
- if test "x$word" = "x-arch"; then
- prev=arch
- fi
- fi
- done
+ AC_CACHE_CHECK([whether the compiler produces multi-arch binaries],
+ [gl_cv_c_multiarch],
+ [gl_cv_c_multiarch=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+ ]])],
+ [
+ dnl Check for potential -arch flags. It is not universal unless
+ dnl there are at least two -arch flags with different values.
+ arch=
+ prev=
+ for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+ if test -n "$prev"; then
+ case $word in
+ i?86 | x86_64 | ppc | ppc64 | arm | arm64)
+ if test -z "$arch" || test "$arch" = "$word"; then
+ arch="$word"
+ else
+ gl_cv_c_multiarch=yes
+ fi
+ ;;
+ esac
+ prev=
+ else
+ if test "x$word" = "x-arch"; then
+ prev=arch
+ fi
+ fi
+ done
+ ])
])
if test $gl_cv_c_multiarch = yes; then
APPLE_UNIVERSAL_BUILD=1
diff --git a/m4/netdb_h.m4 b/m4/netdb_h.m4
index 3a34d2536..db84c787e 100644
--- a/m4/netdb_h.m4
+++ b/m4/netdb_h.m4
@@ -1,5 +1,5 @@
-# netdb_h.m4 serial 11
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+# netdb_h.m4 serial 12
+dnl Copyright (C) 2008-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.
@@ -40,4 +40,5 @@ AC_DEFUN([gl_NETDB_H_DEFAULTS],
HAVE_DECL_GETADDRINFO=1; AC_SUBST([HAVE_DECL_GETADDRINFO])
HAVE_DECL_GETNAMEINFO=1; AC_SUBST([HAVE_DECL_GETNAMEINFO])
REPLACE_GAI_STRERROR=0; AC_SUBST([REPLACE_GAI_STRERROR])
+ REPLACE_GETADDRINFO=0; AC_SUBST([REPLACE_GETADDRINFO])
])
diff --git a/m4/netinet_in_h.m4 b/m4/netinet_in_h.m4
index f93665702..c55559643 100644
--- a/m4/netinet_in_h.m4
+++ b/m4/netinet_in_h.m4
@@ -1,5 +1,5 @@
# netinet_in_h.m4 serial 5
-dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-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.
diff --git a/m4/nl_langinfo.m4 b/m4/nl_langinfo.m4
index 16de8de30..6ad32c807 100644
--- a/m4/nl_langinfo.m4
+++ b/m4/nl_langinfo.m4
@@ -1,5 +1,5 @@
-# nl_langinfo.m4 serial 5
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# nl_langinfo.m4 serial 8
+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.
@@ -9,7 +9,10 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
AC_REQUIRE([gl_LANGINFO_H])
AC_CHECK_FUNCS_ONCE([nl_langinfo])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
+ AC_REQUIRE([gl_PTHREADLIB])
+ AC_CHECK_HEADERS_ONCE([threads.h])
if test $ac_cv_func_nl_langinfo = yes; then
# On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
AC_CACHE_CHECK([whether YESEXPR works],
@@ -36,8 +39,19 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS],
[$FUNC_NL_LANGINFO_YESEXPR_WORKS],
[Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.])
- if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \
- && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then
+ # On Solaris 10 and Solaris 11.3, nl_langinfo is not multithread-safe.
+ case "$host_os" in
+ solaris*) NL_LANGINFO_MTSAFE=0 ;;
+ *) NL_LANGINFO_MTSAFE=1 ;;
+ esac
+ AC_DEFINE_UNQUOTED([NL_LANGINFO_MTSAFE], [$NL_LANGINFO_MTSAFE],
+ [Define to 1 if nl_langinfo is multithread-safe.])
+ if test $HAVE_LANGINFO_CODESET = 1 \
+ && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \
+ && test $HAVE_LANGINFO_ALTMON = 1 \
+ && test $HAVE_LANGINFO_ERA = 1 \
+ && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1 \
+ && test $NL_LANGINFO_MTSAFE = 1; then
:
else
REPLACE_NL_LANGINFO=1
@@ -47,4 +61,17 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
else
HAVE_NL_LANGINFO=0
fi
+ if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then
+ LIB_NL_LANGINFO="$LIB_SETLOCALE_NULL"
+ else
+ LIB_NL_LANGINFO=
+ fi
+ dnl LIB_NL_LANGINFO is expected to be empty everywhere.
+ AC_SUBST([LIB_NL_LANGINFO])
+])
+
+# Prerequisites of lib/nl_langinfo-lock.c.
+AC_DEFUN([gl_PREREQ_NL_LANGINFO_LOCK],
+[
+ gl_VISIBILITY
])
diff --git a/m4/nocrash.m4 b/m4/nocrash.m4
index 2c2c5fb45..27412cd2e 100644
--- a/m4/nocrash.m4
+++ b/m4/nocrash.m4
@@ -1,5 +1,5 @@
-# nocrash.m4 serial 4
-dnl Copyright (C) 2005, 2009-2017 Free Software Foundation, Inc.
+# nocrash.m4 serial 5
+dnl Copyright (C) 2005, 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.
@@ -53,7 +53,7 @@ nocrash_init (void)
/* Allocate a port on which the thread shall listen for exceptions. */
if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
== KERN_SUCCESS) {
- /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
+ /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
if (mach_port_insert_right (self, our_exception_port, our_exception_port,
MACH_MSG_TYPE_MAKE_SEND)
== KERN_SUCCESS) {
@@ -72,14 +72,14 @@ nocrash_init (void)
for a particular thread. This has the effect that when our exception
port gets the message, the thread specific exception port has already
been asked, and we don't need to bother about it.
- See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
+ See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
task_set_exception_ports (self, mask, our_exception_port,
EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
}
}
}
}
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
/* Avoid a crash on native Windows. */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
diff --git a/m4/nproc.m4 b/m4/nproc.m4
index e1ca5b397..887c66bee 100644
--- a/m4/nproc.m4
+++ b/m4/nproc.m4
@@ -1,5 +1,5 @@
# nproc.m4 serial 5
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+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.
diff --git a/m4/strftime.m4 b/m4/nstrftime.m4
index 3a5db9b4e..b510554b9 100644
--- a/m4/strftime.m4
+++ b/m4/nstrftime.m4
@@ -1,6 +1,6 @@
-# serial 33
+# serial 37
-# Copyright (C) 1996-1997, 1999-2007, 2009-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-1997, 1999-2007, 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -10,19 +10,13 @@
AC_DEFUN([gl_FUNC_GNU_STRFTIME],
[
- gl_FUNC_STRFTIME
-])
+ AC_REQUIRE([AC_C_RESTRICT])
-# These are the prerequisite macros for GNU's strftime.c replacement.
-AC_DEFUN([gl_FUNC_STRFTIME],
-[
- # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
+ # This defines (or not) HAVE_TZNAME and HAVE_STRUCT_TM_TM_ZONE.
AC_REQUIRE([AC_STRUCT_TIMEZONE])
AC_REQUIRE([gl_TM_GMTOFF])
- AC_CHECK_FUNCS_ONCE([tzset])
-
AC_DEFINE([my_strftime], [nstrftime],
[Define to the name of the strftime replacement function.])
])
diff --git a/m4/off_t.m4 b/m4/off_t.m4
index 92c45ef78..bdec43c80 100644
--- a/m4/off_t.m4
+++ b/m4/off_t.m4
@@ -1,5 +1,5 @@
# off_t.m4 serial 1
-dnl Copyright (C) 2012-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-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.
diff --git a/m4/open-cloexec.m4 b/m4/open-cloexec.m4
new file mode 100644
index 000000000..542a90f42
--- /dev/null
+++ b/m4/open-cloexec.m4
@@ -0,0 +1,21 @@
+# Test whether O_CLOEXEC is defined.
+
+dnl Copyright 2017-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_PREPROC_O_CLOEXEC],
+[
+ AC_CACHE_CHECK([for O_CLOEXEC],
+ [gl_cv_macro_O_CLOEXEC],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <fcntl.h>
+ #ifndef O_CLOEXEC
+ choke me;
+ #endif
+ ]],
+ [[return O_CLOEXEC;]])],
+ [gl_cv_macro_O_CLOEXEC=yes],
+ [gl_cv_macro_O_CLOEXEC=no])])
+])
diff --git a/m4/open-slash.m4 b/m4/open-slash.m4
new file mode 100644
index 000000000..e619039e8
--- /dev/null
+++ b/m4/open-slash.m4
@@ -0,0 +1,60 @@
+# open-slash.m4 serial 2
+dnl Copyright (C) 2007-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.
+
+dnl Tests whether open() and creat() recognize a trailing slash.
+dnl Sets gl_cv_func_open_slash.
+AC_DEFUN([gl_OPEN_TRAILING_SLASH_BUG],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ dnl open("foo/") should not create a file when the file name has a
+ dnl trailing slash. FreeBSD only has the problem on symlinks.
+ AC_CHECK_FUNCS_ONCE([lstat])
+ AC_CACHE_CHECK([whether open recognizes a trailing slash],
+ [gl_cv_func_open_slash],
+ [# Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ touch conftest.tmp
+ ln -s conftest.tmp conftest.lnk
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <fcntl.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+]GL_MDA_DEFINES[
+int main ()
+{
+ int result = 0;
+#if HAVE_LSTAT
+ if (open ("conftest.lnk/", O_RDONLY) != -1)
+ result |= 1;
+#endif
+ if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
+ result |= 2;
+ return result;
+}]])],
+ [gl_cv_func_open_slash=yes],
+ [gl_cv_func_open_slash=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+ gl_cv_func_open_slash="guessing no" ;;
+ *)
+ gl_cv_func_open_slash="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ rm -f conftest.sl conftest.tmp conftest.lnk
+ ])
+ case "$gl_cv_func_open_slash" in
+ *no)
+ AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
+ [Define to 1 if open() fails to recognize a trailing slash.])
+ ;;
+ esac
+])
diff --git a/m4/open.m4 b/m4/open.m4
index 2a869dc6b..c63438650 100644
--- a/m4/open.m4
+++ b/m4/open.m4
@@ -1,5 +1,5 @@
-# open.m4 serial 14
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# open.m4 serial 15
+dnl Copyright (C) 2007-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.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_OPEN],
[
AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_PREPROC_O_CLOEXEC])
case "$host_os" in
mingw* | pw*)
REPLACE_OPEN=1
@@ -15,48 +16,12 @@ AC_DEFUN([gl_FUNC_OPEN],
dnl open("foo/") should not create a file when the file name has a
dnl trailing slash. FreeBSD only has the problem on symlinks.
AC_CHECK_FUNCS_ONCE([lstat])
- AC_CACHE_CHECK([whether open recognizes a trailing slash],
- [gl_cv_func_open_slash],
- [# Assume that if we have lstat, we can also check symlinks.
- if test $ac_cv_func_lstat = yes; then
- touch conftest.tmp
- ln -s conftest.tmp conftest.lnk
- fi
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <fcntl.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-int main ()
-{
- int result = 0;
-#if HAVE_LSTAT
- if (open ("conftest.lnk/", O_RDONLY) != -1)
- result |= 1;
-#endif
- if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
- result |= 2;
- return result;
-}]])],
- [gl_cv_func_open_slash=yes],
- [gl_cv_func_open_slash=no],
- [
-changequote(,)dnl
- case "$host_os" in
- freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
- gl_cv_func_open_slash="guessing no" ;;
- *)
- gl_cv_func_open_slash="guessing yes" ;;
- esac
-changequote([,])dnl
- ])
- rm -f conftest.sl conftest.tmp conftest.lnk
- ])
+ if test "$gl_cv_macro_O_CLOEXEC" != yes; then
+ REPLACE_OPEN=1
+ fi
+ gl_OPEN_TRAILING_SLASH_BUG
case "$gl_cv_func_open_slash" in
*no)
- AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
- [Define to 1 if open() fails to recognize a trailing slash.])
REPLACE_OPEN=1
;;
esac
diff --git a/m4/pathmax.m4 b/m4/pathmax.m4
index c6c9f24d0..e67c65665 100644
--- a/m4/pathmax.m4
+++ b/m4/pathmax.m4
@@ -1,5 +1,5 @@
-# pathmax.m4 serial 10
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2017 Free Software Foundation,
+# pathmax.m4 serial 11
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2021 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,
@@ -29,7 +29,7 @@ AC_DEFUN([gl_PATHMAX_SNIPPET], [[
# undef PATH_MAX
# define PATH_MAX 1024
#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# undef PATH_MAX
# define PATH_MAX 260
#endif
diff --git a/m4/pid_t.m4 b/m4/pid_t.m4
new file mode 100644
index 000000000..b7650a10f
--- /dev/null
+++ b/m4/pid_t.m4
@@ -0,0 +1,38 @@
+# pid_t.m4 serial 4
+dnl Copyright (C) 2020-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.
+
+# 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/pipe.m4 b/m4/pipe.m4
index c35b32c50..89d666d2a 100644
--- a/m4/pipe.m4
+++ b/m4/pipe.m4
@@ -1,5 +1,5 @@
# pipe.m4 serial 2
-dnl Copyright (C) 2010-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-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.
diff --git a/m4/pipe2.m4 b/m4/pipe2.m4
index 7393343c5..43d547cb4 100644
--- a/m4/pipe2.m4
+++ b/m4/pipe2.m4
@@ -1,5 +1,5 @@
# pipe2.m4 serial 2
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+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.
diff --git a/m4/poll.m4 b/m4/poll.m4
index 5706ab514..80e991142 100644
--- a/m4/poll.m4
+++ b/m4/poll.m4
@@ -1,5 +1,5 @@
-# poll.m4 serial 17
-dnl Copyright (c) 2003, 2005-2007, 2009-2017 Free Software Foundation, Inc.
+# poll.m4 serial 20
+dnl Copyright (c) 2003, 2005-2007, 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.
@@ -8,6 +8,7 @@ AC_DEFUN([gl_FUNC_POLL],
[
AC_REQUIRE([gl_POLL_H])
AC_REQUIRE([gl_SOCKETS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
if test $ac_cv_header_poll_h = no; then
ac_cv_func_poll=no
gl_cv_func_poll=no
@@ -18,6 +19,7 @@ AC_DEFUN([gl_FUNC_POLL],
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <fcntl.h>
#include <poll.h>
+]GL_MDA_DEFINES[
int main()
{
int result = 0;
@@ -53,16 +55,19 @@ AC_DEFUN([gl_FUNC_POLL],
#if (defined(__APPLE__) && defined(__MACH__)) || defined(_AIX)
This is MacOSX or AIX
#endif
-], [gl_cv_func_poll=no], [gl_cv_func_poll=yes])])])
- fi
- if test $gl_cv_func_poll != yes; then
- AC_CHECK_FUNC([poll], [ac_cv_func_poll=yes], [ac_cv_func_poll=no])
- if test $ac_cv_func_poll = no; then
- HAVE_POLL=0
- else
- REPLACE_POLL=1
- fi
+], [gl_cv_func_poll="guessing no"], [gl_cv_func_poll="guessing yes"])])])
fi
+ case "$gl_cv_func_poll" in
+ *yes) ;;
+ *)
+ AC_CHECK_FUNC([poll], [ac_cv_func_poll=yes], [ac_cv_func_poll=no])
+ if test $ac_cv_func_poll = no; then
+ HAVE_POLL=0
+ else
+ REPLACE_POLL=1
+ fi
+ ;;
+ esac
if test $HAVE_POLL = 0 || test $REPLACE_POLL = 1; then
:
else
diff --git a/m4/poll_h.m4 b/m4/poll_h.m4
index b3d6dab5a..20692d866 100644
--- a/m4/poll_h.m4
+++ b/m4/poll_h.m4
@@ -1,5 +1,5 @@
-# poll_h.m4 serial 2
-dnl Copyright (C) 2010-2017 Free Software Foundation, Inc.
+# poll_h.m4 serial 3
+dnl Copyright (C) 2010-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.
@@ -23,6 +23,8 @@ AC_DEFUN([gl_POLL_H],
dnl <poll.h> is always overridden, because of GNULIB_POSIXCHECK.
gl_CHECK_NEXT_HEADERS([poll.h])
+ gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_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 <poll.h>]],
diff --git a/m4/printf.m4 b/m4/printf.m4
index a44ac66b8..c8e74e22c 100644
--- a/m4/printf.m4
+++ b/m4/printf.m4
@@ -1,5 +1,5 @@
-# printf.m4 serial 52
-dnl Copyright (C) 2003, 2007-2017 Free Software Foundation, Inc.
+# printf.m4 serial 71
+dnl Copyright (C) 2003, 2007-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.
@@ -58,10 +58,12 @@ int main ()
[gl_cv_func_printf_sizes_c99=yes],
[gl_cv_func_printf_sizes_c99=no],
[
-changequote(,)dnl
case "$host_os" in
+changequote(,)dnl
# Guess yes on glibc systems.
- *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ *-gnu* | gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_sizes_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
@@ -79,10 +81,21 @@ changequote(,)dnl
netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
gl_cv_func_printf_sizes_c99="guessing no";;
netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_sizes_c99="guessing no";;
- esac
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_sizes_c99="guessing yes";;
changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_sizes_c99="guessing yes"],
+ [gl_cv_func_printf_sizes_c99="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_sizes_c99="$gl_cross_guess_normal";;
+ esac
])
])
])
@@ -122,14 +135,22 @@ int main ()
}]])],
[gl_cv_func_printf_long_double=yes],
[gl_cv_func_printf_long_double=no],
- [
-changequote(,)dnl
- case "$host_os" in
- beos*) gl_cv_func_printf_long_double="guessing no";;
- mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
- *) gl_cv_func_printf_long_double="guessing yes";;
+ [case "$host_os" in
+ # Guess no on BeOS.
+ beos*) gl_cv_func_printf_long_double="guessing no";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_long_double="guessing yes";;
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_long_double="guessing yes"],
+ [gl_cv_func_printf_long_double="guessing no"])
+ ;;
+ *) gl_cv_func_printf_long_double="guessing yes";;
esac
-changequote([,])dnl
])
])
])
@@ -217,10 +238,12 @@ int main ()
[gl_cv_func_printf_infinite=yes],
[gl_cv_func_printf_infinite=no],
[
-changequote(,)dnl
case "$host_os" in
+changequote(,)dnl
# Guess yes on glibc systems.
- *-gnu*) gl_cv_func_printf_infinite="guessing yes";;
+ *-gnu* | gnu*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_infinite="guessing yes";;
# Guess yes on FreeBSD >= 6.
freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
@@ -234,12 +257,26 @@ changequote(,)dnl
netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
gl_cv_func_printf_infinite="guessing no";;
netbsd*) gl_cv_func_printf_infinite="guessing yes";;
+ # Guess yes on OpenBSD >= 6.0.
+ openbsd[1-5].*) gl_cv_func_printf_infinite="guessing no";;
+ openbsd*) gl_cv_func_printf_infinite="guessing yes";;
# Guess yes on BeOS.
beos*) gl_cv_func_printf_infinite="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_infinite="guessing no";;
- esac
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_infinite="guessing no";;
changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_infinite="guessing yes"],
+ [gl_cv_func_printf_infinite="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_infinite="$gl_cross_guess_normal";;
+ esac
])
])
])
@@ -419,27 +456,42 @@ int main ()
}]])],
[gl_cv_func_printf_infinite_long_double=yes],
[gl_cv_func_printf_infinite_long_double=no],
- [
-changequote(,)dnl
- case "$host_cpu" in
+ [case "$host_cpu" in
# Guess no on ia64, x86_64, i386.
ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
*)
case "$host_os" in
+changequote(,)dnl
# Guess yes on glibc systems.
- *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ *-gnu* | gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_infinite_long_double="guessing yes";;
# Guess yes on FreeBSD >= 6.
freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
# Guess yes on HP-UX >= 11.
hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_infinite_long_double="guessing no";;
+ # Guess yes on OpenBSD >= 6.0.
+ openbsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";;
+ openbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_infinite_long_double="guessing no";;
+changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_infinite_long_double="guessing yes"],
+ [gl_cv_func_printf_infinite_long_double="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_infinite_long_double="$gl_cross_guess_normal";;
esac
;;
esac
-changequote([,])dnl
])
])
;;
@@ -489,8 +541,15 @@ int main ()
&& strcmp (buf, "0x6.0ap-2 33") != 0
&& strcmp (buf, "0xc.14p-3 33") != 0))
result |= 4;
+ /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round. */
+ if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0
+ || (strcmp (buf, "0x2p+0 33") != 0
+ && strcmp (buf, "0x3p-1 33") != 0
+ && strcmp (buf, "0x6p-2 33") != 0
+ && strcmp (buf, "0xcp-3 33") != 0))
+ result |= 4;
/* This catches a FreeBSD 6.1 bug. See
- <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
+ <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
|| buf[0] == '0')
result |= 8;
@@ -502,7 +561,7 @@ int main ()
&& strcmp (buf, "0x8.0p-2") != 0))
result |= 16;
/* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
- glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
+ glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
if (sprintf (buf, "%.1La", 1.999L) < 0
|| (strcmp (buf, "0x1.0p+1") != 0
&& strcmp (buf, "0x2.0p+0") != 0
@@ -516,7 +575,7 @@ int main ()
[
case "$host_os" in
# Guess yes on glibc >= 2.5 systems.
- *-gnu*)
+ *-gnu* | gnu*)
AC_EGREP_CPP([BZ2908], [
#include <features.h>
#ifdef __GNU_LIBRARY__
@@ -528,8 +587,14 @@ int main ()
[gl_cv_func_printf_directive_a="guessing yes"],
[gl_cv_func_printf_directive_a="guessing no"])
;;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_directive_a="guessing no";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_directive_a="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_a="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_directive_a="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_directive_a="$gl_cross_guess_normal";;
esac
])
])
@@ -570,23 +635,39 @@ int main ()
[gl_cv_func_printf_directive_f=yes],
[gl_cv_func_printf_directive_f=no],
[
-changequote(,)dnl
case "$host_os" in
+changequote(,)dnl
# Guess yes on glibc systems.
- *-gnu*) gl_cv_func_printf_directive_f="guessing yes";;
+ *-gnu* | gnu*) gl_cv_func_printf_directive_f="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_directive_f="guessing yes";;
# Guess yes on FreeBSD >= 6.
freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
# Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
darwin*) gl_cv_func_printf_directive_f="guessing yes";;
+ # Guess yes on OpenBSD >= 6.0.
+ openbsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";;
+ openbsd*) gl_cv_func_printf_directive_f="guessing yes";;
# Guess yes on Solaris >= 2.10.
- solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
- solaris*) gl_cv_func_printf_sizes_c99="guessing no";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_directive_f="guessing no";;
- esac
+ solaris2.[1-9][0-9]*) gl_cv_func_printf_directive_f="guessing yes";;
+ solaris*) gl_cv_func_printf_directive_f="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_f="guessing no";;
changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_printf_directive_f="guessing yes"],
+ [gl_cv_func_printf_directive_f="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_directive_f="$gl_cross_guess_normal";;
+ esac
])
])
])
@@ -608,7 +689,10 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
#include <stdlib.h>
#include <string.h>
#ifdef _MSC_VER
-/* See page about "Parameter Validation" on msdn.microsoft.com. */
+#include <inttypes.h>
+/* See page about "Parameter Validation" on msdn.microsoft.com.
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation>
+ <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler> */
static void cdecl
invalid_parameter_handler (const wchar_t *expression,
const wchar_t *function,
@@ -638,13 +722,23 @@ int main ()
}]])],
[gl_cv_func_printf_directive_n=yes],
[gl_cv_func_printf_directive_n=no],
- [
-changequote(,)dnl
- case "$host_os" in
- mingw*) gl_cv_func_printf_directive_n="guessing no";;
- *) gl_cv_func_printf_directive_n="guessing yes";;
+ [case "$host_os" in
+ # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+ *-gnu* | gnu*) AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if _FORTIFY_SOURCE >= 2
+ error fail
+ #endif
+ ]])],
+ [gl_cv_func_printf_directive_n="guessing yes"],
+ [gl_cv_func_printf_directive_n="guessing no"])
+ ;;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_n="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_directive_n="guessing no";;
+ *) gl_cv_func_printf_directive_n="guessing yes";;
esac
-changequote([,])dnl
])
])
])
@@ -665,13 +759,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
[
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
-/* 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 <string.h>
int main ()
@@ -719,11 +807,17 @@ int main ()
[
changequote(,)dnl
case "$host_os" in
- openbsd*) gl_cv_func_printf_directive_ls="guessing no";;
+ # Guess yes on OpenBSD >= 6.0.
+ openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";;
+ openbsd*) gl_cv_func_printf_directive_ls="guessing yes";;
irix*) gl_cv_func_printf_directive_ls="guessing no";;
solaris*) gl_cv_func_printf_directive_ls="guessing no";;
cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_directive_ls="guessing no";;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_printf_directive_ls="guessing yes";;
*) gl_cv_func_printf_directive_ls="guessing yes";;
esac
changequote([,])dnl
@@ -761,10 +855,13 @@ int main ()
changequote(,)dnl
case "$host_os" in
netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
- gl_cv_func_printf_positions="guessing no";;
- beos*) gl_cv_func_printf_positions="guessing no";;
- mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
- *) gl_cv_func_printf_positions="guessing yes";;
+ gl_cv_func_printf_positions="guessing no";;
+ beos*) gl_cv_func_printf_positions="guessing no";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_positions="guessing yes";;
+ # Guess no on native Windows.
+ mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
+ *) gl_cv_func_printf_positions="guessing yes";;
esac
changequote([,])dnl
])
@@ -799,10 +896,13 @@ int main ()
[
changequote(,)dnl
case "$host_os" in
- cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
- netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
- mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
- *) gl_cv_func_printf_flag_grouping="guessing yes";;
+ cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
+ netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";;
+ # Guess no on native Windows.
+ mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
+ *) gl_cv_func_printf_flag_grouping="guessing yes";;
esac
changequote([,])dnl
])
@@ -811,7 +911,7 @@ changequote([,])dnl
dnl Test whether the *printf family of functions supports the - flag correctly.
dnl (ISO C99.) See
-dnl <http://lists.gnu.org/archive/html/bug-coreutils/2008-02/msg00035.html>
+dnl <https://lists.gnu.org/r/bug-coreutils/2008-02/msg00035.html>
dnl Result is gl_cv_func_printf_flag_leftadjust.
AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
@@ -839,12 +939,16 @@ int main ()
[
changequote(,)dnl
case "$host_os" in
- # Guess yes on HP-UX 11.
- hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
- # Guess no on HP-UX 10 and older.
- hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";;
- # Guess yes otherwise.
- *) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+ # Guess yes on HP-UX 11.
+ hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+ # Guess no on HP-UX 10 and older.
+ hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+ # Guess yes otherwise.
+ *) gl_cv_func_printf_flag_leftadjust="guessing yes";;
esac
changequote([,])dnl
])
@@ -853,7 +957,7 @@ changequote([,])dnl
dnl Test whether the *printf family of functions supports padding of non-finite
dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See
-dnl <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html>
+dnl <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html>
dnl Result is gl_cv_func_printf_flag_zero.
AC_DEFUN([gl_PRINTF_FLAG_ZERO],
@@ -882,12 +986,18 @@ int main ()
[
changequote(,)dnl
case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_printf_flag_zero="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_flag_zero="guessing no";;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_printf_flag_zero="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_flag_zero="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_printf_flag_zero="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";;
esac
changequote([,])dnl
])
@@ -940,10 +1050,12 @@ int main ()
changequote(,)dnl
case "$host_os" in
# Guess no only on Solaris, native Windows, and BeOS systems.
- solaris*) gl_cv_func_printf_precision="guessing no" ;;
- mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
- beos*) gl_cv_func_printf_precision="guessing no" ;;
- *) gl_cv_func_printf_precision="guessing yes" ;;
+ solaris*) gl_cv_func_printf_precision="guessing no" ;;
+ mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
+ beos*) gl_cv_func_printf_precision="guessing no" ;;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_printf_precision="guessing yes" ;;
+ *) gl_cv_func_printf_precision="guessing yes" ;;
esac
changequote([,])dnl
])
@@ -965,9 +1077,8 @@ AC_DEFUN([gl_PRINTF_ENOMEM],
gl_cv_func_printf_enomem="guessing no"
if test "$cross_compiling" = no; then
if test $APPLE_UNIVERSAL_BUILD = 0; then
- AC_LANG_CONFTEST([AC_LANG_SOURCE([
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
]GL_NOCRASH[
-changequote(,)dnl
#include <stdio.h>
#include <sys/types.h>
#include <sys/time.h>
@@ -1012,8 +1123,7 @@ int main()
ret = printf ("%.5000000f", 1.0);
return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
}
-changequote([,])dnl
- ])])
+ ]])])
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
(./conftest 2>&AS_MESSAGE_LOG_FD
result=$?
@@ -1040,28 +1150,30 @@ changequote([,])dnl
if test "$gl_cv_func_printf_enomem" = "guessing no"; then
changequote(,)dnl
case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess yes on Solaris.
- solaris*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess yes on AIX.
- aix*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess yes on HP-UX/hppa.
- hpux*) case "$host_cpu" in
- hppa*) gl_cv_func_printf_enomem="guessing yes";;
- *) gl_cv_func_printf_enomem="guessing no";;
- esac
- ;;
- # Guess yes on IRIX.
- irix*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess yes on OSF/1.
- osf*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess yes on BeOS.
- beos*) gl_cv_func_printf_enomem="guessing yes";;
- # Guess yes on Haiku.
- haiku*) gl_cv_func_printf_enomem="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_enomem="guessing no";;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on Solaris.
+ solaris*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on AIX.
+ aix*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on HP-UX/hppa.
+ hpux*) case "$host_cpu" in
+ hppa*) gl_cv_func_printf_enomem="guessing yes";;
+ *) gl_cv_func_printf_enomem="guessing no";;
+ esac
+ ;;
+ # Guess yes on IRIX.
+ irix*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on OSF/1.
+ osf*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on BeOS.
+ beos*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess yes on Haiku.
+ haiku*) gl_cv_func_printf_enomem="guessing yes";;
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_printf_enomem="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_enomem="$gl_cross_guess_normal";;
esac
changequote([,])dnl
fi
@@ -1080,7 +1192,7 @@ dnl Test whether the string produced by the snprintf function is always NUL
dnl terminated. (ISO C99, POSIX:2001)
dnl Result is gl_cv_func_snprintf_truncation_c99.
-AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
+AC_DEFUN_ONCE([gl_SNPRINTF_TRUNCATION_C99],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
@@ -1121,7 +1233,9 @@ int main ()
changequote(,)dnl
case "$host_os" in
# Guess yes on glibc systems.
- *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ *-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
@@ -1153,8 +1267,12 @@ changequote(,)dnl
netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess yes on BeOS.
beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";;
esac
changequote([,])dnl
])
@@ -1216,11 +1334,12 @@ int main ()
}]])],
[gl_cv_func_snprintf_retval_c99=yes],
[gl_cv_func_snprintf_retval_c99=no],
- [
+ [case "$host_os" in
changequote(,)dnl
- case "$host_os" in
# Guess yes on glibc systems.
- *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ *-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_snprintf_retval_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
@@ -1243,10 +1362,21 @@ changequote(,)dnl
netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
# Guess yes on BeOS.
beos*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_snprintf_retval_c99="guessing no";;
- esac
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_retval_c99="guessing yes";;
changequote([,])dnl
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_snprintf_retval_c99="guessing yes"],
+ [gl_cv_func_snprintf_retval_c99="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_retval_c99="$gl_cross_guess_normal";;
+ esac
])
])
])
@@ -1298,10 +1428,20 @@ int main ()
[gl_cv_func_snprintf_directive_n=yes],
[gl_cv_func_snprintf_directive_n=no],
[
-changequote(,)dnl
case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+ *-gnu* | gnu*) AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if _FORTIFY_SOURCE >= 2
+ error fail
+ #endif
+ ]])],
+ [gl_cv_func_snprintf_directive_n="guessing yes"],
+ [gl_cv_func_snprintf_directive_n="guessing no"])
+ ;;
+changequote(,)dnl
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on FreeBSD >= 5.
freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
@@ -1326,10 +1466,14 @@ changequote(,)dnl
netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on BeOS.
beos*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_snprintf_directive_n="guessing no";;
- esac
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_snprintf_directive_n="guessing no";;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_snprintf_directive_n="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_directive_n="$gl_cross_guess_normal";;
changequote([,])dnl
+ esac
])
])
])
@@ -1342,6 +1486,7 @@ dnl Result is gl_cv_func_snprintf_size1.
AC_DEFUN([gl_SNPRINTF_SIZE1],
[
AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_REQUIRE([gl_SNPRINTF_PRESENCE])
AC_CACHE_CHECK([whether snprintf respects a size of 1],
[gl_cv_func_snprintf_size1],
@@ -1371,7 +1516,14 @@ int main()
}]])],
[gl_cv_func_snprintf_size1=yes],
[gl_cv_func_snprintf_size1=no],
- [gl_cv_func_snprintf_size1="guessing yes"])
+ [case "$host_os" in
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_snprintf_size1="guessing yes" ;;
+ *) gl_cv_func_snprintf_size1="guessing yes" ;;
+ esac
+ ])
])
])
@@ -1443,7 +1595,9 @@ int main()
changequote(,)dnl
case "$host_os" in
# Guess yes on glibc systems.
- *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ *-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on FreeBSD >= 5.
freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
@@ -1467,10 +1621,12 @@ changequote(,)dnl
netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on BeOS.
beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on mingw.
+ # Guess yes on Android.
+ linux*-android*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+ # Guess yes on native Windows.
mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_vsnprintf_zerosize_c99="$gl_cross_guess_normal";;
esac
changequote([,])dnl
])
@@ -1527,13 +1683,17 @@ dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . .
dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . .
dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . .
+dnl Mac OS X 10.13.5 . . . # # . # . . . . . . . . . . # . .
dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . .
dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . .
+dnl OpenBSD 6.0, 6.7 . . . . # . . . . . . . . # . . . . . .
dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . .
dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . .
dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . .
dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . .
-dnl Solaris 11 2011-11 . . # # # . . # . . . # . . . . . . . .
+dnl Solaris 11.4 . . # # # . . # . . . # . . . . . . . .
+dnl Solaris 11.3 . . . . # . . # . . . . . . . . . . . .
+dnl Solaris 11.0 . . # # # . . # . . . # . . . . . . . .
dnl Solaris 10 . . # # # . . # . . . # # . . . . . . .
dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . .
dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # #
@@ -1546,11 +1706,13 @@ dnl HP-UX 10.20 # . # . # # . ? . . # # . . .
dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . .
dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . #
dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # #
+dnl NetBSD 9.0 . . . . # . . . . . . . . . . . . . . .
dnl NetBSD 5.0 . . . # # . . . . . . # . # . . . . . .
dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ?
dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . .
dnl Haiku . . . # # # . # . . . . . ? . . ? . . .
dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . .
+dnl Android 4.3 . . # # # # # # . # . # . # . . . # . .
dnl old mingw / msvcrt # # # # # # . . # # . # # ? . # # # . .
dnl MSVC 9 # # # # # # # . # # . # # ? # # # # . .
dnl mingw 2009-2011 . # . # . . . . # # . . . ? . . . . . .
diff --git a/m4/putenv.m4 b/m4/putenv.m4
index a8e3ab33d..919984d91 100644
--- a/m4/putenv.m4
+++ b/m4/putenv.m4
@@ -1,5 +1,5 @@
-# putenv.m4 serial 20
-dnl Copyright (C) 2002-2017 Free Software Foundation, Inc.
+# putenv.m4 serial 25
+dnl Copyright (C) 2002-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.
@@ -14,33 +14,41 @@ AC_DEFUN([gl_FUNC_PUTENV],
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([for putenv compatible with GNU and SVID],
- [gl_cv_func_svid_putenv],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[
- /* Put it in env. */
- if (putenv ("CONFTEST_putenv=val"))
- return 1;
+ [gl_cv_func_svid_putenv],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [AC_INCLUDES_DEFAULT
+ GL_MDA_DEFINES],
+ [[
+ /* Put it in env. */
+ if (putenv ("CONFTEST_putenv=val"))
+ return 1;
- /* Try to remove it. */
- if (putenv ("CONFTEST_putenv"))
- return 2;
+ /* Try to remove it. */
+ if (putenv ("CONFTEST_putenv"))
+ return 2;
- /* Make sure it was deleted. */
- if (getenv ("CONFTEST_putenv") != 0)
- return 3;
+ /* Make sure it was deleted. */
+ if (getenv ("CONFTEST_putenv") != 0)
+ return 3;
- return 0;
- ]])],
- gl_cv_func_svid_putenv=yes,
- gl_cv_func_svid_putenv=no,
- dnl When crosscompiling, assume putenv is broken.
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_svid_putenv="guessing no" ;;
- esac
- ])
- ])
+ return 0;
+ ]])],
+ [gl_cv_func_svid_putenv=yes],
+ [gl_cv_func_svid_putenv=no],
+ [dnl When crosscompiling, assume putenv is broken.
+ case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_svid_putenv="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_svid_putenv="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_svid_putenv="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
case "$gl_cv_func_svid_putenv" in
*yes) ;;
*)
diff --git a/m4/raise.m4 b/m4/raise.m4
index 28c2e0b5c..4bf0ca9c1 100644
--- a/m4/raise.m4
+++ b/m4/raise.m4
@@ -1,5 +1,5 @@
-# raise.m4 serial 3
-dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# raise.m4 serial 4
+dnl Copyright (C) 2011-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.
@@ -8,14 +8,16 @@ AC_DEFUN([gl_FUNC_RAISE],
[
AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
- AC_REQUIRE([gl_MSVC_INVAL])
AC_CHECK_FUNCS([raise])
if test $ac_cv_func_raise = no; then
HAVE_RAISE=0
else
- if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
- REPLACE_RAISE=1
- fi
+ m4_ifdef([gl_MSVC_INVAL], [
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_RAISE=1
+ fi
+ ])
m4_ifdef([gl_SIGNALBLOCKING], [
gl_SIGNALBLOCKING
if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
diff --git a/m4/rawmemchr.m4 b/m4/rawmemchr.m4
new file mode 100644
index 000000000..f92846543
--- /dev/null
+++ b/m4/rawmemchr.m4
@@ -0,0 +1,20 @@
+# rawmemchr.m4 serial 2
+dnl Copyright (C) 2003, 2007-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_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/read.m4 b/m4/read.m4
index 36249abdc..c162b7cda 100644
--- a/m4/read.m4
+++ b/m4/read.m4
@@ -1,5 +1,5 @@
-# read.m4 serial 4
-dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# read.m4 serial 5
+dnl Copyright (C) 2011-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.
@@ -7,10 +7,12 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_READ],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([gl_MSVC_INVAL])
- if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
- REPLACE_READ=1
- fi
+ m4_ifdef([gl_MSVC_INVAL], [
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_READ=1
+ fi
+ ])
dnl This ifdef is just an optimization, to avoid performing a configure
dnl check whose result is not used. It does not make the test of
dnl GNULIB_UNISTD_H_NONBLOCKING or GNULIB_NONBLOCKING redundant.
diff --git a/m4/readlink.m4 b/m4/readlink.m4
index d3ba0ad42..352788c65 100644
--- a/m4/readlink.m4
+++ b/m4/readlink.m4
@@ -1,5 +1,5 @@
-# readlink.m4 serial 12
-dnl Copyright (C) 2003, 2007, 2009-2017 Free Software Foundation, Inc.
+# readlink.m4 serial 16
+dnl Copyright (C) 2003, 2007, 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.
@@ -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,16 +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 glibc systems.
- *-gnu*) gl_cv_func_readlink_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_readlink_works="guessing no" ;;
+ # 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
@@ -53,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/regex.m4 b/m4/regex.m4
index 61ff09872..850c57222 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,6 +1,6 @@
-# serial 66
+# serial 71
-# Copyright (C) 1996-2001, 2003-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -13,6 +13,7 @@ AC_PREREQ([2.50])
AC_DEFUN([gl_REGEX],
[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_ARG_WITH([included-regex],
[AS_HELP_STRING([--without-included-regex],
[don't compile regex; this is the default on systems
@@ -75,7 +76,7 @@ AC_DEFUN([gl_REGEX],
if (setlocale (LC_ALL, "en_US.UTF-8"))
{
{
- /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
+ /* https://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
This test needs valgrind to catch the bug on Debian
GNU/Linux 3.1 x86, but it might catch the bug better
on other platforms and it shouldn't hurt to try the
@@ -89,17 +90,20 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern (pat, sizeof pat - 1, &regex);
if (s)
result |= 1;
- else if (re_search (&regex, data, sizeof data - 1,
- 0, sizeof data - 1, &regs)
- != -1)
- result |= 1;
- regfree (&regex);
+ else
+ {
+ if (re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, &regs)
+ != -1)
+ result |= 1;
+ regfree (&regex);
+ }
}
{
/* This test is from glibc bug 15078.
The test case is from Andreas Schwab in
- <http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
+ <https://sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
*/
static char const pat[] = "[^x]x";
static char const data[] =
@@ -124,8 +128,8 @@ AC_DEFUN([gl_REGEX],
0, sizeof data - 1, 0);
if (i != 0 && i != 21)
result |= 1;
+ regfree (&regex);
}
- regfree (&regex);
}
if (! setlocale (LC_ALL, "C"))
@@ -138,9 +142,13 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("a[^x]b", 6, &regex);
if (s)
result |= 2;
- /* This should fail, but succeeds for glibc-2.5. */
- else if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
- result |= 2;
+ else
+ {
+ /* This should fail, but succeeds for glibc-2.5. */
+ if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+ result |= 2;
+ regfree (&regex);
+ }
/* This regular expression is from Spencer ere test number 75
in grep-2.3. */
@@ -152,7 +160,10 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, &regex);
/* This should fail with _Invalid character class name_ error. */
if (!s)
- result |= 4;
+ {
+ result |= 4;
+ regfree (&regex);
+ }
/* Ensure that [b-a] is diagnosed as invalid, when
using RE_NO_EMPTY_RANGES. */
@@ -160,13 +171,18 @@ AC_DEFUN([gl_REGEX],
memset (&regex, 0, sizeof regex);
s = re_compile_pattern ("a[b-a]", 6, &regex);
if (s == 0)
- result |= 8;
+ {
+ result |= 8;
+ regfree (&regex);
+ }
/* This should succeed, but does not for glibc-2.1.3. */
memset (&regex, 0, sizeof regex);
s = re_compile_pattern ("{1", 2, &regex);
if (s)
result |= 8;
+ else
+ regfree (&regex);
/* The following example is derived from a problem report
against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
@@ -174,17 +190,35 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("[an\371]*n", 7, &regex);
if (s)
result |= 8;
- /* This should match, but does not for glibc-2.2.1. */
- else if (re_match (&regex, "an", 2, 0, &regs) != 2)
- result |= 8;
+ else
+ {
+ /* This should match, but does not for glibc-2.2.1. */
+ if (re_match (&regex, "an", 2, 0, &regs) != 2)
+ result |= 8;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
memset (&regex, 0, sizeof regex);
s = re_compile_pattern ("x", 1, &regex);
if (s)
result |= 8;
- /* glibc-2.2.93 does not work with a negative RANGE argument. */
- else if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
- result |= 8;
+ else
+ {
+ /* glibc-2.2.93 does not work with a negative RANGE argument. */
+ if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+ result |= 8;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
/* The version of regex.c in older versions of gnulib
ignored RE_ICASE. Detect that problem too. */
@@ -193,11 +227,20 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("x", 1, &regex);
if (s)
result |= 16;
- else if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
- result |= 16;
+ else
+ {
+ if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+ result |= 16;
+ else
+ {
+ free (regs.start);
+ free (regs.end);
+ }
+ regfree (&regex);
+ }
/* Catch a bug reported by Vin Shelton in
- http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html
+ https://lists.gnu.org/r/bug-coreutils/2007-06/msg00089.html
*/
re_set_syntax (RE_SYNTAX_POSIX_BASIC
& ~RE_CONTEXT_INVALID_DUP
@@ -206,12 +249,31 @@ AC_DEFUN([gl_REGEX],
s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
if (s)
result |= 32;
+ else
+ regfree (&regex);
/* REG_STARTEND was added to glibc on 2004-01-15.
Reject older versions. */
if (! REG_STARTEND)
result |= 64;
+ /* Matching with the compiled form of this regexp would provoke
+ an assertion failure prior to glibc-2.28:
+ regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed
+ With glibc-2.28, compilation fails and reports the invalid
+ back reference. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("0|()0|\\1|0", 10, &regex);
+ if (!s)
+ result |= 64;
+ else
+ {
+ if (strcmp (s, "Invalid back reference"))
+ result |= 64;
+ regfree (&regex);
+ }
+
#if 0
/* It would be nice to reject hosts whose regoff_t values are too
narrow (including glibc on hosts with 64-bit ptrdiff_t and
@@ -226,13 +288,19 @@ AC_DEFUN([gl_REGEX],
return result;
]])],
- [gl_cv_func_re_compile_pattern_working=yes],
- [gl_cv_func_re_compile_pattern_working=no],
- dnl When crosscompiling, assume it is not working.
- [gl_cv_func_re_compile_pattern_working=no])])
- case $gl_cv_func_re_compile_pattern_working in #(
- yes) ac_use_included_regex=no;; #(
- no) ac_use_included_regex=yes;;
+ [gl_cv_func_re_compile_pattern_working=yes],
+ [gl_cv_func_re_compile_pattern_working=no],
+ [case "$host_os" in
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_re_compile_pattern_working="guessing no" ;;
+ # Otherwise obey --enable-cross-guesses.
+ *) gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_re_compile_pattern_working" in #(
+ *yes) ac_use_included_regex=no;; #(
+ *no) ac_use_included_regex=yes;;
esac
;;
*) AC_MSG_ERROR([Invalid value for --with-included-regex: $with_included_regex])
@@ -286,7 +354,6 @@ AC_DEFUN([gl_PREREQ_REGEX],
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([AC_TYPE_MBSTATE_T])
AC_REQUIRE([gl_EEMALLOC])
- AC_REQUIRE([gl_GLIBC21])
AC_CHECK_HEADERS([libintl.h])
AC_CHECK_FUNCS_ONCE([isblank iswctype])
AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
diff --git a/m4/rename.m4 b/m4/rename.m4
index 7c3ffe7c2..8a95b8aee 100644
--- a/m4/rename.m4
+++ b/m4/rename.m4
@@ -1,6 +1,6 @@
-# serial 26
+# serial 33
-# Copyright (C) 2001, 2003, 2005-2006, 2009-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005-2006, 2009-2021 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.
@@ -19,7 +19,7 @@ AC_DEFUN([gl_FUNC_RENAME],
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_CHECK_FUNCS_ONCE([lstat])
- dnl Solaris 10, AIX 7.1 mistakenly allow rename("file","name/").
+ dnl Solaris 11.3, AIX 7.1 mistakenly allow rename("file","name/").
dnl NetBSD 1.6 mistakenly forbids rename("dir","name/").
dnl FreeBSD 7.2 mistakenly allows rename("file","link-to-file/").
dnl The Solaris bug can be worked around without stripping
@@ -55,10 +55,14 @@ AC_DEFUN([gl_FUNC_RENAME],
[gl_cv_func_rename_slash_dst_works=no],
dnl When crosscompiling, assume rename is broken.
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_rename_slash_dst_works="guessing no" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;;
esac
])
rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
@@ -69,7 +73,7 @@ AC_DEFUN([gl_FUNC_RENAME],
REPLACE_RENAME=1
AC_DEFINE([RENAME_TRAILING_SLASH_DEST_BUG], [1],
[Define if rename does not correctly handle slashes on the destination
- argument, such as on Solaris 10 or NetBSD 1.6.])
+ argument, such as on Solaris 11 or NetBSD 1.6.])
;;
esac
@@ -107,10 +111,14 @@ AC_DEFUN([gl_FUNC_RENAME],
[gl_cv_func_rename_slash_src_works=no],
dnl When crosscompiling, assume rename is broken.
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_rename_slash_src_works="guessing no" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;;
esac
])
rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
@@ -132,40 +140,58 @@ AC_DEFUN([gl_FUNC_RENAME],
AC_CACHE_CHECK([whether rename manages hard links correctly],
[gl_cv_func_rename_link_works],
[if test $ac_cv_func_link = yes; then
- rm -rf conftest.f conftest.f1
- if touch conftest.f && ln conftest.f conftest.f1 &&
- set x `ls -i conftest.f conftest.f1` && test "$2" = "$4"; then
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM([[
-# include <stdio.h>
-# include <stdlib.h>
-# include <unistd.h>
- ]],
- [[int result = 0;
- if (rename ("conftest.f", "conftest.f1"))
- result |= 1;
- if (unlink ("conftest.f1"))
- result |= 2;
- if (rename ("conftest.f", "conftest.f"))
- result |= 4;
- if (rename ("conftest.f1", "conftest.f1") == 0)
- result |= 8;
- return result;
- ]])],
- [gl_cv_func_rename_link_works=yes],
- [gl_cv_func_rename_link_works=no],
- dnl When crosscompiling, assume rename is broken.
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_rename_link_works="guessing no" ;;
- esac
- ])
+ if test $cross_compiling != yes; then
+ rm -rf conftest.f conftest.f1 conftest.f2
+ if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 &&
+ set x `ls -i conftest.f conftest.f1` && test "$2" = "$4"; then
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+# include <errno.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <unistd.h>
+ ]GL_MDA_DEFINES],
+ [[int result = 0;
+ if (rename ("conftest.f", "conftest.f1"))
+ result |= 1;
+ if (unlink ("conftest.f1"))
+ result |= 2;
+
+ /* Allow either the POSIX-required behavior, where the
+ previous rename kept conftest.f, or the (better) NetBSD
+ behavior, where it removed conftest.f. */
+ if (rename ("conftest.f", "conftest.f") != 0
+ && errno != ENOENT)
+ result |= 4;
+
+ if (rename ("conftest.f1", "conftest.f1") == 0)
+ result |= 8;
+ if (rename ("conftest.f2", "conftest.f2") != 0)
+ result |= 16;
+ return result;
+ ]])],
+ [gl_cv_func_rename_link_works=yes],
+ [gl_cv_func_rename_link_works=no],
+ [dnl We don't get here.
+ :
+ ])
+ else
+ gl_cv_func_rename_link_works="guessing no"
+ fi
+ rm -rf conftest.f conftest.f1 conftest.f2
else
- gl_cv_func_rename_link_works="guessing no"
+ dnl When crosscompiling, assume rename is broken.
+ case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_rename_link_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;;
+ esac
fi
- rm -rf conftest.f conftest.f1
else
gl_cv_func_rename_link_works=yes
fi
@@ -205,10 +231,14 @@ AC_DEFUN([gl_FUNC_RENAME],
[gl_cv_func_rename_dest_works=no],
dnl When crosscompiling, assume rename is broken.
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_rename_dest_works="guessing no" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_rename_dest_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;;
esac
])
rm -rf conftest.f conftest.d1 conftest.d2
diff --git a/m4/rmdir.m4 b/m4/rmdir.m4
index f585c2769..82b9cccf2 100644
--- a/m4/rmdir.m4
+++ b/m4/rmdir.m4
@@ -1,5 +1,5 @@
-# rmdir.m4 serial 13
-dnl Copyright (C) 2002, 2005, 2009-2017 Free Software Foundation, Inc.
+# rmdir.m4 serial 18
+dnl Copyright (C) 2002, 2005, 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.
@@ -22,21 +22,26 @@ AC_DEFUN([gl_FUNC_RMDIR],
#else /* on Windows with MSVC */
# include <direct.h>
#endif
-]], [[int result = 0;
- if (!rmdir ("conftest.file/"))
- result |= 1;
- else if (errno != ENOTDIR)
- result |= 2;
- if (!rmdir ("conftest.dir/./"))
- result |= 4;
- return result;
- ]])],
+ ]GL_MDA_DEFINES],
+ [[int result = 0;
+ if (!rmdir ("conftest.file/"))
+ result |= 1;
+ else if (errno != ENOTDIR)
+ result |= 2;
+ if (!rmdir ("conftest.dir/./"))
+ result |= 4;
+ return result;
+ ]])],
[gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_rmdir_works="guessing no" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_rmdir_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;;
esac
])
rm -rf conftest.dir conftest.file])
diff --git a/m4/round.m4 b/m4/round.m4
index 45b7df459..68399d363 100644
--- a/m4/round.m4
+++ b/m4/round.m4
@@ -1,5 +1,5 @@
-# round.m4 serial 16
-dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
+# round.m4 serial 23
+dnl Copyright (C) 2007, 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.
@@ -41,7 +41,7 @@ extern
"C"
#endif
double round (double);
-#ifdef _MSC_VER
+#if defined _MSC_VER && !defined __clang__
# pragma fenv_access (off)
#endif
int main()
@@ -57,11 +57,20 @@ int main()
* (double) (1U << ((DBL_MANT_DIG + 3) / 5))
* (double) (1U << ((DBL_MANT_DIG + 4) / 5));
volatile double x = 0.5 - 0.5 / TWO_MANT_DIG;
- exit (x < 0.5 && round (x) != 0.0);
+ return (x < 0.5 && round (x) != 0.0);
}]])], [gl_cv_func_round_works=yes], [gl_cv_func_round_works=no],
[case "$host_os" in
- netbsd* | aix*) gl_cv_func_round_works="guessing no";;
- *) gl_cv_func_round_works="guessing yes";;
+ netbsd* | aix*) gl_cv_func_round_works="guessing no" ;;
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_round_works="guessing yes"],
+ [gl_cv_func_round_works="guessing no"])
+ ;;
+ *) gl_cv_func_round_works="guessing yes" ;;
esac
])
LIBS="$save_LIBS"
@@ -94,7 +103,7 @@ double round (double);
static double dummy (double f) { return 0; }
int main (int argc, char *argv[])
{
- double (*my_round) (double) = argc ? round : dummy;
+ double (* volatile my_round) (double) = argc ? round : dummy;
/* Test whether round (-0.0) is -0.0. */
if (signbitd (minus_zerod) && !signbitd (my_round (minus_zerod)))
return 1;
@@ -104,10 +113,21 @@ int main (int argc, char *argv[])
[gl_cv_func_round_ieee=yes],
[gl_cv_func_round_ieee=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_round_ieee="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_round_ieee="guessing no" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_round_ieee="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_round_ieee="guessing yes" ;;
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_round_ieee="guessing yes"],
+ [gl_cv_func_round_ieee="guessing no"])
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_round_ieee="$gl_cross_guess_normal" ;;
esac
])
LIBS="$save_LIBS"
diff --git a/m4/safe-read.m4 b/m4/safe-read.m4
index 022bb654a..3cba2888d 100644
--- a/m4/safe-read.m4
+++ b/m4/safe-read.m4
@@ -1,5 +1,5 @@
# safe-read.m4 serial 6
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2017 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2021 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/safe-write.m4 b/m4/safe-write.m4
index 09a2226ef..ef10d961b 100644
--- a/m4/safe-write.m4
+++ b/m4/safe-write.m4
@@ -1,5 +1,5 @@
# safe-write.m4 serial 4
-dnl Copyright (C) 2002, 2005-2006, 2009-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2006, 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.
diff --git a/m4/secure_getenv.m4 b/m4/secure_getenv.m4
deleted file mode 100644
index 6bd4afd9c..000000000
--- a/m4/secure_getenv.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-# Look up an environment variable more securely.
-dnl Copyright 2013-2017 Free Software Foundation, Inc.
-dnl This file is free software; the Free 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_SECURE_GETENV],
-[
- dnl Persuade glibc <stdlib.h> to declare secure_getenv().
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-
- AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([secure_getenv])
- if test $ac_cv_func_secure_getenv = no; then
- HAVE_SECURE_GETENV=0
- fi
-])
-
-# Prerequisites of lib/secure_getenv.c.
-AC_DEFUN([gl_PREREQ_SECURE_GETENV], [
- AC_CHECK_FUNCS([__secure_getenv])
- if test $ac_cv_func___secure_getenv = no; then
- AC_CHECK_FUNCS([issetugid])
- fi
- AC_CHECK_FUNCS_ONCE([getuid geteuid getgid getegid])
-])
diff --git a/m4/select.m4 b/m4/select.m4
index c7844bc8e..c7409d204 100644
--- a/m4/select.m4
+++ b/m4/select.m4
@@ -1,5 +1,5 @@
-# select.m4 serial 8
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# select.m4 serial 12
+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.
@@ -60,7 +60,8 @@ changequote([,])dnl
#endif
#include <unistd.h>
#include <errno.h>
-]],[[
+]GL_MDA_DEFINES],
+[[
fd_set set;
dup2(0, 16);
FD_ZERO(&set);
@@ -74,10 +75,12 @@ changequote([,])dnl
[gl_cv_func_select_detects_ebadf=no],
[
case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_select_detects_ebadf="guessing no" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_select_detects_ebadf="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/m4/servent.m4 b/m4/servent.m4
index 89331e23a..2dda17750 100644
--- a/m4/servent.m4
+++ b/m4/servent.m4
@@ -1,5 +1,5 @@
-# servent.m4 serial 2
-dnl Copyright (C) 2008, 2010-2017 Free Software Foundation, Inc.
+# servent.m4 serial 3
+dnl Copyright (C) 2008, 2010-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.
@@ -10,7 +10,7 @@ AC_DEFUN([gl_SERVENT],
dnl getservbyport() defined?
dnl Where are getprotoent(), setprotoent(), endprotoent(), getprotobyname(),
dnl getprotobynumber() defined?
- dnl - On Solaris, they are in libsocket. Ignore libxnet.
+ dnl - On Solaris < 11.4, they are in libsocket. Ignore libxnet.
dnl - On Haiku, they are in libnetwork.
dnl - On BeOS, they are in libnet.
dnl - On native Windows, they are in ws2_32.dll.
diff --git a/m4/setenv.m4 b/m4/setenv.m4
index 005aa8cfe..f79a27850 100644
--- a/m4/setenv.m4
+++ b/m4/setenv.m4
@@ -1,5 +1,5 @@
-# setenv.m4 serial 26
-dnl Copyright (C) 2001-2004, 2006-2017 Free Software Foundation, Inc.
+# setenv.m4 serial 30
+dnl Copyright (C) 2001-2004, 2006-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.
@@ -35,10 +35,12 @@ AC_DEFUN([gl_FUNC_SETENV],
]])],
[gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_setenv_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_setenv_works="guessing no" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_setenv_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
esac
])])
case "$gl_cv_func_setenv_works" in
@@ -104,35 +106,39 @@ int unsetenv (const char *name);
dnl OpenBSD 4.7 unsetenv("") does not fail.
AC_CACHE_CHECK([whether unsetenv obeys POSIX],
[gl_cv_func_unsetenv_works],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
- #include <stdlib.h>
- #include <errno.h>
- extern char **environ;
- ]], [[
- char entry1[] = "a=1";
- char entry2[] = "b=2";
- char *env[] = { entry1, entry2, NULL };
- if (putenv ((char *) "a=1")) return 1;
- if (putenv (entry2)) return 2;
- entry2[0] = 'a';
- unsetenv ("a");
- if (getenv ("a")) return 3;
- if (!unsetenv ("") || errno != EINVAL) return 4;
- entry2[0] = 'b';
- environ = env;
- if (!getenv ("a")) return 5;
- entry2[0] = 'a';
- unsetenv ("a");
- if (getenv ("a")) return 6;
- ]])],
- [gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_unsetenv_works="guessing no" ;;
- esac
- ])])
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <stdlib.h>
+ #include <errno.h>
+ extern char **environ;
+ ]GL_MDA_DEFINES],
+ [[
+ char entry1[] = "a=1";
+ char entry2[] = "b=2";
+ char *env[] = { entry1, entry2, NULL };
+ if (putenv ((char *) "a=1")) return 1;
+ if (putenv (entry2)) return 2;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 3;
+ if (!unsetenv ("") || errno != EINVAL) return 4;
+ entry2[0] = 'b';
+ environ = env;
+ if (!getenv ("a")) return 5;
+ entry2[0] = 'a';
+ unsetenv ("a");
+ if (getenv ("a")) return 6;
+ ]])],
+ [gl_cv_func_unsetenv_works=yes],
+ [gl_cv_func_unsetenv_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
case "$gl_cv_func_unsetenv_works" in
*yes) ;;
*)
diff --git a/m4/setlocale_null.m4 b/m4/setlocale_null.m4
new file mode 100644
index 000000000..c486ca840
--- /dev/null
+++ b/m4/setlocale_null.m4
@@ -0,0 +1,98 @@
+# setlocale_null.m4 serial 4
+dnl Copyright (C) 2019-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_FUNC_SETLOCALE_NULL],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_PTHREADLIB])
+ AC_CHECK_HEADERS_ONCE([threads.h])
+
+ AC_CACHE_CHECK([whether setlocale (LC_ALL, NULL) is multithread-safe],
+ [gl_cv_func_setlocale_null_all_mtsafe],
+ [case "$host_os" in
+ # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
+ *-musl* | darwin* | freebsd* | 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*)
+ gl_cv_func_setlocale_null_all_mtsafe=yes ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ dnl On platforms without multithreading, there is no issue.
+ case "$host_os" in
+ mingw*) ;;
+ *)
+ if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+ gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
+ fi
+ ;;
+ esac
+ case "$gl_cv_func_setlocale_null_all_mtsafe" in
+ *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
+ *) SETLOCALE_NULL_ALL_MTSAFE=0 ;;
+ esac
+ AC_DEFINE_UNQUOTED([SETLOCALE_NULL_ALL_MTSAFE], [$SETLOCALE_NULL_ALL_MTSAFE],
+ [Define to 1 if setlocale (LC_ALL, NULL) is multithread-safe.])
+
+ dnl This is about a single category (not LC_ALL).
+ AC_CACHE_CHECK([whether setlocale (category, NULL) is multithread-safe],
+ [gl_cv_func_setlocale_null_one_mtsafe],
+ [case "$host_os" in
+ # Guess no on OpenBSD, AIX.
+ 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*)
+ gl_cv_func_setlocale_null_one_mtsafe=yes ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *)
+ gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ dnl On platforms without multithreading, there is no issue.
+ case "$host_os" in
+ mingw*) ;;
+ *)
+ if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+ gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
+ fi
+ ;;
+ esac
+ case "$gl_cv_func_setlocale_null_one_mtsafe" in
+ *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
+ *) SETLOCALE_NULL_ONE_MTSAFE=0 ;;
+ esac
+ AC_DEFINE_UNQUOTED([SETLOCALE_NULL_ONE_MTSAFE], [$SETLOCALE_NULL_ONE_MTSAFE],
+ [Define to 1 if setlocale (category, NULL) is multithread-safe.])
+
+ dnl Determine link dependencies of lib/setlocale_null.c and lib/setlocale-lock.c.
+ if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+ case "$host_os" in
+ mingw*) LIB_SETLOCALE_NULL= ;;
+ *)
+ gl_WEAK_SYMBOLS
+ case "$gl_cv_have_weak" in
+ *yes) LIB_SETLOCALE_NULL= ;;
+ *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
+ esac
+ ;;
+ esac
+ else
+ LIB_SETLOCALE_NULL=
+ fi
+ dnl LIB_SETLOCALE_NULL is expected to be '-pthread' or '-lpthread' on AIX
+ dnl with gcc or xlc, and empty otherwise.
+ AC_SUBST([LIB_SETLOCALE_NULL])
+])
+
+# Prerequisites of lib/setlocale-lock.c.
+AC_DEFUN([gl_PREREQ_SETLOCALE_LOCK],
+[
+ gl_VISIBILITY
+])
diff --git a/m4/signal_h.m4 b/m4/signal_h.m4
index eaf5ce98e..ff9f0251f 100644
--- a/m4/signal_h.m4
+++ b/m4/signal_h.m4
@@ -1,5 +1,5 @@
-# signal_h.m4 serial 18
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# signal_h.m4 serial 19
+dnl Copyright (C) 2007-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.
@@ -34,6 +34,8 @@ AC_DEFUN([gl_SIGNAL_H],
]], [pthread_sigmask sigaction
sigaddset sigdelset sigemptyset sigfillset sigismember
sigpending sigprocmask])
+
+ AC_REQUIRE([AC_C_RESTRICT])
])
AC_DEFUN([gl_CHECK_TYPE_SIGSET_T],
diff --git a/m4/signbit.m4 b/m4/signbit.m4
index 9d2b0a8db..6ec70ec44 100644
--- a/m4/signbit.m4
+++ b/m4/signbit.m4
@@ -1,5 +1,5 @@
-# signbit.m4 serial 13
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# signbit.m4 serial 20
+dnl Copyright (C) 2007-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.
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_SIGNBIT],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([AC_CANONICAL_HOST])
AC_CACHE_CHECK([for signbit macro], [gl_cv_func_signbit],
[
AC_RUN_IFELSE(
@@ -29,22 +29,27 @@ AC_DEFUN([gl_SIGNBIT],
[gl_cv_func_signbit=yes],
[gl_cv_func_signbit=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_signbit="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_signbit="guessing no" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_signbit="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_signbit="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_signbit="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_signbit="$gl_cross_guess_normal" ;;
esac
])
])
- dnl GCC 4.0 and newer provides three built-ins for signbit.
+ dnl GCC >= 4.0 and clang provide three built-ins for signbit.
dnl They can be used without warnings, also in C++, regardless of <math.h>.
dnl But they may expand to calls to functions, which may or may not be in
dnl libc.
- AC_CACHE_CHECK([for signbit compiler built-ins], [gl_cv_func_signbit_gcc],
+ AC_CACHE_CHECK([for signbit compiler built-ins],
+ [gl_cv_func_signbit_builtins],
[
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
-#if __GNUC__ >= 4
+#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
# define signbit(x) \
(sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
@@ -55,21 +60,30 @@ AC_DEFUN([gl_SIGNBIT],
#include <string.h>
]gl_SIGNBIT_TEST_PROGRAM
])],
- [gl_cv_func_signbit_gcc=yes],
- [gl_cv_func_signbit_gcc=no],
+ [gl_cv_func_signbit_builtins=yes],
+ [gl_cv_func_signbit_builtins=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_signbit_gcc="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_signbit_gcc="guessing no" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_signbit_builtins="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_signbit_builtins="guessing yes" ;;
+ # Guess yes on mingw, no on MSVC.
+ mingw*) if test -n "$GCC"; then
+ gl_cv_func_signbit_builtins="guessing yes"
+ else
+ gl_cv_func_signbit_builtins="guessing no"
+ fi
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_signbit_builtins="$gl_cross_guess_normal" ;;
esac
])
])
dnl Use the compiler built-ins whenever possible, because they are more
dnl efficient than the system library functions (if they exist).
- case "$gl_cv_func_signbit_gcc" in
+ case "$gl_cv_func_signbit_builtins" in
*yes)
- REPLACE_SIGNBIT_USING_GCC=1
+ REPLACE_SIGNBIT_USING_BUILTINS=1
;;
*)
case "$gl_cv_func_signbit" in
@@ -77,79 +91,90 @@ AC_DEFUN([gl_SIGNBIT],
*)
dnl REPLACE_SIGNBIT=1 makes sure the signbit[fdl] functions get built.
REPLACE_SIGNBIT=1
- gl_FLOAT_SIGN_LOCATION
- gl_DOUBLE_SIGN_LOCATION
- gl_LONG_DOUBLE_SIGN_LOCATION
- if test "$gl_cv_cc_float_signbit" = unknown; then
- dnl Test whether copysignf() is declared.
- AC_CHECK_DECLS([copysignf], , , [[#include <math.h>]])
- if test "$ac_cv_have_decl_copysignf" = yes; then
- dnl Test whether copysignf() can be used without libm.
- AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
- [gl_cv_func_copysignf_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- float x, y;]],
- [[return copysignf (x, y) < 0;]])],
- [gl_cv_func_copysignf_no_libm=yes],
- [gl_cv_func_copysignf_no_libm=no])
- ])
- if test $gl_cv_func_copysignf_no_libm = yes; then
- AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1],
- [Define if the copysignf function is declared in <math.h> and available in libc.])
- fi
- fi
- fi
- if test "$gl_cv_cc_double_signbit" = unknown; then
- dnl Test whether copysign() is declared.
- AC_CHECK_DECLS([copysign], , , [[#include <math.h>]])
- if test "$ac_cv_have_decl_copysign" = yes; then
- dnl Test whether copysign() can be used without libm.
- AC_CACHE_CHECK([whether copysign can be used without linking with libm],
- [gl_cv_func_copysign_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- double x, y;]],
- [[return copysign (x, y) < 0;]])],
- [gl_cv_func_copysign_no_libm=yes],
- [gl_cv_func_copysign_no_libm=no])
- ])
- if test $gl_cv_func_copysign_no_libm = yes; then
- AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1],
- [Define if the copysign function is declared in <math.h> and available in libc.])
- fi
- fi
- fi
- if test "$gl_cv_cc_long_double_signbit" = unknown; then
- dnl Test whether copysignl() is declared.
- AC_CHECK_DECLS([copysignl], , , [[#include <math.h>]])
- if test "$ac_cv_have_decl_copysignl" = yes; then
- dnl Test whether copysignl() can be used without libm.
- AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
- [gl_cv_func_copysignl_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- long double x, y;]],
- [[return copysignl (x, y) < 0;]])],
- [gl_cv_func_copysignl_no_libm=yes],
- [gl_cv_func_copysignl_no_libm=no])
- ])
- if test $gl_cv_func_copysignl_no_libm = yes; then
- AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1],
- [Define if the copysignl function is declared in <math.h> and available in libc.])
- fi
- fi
- fi
;;
esac
;;
esac
+ dnl On Solaris 10, with CC in C++ mode, signbit is not available although
+ dnl is with cc in C mode. This cannot be worked around by defining
+ dnl _XOPEN_SOURCE=600, because the latter does not work in C++ mode on
+ dnl Solaris 11.0. Therefore use the replacement functions on Solaris.
+ case "$host_os" in
+ solaris*)
+ REPLACE_SIGNBIT=1
+ ;;
+ esac
+ if test $REPLACE_SIGNBIT = 1; then
+ gl_FLOAT_SIGN_LOCATION
+ gl_DOUBLE_SIGN_LOCATION
+ gl_LONG_DOUBLE_SIGN_LOCATION
+ if test "$gl_cv_cc_float_signbit" = unknown; then
+ dnl Test whether copysignf() is declared.
+ AC_CHECK_DECLS([copysignf], , , [[#include <math.h>]])
+ if test "$ac_cv_have_decl_copysignf" = yes; then
+ dnl Test whether copysignf() can be used without libm.
+ AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
+ [gl_cv_func_copysignf_no_libm],
+ [
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <math.h>
+ float x, y;]],
+ [[return copysignf (x, y) < 0;]])],
+ [gl_cv_func_copysignf_no_libm=yes],
+ [gl_cv_func_copysignf_no_libm=no])
+ ])
+ if test $gl_cv_func_copysignf_no_libm = yes; then
+ AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1],
+ [Define if the copysignf function is declared in <math.h> and available in libc.])
+ fi
+ fi
+ fi
+ if test "$gl_cv_cc_double_signbit" = unknown; then
+ dnl Test whether copysign() is declared.
+ AC_CHECK_DECLS([copysign], , , [[#include <math.h>]])
+ if test "$ac_cv_have_decl_copysign" = yes; then
+ dnl Test whether copysign() can be used without libm.
+ AC_CACHE_CHECK([whether copysign can be used without linking with libm],
+ [gl_cv_func_copysign_no_libm],
+ [
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <math.h>
+ double x, y;]],
+ [[return copysign (x, y) < 0;]])],
+ [gl_cv_func_copysign_no_libm=yes],
+ [gl_cv_func_copysign_no_libm=no])
+ ])
+ if test $gl_cv_func_copysign_no_libm = yes; then
+ AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1],
+ [Define if the copysign function is declared in <math.h> and available in libc.])
+ fi
+ fi
+ fi
+ if test "$gl_cv_cc_long_double_signbit" = unknown; then
+ dnl Test whether copysignl() is declared.
+ AC_CHECK_DECLS([copysignl], , , [[#include <math.h>]])
+ if test "$ac_cv_have_decl_copysignl" = yes; then
+ dnl Test whether copysignl() can be used without libm.
+ AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
+ [gl_cv_func_copysignl_no_libm],
+ [
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <math.h>
+ long double x, y;]],
+ [[return copysignl (x, y) < 0;]])],
+ [gl_cv_func_copysignl_no_libm=yes],
+ [gl_cv_func_copysignl_no_libm=no])
+ ])
+ if test $gl_cv_func_copysignl_no_libm = yes; then
+ AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1],
+ [Define if the copysignl function is declared in <math.h> and available in libc.])
+ fi
+ fi
+ fi
+ fi
])
AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [[
@@ -272,6 +297,7 @@ int main ()
{
/* More than one bit difference. */
fprintf (fp, "unknown");
+ fclose (fp);
return 2;
}
if (x)
@@ -284,6 +310,7 @@ int main ()
{
/* No difference. */
fprintf (fp, "unknown");
+ fclose (fp);
return 3;
}
/* Now m = plus.word[k] ^ ~minus.word[k]. */
@@ -292,6 +319,7 @@ int main ()
/* Oh? The sign bit is set in the positive and cleared in the negative
numbers? */
fprintf (fp, "unknown");
+ fclose (fp);
return 4;
}
for (i = 0; ; i++)
diff --git a/m4/size_max.m4 b/m4/size_max.m4
index 05ad1b602..1d41ce9ab 100644
--- a/m4/size_max.m4
+++ b/m4/size_max.m4
@@ -1,17 +1,19 @@
-# size_max.m4 serial 10
-dnl Copyright (C) 2003, 2005-2006, 2008-2017 Free Software Foundation, Inc.
+# size_max.m4 serial 12
+dnl Copyright (C) 2003, 2005-2006, 2008-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.
dnl From Bruno Haible.
+AC_PREREQ([2.61])
+
AC_DEFUN([gl_SIZE_MAX],
[
AC_CHECK_HEADERS([stdint.h])
dnl First test whether the system already has SIZE_MAX.
AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
- gl_cv_size_max=
+ gl_cv_size_max=no
AC_EGREP_CPP([Found it], [
#include <limits.h>
#if HAVE_STDINT_H
@@ -21,7 +23,7 @@ AC_DEFUN([gl_SIZE_MAX],
Found it
#endif
], [gl_cv_size_max=yes])
- if test -z "$gl_cv_size_max"; then
+ if test $gl_cv_size_max != yes; then
dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
dnl than the type 'unsigned long'. Try hard to find a definition that can
dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
@@ -71,9 +73,3 @@ Found it
# undef SIZE_MAX
#endif])
])
-
-dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
-dnl Remove this when we can assume autoconf >= 2.61.
-m4_ifdef([AC_COMPUTE_INT], [], [
- AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
-])
diff --git a/m4/snprintf.m4 b/m4/snprintf.m4
index e5155f798..852099408 100644
--- a/m4/snprintf.m4
+++ b/m4/snprintf.m4
@@ -1,5 +1,5 @@
# snprintf.m4 serial 7
-dnl Copyright (C) 2002-2004, 2007-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-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.
diff --git a/m4/socketlib.m4 b/m4/socketlib.m4
index c708fd260..0f8a0829c 100644
--- a/m4/socketlib.m4
+++ b/m4/socketlib.m4
@@ -1,5 +1,5 @@
-# socketlib.m4 serial 1
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+# socketlib.m4 serial 3
+dnl Copyright (C) 2008-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.
@@ -14,21 +14,27 @@ AC_DEFUN([gl_SOCKETLIB],
LIBSOCKET=
if test $HAVE_WINSOCK2_H = 1; then
dnl Native Windows API (not Cygwin).
- AC_CACHE_CHECK([if we need to call WSAStartup in winsock2.h and -lws2_32],
- [gl_cv_func_wsastartup], [
- gl_save_LIBS="$LIBS"
- LIBS="$LIBS -lws2_32"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ dnl If the function WSAStartup exists (declared in <winsock2.h> and
+ dnl defined through -lws2_32), we need to call it.
+ AC_CACHE_CHECK([for WSAStartup],
+ [gl_cv_func_wsastartup], [
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lws2_32"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
#ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
#endif]], [[
- WORD wVersionRequested = MAKEWORD(1, 1);
- WSADATA wsaData;
- int err = WSAStartup(wVersionRequested, &wsaData);
- WSACleanup ();]])],
- gl_cv_func_wsastartup=yes, gl_cv_func_wsastartup=no)
- LIBS="$gl_save_LIBS"
- ])
+ WORD wVersionRequested = MAKEWORD(1, 1);
+ WSADATA wsaData;
+ int err = WSAStartup(wVersionRequested, &wsaData);
+ WSACleanup ();
+ ]])
+ ],
+ [gl_cv_func_wsastartup=yes],
+ [gl_cv_func_wsastartup=no])
+ LIBS="$gl_save_LIBS"
+ ])
if test "$gl_cv_func_wsastartup" = "yes"; then
AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.])
LIBSOCKET='-lws2_32'
@@ -38,6 +44,10 @@ AC_DEFUN([gl_SOCKETLIB],
dnl Solaris has most socket functions in libsocket.
dnl Haiku has most socket functions in libnetwork.
dnl BeOS has most socket functions in libnet.
+ dnl On HP-UX, do NOT link with libxnet, because in 64-bit mode this would
+ dnl break code (e.g. in libraries) that invokes accept(), getpeername(),
+ dnl getsockname(), getsockopt(), or recvfrom() with a 32-bit addrlen. See
+ dnl "man xopen_networking" for details.
AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [
gl_cv_lib_socket=
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
diff --git a/m4/sockets.m4 b/m4/sockets.m4
index 0ef23bc32..02b43b6e7 100644
--- a/m4/sockets.m4
+++ b/m4/sockets.m4
@@ -1,5 +1,5 @@
# sockets.m4 serial 7
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-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.
diff --git a/m4/socklen.m4 b/m4/socklen.m4
index 0a62f49d6..eca1d1b94 100644
--- a/m4/socklen.m4
+++ b/m4/socklen.m4
@@ -1,5 +1,5 @@
-# socklen.m4 serial 10
-dnl Copyright (C) 2005-2007, 2009-2017 Free Software Foundation, Inc.
+# socklen.m4 serial 11
+dnl Copyright (C) 2005-2007, 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.
@@ -15,8 +15,8 @@ dnl So we have to test to find something that will work.
AC_DEFUN([gl_TYPE_SOCKLEN_T],
[AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl
AC_CHECK_TYPE([socklen_t], ,
- [AC_MSG_CHECKING([for socklen_t equivalent])
- AC_CACHE_VAL([gl_cv_socklen_t_equiv],
+ [AC_CACHE_CHECK([for socklen_t equivalent],
+ [gl_cv_socklen_t_equiv],
[# Systems have either "struct sockaddr *" or
# "void *" as the second argument to getpeername
gl_cv_socklen_t_equiv=
@@ -34,11 +34,10 @@ AC_DEFUN([gl_TYPE_SOCKLEN_T],
done
test "$gl_cv_socklen_t_equiv" != "" && break
done
- ])
- if test "$gl_cv_socklen_t_equiv" = ""; then
- AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
- fi
- AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
+ if test "$gl_cv_socklen_t_equiv" = ""; then
+ AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
+ fi
+ ])
AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
[type to use in place of socklen_t if not defined])],
[gl_SOCKET_HEADERS])])
diff --git a/m4/sockpfaf.m4 b/m4/sockpfaf.m4
index c2e258215..edae5d85c 100644
--- a/m4/sockpfaf.m4
+++ b/m4/sockpfaf.m4
@@ -1,5 +1,5 @@
-# sockpfaf.m4 serial 8
-dnl Copyright (C) 2004, 2006, 2009-2017 Free Software Foundation, Inc.
+# sockpfaf.m4 serial 9
+dnl Copyright (C) 2004, 2006, 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.
@@ -16,8 +16,8 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
AC_CHECK_HEADERS_ONCE([netinet/in.h])
- AC_MSG_CHECKING([for IPv4 sockets])
- AC_CACHE_VAL([gl_cv_socket_ipv4],
+ AC_CACHE_CHECK([for IPv4 sockets],
+ [gl_cv_socket_ipv4],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -31,13 +31,12 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
[[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
if (&x && &y && &z) return 0;]])],
gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)])
- AC_MSG_RESULT([$gl_cv_socket_ipv4])
if test $gl_cv_socket_ipv4 = yes; then
AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if <sys/socket.h> defines AF_INET.])
fi
- AC_MSG_CHECKING([for IPv6 sockets])
- AC_CACHE_VAL([gl_cv_socket_ipv6],
+ AC_CACHE_CHECK([for IPv6 sockets],
+ [gl_cv_socket_ipv6],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -54,7 +53,6 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
if (&x && &y && &z) return 0;]])],
gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)])
- AC_MSG_RESULT([$gl_cv_socket_ipv6])
if test $gl_cv_socket_ipv6 = yes; then
AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.])
fi
@@ -65,8 +63,8 @@ AC_DEFUN([gl_SOCKET_FAMILY_UNIX],
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
AC_CHECK_HEADERS_ONCE([sys/un.h])
- AC_MSG_CHECKING([for UNIX domain sockets])
- AC_CACHE_VAL([gl_cv_socket_unix],
+ AC_CACHE_CHECK([for UNIX domain sockets],
+ [gl_cv_socket_unix],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -80,7 +78,6 @@ AC_DEFUN([gl_SOCKET_FAMILY_UNIX],
[[int x = AF_UNIX; struct sockaddr_un y;
if (&x && &y) return 0;]])],
gl_cv_socket_unix=yes, gl_cv_socket_unix=no)])
- AC_MSG_RESULT([$gl_cv_socket_unix])
if test $gl_cv_socket_unix = yes; then
AC_DEFINE([HAVE_UNIXSOCKET], [1], [Define to 1 if <sys/socket.h> defines AF_UNIX.])
fi
diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4
index 66ba9d4ea..f0ed509fc 100644
--- a/m4/ssize_t.m4
+++ b/m4/ssize_t.m4
@@ -1,5 +1,5 @@
# ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-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.
diff --git a/m4/stat-time.m4 b/m4/stat-time.m4
index 4017fc9d7..df1c2a745 100644
--- a/m4/stat-time.m4
+++ b/m4/stat-time.m4
@@ -1,6 +1,6 @@
# Checks for stat-related time functions.
-# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2017 Free Software
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2021 Free Software
# Foundation, Inc.
# This file is free software; the Free Software Foundation
diff --git a/m4/stat.m4 b/m4/stat.m4
index 9ff77df9e..66f6c8c5c 100644
--- a/m4/stat.m4
+++ b/m4/stat.m4
@@ -1,6 +1,6 @@
-# serial 11
+# serial 17
-# Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -8,64 +8,78 @@
AC_DEFUN([gl_FUNC_STAT],
[
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
AC_CHECK_FUNCS_ONCE([lstat])
- dnl mingw is the only known platform where stat(".") and stat("./") differ
- AC_CACHE_CHECK([whether stat handles trailing slashes on directories],
- [gl_cv_func_stat_dir_slash],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <sys/stat.h>
-]], [[struct stat st; return stat (".", &st) != stat ("./", &st);]])],
- [gl_cv_func_stat_dir_slash=yes], [gl_cv_func_stat_dir_slash=no],
- [case $host_os in
- mingw*) gl_cv_func_stat_dir_slash="guessing no";;
- *) gl_cv_func_stat_dir_slash="guessing yes";;
- esac])])
- dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
- dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
- dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
- AC_CACHE_CHECK([whether stat handles trailing slashes on files],
- [gl_cv_func_stat_file_slash],
- [touch conftest.tmp
- # Assume that if we have lstat, we can also check symlinks.
- if test $ac_cv_func_lstat = yes; then
- ln -s conftest.tmp conftest.lnk
- fi
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <sys/stat.h>
+ case "$host_os" in
+ mingw*)
+ dnl On this platform, the original stat() returns st_atime, st_mtime,
+ dnl st_ctime values that are affected by the time zone.
+ REPLACE_STAT=1
+ ;;
+ *)
+ dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
+ dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
+ dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
+ AC_CACHE_CHECK([whether stat handles trailing slashes on files],
+ [gl_cv_func_stat_file_slash],
+ [touch conftest.tmp
+ # Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ ln -s conftest.tmp conftest.lnk
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/stat.h>
]], [[int result = 0;
- struct stat st;
- if (!stat ("conftest.tmp/", &st))
- result |= 1;
+ struct stat st;
+ if (!stat ("conftest.tmp/", &st))
+ result |= 1;
#if HAVE_LSTAT
- if (!stat ("conftest.lnk/", &st))
- result |= 2;
+ if (!stat ("conftest.lnk/", &st))
+ result |= 2;
#endif
- return result;
- ]])],
- [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_stat_file_slash="guessing no" ;;
- esac
- ])
- rm -f conftest.tmp conftest.lnk])
- case $gl_cv_func_stat_dir_slash in
- *no) REPLACE_STAT=1
- AC_DEFINE([REPLACE_FUNC_STAT_DIR], [1], [Define to 1 if stat needs
- help when passed a directory name with a trailing slash]);;
- esac
- case $gl_cv_func_stat_file_slash in
- *no) REPLACE_STAT=1
- AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
- help when passed a file name with a trailing slash]);;
+ return result;
+ ]])],
+ [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ rm -f conftest.tmp conftest.lnk])
+ case $gl_cv_func_stat_file_slash in
+ *no)
+ REPLACE_STAT=1
+ AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
+ help when passed a file name with a trailing slash]);;
+ esac
+ case $host_os in
+ dnl Solaris stat can return a negative tv_nsec.
+ solaris*)
+ REPLACE_FSTAT=1 ;;
+ esac
+ ;;
esac
])
-# Prerequisites of lib/stat.c.
-AC_DEFUN([gl_PREREQ_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_PREREQ_STAT_W32])
+ :
+])
+
+# Prerequisites of lib/stat-w32.c.
+AC_DEFUN([gl_PREREQ_STAT_W32], [
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ AC_CHECK_HEADERS([sdkddkver.h])
+ ;;
+ esac
+])
diff --git a/m4/std-gnu11.m4 b/m4/std-gnu11.m4
new file mode 100644
index 000000000..7b1a042af
--- /dev/null
+++ b/m4/std-gnu11.m4
@@ -0,0 +1,829 @@
+# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*-
+
+# This implementation is taken from GNU Autoconf lib/autoconf/c.m4
+# commit 017d5ddd82854911f0119691d91ea8a1438824d6
+# dated Sun Apr 3 13:57:17 2016 -0700
+# 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-2021 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# Written by David MacKenzie, with help from
+# Akim Demaille, Paul Eggert,
+# François Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
+# Roland McGrath, Noah Friedman, david d zuhn, and many others.
+
+
+# AC_PROG_CC([COMPILER ...])
+# --------------------------
+# COMPILER ... is a space separated list of C compilers to search for.
+# This just gives the user an opportunity to specify an alternative
+# search list for the C compiler.
+AC_DEFUN_ONCE([AC_PROG_CC],
+[AC_LANG_PUSH(C)dnl
+AC_ARG_VAR([CC], [C compiler command])dnl
+AC_ARG_VAR([CFLAGS], [C compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+_AC_ARG_VAR_LIBS()dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+m4_ifval([$1],
+ [AC_CHECK_TOOLS(CC, [$1])],
+[AC_CHECK_TOOL(CC, gcc)
+if test -z "$CC"; then
+ dnl Here we want:
+ dnl AC_CHECK_TOOL(CC, cc)
+ dnl but without the check for a tool without the prefix.
+ dnl Until the check is removed from there, copy the code:
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(CC, [${ac_tool_prefix}cc], [${ac_tool_prefix}cc])
+ fi
+fi
+if test -z "$CC"; then
+ AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+fi
+if test -z "$CC"; then
+ AC_CHECK_TOOLS(CC, cl.exe)
+fi
+if test -z "$CC"; then
+ AC_CHECK_TOOL(CC, clang)
+fi
+])
+
+test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH])
+
+# Provide some information about the compiler.
+_AS_ECHO_LOG([checking for _AC_LANG compiler version])
+set X $ac_compile
+ac_compiler=$[2]
+for ac_option in --version -v -V -qversion -version; do
+ _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD])
+done
+
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+_AC_LANG_COMPILER_GNU
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+_AC_PROG_CC_G
+dnl
+dnl Set ac_prog_cc_stdc to the supported C version.
+dnl Also set the documented variable ac_cv_prog_cc_stdc;
+dnl its name was chosen when it was cached, but it is no longer cached.
+_AC_PROG_CC_C11([ac_prog_cc_stdc=c11
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11],
+ [_AC_PROG_CC_C99([ac_prog_cc_stdc=c99
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99],
+ [_AC_PROG_CC_C89([ac_prog_cc_stdc=c89
+ ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89],
+ [ac_prog_cc_stdc=no
+ ac_cv_prog_cc_stdc=no])])])
+dnl
+AC_LANG_POP(C)dnl
+])# AC_PROG_CC
+
+
+
+# AC_PROG_CXX([LIST-OF-COMPILERS])
+# --------------------------------
+# LIST-OF-COMPILERS is a space separated list of C++ compilers to search
+# for (if not specified, a default list is used). This just gives the
+# user an opportunity to specify an alternative search list for the C++
+# compiler.
+# aCC HP-UX C++ compiler much better than `CC', so test before.
+# FCC Fujitsu C++ compiler
+# KCC KAI C++ compiler
+# RCC Rational C++
+# xlC_r AIX C Set++ (with support for reentrant code)
+# xlC AIX C Set++
+AC_DEFUN([AC_PROG_CXX],
+[AC_LANG_PUSH(C++)dnl
+AC_ARG_VAR([CXX], [C++ compiler command])dnl
+AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+_AC_ARG_VAR_LIBS()dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+_AC_ARG_VAR_PRECIOUS([CCC])dnl
+if test -z "$CXX"; then
+ if test -n "$CCC"; then
+ CXX=$CCC
+ else
+ AC_CHECK_TOOLS(CXX,
+ [m4_default([$1],
+ [g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++])],
+ g++)
+ fi
+fi
+# Provide some information about the compiler.
+_AS_ECHO_LOG([checking for _AC_LANG compiler version])
+set X $ac_compile
+ac_compiler=$[2]
+for ac_option in --version -v -V -qversion; do
+ _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD])
+done
+
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+_AC_LANG_COMPILER_GNU
+if test $ac_compiler_gnu = yes; then
+ GXX=yes
+else
+ GXX=
+fi
+_AC_PROG_CXX_G
+_AC_PROG_CXX_CXX11([ac_prog_cxx_stdcxx=cxx11
+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11
+ ac_cv_prog_cxx_cxx98=$ac_cv_prog_cxx_cxx11],
+ [_AC_PROG_CXX_CXX98([ac_prog_cxx_stdcxx=cxx98
+ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98],
+ [ac_prog_cxx_stdcxx=no
+ ac_cv_prog_cxx_stdcxx=no])])
+AC_LANG_POP(C++)dnl
+])# AC_PROG_CXX
+
+
+# _AC_C_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST,
+# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE)
+# --------------------------------------------------------------
+# Check whether the C compiler accepts features of STANDARD (e.g `c89', `c99')
+# by trying to compile a program of TEST-PROLOGUE and TEST-BODY. If this fails,
+# try again with each compiler option in the space-separated OPTION-LIST; if one
+# helps, append it to CC. If eventually successful, run ACTION-IF-AVAILABLE,
+# else ACTION-IF-UNAVAILABLE.
+AC_DEFUN([_AC_C_STD_TRY],
+[AC_MSG_CHECKING([for $CC option to enable ]m4_translit($1, [c], [C])[ features])
+AC_CACHE_VAL(ac_cv_prog_cc_$1,
+[ac_cv_prog_cc_$1=no
+ac_save_CC=$CC
+AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])])
+for ac_arg in '' $4
+do
+ CC="$ac_save_CC $ac_arg"
+ _AC_COMPILE_IFELSE([], [ac_cv_prog_cc_$1=$ac_arg])
+ test "x$ac_cv_prog_cc_$1" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+])# AC_CACHE_VAL
+ac_prog_cc_stdc_options=
+case "x$ac_cv_prog_cc_$1" in
+ x)
+ AC_MSG_RESULT([none needed]) ;;
+ xno)
+ AC_MSG_RESULT([unsupported]) ;;
+ *)
+ ac_prog_cc_stdc_options=" $ac_cv_prog_cc_$1"
+ CC=$CC$ac_prog_cc_stdc_options
+ AC_MSG_RESULT([$ac_cv_prog_cc_$1]) ;;
+esac
+AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$5], [$6])
+])# _AC_C_STD_TRY
+
+# _AC_C_C99_TEST_HEADER
+# ---------------------
+# A C header suitable for testing for C99.
+AC_DEFUN([_AC_C_C99_TEST_HEADER],
+[[#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+ your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static bool
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str = "";
+ int number = 0;
+ float fnumber = 0;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case 's': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case 'd': // int
+ number = va_arg (args_copy, int);
+ break;
+ case 'f': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+
+ return *str && number && fnumber;
+}]])# _AC_C_C99_TEST_HEADER
+
+# _AC_C_C99_TEST_BODY
+# -------------------
+# A C body suitable for testing for C99, assuming the corresponding header.
+AC_DEFUN([_AC_C_C99_TEST_BODY],
+[[
+ // Check bool.
+ _Bool success = false;
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ success &= test_varargs ("s, d' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+ || dynamic_array[ni.number - 1] != 543);
+]])
+
+# _AC_PROG_CC_C99 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
+# ----------------------------------------------------------------
+# If the C compiler is not in ISO C99 mode by default, try to add an
+# option to output variable CC to make it so. This macro tries
+# various options that select ISO C99 on some system or another. It
+# considers the compiler to be in ISO C99 mode if it handles _Bool,
+# // comments, flexible array members, inline, long long int, mixed
+# code and declarations, named initialization of structs, restrict,
+# va_copy, varargs macros, variable declarations in for loops and
+# variable length arrays.
+AC_DEFUN([_AC_PROG_CC_C99],
+[_AC_C_STD_TRY([c99],
+[_AC_C_C99_TEST_HEADER],
+[_AC_C_C99_TEST_BODY],
+dnl Try
+dnl GCC -std=gnu99 (unused restrictive modes: -std=c99 -std=iso9899:1999)
+dnl IBM XL C -qlanglvl=extc1x (V12.1; does not pass C11 test)
+dnl IBM XL C -qlanglvl=extc99
+dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdc99)
+dnl HP cc -AC99
+dnl Intel ICC -std=c99, -c99 (deprecated)
+dnl IRIX -c99
+dnl Solaris -D_STDC_C99=
+dnl cc's -xc99 option uses linker magic to define the external
+dnl symbol __xpg4 as if by "int __xpg4 = 1;", which enables C99
+dnl behavior for C library functions. This is not wanted here,
+dnl because it means that a single module compiled with -xc99
+dnl alters C runtime behavior for the entire program, not for
+dnl just the module. Instead, define the (private) symbol
+dnl _STDC_C99, which suppresses a bogus failure in <stdbool.h>.
+dnl The resulting compiler passes the test case here, and that's
+dnl good enough. For more, please see the thread starting at:
+dnl https://lists.gnu.org/r/autoconf/2010-12/msg00059.html
+dnl Tru64 -c99
+dnl with extended modes being tried first.
+[[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99]], [$1], [$2])[]dnl
+])# _AC_PROG_CC_C99
+
+
+# _AC_PROG_CC_C11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
+# ----------------------------------------------------------------
+# If the C compiler is not in ISO C11 mode by default, try to add an
+# option to output variable CC to make it so. This macro tries
+# various options that select ISO C11 on some system or another. It
+# considers the compiler to be in ISO C11 mode if it handles _Alignas,
+# _Alignof, _Noreturn, _Static_assert, UTF-8 string literals,
+# duplicate typedefs, and anonymous structures and unions.
+AC_DEFUN([_AC_PROG_CC_C11],
+[_AC_C_STD_TRY([c11],
+[_AC_C_C99_TEST_HEADER[
+// Check _Alignas.
+char _Alignas (double) aligned_as_double;
+char _Alignas (0) no_special_alignment;
+extern char aligned_as_int;
+char _Alignas (0) _Alignas (int) aligned_as_int;
+
+// Check _Alignof.
+enum
+{
+ int_alignment = _Alignof (int),
+ int_array_alignment = _Alignof (int[100]),
+ char_alignment = _Alignof (char)
+};
+_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
+
+// Check _Noreturn.
+int _Noreturn does_not_return (void) { for (;;) continue; }
+
+// Check _Static_assert.
+struct test_static_assert
+{
+ int x;
+ _Static_assert (sizeof (int) <= sizeof (long int),
+ "_Static_assert does not work in struct");
+ long int y;
+};
+
+// Check UTF-8 literals.
+#define u8 syntax error!
+char const utf8_literal[] = u8"happens to be ASCII" "another string";
+
+// Check duplicate typedefs.
+typedef long *long_ptr;
+typedef long int *long_ptr;
+typedef long_ptr long_ptr;
+
+// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
+struct anonymous
+{
+ union {
+ struct { int i; int j; };
+ struct { int k; long int l; } w;
+ };
+ int m;
+} v1;
+]],
+[_AC_C_C99_TEST_BODY[
+ v1.i = 2;
+ v1.w.k = 5;
+ _Static_assert ((offsetof (struct anonymous, i)
+ == offsetof (struct anonymous, w.k)),
+ "Anonymous union alignment botch");
+]],
+dnl Try
+dnl GCC -std=gnu11 (unused restrictive mode: -std=c11)
+dnl with extended modes being tried first.
+dnl
+dnl Do not try -qlanglvl=extc1x, because IBM XL C V12.1 (the latest version as
+dnl of September 2012) does not pass the C11 test. For now, try extc1x when
+dnl compiling the C99 test instead, since it enables _Static_assert and
+dnl _Noreturn, which is a win. If -qlanglvl=extc11 or -qlanglvl=extc1x passes
+dnl the C11 test in some future version of IBM XL C, we'll add it here,
+dnl preferably extc11.
+[[-std=gnu11]], [$1], [$2])[]dnl
+])# _AC_PROG_CC_C11
+
+
+# AC_PROG_CC_C89
+# --------------
+# Do not use AU_ALIAS here and in AC_PROG_CC_C99 and AC_PROG_CC_STDC,
+# as that'd be incompatible with how Automake redefines AC_PROG_CC. See
+# <https://lists.gnu.org/r/autoconf/2012-10/msg00048.html>.
+AU_DEFUN([AC_PROG_CC_C89],
+ [AC_REQUIRE([AC_PROG_CC])],
+ [$0 is obsolete; use AC_PROG_CC]
+)
+
+# AC_PROG_CC_C99
+# --------------
+AU_DEFUN([AC_PROG_CC_C99],
+ [AC_REQUIRE([AC_PROG_CC])],
+ [$0 is obsolete; use AC_PROG_CC]
+)
+
+# AC_PROG_CC_STDC
+# ---------------
+AU_DEFUN([AC_PROG_CC_STDC],
+ [AC_REQUIRE([AC_PROG_CC])],
+ [$0 is obsolete; use AC_PROG_CC]
+)
+
+
+# AC_C_PROTOTYPES
+# ---------------
+# Check if the C compiler supports prototypes, included if it needs
+# options.
+AC_DEFUN([AC_C_PROTOTYPES],
+[AC_REQUIRE([AC_PROG_CC])dnl
+if test "$ac_prog_cc_stdc" != no; then
+ AC_DEFINE(PROTOTYPES, 1,
+ [Define to 1 if the C compiler supports function prototypes.])
+ AC_DEFINE(__PROTOTYPES, 1,
+ [Define like PROTOTYPES; this can be used by system headers.])
+fi
+])# AC_C_PROTOTYPES
+
+
+# _AC_CXX_STD_TRY(STANDARD, TEST-PROLOGUE, TEST-BODY, OPTION-LIST,
+# ACTION-IF-AVAILABLE, ACTION-IF-UNAVAILABLE)
+# ----------------------------------------------------------------
+# Check whether the C++ compiler accepts features of STANDARD (e.g
+# `cxx98', `cxx11') by trying to compile a program of TEST-PROLOGUE
+# and TEST-BODY. If this fails, try again with each compiler option
+# in the space-separated OPTION-LIST; if one helps, append it to CXX.
+# If eventually successful, run ACTION-IF-AVAILABLE, else
+# ACTION-IF-UNAVAILABLE.
+AC_DEFUN([_AC_CXX_STD_TRY],
+[AC_MSG_CHECKING([for $CXX option to enable ]m4_translit(m4_translit($1, [x], [+]), [a-z], [A-Z])[ features])
+AC_LANG_PUSH(C++)dnl
+AC_CACHE_VAL(ac_cv_prog_cxx_$1,
+[ac_cv_prog_cxx_$1=no
+ac_save_CXX=$CXX
+AC_LANG_CONFTEST([AC_LANG_PROGRAM([$2], [$3])])
+for ac_arg in '' $4
+do
+ CXX="$ac_save_CXX $ac_arg"
+ _AC_COMPILE_IFELSE([], [ac_cv_prog_cxx_$1=$ac_arg])
+ test "x$ac_cv_prog_cxx_$1" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CXX=$ac_save_CXX
+])# AC_CACHE_VAL
+ac_prog_cxx_stdcxx_options=
+case "x$ac_cv_prog_cxx_$1" in
+ x)
+ AC_MSG_RESULT([none needed]) ;;
+ xno)
+ AC_MSG_RESULT([unsupported]) ;;
+ *)
+ ac_prog_cxx_stdcxx_options=" $ac_cv_prog_cxx_$1"
+ CXX=$CXX$ac_prog_cxx_stdcxx_options
+ AC_MSG_RESULT([$ac_cv_prog_cxx_$1]) ;;
+esac
+AC_LANG_POP(C++)dnl
+AS_IF([test "x$ac_cv_prog_cxx_$1" != xno], [$5], [$6])
+])# _AC_CXX_STD_TRY
+
+# _AC_CXX_CXX98_TEST_HEADER
+# -------------------------
+# A C++ header suitable for testing for CXX98.
+AC_DEFUN([_AC_CXX_CXX98_TEST_HEADER],
+[[
+#include <algorithm>
+#include <cstdlib>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <list>
+#include <map>
+#include <set>
+#include <sstream>
+#include <stdexcept>
+#include <string>
+#include <utility>
+#include <vector>
+
+namespace test {
+ typedef std::vector<std::string> string_vec;
+ typedef std::pair<int,bool> map_value;
+ typedef std::map<std::string,map_value> map_type;
+ typedef std::set<int> set_type;
+
+ template<typename T>
+ class printer {
+ public:
+ printer(std::ostringstream& os): os(os) {}
+ void operator() (T elem) { os << elem << std::endl; }
+ private:
+ std::ostringstream& os;
+ };
+}
+]])# _AC_CXX_CXX98_TEST_HEADER
+
+# _AC_CXX_CXX98_TEST_BODY
+# -----------------------
+# A C++ body suitable for testing for CXX98, assuming the corresponding header.
+AC_DEFUN([_AC_CXX_CXX98_TEST_BODY],
+[[
+
+try {
+ // Basic string.
+ std::string teststr("ASCII text");
+ teststr += " string";
+
+ // Simple vector.
+ test::string_vec testvec;
+ testvec.push_back(teststr);
+ testvec.push_back("foo");
+ testvec.push_back("bar");
+ if (testvec.size() != 3) {
+ throw std::runtime_error("vector size is not 1");
+ }
+
+ // Dump vector into stringstream and obtain string.
+ std::ostringstream os;
+ for (test::string_vec::const_iterator i = testvec.begin();
+ i != testvec.end(); ++i) {
+ if (i + 1 != testvec.end()) {
+ os << teststr << '\n';
+ }
+ }
+ // Check algorithms work.
+ std::for_each(testvec.begin(), testvec.end(), test::printer<std::string>(os));
+ std::string os_out = os.str();
+
+ // Test pair and map.
+ test::map_type testmap;
+ testmap.insert(std::make_pair(std::string("key"),
+ std::make_pair(53,false)));
+
+ // Test set.
+ int values[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
+ test::set_type testset(values, values + sizeof(values)/sizeof(values[0]));
+ std::list<int> testlist(testset.begin(), testset.end());
+ std::copy(testset.begin(), testset.end(), std::back_inserter(testlist));
+} catch (const std::exception& e) {
+ std::cerr << "Caught exception: " << e.what() << std::endl;
+
+ // Test fstream
+ std::ofstream of("test.txt");
+ of << "Test ASCII text\n" << std::flush;
+ of << "N= " << std::hex << std::setw(8) << std::left << 534 << std::endl;
+ of.close();
+}
+std::exit(0);
+]])
+
+# _AC_CXX_CXX11_TEST_HEADER
+# -------------------------
+# A C++ header suitable for testing for CXX11.
+AC_DEFUN([_AC_CXX_CXX11_TEST_HEADER],
+[[
+#include <deque>
+#include <functional>
+#include <memory>
+#include <tuple>
+#include <array>
+#include <regex>
+#include <iostream>
+
+namespace cxx11test
+{
+ typedef std::shared_ptr<std::string> sptr;
+ typedef std::weak_ptr<std::string> wptr;
+
+ typedef std::tuple<std::string,int,double> tp;
+ typedef std::array<int, 20> int_array;
+
+ constexpr int get_val() { return 20; }
+
+ struct testinit
+ {
+ int i;
+ double d;
+ };
+
+ class delegate {
+ public:
+ delegate(int n) : n(n) {}
+ delegate(): delegate(2354) {}
+
+ virtual int getval() { return this->n; };
+ protected:
+ int n;
+ };
+
+ class overridden : public delegate {
+ public:
+ overridden(int n): delegate(n) {}
+ virtual int getval() override final { return this->n * 2; }
+ };
+
+ class nocopy {
+ public:
+ nocopy(int i): i(i) {}
+ nocopy() = default;
+ nocopy(const nocopy&) = delete;
+ nocopy & operator=(const nocopy&) = delete;
+ private:
+ int i;
+ };
+}
+]])# _AC_CXX_CXX11_TEST_HEADER
+
+# _AC_CXX_CXX11_TEST_BODY
+# -----------------------
+# A C++ body suitable for testing for CXX11, assuming the corresponding header.
+AC_DEFUN([_AC_CXX_CXX11_TEST_BODY],
+[[
+{
+ // Test auto and decltype
+ std::deque<int> d;
+ d.push_front(43);
+ d.push_front(484);
+ d.push_front(3);
+ d.push_front(844);
+ int total = 0;
+ for (auto i = d.begin(); i != d.end(); ++i) { total += *i; }
+
+ auto a1 = 6538;
+ auto a2 = 48573953.4;
+ auto a3 = "String literal";
+
+ decltype(a2) a4 = 34895.034;
+}
+{
+ // Test constexpr
+ short sa[cxx11test::get_val()] = { 0 };
+}
+{
+ // Test initializer lists
+ cxx11test::testinit il = { 4323, 435234.23544 };
+}
+{
+ // Test range-based for and lambda
+ cxx11test::int_array array = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
+ for (int &x : array) { x += 23; }
+ std::for_each(array.begin(), array.end(), [](int v1){ std::cout << v1; });
+}
+{
+ using cxx11test::sptr;
+ using cxx11test::wptr;
+
+ sptr sp(new std::string("ASCII string"));
+ wptr wp(sp);
+ sptr sp2(wp);
+}
+{
+ cxx11test::tp tuple("test", 54, 45.53434);
+ double d = std::get<2>(tuple);
+ std::string s;
+ int i;
+ std::tie(s,i,d) = tuple;
+}
+{
+ static std::regex filename_regex("^_?([a-z0-9_.]+-)+[a-z0-9]+$");
+ std::string testmatch("Test if this string matches");
+ bool match = std::regex_search(testmatch, filename_regex);
+}
+{
+ cxx11test::int_array array = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
+ cxx11test::int_array::size_type size = array.size();
+}
+{
+ // Test constructor delegation
+ cxx11test::delegate d1;
+ cxx11test::delegate d2();
+ cxx11test::delegate d3(45);
+}
+{
+ // Test override and final
+ cxx11test::overridden o1(55464);
+}
+{
+ // Test nullptr
+ char *c = nullptr;
+}
+{
+ // Test template brackets
+ std::vector<std::pair<int,char*>> v1;
+}
+{
+ // Unicode literals
+ char const *utf8 = u8"UTF-8 string \u2500";
+ char16_t const *utf16 = u"UTF-8 string \u2500";
+ char32_t const *utf32 = U"UTF-32 string \u2500";
+}
+]])
+
+# _AC_PROG_CXX_CXX98 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
+# -------------------------------------------------------------------
+
+# If the C++ compiler is not in ISO C++98 mode by default, try to add
+# an option to output variable CXX to make it so. This macro tries
+# various options that select ISO C++98 on some system or another. It
+# considers the compiler to be in ISO C++98 mode if it handles basic
+# features of the std namespace including: string, containers (list,
+# map, set, vector), streams (fstreams, iostreams, stringstreams,
+# iomanip), pair, exceptions and algorithms.
+
+
+AC_DEFUN([_AC_PROG_CXX_CXX98],
+[_AC_CXX_STD_TRY([cxx98],
+[_AC_CXX_CXX98_TEST_HEADER],
+[_AC_CXX_CXX98_TEST_BODY],
+dnl Try
+dnl GCC -std=gnu++98 (unused restrictive mode: -std=c++98)
+dnl IBM XL C -qlanglvl=extended
+dnl HP aC++ -AA
+dnl Intel ICC -std=gnu++98
+dnl Solaris N/A (default)
+dnl Tru64 N/A (default, but -std gnu could be used)
+dnl with extended modes being tried first.
+[[-std=gnu++98 -std=c++98 -qlanglvl=extended -AA]], [$1], [$2])[]dnl
+])# _AC_PROG_CXX_CXX98
+
+# _AC_PROG_CXX_CXX11 ([ACTION-IF-AVAILABLE], [ACTION-IF-UNAVAILABLE])
+# -------------------------------------------------------------------
+# If the C++ compiler is not in ISO CXX11 mode by default, try to add
+# an option to output variable CXX to make it so. This macro tries
+# various options that select ISO C++11 on some system or another. It
+# considers the compiler to be in ISO C++11 mode if it handles all the
+# tests from the C++98 checks, plus the following: Language features
+# (auto, constexpr, decltype, default/deleted constructors, delegate
+# constructors, final, initializer lists, lambda functions, nullptr,
+# override, range-based for loops, template brackets without spaces,
+# unicode literals) and library features (array, memory (shared_ptr,
+# weak_ptr), regex and tuple types).
+AC_DEFUN([_AC_PROG_CXX_CXX11],
+[_AC_CXX_STD_TRY([cxx11],
+[_AC_CXX_CXX11_TEST_HEADER
+_AC_CXX_CXX98_TEST_HEADER],
+[_AC_CXX_CXX11_TEST_BODY
+_AC_CXX_CXX98_TEST_BODY],
+dnl Try
+dnl GCC -std=gnu++11 (unused restrictive mode: -std=c++11) [and 0x variants]
+dnl IBM XL C -qlanglvl=extended0x
+dnl (pre-V12.1; unused restrictive mode: -qlanglvl=stdcxx11)
+dnl HP aC++ -AA
+dnl Intel ICC -std=c++11 -std=c++0x
+dnl Solaris N/A (no support)
+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/stdalign.m4 b/m4/stdalign.m4
index 3a1265824..8dcb634d5 100644
--- a/m4/stdalign.m4
+++ b/m4/stdalign.m4
@@ -1,6 +1,6 @@
# Check for stdalign.h that conforms to C11.
-dnl Copyright 2011-2017 Free Software Foundation, Inc.
+dnl Copyright 2011-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.
@@ -18,7 +18,7 @@ AC_DEFUN([gl_STDALIGN_H],
/* Test that alignof yields a result consistent with offsetof.
This catches GCC bug 52023
- <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. */
#ifdef __cplusplus
template <class t> struct alignof_helper { char a; t b; };
# define ao(type) offsetof (alignof_helper<type>, b)
@@ -35,8 +35,8 @@ AC_DEFUN([gl_STDALIGN_H],
|| (defined __APPLE__ && defined __MACH__ \
? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
: __GNUC__) \
- || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \
- || __ICC || 0x5110 <= __SUNPRO_C \
+ || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+ || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
|| 1300 <= _MSC_VER)
struct alignas_test { char c; char alignas (8) alignas_8; };
char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
index d36812336..3169779d4 100644
--- a/m4/stdbool.m4
+++ b/m4/stdbool.m4
@@ -1,22 +1,36 @@
# Check for stdbool.h that conforms to C99.
-dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 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.
-#serial 7
+#serial 8
# Prepare for substituting <stdbool.h> if it is not supported.
AC_DEFUN([AM_STDBOOL_H],
[
AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
+ AC_REQUIRE([AC_CANONICAL_HOST])
- # Define two additional variables used in the Makefile substitution.
-
+ dnl On some platforms, <stdbool.h> does not exist or does not conform to C99.
+ dnl On Solaris 10 with CC=cc CXX=CC, <stdbool.h> exists but is not usable
+ dnl in C++ mode (and no <cstdbool> exists). In this case, we use our
+ dnl replacement, also in C mode (for binary compatibility between C and C++).
if test "$ac_cv_header_stdbool_h" = yes; then
- STDBOOL_H=''
+ case "$host_os" in
+ solaris*)
+ if test -z "$GCC"; then
+ STDBOOL_H='stdbool.h'
+ else
+ STDBOOL_H=''
+ fi
+ ;;
+ *)
+ STDBOOL_H=''
+ ;;
+ esac
else
STDBOOL_H='stdbool.h'
fi
@@ -87,8 +101,8 @@ AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
char o[sizeof n == m * sizeof n[0] ? 1 : -1];
char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
/* Catch a bug in an HP-UX C compiler. See
- http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
- http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
*/
Bool q = true;
Bool *pq = &q;
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
index f45def101..cd666c4a5 100644
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -1,22 +1,54 @@
-dnl A placeholder for <stddef.h>, for platforms that have issues.
-# stddef_h.m4 serial 5
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# stddef_h.m4 serial 9
+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.
+dnl A placeholder for <stddef.h>, for platforms that have issues.
+
AC_DEFUN([gl_STDDEF_H],
[
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
AC_REQUIRE([gt_TYPE_WCHAR_T])
+
+ dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
STDDEF_H=
- AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h],
- [[#include <stddef.h>
- ]])
+
+ 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".
+ AC_CACHE_CHECK([for good max_align_t],
+ [gl_cv_type_max_align_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ unsigned int s = sizeof (max_align_t);
+ #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
+ int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
+ int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
+ #endif
+ typedef struct { char a; max_align_t b; } max_helper;
+ typedef struct { char a; long b; } long_helper;
+ typedef struct { char a; double b; } double_helper;
+ typedef struct { char a; long double b; } long_double_helper;
+ int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1];
+ int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1];
+ int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1];
+ ]])],
+ [gl_cv_type_max_align_t=yes],
+ [gl_cv_type_max_align_t=no])
+ ])
+ if test $gl_cv_type_max_align_t = no; then
+ HAVE_MAX_ALIGN_T=0
+ STDDEF_H=stddef.h
+ fi
+
if test $gt_cv_c_wchar_t = no; then
HAVE_WCHAR_T=0
STDDEF_H=stddef.h
fi
+
AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
[gl_cv_decl_null_works],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
@@ -28,6 +60,7 @@ AC_DEFUN([gl_STDDEF_H],
REPLACE_NULL=1
STDDEF_H=stddef.h
fi
+
AC_SUBST([STDDEF_H])
AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"])
if test -n "$STDDEF_H"; then
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index 4ac854d51..a785b44ed 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,5 +1,5 @@
-# stdint.m4 serial 50
-dnl Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# stdint.m4 serial 58
+dnl Copyright (C) 2001-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.
@@ -7,28 +7,22 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert and Bruno Haible.
dnl Test whether <stdint.h> is supported or must be substituted.
+AC_PREREQ([2.61])
+
AC_DEFUN_ONCE([gl_STDINT_H],
[
AC_PREREQ([2.59])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_REQUIRE([gl_LIMITS_H])
AC_REQUIRE([gt_TYPE_WINT_T])
- dnl Check for long long int and unsigned long long int.
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
- if test $ac_cv_type_long_long_int = yes; then
- HAVE_LONG_LONG_INT=1
- else
- HAVE_LONG_LONG_INT=0
- fi
- AC_SUBST([HAVE_LONG_LONG_INT])
- AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
- if test $ac_cv_type_unsigned_long_long_int = yes; then
- HAVE_UNSIGNED_LONG_LONG_INT=1
- else
- HAVE_UNSIGNED_LONG_LONG_INT=0
- fi
- AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT])
+ dnl For backward compatibility. Some packages may still be testing these
+ dnl macros.
+ AC_DEFINE([HAVE_LONG_LONG_INT], [1],
+ [Define to 1 if the system has the type 'long long int'.])
+ AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
+ [Define to 1 if the system has the type 'unsigned long long int'.])
dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does.
AC_CHECK_HEADERS_ONCE([wchar.h])
@@ -40,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
@@ -49,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
@@ -158,7 +152,7 @@ uintmax_t j = UINTMAX_MAX;
/* Check that SIZE_MAX has the correct type, if possible. */
#if 201112 <= __STDC_VERSION__
int k = _Generic (SIZE_MAX, size_t: 0);
-#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
+#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
|| (0x5110 <= __SUNPRO_C && !__STDC__))
extern size_t k;
extern __typeof__ (SIZE_MAX) k;
@@ -288,8 +282,12 @@ static const char *macro_values[] =
]])],
[gl_cv_header_working_stdint_h=yes],
[],
- [dnl When cross-compiling, assume it works.
- gl_cv_header_working_stdint_h=yes
+ [case "$host_os" in
+ # Guess yes on native Windows.
+ mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
+ # In general, assume it works.
+ *) gl_cv_header_working_stdint_h="guessing yes" ;;
+ esac
])
])
])
@@ -299,15 +297,17 @@ static const char *macro_values[] =
HAVE_SYS_BITYPES_H=0
HAVE_SYS_INTTYPES_H=0
STDINT_H=stdint.h
- if test "$gl_cv_header_working_stdint_h" = yes; then
- HAVE_C99_STDINT_H=1
- dnl Now see whether the system <stdint.h> works without
- dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
- AC_CACHE_CHECK([whether stdint.h predates C++11],
- [gl_cv_header_stdint_predates_cxx11_h],
- [gl_cv_header_stdint_predates_cxx11_h=yes
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
+ case "$gl_cv_header_working_stdint_h" in
+ *yes)
+ HAVE_C99_STDINT_H=1
+ dnl Now see whether the system <stdint.h> works without
+ dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
+ dnl If not, there would be problems when stdint.h is included from C++.
+ AC_CACHE_CHECK([whether stdint.h works without ISO C predefines],
+ [gl_cv_header_stdint_without_STDC_macros],
+ [gl_cv_header_stdint_without_STDC_macros=no
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
#include <stdint.h>
]
@@ -315,49 +315,51 @@ gl_STDINT_INCLUDES
[
intmax_t im = INTMAX_MAX;
int32_t i32 = INT32_C (0x7fffffff);
- ]])],
- [gl_cv_header_stdint_predates_cxx11_h=no])])
+ ]])],
+ [gl_cv_header_stdint_without_STDC_macros=yes])
+ ])
- if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
- AC_DEFINE([__STDC_CONSTANT_MACROS], [1],
- [Define to 1 if the system <stdint.h> predates C++11.])
- AC_DEFINE([__STDC_LIMIT_MACROS], [1],
- [Define to 1 if the system <stdint.h> predates C++11.])
- fi
- AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.],
- [gl_cv_header_stdint_width],
- [gl_cv_header_stdint_width=no
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
- /* Work if build is not clean. */
- #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
- #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
- #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
- #endif
- #include <stdint.h>
- ]gl_STDINT_INCLUDES[
- int iw = UINTMAX_WIDTH;
- ]])],
- [gl_cv_header_stdint_width=yes])])
- if test "$gl_cv_header_stdint_width" = yes; then
- STDINT_H=
- fi
- else
- dnl Check for <sys/inttypes.h>, and for
- dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
- AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
- if test $ac_cv_header_sys_inttypes_h = yes; then
- HAVE_SYS_INTTYPES_H=1
- fi
- if test $ac_cv_header_sys_bitypes_h = yes; then
- HAVE_SYS_BITYPES_H=1
- fi
- gl_STDINT_TYPE_PROPERTIES
- fi
+ if test $gl_cv_header_stdint_without_STDC_macros = no; then
+ AC_DEFINE([__STDC_CONSTANT_MACROS], [1],
+ [Define to 1 if the system <stdint.h> predates C++11.])
+ AC_DEFINE([__STDC_LIMIT_MACROS], [1],
+ [Define to 1 if the system <stdint.h> predates C++11.])
+ fi
+ AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.],
+ [gl_cv_header_stdint_width],
+ [gl_cv_header_stdint_width=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ /* Work if build is not clean. */
+ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
+ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+ #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+ #endif
+ #include <stdint.h>
+ ]gl_STDINT_INCLUDES[
+ int iw = UINTMAX_WIDTH;
+ ]])],
+ [gl_cv_header_stdint_width=yes])])
+ if test "$gl_cv_header_stdint_width" = yes; then
+ STDINT_H=
+ fi
+ ;;
+ *)
+ dnl Check for <sys/inttypes.h>, and for
+ dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
+ AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
+ if test $ac_cv_header_sys_inttypes_h = yes; then
+ HAVE_SYS_INTTYPES_H=1
+ fi
+ if test $ac_cv_header_sys_bitypes_h = yes; then
+ HAVE_SYS_BITYPES_H=1
+ fi
+ gl_STDINT_TYPE_PROPERTIES
+ ;;
+ esac
dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
- LIMITS_H=limits.h
- AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+ gl_REPLACE_LIMITS_H
AC_SUBST([HAVE_C99_STDINT_H])
AC_SUBST([HAVE_SYS_BITYPES_H])
@@ -491,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
]])
@@ -533,9 +531,3 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
BITSIZEOF_WINT_T=32
fi
])
-
-dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
-dnl Remove this when we can assume autoconf >= 2.61.
-m4_ifdef([AC_COMPUTE_INT], [], [
- AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
-])
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4
index 786eaa3c9..18aa50a4a 100644
--- a/m4/stdint_h.m4
+++ b/m4/stdint_h.m4
@@ -1,5 +1,5 @@
# stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-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.
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 9ffbb852e..4c3f24acc 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 48
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# stdio_h.m4 serial 52
+dnl Copyright (C) 2007-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.
@@ -28,7 +28,7 @@ AC_DEFUN([gl_STDIO_H],
/* For non-mingw systems, compilation will trivially succeed.
For mingw, compilation will succeed for older mingw (system
printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
- #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \
+ #if (defined _WIN32 && ! defined __CYGWIN__) && \
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
#endif
@@ -107,6 +107,13 @@ AC_DEFUN([gl_STDIO_H],
gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen
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],
@@ -173,7 +180,15 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
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])
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 110fe2d1a..5a02972e0 100644
--- a/m4/stdlib_h.m4
+++ b/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 43
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 55
+dnl Copyright (C) 2007-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.
@@ -14,16 +14,36 @@ AC_DEFUN([gl_STDLIB_H],
dnl guaranteed by C89.
gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
#if HAVE_SYS_LOADAVG_H
+/* OpenIndiana has a bug: <sys/time.h> must be included before
+ <sys/loadavg.h>. */
+# include <sys/time.h>
# include <sys/loadavg.h>
#endif
#if HAVE_RANDOM_H
# include <random.h>
#endif
- ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
- initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
- posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch
- secure_getenv setenv setstate setstate_r srandom srandom_r
- strtod strtoll strtoull unlockpt unsetenv])
+ ]], [_Exit aligned_alloc atoll canonicalize_file_name free
+ getloadavg getsubopt grantpt
+ initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps
+ posix_memalign posix_openpt ptsname ptsname_r qsort_r
+ 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],
@@ -38,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])
@@ -51,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])
@@ -58,30 +81,46 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
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])
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])
+ HAVE_INITSTATE=1; AC_SUBST([HAVE_INITSTATE])
+ HAVE_DECL_INITSTATE=1; AC_SUBST([HAVE_DECL_INITSTATE])
+ HAVE_MBTOWC=1; AC_SUBST([HAVE_MBTOWC])
HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
HAVE_MKOSTEMP=1; AC_SUBST([HAVE_MKOSTEMP])
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])
@@ -89,32 +128,43 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM])
HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H])
HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
+ HAVE_REALLOCARRAY=1; AC_SUBST([HAVE_REALLOCARRAY])
HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH])
HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV])
HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV])
+ HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE])
+ HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE])
HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
+ HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD])
HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
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_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])
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_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_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD])
REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV])
REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB])
])
diff --git a/m4/strdup.m4 b/m4/strdup.m4
index a92dbd63b..f6f421d94 100644
--- a/m4/strdup.m4
+++ b/m4/strdup.m4
@@ -1,6 +1,6 @@
-# strdup.m4 serial 13
+# strdup.m4 serial 14
-dnl Copyright (C) 2002-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-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,
@@ -9,7 +9,6 @@ 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_CHECK_FUNCS_ONCE([strdup])
AC_CHECK_DECLS_ONCE([strdup])
if test $ac_cv_have_decl_strdup = no; then
HAVE_DECL_STRDUP=0
@@ -20,11 +19,8 @@ AC_DEFUN([gl_FUNC_STRDUP_POSIX],
[
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
- AC_CHECK_FUNCS_ONCE([strdup])
- if test $ac_cv_func_strdup = yes; then
- if test $gl_cv_func_malloc_posix != yes; then
- REPLACE_STRDUP=1
- fi
+ if test $gl_cv_func_malloc_posix != yes; then
+ REPLACE_STRDUP=1
fi
AC_CHECK_DECLS_ONCE([strdup])
if test $ac_cv_have_decl_strdup = no; then
diff --git a/m4/string_h.m4 b/m4/string_h.m4
index 3d2ad2219..a4cc5b437 100644
--- a/m4/string_h.m4
+++ b/m4/string_h.m4
@@ -1,11 +1,11 @@
# Configure a GNU-like replacement for <string.h>.
-# Copyright (C) 2007-2017 Free Software Foundation, Inc.
+# Copyright (C) 2007-2021 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 21
+# serial 29
# Written by Paul Eggert.
@@ -18,7 +18,6 @@ AC_DEFUN([gl_HEADER_STRING_H],
AC_DEFUN([gl_HEADER_STRING_H_BODY],
[
- AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
gl_NEXT_HEADERS([string.h])
@@ -29,7 +28,9 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
]],
[ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
- strerror_r strsignal strverscmp])
+ strerror_r strerrorname_np sigabbrev_np sigdescr_np strsignal strverscmp])
+
+ AC_REQUIRE([AC_C_RESTRICT])
])
AC_DEFUN([gl_STRING_MODULE_INDICATOR],
@@ -43,48 +44,55 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR],
AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
[
- 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_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL])
- GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
- HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
+ 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])
HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL])
- HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR])
HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR])
@@ -100,21 +108,26 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR])
HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R])
HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R])
+ HAVE_STRERRORNAME_NP=1; AC_SUBST([HAVE_STRERRORNAME_NP])
+ HAVE_SIGABBREV_NP=1; AC_SUBST([HAVE_SIGABBREV_NP])
+ HAVE_SIGDESCR_NP=1; AC_SUBST([HAVE_SIGDESCR_NP])
HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
+ REPLACE_FFSLL=0; AC_SUBST([REPLACE_FFSLL])
REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
+ REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
+ REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
+ REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
+ REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN])
REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
- REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
+ REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R])
- REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
- REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
- REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN])
+ REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP])
REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
- REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
])
diff --git a/m4/sys_file_h.m4 b/m4/sys_file_h.m4
index 631757211..99c2285dd 100644
--- a/m4/sys_file_h.m4
+++ b/m4/sys_file_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <sys/file.h>.
# serial 6
-# Copyright (C) 2008-2017 Free Software Foundation, Inc.
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_random_h.m4 b/m4/sys_random_h.m4
new file mode 100644
index 000000000..45e0469ba
--- /dev/null
+++ b/m4/sys_random_h.m4
@@ -0,0 +1,53 @@
+# sys_random_h.m4 serial 5
+dnl Copyright (C) 2020-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_HEADER_SYS_RANDOM],
+[
+ AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
+ dnl <sys/random.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([sys/random.h])
+ if test $ac_cv_header_sys_random_h = yes; then
+ HAVE_SYS_RANDOM_H=1
+ else
+ HAVE_SYS_RANDOM_H=0
+ fi
+ AC_SUBST([HAVE_SYS_RANDOM_H])
+
+ m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+ if test $ac_cv_header_sys_random_h = yes; then
+ UNISTD_H_HAVE_SYS_RANDOM_H=1
+ fi
+
+ 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([[
+#if HAVE_SYS_RANDOM_H
+/* Additional includes are needed before <sys/random.h> on uClibc
+ and Mac OS X. */
+# include <sys/types.h>
+# include <stdlib.h>
+# include <sys/random.h>
+#endif
+ ]],
+ [getrandom])
+])
+
+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])
+ 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_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/m4/sys_select_h.m4 b/m4/sys_select_h.m4
index 4ec28009d..4b33d312e 100644
--- a/m4/sys_select_h.m4
+++ b/m4/sys_select_h.m4
@@ -1,5 +1,5 @@
# sys_select_h.m4 serial 20
-dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-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.
diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4
index 3ecbe7c02..503cb9668 100644
--- a/m4/sys_socket_h.m4
+++ b/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
-# sys_socket_h.m4 serial 23
-dnl Copyright (C) 2005-2017 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 25
+dnl Copyright (C) 2005-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.
@@ -95,6 +95,8 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
#include <sys/socket.h>
]], [socket connect accept bind getpeername getsockname getsockopt
listen recv send recvfrom sendto setsockopt shutdown accept4])
+
+ AC_REQUIRE([AC_C_RESTRICT])
])
AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
@@ -104,17 +106,11 @@ AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
gl_CHECK_NEXT_HEADERS([sys/socket.h])
if test $ac_cv_header_sys_socket_h = yes; then
HAVE_SYS_SOCKET_H=1
- HAVE_WS2TCPIP_H=0
else
HAVE_SYS_SOCKET_H=0
- if test $ac_cv_header_ws2tcpip_h = yes; then
- HAVE_WS2TCPIP_H=1
- else
- HAVE_WS2TCPIP_H=0
- fi
fi
AC_SUBST([HAVE_SYS_SOCKET_H])
- AC_SUBST([HAVE_WS2TCPIP_H])
+ gl_PREREQ_SYS_H_WS2TCPIP
])
# Common prerequisites of the <sys/socket.h> replacement and of the
@@ -142,6 +138,24 @@ AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
AC_SUBST([HAVE_WINSOCK2_H])
])
+# Common prerequisites of the <sys/socket.h> replacement and of the
+# <arpa/inet.h> replacement.
+# Sets and substitutes HAVE_WS2TCPIP_H.
+AC_DEFUN([gl_PREREQ_SYS_H_WS2TCPIP],
+[
+ AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+ if test $ac_cv_header_sys_socket_h = yes; then
+ HAVE_WS2TCPIP_H=0
+ else
+ if test $ac_cv_header_ws2tcpip_h = yes; then
+ HAVE_WS2TCPIP_H=1
+ else
+ HAVE_WS2TCPIP_H=0
+ fi
+ fi
+ AC_SUBST([HAVE_WS2TCPIP_H])
+])
+
AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4
index 1e34ac40d..23cbdd28e 100644
--- a/m4/sys_stat_h.m4
+++ b/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
-# sys_stat_h.m4 serial 28 -*- Autoconf -*-
-dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 38 -*- Autoconf -*-
+dnl Copyright (C) 2006-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.
@@ -19,18 +19,21 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
dnl Ensure the type mode_t gets defined.
AC_REQUIRE([AC_TYPE_MODE_T])
- dnl Whether to override 'struct stat'.
+ dnl Whether to enable precise timestamps in 'struct stat'.
+ m4_ifdef([gl_WINDOWS_STAT_TIMESPEC], [
+ AC_REQUIRE([gl_WINDOWS_STAT_TIMESPEC])
+ ], [
+ WINDOWS_STAT_TIMESPEC=0
+ ])
+ AC_SUBST([WINDOWS_STAT_TIMESPEC])
+
+ dnl Whether to ensure that struct stat.st_size is 64-bit wide.
m4_ifdef([gl_LARGEFILE], [
AC_REQUIRE([gl_LARGEFILE])
], [
WINDOWS_64_BIT_ST_SIZE=0
])
AC_SUBST([WINDOWS_64_BIT_ST_SIZE])
- if test $WINDOWS_64_BIT_ST_SIZE = 1; then
- AC_DEFINE([_GL_WINDOWS_64_BIT_ST_SIZE], [1],
- [Define to 1 if Gnulib overrides 'struct stat' on Windows so that
- struct stat.st_size becomes 64-bit.])
- fi
dnl Define types that are supposed to be defined in <sys/types.h> or
dnl <sys/stat.h>.
@@ -43,9 +46,11 @@ AC_DEFUN([gl_HEADER_SYS_STAT_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 <sys/stat.h>
- ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
- mknod mknodat stat utimensat])
-]) # gl_HEADER_SYS_STAT_H
+ ]], [fchmodat fstat fstatat futimens getumask lchmod lstat
+ mkdirat mkfifo mkfifoat mknod mknodat stat utimensat])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
[
@@ -63,8 +68,10 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
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])
@@ -72,10 +79,16 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
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])
HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS])
+ HAVE_GETUMASK=1; AC_SUBST([HAVE_GETUMASK])
HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD])
HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT])
HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT])
@@ -84,13 +97,16 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD])
HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT])
HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT])
+ REPLACE_FCHMODAT=0; AC_SUBST([REPLACE_FCHMODAT])
REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT])
REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT])
REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS])
REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT])
REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR])
REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO])
+ REPLACE_MKFIFOAT=0; AC_SUBST([REPLACE_MKFIFOAT])
REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD])
+ REPLACE_MKNODAT=0; AC_SUBST([REPLACE_MKNODAT])
REPLACE_STAT=0; AC_SUBST([REPLACE_STAT])
REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT])
])
diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4
index e622dbe9a..64f133d51 100644
--- a/m4/sys_time_h.m4
+++ b/m4/sys_time_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <sys/time.h>.
-# serial 8
+# serial 9
-# Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2021 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.
@@ -105,7 +105,6 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS],
HAVE_GETTIMEOFDAY=1; AC_SUBST([HAVE_GETTIMEOFDAY])
HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL])
HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H])
- HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY])
REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL])
])
diff --git a/m4/sys_times_h.m4 b/m4/sys_times_h.m4
index 078e5238c..b9daaa7ca 100644
--- a/m4/sys_times_h.m4
+++ b/m4/sys_times_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <sys/times.h>.
# serial 8
-# Copyright (C) 2008-2017 Free Software Foundation, Inc.
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4
index 2eb4e9e44..2172c836d 100644
--- a/m4/sys_types_h.m4
+++ b/m4/sys_types_h.m4
@@ -1,11 +1,14 @@
-# sys_types_h.m4 serial 6
-dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# sys_types_h.m4 serial 11
+dnl Copyright (C) 2011-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_ONCE([gl_SYS_TYPES_H],
[
+ 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])
@@ -17,6 +20,14 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H],
dnl Whether to override the 'off_t' type.
AC_REQUIRE([gl_TYPE_OFF_T])
+
+ dnl Whether to override the 'dev_t' and 'ino_t' types.
+ m4_ifdef([gl_WINDOWS_STAT_INODES], [
+ AC_REQUIRE([gl_WINDOWS_STAT_INODES])
+ ], [
+ WINDOWS_STAT_INODES=0
+ ])
+ AC_SUBST([WINDOWS_STAT_INODES])
])
AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
@@ -24,26 +35,24 @@ AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
])
# This works around a buggy version in autoconf <= 2.69.
-# See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html>
+# 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:
-# http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98
+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/sys_uio_h.m4 b/m4/sys_uio_h.m4
index 68ef08848..503de4d1f 100644
--- a/m4/sys_uio_h.m4
+++ b/m4/sys_uio_h.m4
@@ -1,5 +1,5 @@
# sys_uio_h.m4 serial 1
-dnl Copyright (C) 2011-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-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.
diff --git a/m4/tempname.m4 b/m4/tempname.m4
index a59f4c086..14c796d3e 100644
--- a/m4/tempname.m4
+++ b/m4/tempname.m4
@@ -1,6 +1,6 @@
#serial 5
-# Copyright (C) 2006-2007, 2009-2017 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/threadlib.m4 b/m4/threadlib.m4
new file mode 100644
index 000000000..20b383a88
--- /dev/null
+++ b/m4/threadlib.m4
@@ -0,0 +1,622 @@
+# threadlib.m4 serial 29
+dnl Copyright (C) 2005-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.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.60])
+
+dnl The general structure of the multithreading modules in gnulib is that we
+dnl have three set of modules:
+dnl
+dnl * POSIX API:
+dnl pthread, which combines
+dnl pthread-h
+dnl pthread-thread
+dnl pthread-once
+dnl pthread-mutex
+dnl pthread-rwlock
+dnl pthread-cond
+dnl pthread-tss
+dnl pthread-spin
+dnl sched_yield
+dnl
+dnl * ISO C API:
+dnl threads, which combines
+dnl threads-h
+dnl thrd
+dnl mtx
+dnl cnd
+dnl tss
+dnl
+dnl * Gnulib API, with an implementation that can be chosen at configure
+dnl time through the option --enable-threads=...
+dnl thread
+dnl lock
+dnl cond
+dnl tls
+dnl yield
+dnl
+dnl They are independent, except for the fact that
+dnl - the implementation of the ISO C API may use the POSIX (or some other
+dnl platform dependent) API,
+dnl - the implementation of the Gnulib API may use the POSIX or ISO C or
+dnl some other platform dependent API, depending on the --enable-threads
+dnl option.
+dnl
+dnl This file contains macros for all of these APIs!
+
+dnl ============================================================================
+dnl Macros for all thread APIs
+
+AC_DEFUN([gl_ANYTHREADLIB_EARLY],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ if test -z "$gl_anythreadlib_early_done"; then
+ case "$host_os" in
+ osf*)
+ # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+ # groks <pthread.h>. cc also understands the flag -pthread, but
+ # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+ # 2. putting a flag into CPPFLAGS that has an effect on the linker
+ # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
+ # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+ ;;
+ esac
+ # Some systems optimize for single-threaded programs by default, and
+ # need special flags to disable these optimizations. For example, the
+ # definition of 'errno' in <errno.h>.
+ case "$host_os" in
+ aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+ solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
+ esac
+ gl_anythreadlib_early_done=done
+ fi
+])
+
+dnl Checks whether the compiler and linker support weak declarations of symbols.
+
+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 ();
+#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([[
+#include <stdio.h>
+#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
+ dnl But when linking statically, weak symbols don't work.
+ case " $LDFLAGS " in
+ *" -static "*) gl_cv_have_weak=no ;;
+ esac
+ dnl Test for a bug in FreeBSD 11: A link error occurs when using a weak
+ dnl symbol and linking against a shared library that has a dependency on
+ dnl the shared library that defines the symbol.
+ case "$gl_cv_have_weak" in
+ *yes)
+ case "$host_os" in
+ freebsd* | dragonfly*)
+ : > conftest1.c
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&AS_MESSAGE_LOG_FD 2>&1
+ cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+ return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&AS_MESSAGE_LOG_FD 2>&1 \
+ || gl_cv_have_weak=no
+ rm -f conftest1.c libempty.so conftest2.c conftest
+ ;;
+ esac
+ ;;
+ esac
+ ])
+ case "$gl_cv_have_weak" in
+ *yes)
+ AC_DEFINE([HAVE_WEAK_SYMBOLS], [1],
+ [Define to 1 if the compiler and linker support weak declarations of symbols.])
+ ;;
+ esac
+])
+
+dnl ============================================================================
+dnl Macros for the POSIX API
+
+dnl gl_PTHREADLIB
+dnl -------------
+dnl Tests for the libraries needs for using the POSIX threads API.
+dnl Sets the variable LIBPTHREAD to the linker options for use in a Makefile.
+dnl Sets the variable LIBPMULTITHREAD, for programs that really need
+dnl multithread functionality. The difference between LIBPTHREAD and
+dnl LIBPMULTITHREAD is that on platforms supporting weak symbols, typically
+dnl LIBPTHREAD is empty whereas LIBPMULTITHREAD is not.
+dnl Sets the variable LIB_SCHED_YIELD to the linker options needed to use the
+dnl sched_yield() function.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Defines the C macro HAVE_PTHREAD_API if (at least parts of) the POSIX
+dnl threads API is available.
+
+dnl The guts of gl_PTHREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_PTHREADLIB_BODY],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ if test -z "$gl_pthreadlib_body_done"; then
+ gl_pthread_api=no
+ LIBPTHREAD=
+ LIBPMULTITHREAD=
+ # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+ # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+ AC_CHECK_HEADER([pthread.h],
+ [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
+ if test "$gl_have_pthread_h" = yes; then
+ # Other possible tests:
+ # -lpthreads (FSU threads, PCthreads)
+ # -lgthreads
+ # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+ # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+ # the second one only in libpthread, and lock.c needs it.
+ #
+ # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+ # needs -pthread for some reason. See:
+ # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+ save_LIBS=$LIBS
+ for gl_pthread in '' '-pthread'; do
+ LIBS="$LIBS $gl_pthread"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ pthread_mutex_t m;
+ pthread_mutexattr_t ma;
+ ]],
+ [[pthread_mutex_lock (&m);
+ pthread_mutexattr_init (&ma);]])],
+ [gl_pthread_api=yes
+ LIBPTHREAD=$gl_pthread
+ LIBPMULTITHREAD=$gl_pthread])
+ LIBS=$save_LIBS
+ test $gl_pthread_api = yes && break
+ done
+
+ # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+ # since it is defined as a macro on OSF/1.)
+ if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+ # 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
+ ])
+ elif test $gl_pthread_api != yes; then
+ # Some library is needed. Try libpthread and libc_r.
+ AC_CHECK_LIB([pthread], [pthread_kill],
+ [gl_pthread_api=yes
+ LIBPTHREAD=-lpthread
+ LIBPMULTITHREAD=-lpthread])
+ if test $gl_pthread_api != yes; then
+ # For FreeBSD 4.
+ AC_CHECK_LIB([c_r], [pthread_kill],
+ [gl_pthread_api=yes
+ LIBPTHREAD=-lc_r
+ LIBPMULTITHREAD=-lc_r])
+ fi
+ fi
+ fi
+ AC_MSG_CHECKING([whether POSIX threads API is available])
+ AC_MSG_RESULT([$gl_pthread_api])
+ AC_SUBST([LIBPTHREAD])
+ AC_SUBST([LIBPMULTITHREAD])
+ if test $gl_pthread_api = yes; then
+ AC_DEFINE([HAVE_PTHREAD_API], [1],
+ [Define if you have the <pthread.h> header and the POSIX threads API.])
+ fi
+
+ dnl On some systems, sched_yield is in librt, rather than in libpthread.
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sched.h>]],
+ [[sched_yield ();]])],
+ [LIB_SCHED_YIELD=
+ ],
+ [dnl Solaris 7...10 has sched_yield in librt, not in libpthread or libc.
+ AC_CHECK_LIB([rt], [sched_yield], [LIB_SCHED_YIELD=-lrt],
+ [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
+ AC_CHECK_LIB([posix4], [sched_yield], [LIB_SCHED_YIELD=-lposix4])])
+ ])
+ AC_SUBST([LIB_SCHED_YIELD])
+
+ gl_pthreadlib_body_done=done
+ fi
+])
+
+AC_DEFUN([gl_PTHREADLIB],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ gl_PTHREADLIB_BODY
+])
+
+dnl ============================================================================
+dnl Macros for the ISO C API
+
+dnl gl_STDTHREADLIB
+dnl ---------------
+dnl Tests for the libraries needs for using the ISO C threads API.
+dnl Sets the variable LIBSTDTHREAD to the linker options for use in a Makefile.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Defines the C macro HAVE_THREADS_H if (at least parts of) the ISO C threads
+dnl API is available.
+
+dnl The guts of gl_STDTHREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_STDTHREADLIB_BODY],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ if test -z "$gl_stdthreadlib_body_done"; then
+ AC_CHECK_HEADERS_ONCE([threads.h])
+
+ case "$host_os" in
+ mingw*)
+ LIBSTDTHREAD=
+ ;;
+ *)
+ gl_PTHREADLIB_BODY
+ if test $ac_cv_header_threads_h = yes; then
+ 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.
+ AC_CHECK_FUNCS([thrd_create])
+ if test $ac_cv_func_thrd_create = yes; then
+ LIBSTDTHREAD=
+ else
+ AC_CHECK_LIB([stdthreads], [thrd_create], [
+ LIBSTDTHREAD='-lstdthreads -lpthread'
+ ], [
+ dnl Guess that thrd_create is in libpthread.
+ LIBSTDTHREAD="$LIBPMULTITHREAD"
+ ])
+ fi
+ else
+ dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c.
+ LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
+ fi
+ ;;
+ esac
+ AC_SUBST([LIBSTDTHREAD])
+
+ AC_MSG_CHECKING([whether ISO C threads API is available])
+ AC_MSG_RESULT([$ac_cv_header_threads_h])
+ gl_stdthreadlib_body_done=done
+ fi
+])
+
+AC_DEFUN([gl_STDTHREADLIB],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ gl_STDTHREADLIB_BODY
+])
+
+dnl ============================================================================
+dnl Macros for the Gnulib API
+
+dnl gl_THREADLIB
+dnl ------------
+dnl Tests for a multithreading library to be used.
+dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO
+dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
+dnl default is 'no', otherwise it is system dependent. In both cases, the user
+dnl can change the choice through the options --enable-threads=choice or
+dnl --disable-threads.
+dnl Defines at most one of the macros USE_ISOC_THREADS, USE_POSIX_THREADS,
+dnl USE_ISOC_AND_POSIX_THREADS, USE_WINDOWS_THREADS.
+dnl The choice --enable-threads=isoc+posix is available only on platforms that
+dnl have both the ISO C and the POSIX threads APIs. It has the effect of using
+dnl the ISO C API for most things and the POSIX API only for creating and
+dnl controlling threads (because there is no equivalent to pthread_atfork in
+dnl the ISO C API).
+dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
+dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
+dnl libtool).
+dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
+dnl programs that really need multithread functionality. The difference
+dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
+dnl symbols, typically LIBTHREAD is empty whereas LIBMULTITHREAD is not.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Since support for GNU pth was removed, $LTLIBTHREAD and $LIBTHREAD have the
+dnl same value, and similarly $LTLIBMULTITHREAD and $LIBMULTITHREAD have the
+dnl same value. Only system libraries are needed.
+
+AC_DEFUN([gl_THREADLIB_EARLY],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
+])
+
+dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
+
+AC_DEFUN([gl_THREADLIB_EARLY_BODY],
+[
+ dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
+ dnl influences the result of the autoconf tests that test for *_unlocked
+ dnl declarations, on AIX 5 at least. Therefore it must come early.
+ AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
+ AC_BEFORE([$0], [gl_ARGP])dnl
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ dnl Check for multithreading.
+ m4_ifdef([gl_THREADLIB_DEFAULT_NO],
+ [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
+ [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
+ m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=])
+ AC_ARG_ENABLE([threads],
+AS_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+AS_HELP_STRING([--disable-threads], [build without multithread safety])]),
+ [gl_use_threads=$enableval],
+ [if test -n "$gl_use_threads_default"; then
+ gl_use_threads="$gl_use_threads_default"
+ else
+changequote(,)dnl
+ case "$host_os" in
+ dnl Disable multithreading by default on OSF/1, because it interferes
+ dnl with fork()/exec(): When msgexec is linked with -lpthread, its
+ dnl child process gets an endless segmentation fault inside execvp().
+ osf*) gl_use_threads=no ;;
+ dnl Disable multithreading by default on Cygwin 1.5.x, because it has
+ dnl bugs that lead to endless loops or crashes. See
+ dnl <https://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
+ cygwin*)
+ case `uname -r` in
+ 1.[0-5].*) gl_use_threads=no ;;
+ *) gl_use_threads=yes ;;
+ esac
+ ;;
+ dnl Obey gl_AVOID_WINPTHREAD on mingw.
+ mingw*)
+ case "$gl_use_winpthreads_default" in
+ yes) gl_use_threads=posix ;;
+ no) gl_use_threads=windows ;;
+ *) gl_use_threads=yes ;;
+ esac
+ ;;
+ *) gl_use_threads=yes ;;
+ esac
+changequote([,])dnl
+ fi
+ ])
+ if test "$gl_use_threads" = yes \
+ || test "$gl_use_threads" = isoc \
+ || test "$gl_use_threads" = posix \
+ || test "$gl_use_threads" = isoc+posix; then
+ # For using <threads.h> or <pthread.h>:
+ gl_ANYTHREADLIB_EARLY
+ fi
+])
+
+dnl The guts of gl_THREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_THREADLIB_BODY],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
+ gl_threads_api=none
+ LIBTHREAD=
+ LTLIBTHREAD=
+ LIBMULTITHREAD=
+ LTLIBMULTITHREAD=
+ if test "$gl_use_threads" != no; then
+ dnl Check whether the compiler and linker support weak declarations.
+ gl_WEAK_SYMBOLS
+ if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+ dnl If we use weak symbols to implement pthread_in_use / pth_in_use /
+ dnl thread_in_use, we also need to test whether the ISO C 11 thrd_create
+ dnl facility is in use.
+ AC_CHECK_HEADERS_ONCE([threads.h])
+ :
+ fi
+ if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
+ AC_CHECK_HEADERS_ONCE([threads.h])
+ gl_have_isoc_threads="$ac_cv_header_threads_h"
+ fi
+ if test "$gl_use_threads" = yes \
+ || test "$gl_use_threads" = posix \
+ || test "$gl_use_threads" = isoc+posix; then
+ gl_PTHREADLIB_BODY
+ LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
+ LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
+ if test $gl_pthread_api = yes; then
+ if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
+ gl_threads_api='isoc+posix'
+ AC_DEFINE([USE_ISOC_AND_POSIX_THREADS], [1],
+ [Define if the combination of the ISO C and POSIX multithreading APIs can be used.])
+ LIBTHREAD= LTLIBTHREAD=
+ else
+ 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 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*)
+ 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.
+ AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
+ [Define if the pthread_in_use() detection is hard.])
+ fi
+ ;;
+ esac
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test $gl_threads_api = none; then
+ if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
+ gl_STDTHREADLIB_BODY
+ LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
+ LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
+ gl_threads_api=isoc
+ AC_DEFINE([USE_ISOC_THREADS], [1],
+ [Define if the ISO C multithreading library can be used.])
+ fi
+ fi
+ if test $gl_threads_api = none; then
+ case "$gl_use_threads" in
+ yes | windows | win32) # The 'win32' is for backward compatibility.
+ if { case "$host_os" in
+ mingw*) true;;
+ *) false;;
+ esac
+ }; then
+ gl_threads_api=windows
+ AC_DEFINE([USE_WINDOWS_THREADS], [1],
+ [Define if the native Windows multithreading API can be used.])
+ fi
+ ;;
+ esac
+ fi
+ fi
+ AC_MSG_CHECKING([for multithread API to use])
+ AC_MSG_RESULT([$gl_threads_api])
+ AC_SUBST([LIBTHREAD])
+ AC_SUBST([LTLIBTHREAD])
+ AC_SUBST([LIBMULTITHREAD])
+ AC_SUBST([LTLIBMULTITHREAD])
+])
+
+AC_DEFUN([gl_THREADLIB],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY])
+ AC_REQUIRE([gl_THREADLIB_BODY])
+])
+
+
+dnl gl_DISABLE_THREADS
+dnl ------------------
+dnl Sets the gl_THREADLIB default so that threads are not used by default.
+dnl The user can still override it at installation time, by using the
+dnl configure option '--enable-threads'.
+
+AC_DEFUN([gl_DISABLE_THREADS], [
+ m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
+])
+
+
+dnl gl_AVOID_WINPTHREAD
+dnl -------------------
+dnl Sets the gl_THREADLIB default so that on mingw, a dependency to the
+dnl libwinpthread DLL (mingw-w64 winpthreads library) is avoided.
+dnl The user can still override it at installation time, by using the
+dnl configure option '--enable-threads'.
+
+AC_DEFUN([gl_AVOID_WINPTHREAD], [
+ m4_divert_text([INIT_PREPARE], [gl_use_winpthreads_default=no])
+])
+
+
+dnl ============================================================================
+
+
+dnl Survey of platforms:
+dnl
+dnl Platform Available Compiler Supports test-lock
+dnl flavours option weak result
+dnl --------------- --------- --------- -------- ---------
+dnl Linux 2.4/glibc posix -lpthread Y OK
+dnl
+dnl GNU Hurd/glibc posix
+dnl
+dnl Ubuntu 14.04 posix -pthread Y OK
+dnl
+dnl FreeBSD 5.3 posix -lc_r Y
+dnl posix -lkse ? Y
+dnl posix -lpthread ? Y
+dnl posix -lthr Y
+dnl
+dnl FreeBSD 5.2 posix -lc_r Y
+dnl posix -lkse Y
+dnl posix -lthr Y
+dnl
+dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
+dnl
+dnl NetBSD 1.6 --
+dnl
+dnl OpenBSD 3.4 posix -lpthread Y OK
+dnl
+dnl Mac OS X 10.[123] posix -lpthread Y OK
+dnl
+dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
+dnl
+dnl HP-UX 11 posix -lpthread N (cc) OK
+dnl Y (gcc)
+dnl
+dnl IRIX 6.5 posix -lpthread Y 0.5
+dnl
+dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
+dnl
+dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
+dnl -lpthread (gcc) Y
+dnl
+dnl Cygwin posix -lpthread Y OK
+dnl
+dnl Mingw windows N OK
+dnl
+dnl BeOS 5 --
+dnl
+dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
+dnl turned off:
+dnl OK if all three tests terminate OK,
+dnl 0.5 if the first test terminates OK but the second one loops endlessly,
+dnl 0.0 if the first test already loops endlessly.
diff --git a/m4/time_h.m4 b/m4/time_h.m4
index b92567875..b6a1aa3bc 100644
--- a/m4/time_h.m4
+++ b/m4/time_h.m4
@@ -1,8 +1,8 @@
# Configure a more-standard replacement for <time.h>.
-# Copyright (C) 2000-2001, 2003-2007, 2009-2017 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2021 Free Software Foundation, Inc.
-# serial 9
+# serial 15
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -19,10 +19,28 @@ AC_DEFUN([gl_HEADER_TIME_H],
AC_DEFUN([gl_HEADER_TIME_H_BODY],
[
- AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+
gl_NEXT_HEADERS([time.h])
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CACHE_CHECK([for TIME_UTC in <time.h>],
+ [gl_cv_time_h_has_TIME_UTC],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <time.h>
+ ]],
+ [[static int x = TIME_UTC; x++;]])],
+ [gl_cv_time_h_has_TIME_UTC=yes],
+ [gl_cv_time_h_has_TIME_UTC=no])])
+ if test $gl_cv_time_h_has_TIME_UTC = yes; then
+ TIME_H_DEFINES_TIME_UTC=1
+ else
+ TIME_H_DEFINES_TIME_UTC=0
+ fi
+ AC_SUBST([TIME_H_DEFINES_TIME_UTC])
])
dnl Check whether 'struct timespec' is declared
@@ -104,24 +122,37 @@ AC_DEFUN([gl_TIME_MODULE_INDICATOR],
AC_DEFUN([gl_HEADER_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])
+ dnl Even GNU libc does not have timezone_t yet.
+ HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
dnl If another module says to replace or to not replace, do that.
dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
dnl this lets maintainers check for portability.
+ REPLACE_CTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_CTIME])
REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R])
REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME])
REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP])
+ REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME])
REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
+ REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET])
dnl Hack so that the time module doesn't depend on the sys_time module.
dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent.
diff --git a/m4/time_r.m4 b/m4/time_r.m4
index 3e24ccb2e..713e93ac2 100644
--- a/m4/time_r.m4
+++ b/m4/time_r.m4
@@ -1,6 +1,6 @@
dnl Reentrant time functions: localtime_r, gmtime_r.
-dnl Copyright (C) 2003, 2006-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2006-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.
@@ -17,7 +17,15 @@ AC_DEFUN([gl_TIME_R],
dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is
dnl not defined.
- AC_CHECK_DECLS([localtime_r], [], [], [[#include <time.h>]])
+ AC_CHECK_DECLS([localtime_r], [], [],
+ [[/* mingw's <time.h> provides the functions asctime_r, ctime_r,
+ gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
+ been included before. */
+ #if defined __MINGW32__
+ # include <unistd.h>
+ #endif
+ #include <time.h>
+ ]])
if test $ac_cv_have_decl_localtime_r = no; then
HAVE_DECL_LOCALTIME_R=0
fi
@@ -29,7 +37,14 @@ AC_DEFUN([gl_TIME_R],
[gl_cv_time_r_posix],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
- [[#include <time.h>]],
+ [[/* mingw's <time.h> provides the functions asctime_r, ctime_r,
+ gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
+ been included before. */
+ #if defined __MINGW32__
+ # include <unistd.h>
+ #endif
+ #include <time.h>
+ ]],
[[/* We don't need to append 'restrict's to the argument types,
even though the POSIX signature has the 'restrict's,
since C99 says they can't affect type compatibility. */
@@ -49,6 +64,32 @@ AC_DEFUN([gl_TIME_R],
fi
else
HAVE_LOCALTIME_R=0
+ dnl On mingw, localtime_r() is defined as an inline function; use through a
+ dnl direct function call works but the use as a function pointer leads to a
+ dnl link error.
+ AC_CACHE_CHECK([whether localtime_r exists as an inline function],
+ [gl_cv_func_localtime_r_inline],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* mingw's <time.h> provides the functions asctime_r, ctime_r,
+ gmtime_r, localtime_r only if <unistd.h> or <pthread.h> has
+ been included before. */
+ #if defined __MINGW32__
+ # include <unistd.h>
+ #endif
+ #include <time.h>
+ ]],
+ [[time_t a;
+ struct tm r;
+ localtime_r (&a, &r);
+ ]])
+ ],
+ [gl_cv_func_localtime_r_inline=yes],
+ [gl_cv_func_localtime_r_inline=no])
+ ])
+ if test $gl_cv_func_localtime_r_inline = yes; then
+ REPLACE_LOCALTIME_R=1
+ fi
fi
])
diff --git a/m4/time_rz.m4 b/m4/time_rz.m4
index 79060e00f..34ef0bab4 100644
--- a/m4/time_rz.m4
+++ b/m4/time_rz.m4
@@ -1,6 +1,6 @@
dnl Time zone functions: tzalloc, localtime_rz, etc.
-dnl Copyright (C) 2015-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2015-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.
@@ -10,9 +10,41 @@ dnl Written by Paul Eggert.
AC_DEFUN([gl_TIME_RZ],
[
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
AC_REQUIRE([AC_STRUCT_TIMEZONE])
- AC_CHECK_FUNCS_ONCE([tzset])
+
+ # On Mac OS X 10.6, localtime loops forever with some time_t values.
+ # See Bug#27706, Bug#27736, and
+ # https://lists.gnu.org/r/bug-gnulib/2017-07/msg00142.html
+ AC_CACHE_CHECK([whether localtime works even near extrema],
+ [gl_cv_func_localtime_works],
+ [gl_cv_func_localtime_works=yes
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <time.h>
+ ]], [[
+ time_t t = -67768038400666600;
+ struct tm *tm;
+ char *tz = getenv ("TZ");
+ if (! (tz && strcmp (tz, "QQQ0") == 0))
+ return 0;
+ alarm (2);
+ tm = localtime (&t);
+ /* Use TM and *TM to suppress over-optimization. */
+ return tm && tm->tm_isdst;
+ ]])],
+ [(TZ=QQQ0 ./conftest$EXEEXT) >/dev/null 2>&1 ||
+ gl_cv_func_localtime_works=no],
+ [],
+ [gl_cv_func_localtime_works="guessing yes"])])
+ if test "$gl_cv_func_localtime_works" = no; then
+ AC_DEFINE([HAVE_LOCALTIME_INFLOOP_BUG], 1,
+ [Define if localtime-like functions can loop forever on
+ extreme arguments.])
+ fi
AC_CHECK_TYPES([timezone_t], [], [], [[#include <time.h>]])
if test "$ac_cv_type_timezone_t" = yes; then
diff --git a/m4/timegm.m4 b/m4/timegm.m4
index 510e25ab4..098c857e7 100644
--- a/m4/timegm.m4
+++ b/m4/timegm.m4
@@ -1,5 +1,5 @@
-# timegm.m4 serial 11
-dnl Copyright (C) 2003, 2007, 2009-2017 Free Software Foundation, Inc.
+# timegm.m4 serial 12
+dnl Copyright (C) 2003, 2007, 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.
@@ -7,11 +7,11 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_TIMEGM],
[
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
- AC_REQUIRE([gl_FUNC_MKTIME])
+ AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
REPLACE_TIMEGM=0
AC_CHECK_FUNCS_ONCE([timegm])
if test $ac_cv_func_timegm = yes; then
- if test $gl_cv_func_working_mktime = no; then
+ if test "$gl_cv_func_working_mktime" != yes; then
# Assume that timegm is buggy if mktime is.
REPLACE_TIMEGM=1
fi
diff --git a/m4/times.m4 b/m4/times.m4
index 57570de43..fe75c31bf 100644
--- a/m4/times.m4
+++ b/m4/times.m4
@@ -1,5 +1,5 @@
# times.m4 serial 2
-dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
+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.
diff --git a/m4/tm_gmtoff.m4 b/m4/tm_gmtoff.m4
index 32db008d9..2743999fb 100644
--- a/m4/tm_gmtoff.m4
+++ b/m4/tm_gmtoff.m4
@@ -1,5 +1,5 @@
# tm_gmtoff.m4 serial 3
-dnl Copyright (C) 2002, 2009-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 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.
diff --git a/m4/trunc.m4 b/m4/trunc.m4
index a070d7828..b80b91926 100644
--- a/m4/trunc.m4
+++ b/m4/trunc.m4
@@ -1,5 +1,5 @@
-# trunc.m4 serial 9
-dnl Copyright (C) 2007, 2010-2017 Free Software Foundation, Inc.
+# trunc.m4 serial 15
+dnl Copyright (C) 2007, 2010-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.
@@ -21,8 +21,9 @@ AC_DEFUN([gl_FUNC_TRUNC],
# define __NO_MATH_INLINES 1 /* for glibc */
#endif
#include <math.h>
+ double (*funcptr) (double) = trunc;
double x;]],
- [[x = trunc(x);]])],
+ [[x = funcptr(x) + trunc(x);]])],
[TRUNC_LIBM=])
if test "$TRUNC_LIBM" = "?"; then
save_LIBS="$LIBS"
@@ -33,8 +34,9 @@ AC_DEFUN([gl_FUNC_TRUNC],
# define __NO_MATH_INLINES 1 /* for glibc */
#endif
#include <math.h>
+ double (*funcptr) (double) = trunc;
double x;]],
- [[x = trunc(x);]])],
+ [[x = funcptr(x) + trunc(x);]])],
[TRUNC_LIBM="-lm"])
LIBS="$save_LIBS"
fi
@@ -60,7 +62,7 @@ AC_DEFUN([gl_FUNC_TRUNC],
static double dummy (double f) { return 0; }
int main (int argc, char *argv[])
{
- double (*my_trunc) (double) = argc ? trunc : dummy;
+ double (* volatile my_trunc) (double) = argc ? trunc : dummy;
/* Test whether trunc (-0.0) is -0.0. */
if (signbitd (minus_zerod) && !signbitd (my_trunc (minus_zerod)))
return 1;
@@ -70,10 +72,14 @@ int main (int argc, char *argv[])
[gl_cv_func_trunc_ieee=yes],
[gl_cv_func_trunc_ieee=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_trunc_ieee="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_trunc_ieee="guessing no" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_trunc_ieee="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_trunc_ieee="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_trunc_ieee="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_trunc_ieee="$gl_cross_guess_normal" ;;
esac
])
LIBS="$save_LIBS"
diff --git a/m4/tzset.m4 b/m4/tzset.m4
new file mode 100644
index 000000000..8eaf41f41
--- /dev/null
+++ b/m4/tzset.m4
@@ -0,0 +1,18 @@
+# serial 15
+
+# Copyright (C) 2003, 2007, 2009-2021 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 Jim Meyering.
+
+AC_DEFUN([gl_FUNC_TZSET],
+[
+ AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ REPLACE_TZSET=0
+ case "$host_os" in
+ mingw*) REPLACE_TZSET=1 ;;
+ esac
+])
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index 25aef19ec..0f26fb908 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 69
-dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
+# unistd_h.m4 serial 85
+dnl Copyright (C) 2006-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.
@@ -37,17 +37,26 @@ AC_DEFUN([gl_UNISTD_H],
# include <fcntl.h>
# include <stdio.h>
# include <stdlib.h>
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
# include <io.h>
# endif
#endif
- ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat
- fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups
- gethostname getlogin getlogin_r getpagesize
+ ]], [access chdir chown copy_file_range dup dup2 dup3 environ euidaccess
+ execl execle execlp execv execve execvp execvpe
+ faccessat fchdir
+ fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize
+ getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass
getusershell setusershell endusershell
group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
- readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r
- unlink unlinkat usleep])
+ readlink readlinkat rmdir sethostname sleep symlink symlinkat
+ 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],
@@ -61,14 +70,23 @@ AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
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])
@@ -78,11 +96,14 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
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])
@@ -102,6 +123,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
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])
@@ -109,11 +131,34 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
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_DUP2=1; AC_SUBST([HAVE_DUP2])
+ 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])
@@ -121,10 +166,12 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
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])
@@ -142,6 +189,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])
@@ -150,13 +198,23 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
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])
@@ -165,6 +223,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
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])
@@ -179,11 +238,13 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
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/m4/vasnprintf.m4 b/m4/vasnprintf.m4
index 47c5951cb..483bba969 100644
--- a/m4/vasnprintf.m4
+++ b/m4/vasnprintf.m4
@@ -1,5 +1,5 @@
-# vasnprintf.m4 serial 36
-dnl Copyright (C) 2002-2004, 2006-2017 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 38
+dnl Copyright (C) 2002-2004, 2006-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.
@@ -32,7 +32,6 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
# Prerequisites of lib/printf-args.h, lib/printf-args.c.
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
])
@@ -41,7 +40,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_REQUIRE([AC_TYPE_SIZE_T])
@@ -56,7 +54,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
[
AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
@@ -77,6 +74,16 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
if the buffer had been large enough.])
;;
esac
+ dnl Additionally, the use of %n can be eliminated by assuming that snprintf
+ dnl always produces NUL-terminated strings (no truncation).
+ AC_REQUIRE([gl_SNPRINTF_TRUNCATION_C99])
+ case "$gl_cv_func_snprintf_truncation_c99" in
+ *yes)
+ AC_DEFINE([HAVE_SNPRINTF_TRUNCATION_C99], [1],
+ [Define if the string produced by the snprintf function is always NUL
+ terminated.])
+ ;;
+ esac
])
# Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
diff --git a/m4/visibility.m4 b/m4/visibility.m4
index ce00e7250..6e4b46150 100644
--- a/m4/visibility.m4
+++ b/m4/visibility.m4
@@ -1,5 +1,5 @@
-# visibility.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2005, 2008, 2010-2017 Free Software Foundation, Inc.
+# visibility.m4 serial 6
+dnl Copyright (C) 2005, 2008, 2010-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.
@@ -29,42 +29,42 @@ AC_DEFUN([gl_VISIBILITY],
dnl First, check whether -Werror can be added to the command line, or
dnl whether it leads to an error because of some other option that the
dnl user has put into $CC $CFLAGS $CPPFLAGS.
- AC_MSG_CHECKING([whether the -Werror option is usable])
- AC_CACHE_VAL([gl_cv_cc_vis_werror], [
- gl_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Werror"
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[]], [[]])],
- [gl_cv_cc_vis_werror=yes],
- [gl_cv_cc_vis_werror=no])
- CFLAGS="$gl_save_CFLAGS"])
- AC_MSG_RESULT([$gl_cv_cc_vis_werror])
+ AC_CACHE_CHECK([whether the -Werror option is usable],
+ [gl_cv_cc_vis_werror],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [gl_cv_cc_vis_werror=yes],
+ [gl_cv_cc_vis_werror=no])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
dnl Now check whether visibility declarations are supported.
- AC_MSG_CHECKING([for simple visibility declarations])
- AC_CACHE_VAL([gl_cv_cc_visibility], [
- gl_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -fvisibility=hidden"
- dnl We use the option -Werror and a function dummyfunc, because on some
- dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
- dnl "visibility attribute not supported in this configuration; ignored"
- dnl at the first function definition in every compilation unit, and we
- dnl don't want to use the option in this case.
- if test $gl_cv_cc_vis_werror = yes; then
- CFLAGS="$CFLAGS -Werror"
- fi
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
- extern __attribute__((__visibility__("default"))) int exportedvar;
- extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
- extern __attribute__((__visibility__("default"))) int exportedfunc (void);
- void dummyfunc (void) {}
- ]],
- [[]])],
- [gl_cv_cc_visibility=yes],
- [gl_cv_cc_visibility=no])
- CFLAGS="$gl_save_CFLAGS"])
- AC_MSG_RESULT([$gl_cv_cc_visibility])
+ AC_CACHE_CHECK([for simple visibility declarations],
+ [gl_cv_cc_visibility],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ dnl We use the option -Werror and a function dummyfunc, because on some
+ dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
+ dnl "visibility attribute not supported in this configuration; ignored"
+ dnl at the first function definition in every compilation unit, and we
+ dnl don't want to use the option in this case.
+ if test $gl_cv_cc_vis_werror = yes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void) {}
+ ]],
+ [[]])],
+ [gl_cv_cc_visibility=yes],
+ [gl_cv_cc_visibility=no])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
if test $gl_cv_cc_visibility = yes; then
CFLAG_VISIBILITY="-fvisibility=hidden"
HAVE_VISIBILITY=1
diff --git a/m4/vsnprintf.m4 b/m4/vsnprintf.m4
index 9c37bca9c..5f5375e63 100644
--- a/m4/vsnprintf.m4
+++ b/m4/vsnprintf.m4
@@ -1,5 +1,5 @@
# vsnprintf.m4 serial 7
-dnl Copyright (C) 2002-2004, 2007-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-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.
diff --git a/m4/warn-on-use.m4 b/m4/warn-on-use.m4
index 25ce73789..04edfe85d 100644
--- a/m4/warn-on-use.m4
+++ b/m4/warn-on-use.m4
@@ -1,11 +1,13 @@
-# warn-on-use.m4 serial 5
-dnl Copyright (C) 2010-2017 Free Software Foundation, Inc.
+# warn-on-use.m4 serial 9
+dnl Copyright (C) 2010-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.
# gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES)
# ---------------------------------------
+# If the module 'posixcheck' is in use:
+#
# For each whitespace-separated element in the list of NAMES, define
# HAVE_RAW_DECL_name if the function has a declaration among INCLUDES
# even after being undefined as a macro.
@@ -23,25 +25,25 @@ dnl with or without modifications, as long as this notice is preserved.
# needing gl_WARN_ON_USE_PREPARE.
AC_DEFUN([gl_WARN_ON_USE_PREPARE],
[
- m4_foreach_w([gl_decl], [$2],
- [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
- [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
- undefining macros.])])dnl
-dnl FIXME: gl_Symbol must be used unquoted until we can assume
-dnl autoconf 2.64 or newer.
- for gl_func in m4_flatten([$2]); do
- AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
- AC_CACHE_CHECK([whether $gl_func is declared without a macro],
- gl_Symbol,
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
-[@%:@undef $gl_func
- (void) $gl_func;])],
- [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])])
- AS_VAR_IF(gl_Symbol, [yes],
- [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
- dnl shortcut - if the raw declaration exists, then set a cache
- dnl variable to allow skipping any later AC_CHECK_DECL efforts
- eval ac_cv_have_decl_$gl_func=yes])
- AS_VAR_POPDEF([gl_Symbol])dnl
- done
+ m4_ifdef([gl_POSIXCHECK],
+ [m4_foreach_w([gl_decl], [$2],
+ [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
+ [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
+ undefining macros.])])dnl
+ for gl_func in m4_flatten([$2]); do
+ AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
+ AC_CACHE_CHECK([whether $gl_func is declared without a macro],
+ [gl_Symbol],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
+[[#undef $gl_func
+ (void) $gl_func;]])],
+ [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])])
+ AS_VAR_IF([gl_Symbol], [yes],
+ [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
+ dnl shortcut - if the raw declaration exists, then set a cache
+ dnl variable to allow skipping any later AC_CHECK_DECL efforts
+ eval ac_cv_have_decl_$gl_func=yes])
+ AS_VAR_POPDEF([gl_Symbol])dnl
+ done
+ ])
])
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index e697174ed..9e24d898e 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -1,5 +1,5 @@
-# warnings.m4 serial 11
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+# warnings.m4 serial 16
+dnl Copyright (C) 2008-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.
@@ -20,10 +20,10 @@ m4_ifdef([AS_VAR_APPEND],
# -----------------------------------------------------------------
# Check if the compiler supports OPTION when compiling PROGRAM.
#
-# FIXME: gl_Warn must be used unquoted until we can assume Autoconf
-# 2.64 or newer.
+# The effects of this macro depend on the current language (_AC_LANG).
AC_DEFUN([gl_COMPILER_OPTION_IF],
-[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
+[
+AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
AS_LITERAL_IF([$1],
[m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))],
@@ -32,13 +32,13 @@ case $gl_positive in
-Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
esac
m4_pushdef([gl_Positive], [$gl_positive])])dnl
-AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
+AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], [gl_Warn], [
gl_save_compiler_FLAGS="$gl_Flags"
gl_AS_VAR_APPEND(m4_defn([gl_Flags]),
[" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["])
- AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
- [AS_VAR_SET(gl_Warn, [yes])],
- [AS_VAR_SET(gl_Warn, [no])])
+ AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([[]])])],
+ [AS_VAR_SET([gl_Warn], [yes])],
+ [AS_VAR_SET([gl_Warn], [no])])
gl_Flags="$gl_save_compiler_FLAGS"
])
AS_VAR_IF(gl_Warn, [yes], [$2], [$3])
@@ -51,27 +51,58 @@ AS_VAR_POPDEF([gl_Warn])dnl
# ------------------------------
# Clang doesn't complain about unknown warning options unless one also
# specifies -Wunknown-warning-option -Werror. Detect this.
+#
+# The effects of this macro depend on the current language (_AC_LANG).
AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+# Specialization for _AC_LANG = C. This macro can be AC_REQUIREd.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)],
+[
+ AC_LANG_PUSH([C])
+ gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
+ AC_LANG_POP([C])
+])
+
+# Specialization for _AC_LANG = C++. This macro can be AC_REQUIREd.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)],
+[
+ AC_LANG_PUSH([C++])
+ gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
+ AC_LANG_POP([C++])
+])
+
+# Specialization for _AC_LANG = Objective C. This macro can be AC_REQUIREd.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)],
+[
+ AC_LANG_PUSH([Objective C])
+ gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
+ AC_LANG_POP([Objective C])
+])
+
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL],
[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option],
[gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'],
[gl_unknown_warnings_are_errors=])])
-# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS],
+# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS/WARN_CXXFLAGS],
# [PROGRAM = AC_LANG_PROGRAM()])
-# ---------------------------------------------
-# Adds parameter to WARN_CFLAGS if the compiler supports it when
-# compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]).
+# -----------------------------------------------------------
+# Adds parameter to WARN_CFLAGS/WARN_CXXFLAGS if the compiler supports it
+# when compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]).
#
# If VARIABLE is a variable name, AC_SUBST it.
+#
+# The effects of this macro depend on the current language (_AC_LANG).
AC_DEFUN([gl_WARN_ADD],
-[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS(]_AC_LANG[)])
gl_COMPILER_OPTION_IF([$1],
- [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])],
+ [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_]_AC_LANG_PREFIX[FLAGS]], [[$2]]), [" $1"])],
[],
[$3])
m4_ifval([$2],
[AS_LITERAL_IF([$2], [AC_SUBST([$2])])],
- [AC_SUBST([WARN_CFLAGS])])dnl
+ [AC_SUBST([WARN_]_AC_LANG_PREFIX[FLAGS])])dnl
])
# Local Variables:
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4
index d0e11a04e..59c55fcda 100644
--- a/m4/wchar_h.m4
+++ b/m4/wchar_h.m4
@@ -1,13 +1,13 @@
dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
-dnl Copyright (C) 2007-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-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.
dnl Written by Eric Blake.
-# wchar_h.m4 serial 40
+# wchar_h.m4 serial 50
AC_DEFUN([gl_WCHAR_H],
[
@@ -35,84 +35,82 @@ AC_DEFUN([gl_WCHAR_H],
fi
AC_SUBST([HAVE_WINT_T])
+ AC_REQUIRE([gl_TYPE_WINT_T_PREREQ])
+
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([[
-/* 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>. */
-#if !(defined __GLIBC__ && !defined __UCLIBC__)
-# include <stddef.h>
-# include <stdio.h>
-# include <time.h>
-#endif
-#include <wchar.h>
+ #include <wchar.h>
]],
[btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
- wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset
+ wcsrtombs wcsnrtombs wcwidth
+ wmemchr wmemcmp wmemcpy wmemmove wmempcpy wmemset
wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp
wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr
- wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth
+ wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime
])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ AC_CHECK_DECLS([wcsdup], [], [], [[
+ #include <wchar.h>
+ ]])
+ if test $ac_cv_have_decl_wcsdup = no; then
+ HAVE_DECL_WCSDUP=0
+ fi
])
dnl Check whether <wchar.h> is usable at all.
AC_DEFUN([gl_WCHAR_H_INLINE_OK],
[
dnl Test whether <wchar.h> suffers due to the transition from '__inline' to
- dnl 'gnu_inline'. See <http://sourceware.org/bugzilla/show_bug.cgi?id=4022>
- dnl and <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
+ dnl 'gnu_inline'. See <https://sourceware.org/bugzilla/show_bug.cgi?id=4022>
+ dnl and <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and
dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>.
+ AC_REQUIRE([AC_CANONICAL_HOST])
AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly],
[gl_cv_header_wchar_h_correct_inline],
[gl_cv_header_wchar_h_correct_inline=yes
- AC_LANG_CONFTEST([
- AC_LANG_SOURCE([[#define wcstod renamed_wcstod
-/* 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>
-extern int zero (void);
-int main () { return zero(); }
-]])])
- dnl Do not rename the object file from conftest.$ac_objext to
- dnl conftest1.$ac_objext, as this will cause the link to fail on
- dnl z/OS when using the XPLINK object format (due to duplicate
- dnl CSECT names). Instead, temporarily redefine $ac_compile so
- dnl that the object file has the latter name from the start.
- save_ac_compile="$ac_compile"
- ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
- if AC_TRY_EVAL([ac_compile]); then
- AC_LANG_CONFTEST([
- AC_LANG_SOURCE([[#define wcstod renamed_wcstod
-/* 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>
-int zero (void) { return 0; }
-]])])
- dnl See note above about renaming object files.
- ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
- if AC_TRY_EVAL([ac_compile]); then
- if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
- :
- else
- gl_cv_header_wchar_h_correct_inline=no
+ case "$host_os" in
+ *-gnu* | gnu*)
+ AC_LANG_CONFTEST([
+ AC_LANG_SOURCE([[
+ #define wcstod renamed_wcstod
+ #include <wchar.h>
+ extern int zero (void);
+ int main () { return zero(); }
+ ]])])
+ dnl Do not rename the object file from conftest.$ac_objext to
+ dnl conftest1.$ac_objext, as this will cause the link to fail on
+ dnl z/OS when using the XPLINK object format (due to duplicate
+ dnl CSECT names). Instead, temporarily redefine $ac_compile so
+ dnl that the object file has the latter name from the start.
+ save_ac_compile="$ac_compile"
+ ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
+ if echo '#include "conftest.c"' >conftest1.c \
+ && AC_TRY_EVAL([ac_compile]); then
+ AC_LANG_CONFTEST([
+ AC_LANG_SOURCE([[
+ #define wcstod renamed_wcstod
+ #include <wchar.h>
+ int zero (void) { return 0; }
+ ]])])
+ dnl See note above about renaming object files.
+ ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
+ if echo '#include "conftest.c"' >conftest2.c \
+ && AC_TRY_EVAL([ac_compile]); then
+ if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
+ :
+ else
+ gl_cv_header_wchar_h_correct_inline=no
+ fi
+ fi
fi
- fi
- fi
- ac_compile="$save_ac_compile"
- rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
+ ac_compile="$save_ac_compile"
+ rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext
+ ;;
+ esac
])
if test $gl_cv_header_wchar_h_correct_inline = no; then
AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
@@ -120,7 +118,7 @@ This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
C99 mode. You have four options:
- Add the flag -fgnu89-inline to CC and reconfigure, or
- Fix your include files, using parts of
- <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
+ <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
- Use a gcc version older than 4.3, or
- Don't use the flags -std=c99 or -std=gnu99.
Configuration aborted.])
@@ -153,6 +151,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
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])
@@ -177,6 +176,9 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
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])
@@ -191,6 +193,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP])
HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY])
HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE])
+ HAVE_WMEMPCPY=1; AC_SUBST([HAVE_WMEMPCPY])
HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET])
HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN])
HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN])
@@ -215,7 +218,9 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
HAVE_WCSSTR=1; AC_SUBST([HAVE_WCSSTR])
HAVE_WCSTOK=1; AC_SUBST([HAVE_WCSTOK])
HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH])
+ HAVE_WCSFTIME=1; AC_SUBST([HAVE_WCSFTIME])
HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB])
+ HAVE_DECL_WCSDUP=1; AC_SUBST([HAVE_DECL_WCSDUP])
HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T])
REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC])
@@ -230,4 +235,6 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH])
+ REPLACE_WCSFTIME=0; AC_SUBST([REPLACE_WCSFTIME])
+ REPLACE_WCSTOK=0; AC_SUBST([REPLACE_WCSTOK])
])
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4
index 11783d299..34db10e5c 100644
--- a/m4/wchar_t.m4
+++ b/m4/wchar_t.m4
@@ -1,5 +1,5 @@
# wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-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.
diff --git a/m4/wcrtomb.m4 b/m4/wcrtomb.m4
index 0aa040df3..cd96f1161 100644
--- a/m4/wcrtomb.m4
+++ b/m4/wcrtomb.m4
@@ -1,5 +1,5 @@
-# wcrtomb.m4 serial 11
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+# wcrtomb.m4 serial 17
+dnl Copyright (C) 2008-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.
@@ -15,15 +15,8 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
if test $ac_cv_func_wcrtomb = no; then
HAVE_WCRTOMB=0
AC_CHECK_DECLS([wcrtomb],,, [[
-/* 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>
+ ]])
if test $ac_cv_have_decl_wcrtomb = yes; then
dnl On Minix 3.1.8, the system's <wchar.h> declares wcrtomb() although
dnl it does not have the function. Avoid a collision with gnulib's
@@ -31,17 +24,56 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
REPLACE_WCRTOMB=1
fi
else
- if test $REPLACE_MBSTATE_T = 1; then
- REPLACE_WCRTOMB=1
- else
- dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes
- dnl returns 0 instead of 1.
+ dnl We don't actually need to override wcrtomb when redefining the semantics
+ dnl of the mbstate_t type. Tested on 32-bit AIX.
+ dnl if test $REPLACE_MBSTATE_T = 1; then
+ dnl REPLACE_WCRTOMB=1
+ dnl fi
+ if test $REPLACE_WCRTOMB = 0; then
+ dnl On Android 4.3, wcrtomb produces wrong characters in the C locale.
+ dnl On AIX 4.3, OSF/1 5.1 and Solaris <= 11.3, wcrtomb (NULL, 0, NULL)
+ dnl sometimes returns 0 instead of 1.
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([gt_LOCALE_FR])
AC_REQUIRE([gt_LOCALE_FR_UTF8])
AC_REQUIRE([gt_LOCALE_JA])
AC_REQUIRE([gt_LOCALE_ZH_CN])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CACHE_CHECK([whether wcrtomb works in the C locale],
+ [gl_cv_func_wcrtomb_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <string.h>
+#include <stdlib.h>
+#include <wchar.h>
+int main ()
+{
+ mbstate_t state;
+ char out[64];
+ int count;
+ memset (&state, 0, sizeof (state));
+ out[0] = 'x';
+ count = wcrtomb (out, L'a', &state);
+ return !(count == 1 && out[0] == 'a');
+}]])],
+ [gl_cv_func_wcrtomb_works=yes],
+ [gl_cv_func_wcrtomb_works=no],
+ [case "$host_os" in
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_wcrtomb_works="guessing no";;
+ # Guess yes otherwise.
+ *) gl_cv_func_wcrtomb_works="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_wcrtomb_works" in
+ *yes) ;;
+ *) AC_DEFINE([WCRTOMB_C_LOCALE_BUG], [1],
+ [Define if the wcrtomb function does not work in the C locale.])
+ REPLACE_WCRTOMB=1 ;;
+ esac
+ fi
+ if test $REPLACE_WCRTOMB = 0; then
AC_CACHE_CHECK([whether wcrtomb return value is correct],
[gl_cv_func_wcrtomb_retval],
[
@@ -49,10 +81,10 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
dnl is present.
changequote(,)dnl
case "$host_os" in
- # Guess no on AIX 4, OSF/1 and Solaris.
- aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;;
- # Guess yes otherwise.
- *) gl_cv_func_wcrtomb_retval="guessing yes" ;;
+ # Guess no on AIX 4, OSF/1, Solaris, native Windows.
+ aix4* | osf* | solaris* | mingw*) gl_cv_func_wcrtomb_retval="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_wcrtomb_retval="guessing yes" ;;
esac
changequote([,])dnl
if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
@@ -60,14 +92,8 @@ changequote([,])dnl
[AC_LANG_SOURCE([[
#include <locale.h>
#include <string.h>
-/* 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 <stdlib.h>
int main ()
{
int result = 0;
@@ -80,6 +106,12 @@ int main ()
{
if (wcrtomb (NULL, 0, NULL) != 1)
result |= 2;
+ {
+ wchar_t wc = (wchar_t) 0xBADFACE;
+ if (mbtowc (&wc, "\303\274", 2) == 2)
+ if (wcrtomb (NULL, wc, NULL) != 1)
+ result |= 2;
+ }
}
if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
{
@@ -100,7 +132,9 @@ int main ()
])
case "$gl_cv_func_wcrtomb_retval" in
*yes) ;;
- *) REPLACE_WCRTOMB=1 ;;
+ *) AC_DEFINE([WCRTOMB_RETVAL_BUG], [1],
+ [Define if the wcrtomb function has an incorrect return value.])
+ REPLACE_WCRTOMB=1 ;;
esac
fi
fi
diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4
index 45ddaeb17..1ab0bc985 100644
--- a/m4/wctype_h.m4
+++ b/m4/wctype_h.m4
@@ -1,8 +1,8 @@
-# wctype_h.m4 serial 18
+# wctype_h.m4 serial 26
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
-dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-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.
@@ -30,6 +30,8 @@ AC_DEFUN([gl_WCTYPE_H],
fi
AC_SUBST([HAVE_WINT_T])
+ AC_REQUIRE([gl_TYPE_WINT_T_PREREQ])
+
gl_CHECK_NEXT_HEADERS([wctype.h])
if test $ac_cv_header_wctype_h = yes; then
if test $ac_cv_func_iswcntrl = yes; then
@@ -39,22 +41,16 @@ AC_DEFUN([gl_WCTYPE_H],
[
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
- /* 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 <wctype.h>
int main () { return iswprint ('x') == 0; }
]])],
[gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+ [dnl Guess no on Linux libc5, yes otherwise.
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
#if __GNU_LIBRARY__ == 1
Linux libc5 i18n is broken.
- #endif]], [])],
+ #endif]], [[]])],
[gl_cv_func_iswcntrl_works="guessing yes"],
[gl_cv_func_iswcntrl_works="guessing no"])
])
@@ -66,10 +62,14 @@ AC_DEFUN([gl_WCTYPE_H],
fi
AC_SUBST([HAVE_WCTYPE_H])
- case "$gl_cv_func_iswcntrl_works" in
- *yes) REPLACE_ISWCNTRL=0 ;;
- *) REPLACE_ISWCNTRL=1 ;;
- esac
+ if test $GNULIB_OVERRIDES_WINT_T = 1; then
+ REPLACE_ISWCNTRL=1
+ else
+ case "$gl_cv_func_iswcntrl_works" in
+ *yes) REPLACE_ISWCNTRL=0 ;;
+ *) REPLACE_ISWCNTRL=1 ;;
+ esac
+ fi
AC_SUBST([REPLACE_ISWCNTRL])
if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
@@ -85,14 +85,7 @@ AC_DEFUN([gl_WCTYPE_H],
REPLACE_TOWLOWER=0
else
AC_CHECK_DECLS([towlower],,,
- [[/* 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>
#if HAVE_WCTYPE_H
# include <wctype.h>
#endif
@@ -121,14 +114,7 @@ AC_DEFUN([gl_WCTYPE_H],
AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
- [[/* 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>
#if HAVE_WCTYPE_H
# include <wctype.h>
#endif
@@ -147,14 +133,7 @@ AC_DEFUN([gl_WCTYPE_H],
AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
- [[/* 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>
#include <wctype.h>
wctrans_t a;
]],
@@ -169,14 +148,7 @@ AC_DEFUN([gl_WCTYPE_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([[
-/* 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>. */
#if !(defined __GLIBC__ && !defined __UCLIBC__)
-# include <stddef.h>
-# include <stdio.h>
-# include <time.h>
# include <wchar.h>
#endif
#include <wctype.h>
@@ -197,6 +169,8 @@ AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
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])
@@ -206,4 +180,6 @@ AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T])
HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T])
REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK])
+ REPLACE_ISWDIGIT=0; AC_SUBST([REPLACE_ISWDIGIT])
+ REPLACE_ISWXDIGIT=0; AC_SUBST([REPLACE_ISWXDIGIT])
])
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
index 65e25a4c3..2fc7467f4 100644
--- a/m4/wint_t.m4
+++ b/m4/wint_t.m4
@@ -1,5 +1,5 @@
-# wint_t.m4 serial 6
-dnl Copyright (C) 2003, 2007-2017 Free Software Foundation, Inc.
+# wint_t.m4 serial 10
+dnl Copyright (C) 2003, 2007-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.
@@ -14,15 +14,7 @@ AC_DEFUN([gt_TYPE_WINT_T],
AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
- [[
-/* 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>
wint_t foo = (wchar_t)'\0';]],
[[]])],
[gt_cv_c_wint_t=yes],
@@ -32,25 +24,16 @@ AC_DEFUN([gt_TYPE_WINT_T],
dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present,
dnl override 'wint_t'.
- AC_CACHE_CHECK([whether wint_t is too small],
- [gl_cv_type_wint_t_too_small],
+ AC_CACHE_CHECK([whether wint_t is large enough],
+ [gl_cv_type_wint_t_large_enough],
[AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
-/* 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>. */
-#if !(defined __GLIBC__ && !defined __UCLIBC__)
-# include <stddef.h>
-# include <stdio.h>
-# include <time.h>
-#endif
-#include <wchar.h>
+ [AC_LANG_PROGRAM(
+ [[#include <wchar.h>
int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
- ]])],
- [gl_cv_type_wint_t_too_small=no],
- [gl_cv_type_wint_t_too_small=yes])])
- if test $gl_cv_type_wint_t_too_small = yes; then
+ ]])],
+ [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
else
GNULIB_OVERRIDES_WINT_T=0
@@ -60,3 +43,15 @@ AC_DEFUN([gt_TYPE_WINT_T],
fi
AC_SUBST([GNULIB_OVERRIDES_WINT_T])
])
+
+dnl Prerequisites of the 'wint_t' override.
+AC_DEFUN([gl_TYPE_WINT_T_PREREQ],
+[
+ AC_CHECK_HEADERS_ONCE([crtdefs.h])
+ if test $ac_cv_header_crtdefs_h = yes; then
+ HAVE_CRTDEFS_H=1
+ else
+ HAVE_CRTDEFS_H=0
+ fi
+ AC_SUBST([HAVE_CRTDEFS_H])
+])
diff --git a/m4/write.m4 b/m4/write.m4
index fd46acc1b..84400c5f0 100644
--- a/m4/write.m4
+++ b/m4/write.m4
@@ -1,5 +1,5 @@
-# write.m4 serial 5
-dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
+# write.m4 serial 6
+dnl Copyright (C) 2008-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.
@@ -7,10 +7,12 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_WRITE],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([gl_MSVC_INVAL])
- if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
- REPLACE_WRITE=1
- fi
+ m4_ifdef([gl_MSVC_INVAL], [
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_WRITE=1
+ fi
+ ])
dnl This ifdef is just an optimization, to avoid performing a configure
dnl check whose result is not used. It does not make the test of
dnl GNULIB_UNISTD_H_SIGPIPE or GNULIB_SIGPIPE redundant.
diff --git a/m4/xsize.m4 b/m4/xsize.m4
index 5f8505770..64e8a4f45 100644
--- a/m4/xsize.m4
+++ b/m4/xsize.m4
@@ -1,5 +1,5 @@
# xsize.m4 serial 5
-dnl Copyright (C) 2003-2004, 2008-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-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.
diff --git a/m4/zzgnulib.m4 b/m4/zzgnulib.m4
new file mode 100644
index 000000000..b9533847c
--- /dev/null
+++ b/m4/zzgnulib.m4
@@ -0,0 +1,23 @@
+# zzgnulib.m4 serial 1
+dnl Copyright (C) 2020-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.
+
+dnl This file must be named something that sorts after all other
+dnl package- or gnulib-provided .m4 files - at least for those packages
+dnl that redefine AC_PROG_CC.
+
+dnl Redefine AC_PROG_CC so that it ends with invocations of gl_COMPILER_CLANG
+dnl and gl_COMPILER_PREPARE_CHECK_DECL.
+m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[
+gl_COMPILER_CLANG
+gl_COMPILER_PREPARE_CHECK_DECL
+])
+
+# gl_ZZGNULIB
+# -----------
+# Witness macro that this file has been included. Needed to force
+# Automake to include this file after all other gnulib .m4 files.
+AC_DEFUN([gl_ZZGNULIB])