summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/00gnulib.m472
-rw-r--r--m4/__inline.m42
-rw-r--r--m4/absolute-header.m42
-rw-r--r--m4/acl.m42
-rw-r--r--m4/alloca.m411
-rw-r--r--m4/arpa_inet_h.m46
-rw-r--r--m4/assert.m42
-rw-r--r--m4/btowc.m42
-rw-r--r--m4/builtin-expect.m42
-rw-r--r--m4/canonicalize.m410
-rw-r--r--m4/close-stream.m411
-rw-r--r--m4/close.m42
-rw-r--r--m4/closedir.m42
-rw-r--r--m4/closeout.m412
-rw-r--r--m4/codeset.m44
-rw-r--r--m4/ctype.m42
-rw-r--r--m4/dirent_h.m42
-rw-r--r--m4/dirfd.m42
-rw-r--r--m4/dirname.m42
-rw-r--r--m4/double-slash-root.m42
-rw-r--r--m4/dup2.m42
-rw-r--r--m4/eealloc.m42
-rw-r--r--m4/environ.m42
-rw-r--r--m4/errno_h.m42
-rw-r--r--m4/error.m42
-rw-r--r--m4/extensions.m42
-rw-r--r--m4/extern-inline.m44
-rw-r--r--m4/fcntl-o.m42
-rw-r--r--m4/fcntl.m42
-rw-r--r--m4/fcntl_h.m46
-rw-r--r--m4/fdopen.m42
-rw-r--r--m4/fflush.m44
-rw-r--r--m4/flexmember.m410
-rw-r--r--m4/fpending.m42
-rw-r--r--m4/fpurge.m426
-rw-r--r--m4/freading.m42
-rw-r--r--m4/fseek.m42
-rw-r--r--m4/fseeko.m42
-rw-r--r--m4/fstat.m42
-rw-r--r--m4/ftell.m42
-rw-r--r--m4/ftello.m42
-rw-r--r--m4/ftruncate.m44
-rw-r--r--m4/fwriting.m42
-rw-r--r--m4/getcwd.m416
-rw-r--r--m4/getdelim.m442
-rw-r--r--m4/getdtablesize.m42
-rw-r--r--m4/getopt.m410
-rw-r--r--m4/getpagesize.m42
-rw-r--r--m4/getprogname.m42
-rw-r--r--m4/gettimeofday.m410
-rw-r--r--m4/glibc21.m42
-rw-r--r--m4/gnulib-common.m487
-rw-r--r--m4/gnulib-comp.m4186
-rw-r--r--m4/host-cpu-c-abi.m4644
-rw-r--r--m4/include_next.m42
-rw-r--r--m4/inet_pton.m413
-rw-r--r--m4/intl-thread-locale.m441
-rw-r--r--m4/intlmacosx.m429
-rw-r--r--m4/inttypes-pri.m42
-rw-r--r--m4/inttypes.m48
-rw-r--r--m4/ioctl.m42
-rw-r--r--m4/isblank.m42
-rw-r--r--m4/langinfo_h.m42
-rw-r--r--m4/largefile.m424
-rw-r--r--m4/lcmessage.m44
-rw-r--r--m4/lib-ld.m4163
-rw-r--r--m4/lib-link.m421
-rw-r--r--m4/lib-prefix.m4135
-rw-r--r--m4/limits-h.m42
-rw-r--r--m4/link.m48
-rw-r--r--m4/localcharset.m42
-rw-r--r--m4/locale-fr.m42
-rw-r--r--m4/locale-ja.m42
-rw-r--r--m4/locale-tr.m45
-rw-r--r--m4/locale-zh.m42
-rw-r--r--m4/locale_h.m4101
-rw-r--r--m4/localeconv.m42
-rw-r--r--m4/localename.m425
-rw-r--r--m4/localtime-buffer.m42
-rw-r--r--m4/lock.m42
-rw-r--r--m4/longlong.m4113
-rw-r--r--m4/lseek.m42
-rw-r--r--m4/lstat.m48
-rw-r--r--m4/malloc.m425
-rw-r--r--m4/malloca.m45
-rw-r--r--m4/manywarnings.m411
-rw-r--r--m4/mbrlen.m42
-rw-r--r--m4/mbrtowc.m4219
-rw-r--r--m4/mbsinit.m42
-rw-r--r--m4/mbstate_t.m42
-rw-r--r--m4/mbtowc.m413
-rw-r--r--m4/memchr.m425
-rw-r--r--m4/memrchr.m42
-rw-r--r--m4/minmax.m42
-rw-r--r--m4/mkdir.m414
-rw-r--r--m4/mkostemp.m42
-rw-r--r--m4/mmap-anon.m42
-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.m42
-rw-r--r--m4/nanosleep.m48
-rw-r--r--m4/netinet_in_h.m42
-rw-r--r--m4/nl_langinfo.m412
-rw-r--r--m4/nocrash.m46
-rw-r--r--m4/non-recursive-gnulib-prefix-hack.m42
-rw-r--r--m4/obstack.m42
-rw-r--r--m4/off_t.m42
-rw-r--r--m4/open-cloexec.m42
-rw-r--r--m4/open-slash.m459
-rw-r--r--m4/open.m443
-rw-r--r--m4/opendir.m42
-rw-r--r--m4/pathmax.m42
-rw-r--r--m4/perl.m446
-rw-r--r--m4/perror.m414
-rw-r--r--m4/pipe.m42
-rw-r--r--m4/pthread-thread.m469
-rw-r--r--m4/pthread_h.m4268
-rw-r--r--m4/pthread_rwlock_rdlock.m430
-rw-r--r--m4/pthread_sigmask.m4273
-rw-r--r--m4/putenv.m410
-rw-r--r--m4/quote.m42
-rw-r--r--m4/quotearg.m42
-rw-r--r--m4/raise.m42
-rw-r--r--m4/read-file.m42
-rw-r--r--m4/readdir.m42
-rw-r--r--m4/readlink.m48
-rw-r--r--m4/realloc.m425
-rw-r--r--m4/regex.m48
-rw-r--r--m4/rename.m4107
-rw-r--r--m4/rmdir.m48
-rw-r--r--m4/sched_h.m491
-rw-r--r--m4/select.m48
-rw-r--r--m4/selinux-context-h.m42
-rw-r--r--m4/selinux-selinux-h.m42
-rw-r--r--m4/setenv.m414
-rw-r--r--m4/setlocale.m461
-rw-r--r--m4/setlocale_null.m498
-rw-r--r--m4/sigaction.m42
-rw-r--r--m4/signal_h.m42
-rw-r--r--m4/signalblocking.m42
-rw-r--r--m4/sleep.m410
-rw-r--r--m4/socketlib.m42
-rw-r--r--m4/sockets.m42
-rw-r--r--m4/socklen.m42
-rw-r--r--m4/sockpfaf.m42
-rw-r--r--m4/ssize_t.m42
-rw-r--r--m4/stat-time.m42
-rw-r--r--m4/stat.m48
-rw-r--r--m4/std-gnu11.m42
-rw-r--r--m4/stdalign.m42
-rw-r--r--m4/stdarg.m42
-rw-r--r--m4/stdbool.m424
-rw-r--r--m4/stddef_h.m42
-rw-r--r--m4/stdint.m425
-rw-r--r--m4/stdio_h.m42
-rw-r--r--m4/stdlib_h.m417
-rw-r--r--m4/strdup.m42
-rw-r--r--m4/strerror.m416
-rw-r--r--m4/strerror_r.m46
-rw-r--r--m4/string_h.m42
-rw-r--r--m4/strverscmp.m42
-rw-r--r--m4/symlink.m48
-rw-r--r--m4/sys_ioctl_h.m42
-rw-r--r--m4/sys_select_h.m42
-rw-r--r--m4/sys_socket_h.m430
-rw-r--r--m4/sys_stat_h.m42
-rw-r--r--m4/sys_time_h.m42
-rw-r--r--m4/sys_types_h.m42
-rw-r--r--m4/sys_uio_h.m42
-rw-r--r--m4/tempname.m42
-rw-r--r--m4/thread.m417
-rw-r--r--m4/threadlib.m4671
-rw-r--r--m4/time_h.m42
-rw-r--r--m4/ungetc.m420
-rw-r--r--m4/unistd_h.m415
-rw-r--r--m4/unlocked-io.m42
-rw-r--r--m4/version-etc.m42
-rw-r--r--m4/visibility.m477
-rw-r--r--m4/warn-on-use.m42
-rw-r--r--m4/warnings.m42
-rw-r--r--m4/wchar_h.m45
-rw-r--r--m4/wchar_t.m42
-rw-r--r--m4/wcrtomb.m476
-rw-r--r--m4/wctob.m45
-rw-r--r--m4/wctomb.m42
-rw-r--r--m4/wctype_h.m416
-rw-r--r--m4/wint_t.m42
-rw-r--r--m4/xalloc.m42
189 files changed, 2853 insertions, 1858 deletions
diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4
index bd24796..58bc4ef 100644
--- a/m4/00gnulib.m4
+++ b/m4/00gnulib.m4
@@ -1,13 +1,14 @@
-# 00gnulib.m4 serial 3
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+# 00gnulib.m4 serial 5
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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. The first part is needed until such time
+dnl as we can assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and
+dnl m4_divert semantics. The second part is needed until the clang fix
+dnl has 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
@@ -39,6 +40,67 @@ m4_version_prereq([2.63.263], [],
[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.
+AC_DEFUN([gl_COMPILER_CLANG],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([whether the compiler is clang],
+ [gl_cv_compiler_clang],
+ [AC_EGREP_CPP([barfbarf],[
+#ifdef __clang__
+barfbarf
+#endif
+ ],
+ [gl_cv_compiler_clang=yes],
+ [gl_cv_compiler_clang=no])
+ ])
+])
+AC_DEFUN_ONCE([gl_COMPILER_PREPARE_CHECK_DECL],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ 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"
+ 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.
+m4_define([_AC_CHECK_DECL_BODY],
+[ ac_save_ac_compile="$ac_compile"
+ ac_compile="$ac_compile_for_check_decl"]
+m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile"
+])
+ ])
+dnl Redefine AC_CHECK_DECL so that it starts with an invocation of
+dnl gl_COMPILER_PREPARE_CHECK_DECL.
+m4_define([AC_CHECK_DECL],
+ [gl_COMPILER_PREPARE_CHECK_DECL dnl
+]m4_defn([AC_CHECK_DECL]))
+
# gl_00GNULIB
# -----------
# Witness macro that this file has been included. Needed to force
diff --git a/m4/__inline.m4 b/m4/__inline.m4
index 3d0c479..520c8c4 100644
--- a/m4/__inline.m4
+++ b/m4/__inline.m4
@@ -1,5 +1,5 @@
# Test for __inline keyword
-dnl Copyright 2017-2018 Free Software Foundation, Inc.
+dnl Copyright 2017-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/absolute-header.m4 b/m4/absolute-header.m4
index 4e67e5f..39726ba 100644
--- a/m4/absolute-header.m4
+++ b/m4/absolute-header.m4
@@ -1,5 +1,5 @@
# absolute-header.m4 serial 16
-dnl Copyright (C) 2006-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/acl.m4 b/m4/acl.m4
index b64aa84..e459451 100644
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,7 +1,7 @@
# acl.m4 - check for access control list (ACL) primitives
# serial 23
-# Copyright (C) 2002, 2004-2018 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/alloca.m4 b/m4/alloca.m4
index b9d94e8..5922524 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-2018 Free Software Foundation,
+# alloca.m4 serial 15
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2020 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,6 +37,13 @@ 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.
diff --git a/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4
index e73dc69..b394494 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-2018 Free Software Foundation, Inc.
+# arpa_inet_h.m4 serial 14
+dnl Copyright (C) 2006, 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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/assert.m4 b/m4/assert.m4
index 0cad039..d823b9f 100644
--- a/m4/assert.m4
+++ b/m4/assert.m4
@@ -1,6 +1,6 @@
#serial 7
-# Copyright (C) 1998-1999, 2001, 2004, 2008-2018 Free Software Foundation, Inc.
+# Copyright (C) 1998-1999, 2001, 2004, 2008-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/btowc.m4 b/m4/btowc.m4
index 8acdffc..c28ccb2 100644
--- a/m4/btowc.m4
+++ b/m4/btowc.m4
@@ -1,5 +1,5 @@
# btowc.m4 serial 11
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/builtin-expect.m4 b/m4/builtin-expect.m4
index a1eaf96..a6e8895 100644
--- a/m4/builtin-expect.m4
+++ b/m4/builtin-expect.m4
@@ -1,6 +1,6 @@
dnl Check for __builtin_expect.
-dnl Copyright 2016-2018 Free Software Foundation, Inc.
+dnl Copyright 2016-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4
index 0c23894..bdc5c8f 100644
--- a/m4/canonicalize.m4
+++ b/m4/canonicalize.m4
@@ -1,6 +1,6 @@
-# canonicalize.m4 serial 29
+# canonicalize.m4 serial 31
-dnl Copyright (C) 2003-2007, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -113,10 +113,12 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_realpath_works="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_realpath_works="guessing no" ;;
- # If we don't know, assume the worst.
- *) 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
diff --git a/m4/close-stream.m4 b/m4/close-stream.m4
deleted file mode 100644
index c9bf62e..0000000
--- a/m4/close-stream.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-#serial 4
-dnl Copyright (C) 2006-2007, 2009-2018 Free Software Foundation, Inc.
-dnl This file is free software; the Free 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 Prerequisites of lib/close-stream.c.
-AC_DEFUN([gl_CLOSE_STREAM],
-[
- :
-])
diff --git a/m4/close.m4 b/m4/close.m4
index f11b17e..378ec4c 100644
--- a/m4/close.m4
+++ b/m4/close.m4
@@ -1,5 +1,5 @@
# close.m4 serial 9
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/closedir.m4 b/m4/closedir.m4
index 338b5a7..66f6d4e 100644
--- a/m4/closedir.m4
+++ b/m4/closedir.m4
@@ -1,5 +1,5 @@
# closedir.m4 serial 6
-dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/closeout.m4 b/m4/closeout.m4
deleted file mode 100644
index 6442406..0000000
--- a/m4/closeout.m4
+++ /dev/null
@@ -1,12 +0,0 @@
-# closeout.m4 serial 6
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2018 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.
-
-dnl Prerequisites of lib/closeout.c.
-AC_DEFUN([gl_CLOSEOUT],
-[
- :
-])
diff --git a/m4/codeset.m4 b/m4/codeset.m4
index bc98201..9b019cf 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-2020 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/ctype.m4 b/m4/ctype.m4
index 85a7e3e..0b123d5 100644
--- a/m4/ctype.m4
+++ b/m4/ctype.m4
@@ -1,5 +1,5 @@
# ctype_h.m4 serial 6
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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 b054a92..8bef6a0 100644
--- a/m4/dirent_h.m4
+++ b/m4/dirent_h.m4
@@ -1,5 +1,5 @@
# dirent_h.m4 serial 16
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/dirfd.m4 b/m4/dirfd.m4
index 48589b9..d92445e 100644
--- a/m4/dirfd.m4
+++ b/m4/dirfd.m4
@@ -2,7 +2,7 @@
dnl Find out how to get the file descriptor associated with an open DIR*.
-# Copyright (C) 2001-2006, 2008-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2006, 2008-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/dirname.m4 b/m4/dirname.m4
index 820b047..9995ff3 100644
--- a/m4/dirname.m4
+++ b/m4/dirname.m4
@@ -1,5 +1,5 @@
#serial 10 -*- autoconf -*-
-dnl Copyright (C) 2002-2006, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/double-slash-root.m4 b/m4/double-slash-root.m4
index e99d4a3..c463ac4 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-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/dup2.m4 b/m4/dup2.m4
index c785d37..21b1ecc 100644
--- a/m4/dup2.m4
+++ b/m4/dup2.m4
@@ -1,5 +1,5 @@
#serial 25
-dnl Copyright (C) 2002, 2005, 2007, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005, 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/eealloc.m4 b/m4/eealloc.m4
index a5a4e26..236f373 100644
--- a/m4/eealloc.m4
+++ b/m4/eealloc.m4
@@ -1,5 +1,5 @@
# eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/environ.m4 b/m4/environ.m4
index acee536..bab85f1 100644
--- a/m4/environ.m4
+++ b/m4/environ.m4
@@ -1,5 +1,5 @@
# environ.m4 serial 7
-dnl Copyright (C) 2001-2004, 2006-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2004, 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/errno_h.m4 b/m4/errno_h.m4
index e1ae295..dd4994f 100644
--- a/m4/errno_h.m4
+++ b/m4/errno_h.m4
@@ -1,5 +1,5 @@
# errno_h.m4 serial 13
-dnl Copyright (C) 2004, 2006, 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/error.m4 b/m4/error.m4
index 280fdce..60c229d 100644
--- a/m4/error.m4
+++ b/m4/error.m4
@@ -1,6 +1,6 @@
#serial 14
-# Copyright (C) 1996-1998, 2001-2004, 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-1998, 2001-2004, 2009-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/m4/extensions.m4 b/m4/extensions.m4
index 71a854f..d7c95ef 100644
--- a/m4/extensions.m4
+++ b/m4/extensions.m4
@@ -1,7 +1,7 @@
# serial 18 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2018 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index 3661cbd..75c5008 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-2018 Free Software Foundation, Inc.
+dnl Copyright 2012-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -32,7 +32,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
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:
https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4
index cffb9de..747b865 100644
--- a/m4/fcntl-o.m4
+++ b/m4/fcntl-o.m4
@@ -1,5 +1,5 @@
# fcntl-o.m4 serial 6
-dnl Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/fcntl.m4 b/m4/fcntl.m4
index 46b2445..562ae23 100644
--- a/m4/fcntl.m4
+++ b/m4/fcntl.m4
@@ -1,5 +1,5 @@
# fcntl.m4 serial 9
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/fcntl_h.m4 b/m4/fcntl_h.m4
index 9fd3ab1..6b25393 100644
--- a/m4/fcntl_h.m4
+++ b/m4/fcntl_h.m4
@@ -1,6 +1,6 @@
-# serial 15
+# serial 16
# Configure fcntl.h.
-dnl Copyright (C) 2006-2007, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -37,6 +37,7 @@ 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])
@@ -44,6 +45,7 @@ AC_DEFUN([gl_FCNTL_H_DEFAULTS],
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/fdopen.m4 b/m4/fdopen.m4
index bff80ab..b1909db 100644
--- a/m4/fdopen.m4
+++ b/m4/fdopen.m4
@@ -1,5 +1,5 @@
# fdopen.m4 serial 4
-dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/fflush.m4 b/m4/fflush.m4
index 9098b10..620d1a7 100644
--- a/m4/fflush.m4
+++ b/m4/fflush.m4
@@ -1,6 +1,6 @@
# fflush.m4 serial 17
-# Copyright (C) 2007-2018 Free Software Foundation, Inc.
+# Copyright (C) 2007-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -57,7 +57,7 @@ AC_DEFUN([gl_FUNC_FFLUSH_STDIN],
if (lseek (fd, 0, SEEK_CUR) != 5)
{ fclose (f); return 5; }
/* Verify behaviour of fflush after ungetc. See
- <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> */
+ <https://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> */
/* Verify behaviour of fflush after a backup ungetc. This fails on
mingw. */
c = fgetc (f);
diff --git a/m4/flexmember.m4 b/m4/flexmember.m4
index db93cf3..90f3ddd 100644
--- a/m4/flexmember.m4
+++ b/m4/flexmember.m4
@@ -1,7 +1,7 @@
# serial 5
# Check for flexible array member support.
-# Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -34,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/fpending.m4 b/m4/fpending.m4
index c897073..ea9725e 100644
--- a/m4/fpending.m4
+++ b/m4/fpending.m4
@@ -1,6 +1,6 @@
# serial 22
-# Copyright (C) 2000-2001, 2004-2018 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2004-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/fpurge.m4 b/m4/fpurge.m4
index 99d1fc4..890c3e7 100644
--- a/m4/fpurge.m4
+++ b/m4/fpurge.m4
@@ -1,5 +1,5 @@
-# fpurge.m4 serial 8
-dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+# fpurge.m4 serial 10
+dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,12 +7,13 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FPURGE],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_FUNCS_ONCE([fpurge])
AC_CHECK_FUNCS_ONCE([__fpurge])
AC_CHECK_DECLS([fpurge], , , [[#include <stdio.h>]])
if test "x$ac_cv_func_fpurge" = xyes; then
HAVE_FPURGE=1
- # Detect BSD bug. Only cygwin 1.7 is known to be immune.
+ # Detect BSD bug. Only cygwin 1.7 and musl are known to be immune.
AC_CACHE_CHECK([whether fpurge works], [gl_cv_func_fpurge_works],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
@@ -48,11 +49,20 @@ AC_DEFUN([gl_FUNC_FPURGE],
return 13;
return 0;
])],
- [gl_cv_func_fpurge_works=yes], [gl_cv_func_fpurge_works=no],
- [gl_cv_func_fpurge_works='guessing no'])])
- if test "x$gl_cv_func_fpurge_works" != xyes; then
- REPLACE_FPURGE=1
- fi
+ [gl_cv_func_fpurge_works=yes],
+ [gl_cv_func_fpurge_works=no],
+ [case "$host_os" in
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_fpurge_works="guessing yes" ;;
+ # Otherwise obey --enable-cross-guesses.
+ *) gl_cv_func_fpurge_works="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_fpurge_works" in
+ *yes) ;;
+ *) REPLACE_FPURGE=1 ;;
+ esac
else
HAVE_FPURGE=0
fi
diff --git a/m4/freading.m4 b/m4/freading.m4
index 59a3528..440c241 100644
--- a/m4/freading.m4
+++ b/m4/freading.m4
@@ -1,5 +1,5 @@
# freading.m4 serial 1
-dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/fseek.m4 b/m4/fseek.m4
index 4a9ac7e..e36508c 100644
--- a/m4/fseek.m4
+++ b/m4/fseek.m4
@@ -1,5 +1,5 @@
# fseek.m4 serial 4
-dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/fseeko.m4 b/m4/fseeko.m4
index 86c246e..1a10515 100644
--- a/m4/fseeko.m4
+++ b/m4/fseeko.m4
@@ -1,5 +1,5 @@
# fseeko.m4 serial 19
-dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/fstat.m4 b/m4/fstat.m4
index f7fc383..53c0896 100644
--- a/m4/fstat.m4
+++ b/m4/fstat.m4
@@ -1,5 +1,5 @@
# fstat.m4 serial 6
-dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/ftell.m4 b/m4/ftell.m4
index 0ae8a92..22055d4 100644
--- a/m4/ftell.m4
+++ b/m4/ftell.m4
@@ -1,5 +1,5 @@
# ftell.m4 serial 3
-dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/ftello.m4 b/m4/ftello.m4
index b8fc70d..4c629c0 100644
--- a/m4/ftello.m4
+++ b/m4/ftello.m4
@@ -1,5 +1,5 @@
# ftello.m4 serial 13
-dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/ftruncate.m4 b/m4/ftruncate.m4
index ffeb4e6..041f542 100644
--- a/m4/ftruncate.m4
+++ b/m4/ftruncate.m4
@@ -2,7 +2,7 @@
# See if we need to emulate a missing ftruncate function using chsize.
-# Copyright (C) 2000-2001, 2003-2007, 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -20,7 +20,7 @@ AC_DEFUN([gl_FUNC_FTRUNCATE],
dnl The MSVCRT _chsize() function only accepts a 32-bit file size,
dnl and the mingw64 ftruncate64() function is unreliable (it may
dnl delete the file, see
- dnl <http://mingw-w64.sourcearchive.com/documentation/2.0-1/ftruncate64_8c_source.html>).
+ dnl <https://web.archive.org/web/20160425005423/http://mingw-w64.sourcearchive.com/documentation/2.0-1/ftruncate64_8c_source.html>).
dnl Use gnulib's ftruncate() implementation instead.
REPLACE_FTRUNCATE=1
;;
diff --git a/m4/fwriting.m4 b/m4/fwriting.m4
index 2da1653..4d7cd3e 100644
--- a/m4/fwriting.m4
+++ b/m4/fwriting.m4
@@ -1,5 +1,5 @@
# fwriting.m4 serial 2
-dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/getcwd.m4 b/m4/getcwd.m4
index 019934d..ba68c5f 100644
--- a/m4/getcwd.m4
+++ b/m4/getcwd.m4
@@ -1,12 +1,12 @@
# getcwd.m4 - check for working getcwd that is compatible with glibc
-# Copyright (C) 2001, 2003-2007, 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003-2007, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Written by Paul Eggert.
-# serial 16
+# serial 18
AC_DEFUN([gl_FUNC_GETCWD_NULL],
[
@@ -50,10 +50,12 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
[[case "$host_os" in
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_getcwd_null="guessing yes";;
# Guess yes on Cygwin.
cygwin*) gl_cv_func_getcwd_null="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_getcwd_null="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_getcwd_null="$gl_cross_guess_normal";;
esac
]])])
])
@@ -125,7 +127,7 @@ AC_DEFUN([gl_FUNC_GETCWD],
dnl Define HAVE_MINIMALLY_WORKING_GETCWD and HAVE_PARTLY_WORKING_GETCWD
dnl if appropriate.
case "$gl_cv_func_getcwd_path_max" in
- "no"|"no, it has the AIX bug") ;;
+ *"no" | *"no, it has the AIX bug") ;;
*)
AC_DEFINE([HAVE_MINIMALLY_WORKING_GETCWD], [1],
[Define to 1 if getcwd minimally works, that is, its result can be
@@ -133,12 +135,12 @@ AC_DEFUN([gl_FUNC_GETCWD],
;;
esac
case "$gl_cv_func_getcwd_path_max" in
- "no, but it is partly working")
+ *"no, but it is partly working")
AC_DEFINE([HAVE_PARTLY_WORKING_GETCWD], [1],
[Define to 1 if getcwd works, except it sometimes fails when it
shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT.])
;;
- "yes, but with shorter paths")
+ *"yes, but with shorter paths")
AC_DEFINE([HAVE_GETCWD_SHORTER], [1],
[Define to 1 if getcwd works, but with shorter paths
than is generally tested with the replacement.])
diff --git a/m4/getdelim.m4 b/m4/getdelim.m4
index e50af81..9f4c7f6 100644
--- a/m4/getdelim.m4
+++ b/m4/getdelim.m4
@@ -1,6 +1,6 @@
-# getdelim.m4 serial 12
+# getdelim.m4 serial 14
-dnl Copyright (C) 2005-2007, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc.
dnl
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,6 +11,7 @@ AC_PREREQ([2.59])
AC_DEFUN([gl_FUNC_GETDELIM],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
dnl Persuade glibc <stdio.h> to declare getdelim().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
@@ -21,9 +22,10 @@ AC_DEFUN([gl_FUNC_GETDELIM],
if test $ac_cv_func_getdelim = yes; then
HAVE_GETDELIM=1
dnl Found it in some library. Verify that it works.
- AC_CACHE_CHECK([for working getdelim function], [gl_cv_func_working_getdelim],
- [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ AC_CACHE_CHECK([for working getdelim function],
+ [gl_cv_func_working_getdelim],
+ [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
@@ -53,25 +55,31 @@ AC_DEFUN([gl_FUNC_GETDELIM],
fclose (in);
return 0;
}
- ]])], [gl_cv_func_working_getdelim=yes] dnl The library version works.
- , [gl_cv_func_working_getdelim=no] dnl The library version does NOT work.
- , dnl We're cross compiling. Assume it works on glibc2 systems.
- [AC_EGREP_CPP([Lucky GNU user],
- [
+ ]])],
+ [gl_cv_func_working_getdelim=yes],
+ [gl_cv_func_working_getdelim=no],
+ [dnl We're cross compiling.
+ dnl Guess it works on glibc2 systems and musl systems.
+ AC_EGREP_CPP([Lucky GNU user],
+ [
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ >= 2) && !defined __UCLIBC__
Lucky GNU user
#endif
#endif
- ],
- [gl_cv_func_working_getdelim="guessing yes"],
- [gl_cv_func_working_getdelim="guessing no"])]
- )])
+ ],
+ [gl_cv_func_working_getdelim="guessing yes"],
+ [case "$host_os" in
+ *-musl*) gl_cv_func_working_getdelim="guessing yes" ;;
+ *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;;
+ esac
+ ])
+ ])
+ ])
case "$gl_cv_func_working_getdelim" in
- *no)
- REPLACE_GETDELIM=1
- ;;
+ *yes) ;;
+ *) REPLACE_GETDELIM=1 ;;
esac
else
HAVE_GETDELIM=0
diff --git a/m4/getdtablesize.m4 b/m4/getdtablesize.m4
index 4cc1a8f..ab2e3fe 100644
--- a/m4/getdtablesize.m4
+++ b/m4/getdtablesize.m4
@@ -1,5 +1,5 @@
# getdtablesize.m4 serial 7
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index 0496250..595483d 100644
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -1,5 +1,5 @@
-# getopt.m4 serial 46
-dnl Copyright (C) 2002-2006, 2008-2018 Free Software Foundation, Inc.
+# getopt.m4 serial 47
+dnl Copyright (C) 2002-2006, 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -302,8 +302,10 @@ dnl is ambiguous with environment values that contain newlines.
]])],
[gl_cv_func_getopt_gnu=yes],
[gl_cv_func_getopt_gnu=no],
- [dnl Cross compiling. Assume the worst, even on glibc platforms.
- gl_cv_func_getopt_gnu="guessing no"
+ [dnl Cross compiling.
+ dnl Assume the worst, even on glibc platforms.
+ dnl But obey --enable-cross-guesses.
+ gl_cv_func_getopt_gnu="$gl_cross_guess_normal"
])
case $gl_had_POSIXLY_CORRECT in
exported) ;;
diff --git a/m4/getpagesize.m4 b/m4/getpagesize.m4
index eb17d60..8f0f046 100644
--- a/m4/getpagesize.m4
+++ b/m4/getpagesize.m4
@@ -1,5 +1,5 @@
# getpagesize.m4 serial 10
-dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2018 Free Software Foundation,
+dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2020 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/getprogname.m4 b/m4/getprogname.m4
index 3a9ba8b..6baefc9 100644
--- a/m4/getprogname.m4
+++ b/m4/getprogname.m4
@@ -1,6 +1,6 @@
# getprogname.m4 - check for getprogname or replacements for it
-# Copyright (C) 2016-2018 Free Software Foundation, Inc.
+# Copyright (C) 2016-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4
index 198695e..c72b3ea 100644
--- a/m4/gettimeofday.m4
+++ b/m4/gettimeofday.m4
@@ -1,6 +1,6 @@
-# serial 25
+# serial 27
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -105,10 +105,12 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
case "$host_os" in
# Guess all is fine on glibc systems.
*-gnu* | gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
+ # Guess all is fine on musl systems.
+ *-musl*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_gettimeofday_clobber="$gl_cross_guess_inverted" ;;
esac
])])
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
index 126aa1a..ece484b 100644
--- a/m4/glibc21.m4
+++ b/m4/glibc21.m4
@@ -1,5 +1,5 @@
# glibc21.m4 serial 5
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2018 Free Software Foundation,
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2020 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/gnulib-common.m4 b/m4/gnulib-common.m4
index 2b253da..6c4cad6 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 41
-dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 46
+dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -17,10 +17,20 @@ AC_DEFUN([gl_COMMON_BODY], [
AH_VERBATIM([_Noreturn],
[/* The _Noreturn keyword of C11. */
#ifndef _Noreturn
-# if 201103 <= (defined __cplusplus ? __cplusplus : 0)
+# 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 (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
- || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))
+# elif ((!defined __cplusplus || defined __clang__) \
+ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+ || 4 < __GNUC__ + (7 <= __GNUC_MINOR__)))
/* _Noreturn works as-is. */
# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
# define _Noreturn __attribute__ ((__noreturn__))
@@ -85,6 +95,60 @@ AC_DEFUN([gl_COMMON_BODY], [
# define _GL_ATTRIBUTE_MALLOC /* empty */
#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
+])
+ 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
@@ -351,12 +415,13 @@ AC_DEFUN([AC_C_RESTRICT],
nothing if this is not supported. Do not define if restrict is
supported 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])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 0d8b64f..dff0d58 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2018 Free Software Foundation, Inc.
+# Copyright (C) 2002-2020 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
@@ -114,7 +114,7 @@ AC_DEFUN([gl_EARLY],
# Code from module fdopen:
# Code from module fdopen-tests:
# Code from module fflush:
- AC_REQUIRE([AC_FUNC_FSEEKO])
+ AC_REQUIRE([gl_SET_LARGEFILE_SOURCE])
# Code from module fflush-tests:
# Code from module fgetc-tests:
# Code from module file-has-acl:
@@ -132,14 +132,14 @@ AC_DEFUN([gl_EARLY],
# Code from module fseek:
# Code from module fseek-tests:
# Code from module fseeko:
- AC_REQUIRE([AC_FUNC_FSEEKO])
+ AC_REQUIRE([gl_SET_LARGEFILE_SOURCE])
# Code from module fseeko-tests:
# Code from module fstat:
# Code from module fstat-tests:
# Code from module ftell:
# Code from module ftell-tests:
# Code from module ftello:
- AC_REQUIRE([AC_FUNC_FSEEKO])
+ AC_REQUIRE([gl_SET_LARGEFILE_SOURCE])
# Code from module ftello-tests:
# Code from module ftruncate:
# Code from module ftruncate-tests:
@@ -170,7 +170,7 @@ AC_DEFUN([gl_EARLY],
# Code from module gnumakefile:
# Code from module gnupload:
# Code from module hard-locale:
- # Code from module havelib:
+ # Code from module hard-locale-tests:
# Code from module ignore-value:
# Code from module ignore-value-tests:
# Code from module include_next:
@@ -246,11 +246,19 @@ AC_DEFUN([gl_EARLY],
# Code from module opendir:
# Code from module pathmax:
# Code from module pathmax-tests:
+ # Code from module perl:
# Code from module perror:
# Code from module perror-tests:
# Code from module pipe-posix:
# Code from module pipe-posix-tests:
# Code from module progname:
+ # Code from module pthread-h:
+ gl_ANYTHREADLIB_EARLY
+ # Code from module pthread-h-tests:
+ # Code from module pthread-thread:
+ # Code from module pthread-thread-tests:
+ # Code from module pthread_sigmask:
+ # Code from module pthread_sigmask-tests:
# Code from module putenv:
# Code from module qcopy-acl:
# Code from module qset-acl:
@@ -274,12 +282,16 @@ AC_DEFUN([gl_EARLY],
# Code from module rmdir:
# Code from module rmdir-tests:
# Code from module same-inode:
+ # Code from module sched:
+ # Code from module sched-tests:
# Code from module select:
# Code from module select-tests:
# Code from module selinux-h:
# Code from module setenv:
# Code from module setenv-tests:
# Code from module setlocale:
+ # Code from module setlocale-null:
+ # Code from module setlocale-null-tests:
# Code from module setlocale-tests:
# Code from module setsockopt:
# Code from module setsockopt-tests:
@@ -312,10 +324,9 @@ AC_DEFUN([gl_EARLY],
# Code from module stdalign-tests:
# Code from module stdarg:
dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
- dnl for the builtin va_copy to work. With Autoconf 2.60 or later,
- dnl gl_PROG_CC_C99 arranges for this. With older Autoconf gl_PROG_CC_C99
- dnl shouldn't hurt, though installers are on their own to set c99 mode.
+ dnl for the builtin va_copy to work. gl_PROG_CC_C99 arranges for this.
gl_PROG_CC_C99
+ # Code from module stdarg-tests:
# Code from module stdbool:
# Code from module stdbool-tests:
# Code from module stddef:
@@ -356,6 +367,8 @@ AC_DEFUN([gl_EARLY],
# Code from module tempname:
# Code from module test-framework-sh:
# Code from module test-framework-sh-tests:
+ # Code from module thread:
+ # Code from module thread-tests:
# Code from module threadlib:
gl_THREADLIB_EARLY
# Code from module time:
@@ -384,6 +397,12 @@ AC_DEFUN([gl_EARLY],
# Code from module wctomb:
# Code from module wctype-h:
# Code from module wctype-h-tests:
+ # Code from module windows-mutex:
+ # Code from module windows-once:
+ # Code from module windows-recmutex:
+ # Code from module windows-rwlock:
+ # Code from module windows-thread:
+ # Code from module windows-tls:
# Code from module xalloc:
# Code from module xalloc-die:
# Code from module xalloc-die-tests:
@@ -424,9 +443,7 @@ AC_DEFUN([gl_INIT],
gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
gl_STDLIB_MODULE_INDICATOR([realpath])
gl_UNISTD_MODULE_INDICATOR([chdir])
- gl_CLOSE_STREAM
gl_MODULE_INDICATOR([close-stream])
- gl_CLOSEOUT
gl_CTYPE_H
gl_DIRNAME_LGPL
gl_DOUBLE_SLASH_ROOT
@@ -441,6 +458,7 @@ AC_DEFUN([gl_INIT],
AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
AC_REQUIRE([gl_EXTERN_INLINE])
gl_FCNTL_H
+ AC_C_FLEXIBLE_ARRAY_MEMBER
gl_FUNC_FPENDING
if test $gl_cv_func___fpending = no; then
AC_LIBOBJ([fpending])
@@ -478,6 +496,7 @@ AC_DEFUN([gl_INIT],
GNULIB_GL_UNISTD_H_GETOPT=1
fi
AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
+ gl_UNISTD_MODULE_INDICATOR([getopt-posix])
gl_FUNC_GETPROGNAME
AC_SUBST([LIBINTL])
AC_SUBST([LTLIBINTL])
@@ -497,6 +516,10 @@ AC_DEFUN([gl_INIT],
m4_defn([m4_PACKAGE_VERSION])), [1], [],
[AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
[GNUmakefile=$GNUmakefile])])
+ AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
+ LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
+ AC_SUBST([LIB_HARD_LOCALE])
+ gl_INTTYPES_INCOMPLETE
gl_FUNC_ISBLANK
if test $HAVE_ISBLANK = 0; then
AC_LIBOBJ([isblank])
@@ -530,6 +553,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_POSIX
if test $REPLACE_MALLOC = 1; then
AC_LIBOBJ([malloc])
@@ -545,6 +569,11 @@ AC_DEFUN([gl_INIT],
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])
@@ -555,7 +584,7 @@ AC_DEFUN([gl_INIT],
fi
gl_WCHAR_MODULE_INDICATOR([mbsinit])
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
@@ -610,6 +639,7 @@ AC_DEFUN([gl_INIT],
AC_FUNC_OBSTACK
dnl Note: AC_FUNC_OBSTACK does AC_LIBSOURCES([obstack.h, obstack.c]).
gl_PATHMAX
+ gl_PERL
AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
gl_QUOTE
@@ -640,6 +670,12 @@ AC_DEFUN([gl_INIT],
if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then
AC_LIBOBJ([getfilecon])
fi
+ 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])
gt_TYPE_SSIZE_T
gl_FUNC_STAT
if test $REPLACE_STAT = 1; then
@@ -687,7 +723,7 @@ AC_DEFUN([gl_INIT],
gl_SYS_TYPES_H
AC_PROG_MKDIR_P
gl_FUNC_GEN_TEMPNAME
- gl_THREADLIB
+ AC_REQUIRE([gl_THREADLIB])
gl_HEADER_TIME_H
gl_UNISTD_H
gl_FUNC_GLIBC_UNLOCKED_IO
@@ -712,6 +748,30 @@ AC_DEFUN([gl_INIT],
fi
gl_STDLIB_MODULE_INDICATOR([wctomb])
gl_WCTYPE_H
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ AC_LIBOBJ([windows-mutex])
+ ;;
+ esac
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ AC_LIBOBJ([windows-once])
+ ;;
+ esac
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ AC_LIBOBJ([windows-recmutex])
+ ;;
+ esac
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ AC_LIBOBJ([windows-rwlock])
+ ;;
+ esac
gl_XALLOC
# End of code from modules
m4_ifval(gl_LIBSOURCES_LIST, [
@@ -827,7 +887,6 @@ changequote([, ])dnl
gl_STDIO_MODULE_INDICATOR([fflush])
gl_FILE_HAS_ACL
AC_CHECK_DECLS_ONCE([alarm])
- AC_C_FLEXIBLE_ARRAY_MEMBER
gl_FUNC_FPURGE
if test $HAVE_FPURGE = 0 || test $REPLACE_FPURGE = 1; then
AC_LIBOBJ([fpurge])
@@ -882,15 +941,20 @@ changequote([, ])dnl
AC_LIBOBJ([getpagesize])
fi
gl_UNISTD_MODULE_INDICATOR([getpagesize])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ *-musl*) AC_DEFINE([MUSL_LIBC], [1], [Define to 1 on musl libc.]) ;;
+ esac
+ dnl Distinguish OpenBSD >= 6.2 from OpenBSD < 6.2.
+ AC_CHECK_FUNCS_ONCE([duplocale])
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])
AC_C_BIGENDIAN
gl_INTTYPES_H
- gl_INTTYPES_INCOMPLETE
gl_FUNC_IOCTL
if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then
AC_LIBOBJ([ioctl])
@@ -959,6 +1023,18 @@ changequote([, ])dnl
AC_LIBOBJ([pipe])
fi
gl_UNISTD_MODULE_INDICATOR([pipe])
+ gl_PTHREAD_H
+ gl_PTHREAD_THREAD
+ if test $HAVE_PTHREAD_CREATE = 0 || test $REPLACE_PTHREAD_CREATE = 1; then
+ AC_LIBOBJ([pthread-thread])
+ fi
+ gl_PTHREAD_MODULE_INDICATOR([pthread-thread])
+ gl_FUNC_PTHREAD_SIGMASK
+ if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
+ AC_LIBOBJ([pthread_sigmask])
+ gl_PREREQ_PTHREAD_SIGMASK
+ fi
+ gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask])
gl_FUNC_PUTENV
if test $REPLACE_PUTENV = 1; then
AC_LIBOBJ([putenv])
@@ -987,6 +1063,7 @@ changequote([, ])dnl
AC_LIBOBJ([realloc])
fi
gl_STDLIB_MODULE_INDICATOR([realloc-posix])
+ gl_SCHED_H
gl_FUNC_SELECT
if test $REPLACE_SELECT = 1; then
AC_LIBOBJ([select])
@@ -1079,6 +1156,7 @@ changequote([, ])dnl
AC_CHECK_FUNCS_ONCE([shutdown])
gl_HEADER_SYS_UIO
AC_PROG_MKDIR_P
+ gl_THREAD
gl_FUNC_UNSETENV
if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
AC_LIBOBJ([unsetenv])
@@ -1093,6 +1171,18 @@ changequote([, ])dnl
gt_LOCALE_FR_UTF8
gt_LOCALE_JA
gt_LOCALE_ZH_CN
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ AC_LIBOBJ([windows-thread])
+ ;;
+ esac
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ AC_LIBOBJ([windows-tls])
+ ;;
+ esac
m4_popdef([gl_MODULE_INDICATOR_CONDITION])
m4_ifval(gltests_LIBSOURCES_LIST, [
m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
@@ -1190,7 +1280,6 @@ AC_DEFUN([gltests_LIBSOURCES], [
# gnulib-tool and may be removed by future gnulib-tool invocations.
AC_DEFUN([gl_FILE_LIST], [
build-aux/announce-gen
- build-aux/config.rpath
build-aux/do-release-commit-and-tag
build-aux/gendocs.sh
build-aux/git-version-gen
@@ -1245,6 +1334,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/exitfail.h
lib/fcntl.in.h
lib/filename.h
+ lib/flexmember.h
lib/fpending.c
lib/fpending.h
lib/fstat.c
@@ -1273,8 +1363,11 @@ AC_DEFUN([gl_FILE_LIST], [
lib/hard-locale.h
lib/ignore-value.h
lib/intprops.h
+ lib/inttypes.in.h
lib/isblank.c
lib/langinfo.in.h
+ lib/lc-charset-dispatch.c
+ lib/lc-charset-dispatch.h
lib/libc-config.h
lib/limits.in.h
lib/localcharset.c
@@ -1290,9 +1383,13 @@ AC_DEFUN([gl_FILE_LIST], [
lib/malloca.c
lib/malloca.h
lib/mbrlen.c
+ 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
@@ -1331,6 +1428,9 @@ AC_DEFUN([gl_FILE_LIST], [
lib/se-selinux.in.h
lib/set-acl.c
lib/set-permissions.c
+ lib/setlocale-lock.c
+ lib/setlocale_null.c
+ lib/setlocale_null.h
lib/stat-macros.h
lib/stat-time.c
lib/stat-time.h
@@ -1374,6 +1474,15 @@ AC_DEFUN([gl_FILE_LIST], [
lib/wctomb.c
lib/wctype-h.c
lib/wctype.in.h
+ lib/windows-initguard.h
+ lib/windows-mutex.c
+ lib/windows-mutex.h
+ lib/windows-once.c
+ lib/windows-once.h
+ lib/windows-recmutex.c
+ lib/windows-recmutex.h
+ lib/windows-rwlock.c
+ lib/windows-rwlock.h
lib/xalloc-die.c
lib/xalloc-oversized.h
lib/xalloc.h
@@ -1388,10 +1497,8 @@ AC_DEFUN([gl_FILE_LIST], [
m4/btowc.m4
m4/builtin-expect.m4
m4/canonicalize.m4
- m4/close-stream.m4
m4/close.m4
m4/closedir.m4
- m4/closeout.m4
m4/codeset.m4
m4/ctype.m4
m4/dirent_h.m4
@@ -1430,7 +1537,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/gettimeofday.m4
m4/glibc21.m4
m4/gnulib-common.m4
- m4/host-cpu-c-abi.m4
m4/include_next.m4
m4/inet_pton.m4
m4/intl-thread-locale.m4
@@ -1442,9 +1548,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/langinfo_h.m4
m4/largefile.m4
m4/lcmessage.m4
- m4/lib-ld.m4
- m4/lib-link.m4
- m4/lib-prefix.m4
m4/limits-h.m4
m4/link.m4
m4/localcharset.m4
@@ -1457,7 +1560,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/localename.m4
m4/localtime-buffer.m4
m4/lock.m4
- m4/longlong.m4
m4/lseek.m4
m4/lstat.m4
m4/malloc.m4
@@ -1487,12 +1589,17 @@ AC_DEFUN([gl_FILE_LIST], [
m4/obstack.m4
m4/off_t.m4
m4/open-cloexec.m4
+ m4/open-slash.m4
m4/open.m4
m4/opendir.m4
m4/pathmax.m4
+ m4/perl.m4
m4/perror.m4
m4/pipe.m4
+ m4/pthread-thread.m4
+ m4/pthread_h.m4
m4/pthread_rwlock_rdlock.m4
+ m4/pthread_sigmask.m4
m4/putenv.m4
m4/quote.m4
m4/quotearg.m4
@@ -1504,11 +1611,13 @@ AC_DEFUN([gl_FILE_LIST], [
m4/regex.m4
m4/rename.m4
m4/rmdir.m4
+ m4/sched_h.m4
m4/select.m4
m4/selinux-context-h.m4
m4/selinux-selinux-h.m4
m4/setenv.m4
m4/setlocale.m4
+ m4/setlocale_null.m4
m4/sigaction.m4
m4/signal_h.m4
m4/signalblocking.m4
@@ -1542,12 +1651,14 @@ AC_DEFUN([gl_FILE_LIST], [
m4/sys_types_h.m4
m4/sys_uio_h.m4
m4/tempname.m4
+ m4/thread.m4
m4/threadlib.m4
m4/time_h.m4
m4/ungetc.m4
m4/unistd_h.m4
m4/unlocked-io.m4
m4/version-etc.m4
+ m4/visibility.m4
m4/warn-on-use.m4
m4/warnings.m4
m4/wchar_h.m4
@@ -1562,6 +1673,7 @@ AC_DEFUN([gl_FILE_LIST], [
tests/dfa-match-aux.c
tests/dfa-match.sh
tests/init.sh
+ tests/locale.c
tests/macros.h
tests/nap.h
tests/null-ptr.h
@@ -1646,6 +1758,7 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-getopt_long.h
tests/test-getprogname.c
tests/test-gettimeofday.c
+ tests/test-hard-locale.c
tests/test-ignore-value.c
tests/test-inet_pton.c
tests/test-init.sh
@@ -1672,6 +1785,8 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-mbrtowc-w32-3.sh
tests/test-mbrtowc-w32-4.sh
tests/test-mbrtowc-w32-5.sh
+ tests/test-mbrtowc-w32-6.sh
+ tests/test-mbrtowc-w32-7.sh
tests/test-mbrtowc-w32.c
tests/test-mbrtowc.c
tests/test-mbrtowc1.sh
@@ -1687,6 +1802,7 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-mkdir.h
tests/test-nanosleep.c
tests/test-netinet_in.c
+ tests/test-nl_langinfo-mt.c
tests/test-nl_langinfo.c
tests/test-nl_langinfo.sh
tests/test-open.c
@@ -1696,6 +1812,10 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-perror.sh
tests/test-perror2.c
tests/test-pipe.c
+ tests/test-pthread-thread.c
+ tests/test-pthread.c
+ tests/test-pthread_sigmask1.c
+ tests/test-pthread_sigmask2.c
tests/test-quotearg-simple.c
tests/test-quotearg.h
tests/test-raise.c
@@ -1708,6 +1828,7 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-rmdir.c
tests/test-rmdir.h
tests/test-sameacls.c
+ tests/test-sched.c
tests/test-select-fd.c
tests/test-select-in.sh
tests/test-select-out.sh
@@ -1723,6 +1844,9 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-setlocale1.sh
tests/test-setlocale2.c
tests/test-setlocale2.sh
+ tests/test-setlocale_null-mt-all.c
+ tests/test-setlocale_null-mt-one.c
+ tests/test-setlocale_null.c
tests/test-setsockopt.c
tests/test-sigaction.c
tests/test-signal-h.c
@@ -1752,6 +1876,8 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-sys_types.c
tests/test-sys_uio.c
tests/test-sys_wait.h
+ tests/test-thread_create.c
+ tests/test-thread_self.c
tests/test-time.c
tests/test-unistd.c
tests/test-unsetenv.c
@@ -1769,6 +1895,8 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-wcrtomb-w32-3.sh
tests/test-wcrtomb-w32-4.sh
tests/test-wcrtomb-w32-5.sh
+ tests/test-wcrtomb-w32-6.sh
+ tests/test-wcrtomb-w32-7.sh
tests/test-wcrtomb-w32.c
tests/test-wcrtomb.c
tests/test-wcrtomb.sh
@@ -1797,7 +1925,6 @@ AC_DEFUN([gl_FILE_LIST], [
tests=lib/fdopen.c
tests=lib/fflush.c
tests=lib/file-has-acl.c
- tests=lib/flexmember.h
tests=lib/fpurge.c
tests=lib/freading.c
tests=lib/freading.h
@@ -1809,8 +1936,9 @@ AC_DEFUN([gl_FILE_LIST], [
tests=lib/getcwd-lgpl.c
tests=lib/getdtablesize.c
tests=lib/getpagesize.c
+ tests=lib/glthread/thread.c
+ tests=lib/glthread/thread.h
tests=lib/inet_pton.c
- tests=lib/inttypes.in.h
tests=lib/ioctl.c
tests=lib/link.c
tests=lib/listen.c
@@ -1825,12 +1953,16 @@ AC_DEFUN([gl_FILE_LIST], [
tests=lib/opendir.c
tests=lib/perror.c
tests=lib/pipe.c
+ tests=lib/pthread-thread.c
+ tests=lib/pthread.in.h
+ tests=lib/pthread_sigmask.c
tests=lib/putenv.c
tests=lib/raise.c
tests=lib/read-file.c
tests=lib/read-file.h
tests=lib/readdir.c
tests=lib/realloc.c
+ tests=lib/sched.in.h
tests=lib/select.c
tests=lib/setenv.c
tests=lib/setlocale.c
@@ -1857,6 +1989,10 @@ AC_DEFUN([gl_FILE_LIST], [
tests=lib/unused-parameter.h
tests=lib/w32sock.h
tests=lib/warn-on-use.h
+ tests=lib/windows-thread.c
+ tests=lib/windows-thread.h
+ tests=lib/windows-tls.c
+ tests=lib/windows-tls.h
top/GNUmakefile
top/README-release
top/maint.mk
diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4
deleted file mode 100644
index cd88070..0000000
--- a/m4/host-cpu-c-abi.m4
+++ /dev/null
@@ -1,644 +0,0 @@
-# host-cpu-c-abi.m4 serial 11
-dnl Copyright (C) 2002-2018 Free Software Foundation, Inc.
-dnl This file is free software; the Free 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[4567]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, or to 'no' otherwise.
-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 ;;
- *)
- gl_cv_host_cpu_c_abi_32bit=no ;;
- esac
- else
- case "$host_cpu" in
-
-changequote(,)dnl
- i[4567]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=no
- ;;
- esac
- fi
- ])
-
- HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
-])
diff --git a/m4/include_next.m4 b/m4/include_next.m4
index a363cb0..9009e29 100644
--- a/m4/include_next.m4
+++ b/m4/include_next.m4
@@ -1,5 +1,5 @@
# include_next.m4 serial 24
-dnl Copyright (C) 2006-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/inet_pton.m4 b/m4/inet_pton.m4
index 1aaa2e6..4191a39 100644
--- a/m4/inet_pton.m4
+++ b/m4/inet_pton.m4
@@ -1,5 +1,5 @@
-# inet_pton.m4 serial 18
-dnl Copyright (C) 2006, 2008-2018 Free Software Foundation, Inc.
+# inet_pton.m4 serial 19
+dnl Copyright (C) 2006, 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -24,15 +24,16 @@ 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
diff --git a/m4/intl-thread-locale.m4 b/m4/intl-thread-locale.m4
index 661a23f..b4bc839 100644
--- a/m4/intl-thread-locale.m4
+++ b/m4/intl-thread-locale.m4
@@ -1,5 +1,5 @@
-# intl-thread-locale.m4 serial 4
-dnl Copyright (C) 2015-2018 Free Software Foundation, Inc.
+# intl-thread-locale.m4 serial 7
+dnl Copyright (C) 2015-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -17,7 +17,7 @@ dnl Check how to retrieve the name of a per-thread locale (POSIX locale_t).
dnl Sets gt_nameless_locales.
AC_DEFUN([gt_INTL_THREAD_LOCALE_NAME],
[
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([AC_CANONICAL_HOST])
dnl Persuade Solaris <locale.h> to define 'locale_t'.
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
@@ -119,18 +119,20 @@ int main ()
;;
esac
- dnl This code is for future use, in case we some day have to port to a
- dnl platform where the locale_t type does not provide access to the name of
- dnl each locale category. This code has the drawback that it requires the
- dnl gnulib overrides of 'newlocale', 'duplocale', 'freelocale', which is a
- dnl problem for GNU libunistring. Therefore try hard to avoid enabling this
- dnl code!
+ dnl This code is for platforms where the locale_t type does not provide access
+ dnl to the name of each locale category. This code has the drawback that it
+ dnl requires the gnulib overrides of 'newlocale', 'duplocale', 'freelocale',
+ dnl which is a problem for GNU libunistring. Therefore try hard to avoid
+ dnl enabling this code!
gt_nameless_locales=no
- if false; then
- gt_nameless_locales=yes
- AC_DEFINE([HAVE_NAMELESS_LOCALES], [1],
- [Define if the locale_t type does not contain the name of each locale category.])
- fi
+ case "$host_os" in
+ dnl It's needed on AIX 7.2.
+ aix*)
+ gt_nameless_locales=yes
+ AC_DEFINE([HAVE_NAMELESS_LOCALES], [1],
+ [Define if the locale_t type does not contain the name of each locale category.])
+ ;;
+ esac
])
dnl Tests whether uselocale() exists and is usable.
@@ -139,13 +141,15 @@ AC_DEFUN([gt_FUNC_USELOCALE],
[
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- dnl Persuade Solaris <locale.h> to define 'locale_t'.
+ dnl Persuade glibc and Solaris <locale.h> to define 'locale_t'.
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_CHECK_FUNCS_ONCE([uselocale])
dnl On AIX 7.2, the uselocale() function is not documented and leads to
dnl crashes in subsequent setlocale() invocations.
+ dnl In 2019, some versions of z/OS lack the locale_t type and have a broken
+ dnl uselocale function.
if test $ac_cv_func_uselocale = yes; then
AC_CHECK_HEADERS_ONCE([xlocale.h])
AC_CACHE_CHECK([whether uselocale works],
@@ -156,6 +160,7 @@ AC_DEFUN([gt_FUNC_USELOCALE],
#if HAVE_XLOCALE_H
# include <xlocale.h>
#endif
+locale_t loc1;
int main ()
{
uselocale (NULL);
@@ -164,10 +169,10 @@ int main ()
}]])],
[gt_cv_func_uselocale_works=yes],
[gt_cv_func_uselocale_works=no],
- [# Guess no on AIX, yes otherwise.
+ [# Guess no on AIX and z/OS, yes otherwise.
case "$host_os" in
- aix*) gt_cv_func_uselocale_works="guessing no" ;;
- *) gt_cv_func_uselocale_works="guessing yes" ;;
+ aix* | openedition*) gt_cv_func_uselocale_works="guessing no" ;;
+ *) gt_cv_func_uselocale_works="guessing yes" ;;
esac
])
])
diff --git a/m4/intlmacosx.m4 b/m4/intlmacosx.m4
index 17c1bd4..1c28ce2 100644
--- a/m4/intlmacosx.m4
+++ b/m4/intlmacosx.m4
@@ -1,5 +1,5 @@
-# intlmacosx.m4 serial 6 (gettext-0.19.9)
-dnl Copyright (C) 2004-2014, 2016 Free Software Foundation, Inc.
+# intlmacosx.m4 serial 7 (gettext-0.20.2)
+dnl Copyright (C) 2004-2014, 2016, 2019-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -33,21 +33,15 @@ AC_DEFUN([gt_INTL_MACOSX],
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
[Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
fi
- dnl Check for API introduced in Mac OS X 10.5.
- AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
- [gt_save_LIBS="$LIBS"
- LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <CoreFoundation/CFLocale.h>]],
- [[CFLocaleCopyCurrent();]])],
- [gt_cv_func_CFLocaleCopyCurrent=yes],
- [gt_cv_func_CFLocaleCopyCurrent=no])
- LIBS="$gt_save_LIBS"])
- if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
- AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
- [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
- fi
+ dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent,
+ dnl because in macOS 10.13.4 it has the following behaviour:
+ dnl When two or more languages are specified in the
+ dnl "System Preferences > Language & Region > Preferred Languages" panel,
+ dnl it returns en_CC where CC is the territory (even when English is not among
+ dnl the preferred languages!). What we want instead is what
+ dnl CFLocaleCopyCurrent returned in earlier macOS releases and what
+ dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the
+ dnl first among the preferred languages and CC is the territory.
AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
[gt_save_LIBS="$LIBS"
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
@@ -64,7 +58,6 @@ AC_DEFUN([gt_INTL_MACOSX],
fi
INTL_MACOSX_LIBS=
if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
- || test $gt_cv_func_CFLocaleCopyCurrent = yes \
|| test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
fi
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
index c844262..ac40a05 100644
--- a/m4/inttypes-pri.m4
+++ b/m4/inttypes-pri.m4
@@ -1,5 +1,5 @@
# inttypes-pri.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1997-2002, 2006, 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2002, 2006, 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
index d756f01..d0487d6 100644
--- a/m4/inttypes.m4
+++ b/m4/inttypes.m4
@@ -1,5 +1,5 @@
-# inttypes.m4 serial 27
-dnl Copyright (C) 2006-2018 Free Software Foundation, Inc.
+# inttypes.m4 serial 28
+dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -113,10 +113,8 @@ AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
#if $2
#define CONDITION ($3)
- #elif HAVE_LONG_LONG_INT
- #define CONDITION ($4)
#else
- #define CONDITION 0
+ #define CONDITION ($4)
#endif
int test[CONDITION ? 1 : -1];]])],
[gl_cv_test_$1=yes],
diff --git a/m4/ioctl.m4 b/m4/ioctl.m4
index 835338a..263aaae 100644
--- a/m4/ioctl.m4
+++ b/m4/ioctl.m4
@@ -1,5 +1,5 @@
# ioctl.m4 serial 5
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/isblank.m4 b/m4/isblank.m4
index f98dfbf..5e1b783 100644
--- a/m4/isblank.m4
+++ b/m4/isblank.m4
@@ -1,5 +1,5 @@
# isblank.m4 serial 3
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/langinfo_h.m4 b/m4/langinfo_h.m4
index de077c3..ef92f84 100644
--- a/m4/langinfo_h.m4
+++ b/m4/langinfo_h.m4
@@ -1,5 +1,5 @@
# langinfo_h.m4 serial 8
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/largefile.m4 b/m4/largefile.m4
index bec7cd1..e381339 100644
--- a/m4/largefile.m4
+++ b/m4/largefile.m4
@@ -1,10 +1,27 @@
# 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-2018 Free Software Foundation, Inc.
+# Copyright 1992-1996, 1998-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
+# 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.
@@ -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])
diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4
index 1c24d6d..9d4de1a 100644
--- a/m4/lcmessage.m4
+++ b/m4/lcmessage.m4
@@ -1,6 +1,6 @@
# lcmessage.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1995-2002, 2004-2005, 2008-2014, 2016 Free Software
-dnl Foundation, Inc.
+dnl Copyright (C) 1995-2002, 2004-2005, 2008-2014, 2016, 2019-2020 Free
+dnl Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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 1244ff8..ddc569f 100644
--- a/m4/lib-ld.m4
+++ b/m4/lib-ld.m4
@@ -1,5 +1,5 @@
-# lib-ld.m4 serial 9
-dnl Copyright (C) 1996-2003, 2009-2018 Free Software Foundation, Inc.
+# lib-ld.m4 serial 6
+dnl Copyright (C) 1996-2003, 2009-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free 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,122 +47,73 @@ if test "${PATH_SEPARATOR+set}" != set; then
}
fi
-if test -n "$LD"; then
- AC_MSG_CHECKING([for ld])
-elif test "$GCC" = yes; then
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
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
-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
- 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
- ], [])
+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
;;
- 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
- ])
+ *)
+ test "$with_gnu_ld" != yes && break
;;
- esac
- ])
- LD="$acl_cv_path_LD"
-fi
+ 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 "$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 dee3300..3522d99 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -1,12 +1,12 @@
-# lib-link.m4 serial 28
-dnl Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# lib-link.m4 serial 26 (gettext-0.18.2)
+dnl Copyright (C) 2001-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free 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_PREREQ([2.54])
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 Complain if config.rpath is missing.
- AC_REQUIRE_AUX_FILE([config.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])])
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,15 +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\"
])
- 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]],
+ 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]],
[
if test "X$withval" = "Xno"; then
use_additional=no
@@ -209,7 +211,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
additional_includedir="$withval/include"
additional_libdir="$withval/$acl_libdirstem"
if test "$acl_libdirstem2" != "$acl_libdirstem" \
- && test ! -d "$withval/$acl_libdirstem"; then
+ && ! test -d "$withval/$acl_libdirstem"; then
additional_libdir="$withval/$acl_libdirstem2"
fi
fi
@@ -668,6 +670,7 @@ 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])
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
index 2e90b11..31f49e4 100644
--- a/m4/lib-prefix.m4
+++ b/m4/lib-prefix.m4
@@ -1,11 +1,18 @@
-# lib-prefix.m4 serial 14
-dnl Copyright (C) 2001-2005, 2008-2018 Free Software Foundation, Inc.
+# lib-prefix.m4 serial 7 (gettext-0.18)
+dnl Copyright (C) 2001-2005, 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free 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
@@ -25,9 +32,9 @@ AC_DEFUN([AC_LIB_PREFIX],
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$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]],
+ 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],
[
if test "X$withval" = "Xno"; then
use_additional=no
@@ -167,83 +174,51 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
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])
- AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
-
+ 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_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [[#ifdef _LP64
- int ok;
- #else
- error fail
- #endif
- ]])],
- [gl_cv_solaris_64bit=yes],
- [gl_cv_solaris_64bit=no])
- ]);;
- esac
-
- 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],
- [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 <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 $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
- ;;
- *)
- dnl If $CC generates code for a 32-bit ABI, the libraries are
- dnl surely under $prefix/lib, not $prefix/lib64.
- if test "$HOST_CPU_C_ABI_32BIT" != yes; then
- dnl The result is a property of the system. However, non-system
- dnl compilers sometimes have odd library search paths. Therefore
- dnl prefer asking /usr/bin/gcc, if available, rather than $CC.
- searchpath=`(if test -f /usr/bin/gcc \
- && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \
- LC_ALL=C /usr/bin/gcc -print-search-dirs; \
- else \
- LC_ALL=C $CC -print-search-dirs; \
- fi) 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
+ [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/ | */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
- fi
- ;;
- esac
- test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
- acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2"
- ])
- # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2.
- acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
- acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'`
+ */lib64 ) acl_libdirstem=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ fi
+ ;;
+ esac
+ test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
])
diff --git a/m4/limits-h.m4 b/m4/limits-h.m4
index 3a2cd91..0b4f092 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-2018 Free Software Foundation, Inc.
+dnl Copyright 2016-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/link.m4 b/m4/link.m4
index d06b4f2..0d1de80 100644
--- a/m4/link.m4
+++ b/m4/link.m4
@@ -1,5 +1,5 @@
-# link.m4 serial 10
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+# link.m4 serial 11
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -43,8 +43,8 @@ AC_DEFUN([gl_FUNC_LINK],
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, assume the worst.
- *) gl_cv_func_link_works="guessing no" ;;
+ # 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 d38a2c9..9d21c4f 100644
--- a/m4/localcharset.m4
+++ b/m4/localcharset.m4
@@ -1,5 +1,5 @@
# localcharset.m4 serial 8
-dnl Copyright (C) 2002, 2004, 2006, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004, 2006, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/locale-fr.m4 b/m4/locale-fr.m4
index a37a0d2..5abe052 100644
--- a/m4/locale-fr.m4
+++ b/m4/locale-fr.m4
@@ -1,5 +1,5 @@
# locale-fr.m4 serial 19
-dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/locale-ja.m4 b/m4/locale-ja.m4
index 9f16231..0982ab1 100644
--- a/m4/locale-ja.m4
+++ b/m4/locale-ja.m4
@@ -1,5 +1,5 @@
# locale-ja.m4 serial 14
-dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/locale-tr.m4 b/m4/locale-tr.m4
index 2f2cf47..75a45b8 100644
--- a/m4/locale-tr.m4
+++ b/m4/locale-tr.m4
@@ -1,5 +1,5 @@
-# locale-tr.m4 serial 11
-dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
+# locale-tr.m4 serial 12
+dnl Copyright (C) 2003, 2005-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -21,6 +21,7 @@ changequote(,)dnl
#endif
#include <stdlib.h>
#include <string.h>
+#include <wctype.h>
struct tm t;
char buf[16];
int main () {
diff --git a/m4/locale-zh.m4 b/m4/locale-zh.m4
index cfb447f..cde5140 100644
--- a/m4/locale-zh.m4
+++ b/m4/locale-zh.m4
@@ -1,5 +1,5 @@
# locale-zh.m4 serial 14
-dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/locale_h.m4 b/m4/locale_h.m4
index e619dcd..32494cf 100644
--- a/m4/locale_h.m4
+++ b/m4/locale_h.m4
@@ -1,5 +1,5 @@
-# locale_h.m4 serial 21
-dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+# locale_h.m4 serial 24
+dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -17,6 +17,8 @@ AC_DEFUN([gl_LOCALE_H],
dnl If <stddef.h> is replaced, then <locale.h> must also be replaced.
AC_REQUIRE([gl_STDDEF_H])
+ 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])
@@ -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.
@@ -99,6 +86,49 @@ AC_DEFUN([gl_LOCALE_H],
[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],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
@@ -110,10 +140,11 @@ 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_LOCALENAME=0; AC_SUBST([GNULIB_LOCALENAME])
+ 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])
diff --git a/m4/localeconv.m4 b/m4/localeconv.m4
index 517f398..a926224 100644
--- a/m4/localeconv.m4
+++ b/m4/localeconv.m4
@@ -1,5 +1,5 @@
# localeconv.m4 serial 1
-dnl Copyright (C) 2012-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/localename.m4 b/m4/localename.m4
index f093fa5..fa7fe12 100644
--- a/m4/localename.m4
+++ b/m4/localename.m4
@@ -1,5 +1,5 @@
-# localename.m4 serial 5
-dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+# localename.m4 serial 7
+dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,19 +7,30 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_LOCALENAME],
[
AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+ AC_REQUIRE([gl_LOCALE_T])
AC_REQUIRE([gt_LC_MESSAGES])
AC_REQUIRE([gt_INTL_THREAD_LOCALE_NAME])
AC_REQUIRE([gt_INTL_MACOSX])
AC_CHECK_HEADERS_ONCE([langinfo.h])
- AC_CHECK_FUNCS([setlocale])
- AC_CHECK_FUNCS_ONCE([newlocale duplocale freelocale])
- if test $ac_cv_func_newlocale != yes; then
+ if test $HAVE_LOCALE_T = 1; then
+ AC_CHECK_FUNCS_ONCE([newlocale duplocale freelocale])
+ gl_func_newlocale="$ac_cv_func_newlocale"
+ gl_func_duplocale="$ac_cv_func_duplocale"
+ gl_func_freelocale="$ac_cv_func_freelocale"
+ else
+ dnl In 2019, some versions of z/OS lack the locale_t type and have broken
+ dnl newlocale, duplocale, freelocale functions.
+ gl_func_newlocale=no
+ gl_func_duplocale=no
+ gl_func_freelocale=no
+ fi
+ if test $gl_func_newlocale != yes; then
HAVE_NEWLOCALE=0
fi
- if test $ac_cv_func_duplocale != yes; then
+ if test $gl_func_duplocale != yes; then
HAVE_DUPLOCALE=0
fi
- if test $ac_cv_func_freelocale != yes; then
+ if test $gl_func_freelocale != yes; then
HAVE_FREELOCALE=0
fi
if test $gt_nameless_locales = yes; then
diff --git a/m4/localtime-buffer.m4 b/m4/localtime-buffer.m4
index 4b3ec57..09df3c9 100644
--- a/m4/localtime-buffer.m4
+++ b/m4/localtime-buffer.m4
@@ -1,5 +1,5 @@
# localtime-buffer.m4 serial 1
-dnl Copyright (C) 2017-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2017-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/lock.m4 b/m4/lock.m4
index dac4c38..1c39591 100644
--- a/m4/lock.m4
+++ b/m4/lock.m4
@@ -1,5 +1,5 @@
# lock.m4 serial 14
-dnl Copyright (C) 2005-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/longlong.m4 b/m4/longlong.m4
deleted file mode 100644
index 582af53..0000000
--- a/m4/longlong.m4
+++ /dev/null
@@ -1,113 +0,0 @@
-# longlong.m4 serial 18
-dnl Copyright (C) 1999-2007, 2009-2018 Free Software Foundation, Inc.
-dnl This file is free software; the Free 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.
-
-AC_PREREQ([2.62])
-
-# Define HAVE_LONG_LONG_INT if 'long long int' works.
-# This 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 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/lseek.m4 b/m4/lseek.m4
index 423b9fb..609c19a 100644
--- a/m4/lseek.m4
+++ b/m4/lseek.m4
@@ -1,5 +1,5 @@
# lseek.m4 serial 10
-dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/lstat.m4 b/m4/lstat.m4
index 3694e4c..3c2b214 100644
--- a/m4/lstat.m4
+++ b/m4/lstat.m4
@@ -1,6 +1,6 @@
-# serial 32
+# serial 33
-# Copyright (C) 1997-2001, 2003-2018 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -63,8 +63,8 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
# Guess no on native Windows.
gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
*)
- # If we don't know, assume the worst.
- 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 4c182b4..c1f8ea3 100644
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -1,11 +1,9 @@
-# malloc.m4 serial 17
-dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+# malloc.m4 serial 20
+dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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:
# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
AC_DEFUN([_AC_FUNC_MALLOC_IF],
@@ -32,19 +30,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* | 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
diff --git a/m4/malloca.m4 b/m4/malloca.m4
index 2251e61..930199d 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-2018 Free Software Foundation,
+# malloca.m4 serial 2
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2020 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/manywarnings.m4 b/m4/manywarnings.m4
index d831ed2..783620d 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -1,5 +1,5 @@
-# manywarnings.m4 serial 17
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+# manywarnings.m4 serial 18
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -112,16 +112,19 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
gl_manywarn_set=
for gl_manywarn_item in -fno-common \
-W \
+ -Wabsolute-value \
-Waddress \
+ -Waddress-of-packed-member \
-Waggressive-loop-optimizations \
-Wall \
- -Wattribute-alias \
+ -Wattribute-warning \
-Wattributes \
-Wbad-function-cast \
-Wbool-compare \
-Wbool-operation \
-Wbuiltin-declaration-mismatch \
-Wbuiltin-macro-redefined \
+ -Wcannot-profile \
-Wcast-align \
-Wcast-align=strict \
-Wcast-function-type \
@@ -186,6 +189,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Wmissing-field-initializers \
-Wmissing-include-dirs \
-Wmissing-parameter-type \
+ -Wmissing-profile \
-Wmissing-prototypes \
-Wmultichar \
-Wmultistatement-macros \
@@ -292,6 +296,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
AC_MSG_RESULT([$gl_alloc_max])
gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$gl_alloc_max"
gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2"
+ gl_manywarn_set="$gl_manywarn_set -Wattribute-alias=2"
gl_manywarn_set="$gl_manywarn_set -Wformat-overflow=2"
gl_manywarn_set="$gl_manywarn_set -Wformat-truncation=2"
gl_manywarn_set="$gl_manywarn_set -Wimplicit-fallthrough=5"
diff --git a/m4/mbrlen.m4 b/m4/mbrlen.m4
index 2a5df28..215f9ff 100644
--- a/m4/mbrlen.m4
+++ b/m4/mbrlen.m4
@@ -1,5 +1,5 @@
# mbrlen.m4 serial 10 -*- coding: utf-8 -*-
-dnl Copyright (C) 2008, 2010-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2010-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4
index c706d04..755f8c9 100644
--- a/m4/mbrtowc.m4
+++ b/m4/mbrtowc.m4
@@ -1,5 +1,5 @@
-# mbrtowc.m4 serial 31 -*- coding: utf-8 -*-
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2018 Free Software Foundation,
+# mbrtowc.m4 serial 37 -*- coding: utf-8 -*-
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2020 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
@@ -39,6 +41,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 +72,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 +87,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 +124,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 +161,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],
@@ -171,6 +207,39 @@ 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>
+/* 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 ()
+{
+ 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
])
])
@@ -550,6 +619,126 @@ 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>
+/* 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 ()
+{
+ 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>
+/* 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 ()
+{
+ 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],
@@ -595,11 +784,11 @@ 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(
@@ -622,22 +811,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_C_locale_sans_EILSEQ="guessing yes" ;;
+ 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
diff --git a/m4/mbsinit.m4 b/m4/mbsinit.m4
index 5cba3df..8c26b6b 100644
--- a/m4/mbsinit.m4
+++ b/m4/mbsinit.m4
@@ -1,5 +1,5 @@
# mbsinit.m4 serial 8
-dnl Copyright (C) 2008, 2010-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008, 2010-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4
index 004aa0d..057ce12 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-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/mbtowc.m4 b/m4/mbtowc.m4
index ecac6a2..befcffa 100644
--- a/m4/mbtowc.m4
+++ b/m4/mbtowc.m4
@@ -1,5 +1,5 @@
-# mbtowc.m4 serial 2
-dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
+# mbtowc.m4 serial 3
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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 83c65c1..91eec88 100644
--- a/m4/memchr.m4
+++ b/m4/memchr.m4
@@ -1,5 +1,5 @@
-# memchr.m4 serial 13
-dnl Copyright (C) 2002-2004, 2009-2018 Free Software Foundation, Inc.
+# memchr.m4 serial 15
+dnl Copyright (C) 2002-2004, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -29,6 +29,8 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
# 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([[
@@ -74,15 +76,26 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
if (memchr (fence - 1, 0, 3) != fence - 1)
result |= 4;
}
+ /* 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 |= 8;
+ }
return result;
]])],
[gl_cv_func_memchr_works=yes],
[gl_cv_func_memchr_works=no],
[case "$host_os" in
- # Guess yes on native Windows.
- mingw*) gl_cv_func_memchr_works="guessing yes" ;;
- # Be pessimistic for now.
- *) gl_cv_func_memchr_works="guessing no" ;;
+ # 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
])
])
diff --git a/m4/memrchr.m4 b/m4/memrchr.m4
index a036b39..95990ed 100644
--- a/m4/memrchr.m4
+++ b/m4/memrchr.m4
@@ -1,5 +1,5 @@
# memrchr.m4 serial 10
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2018 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/minmax.m4 b/m4/minmax.m4
index 5e88508..e5b28b0 100644
--- a/m4/minmax.m4
+++ b/m4/minmax.m4
@@ -1,5 +1,5 @@
# minmax.m4 serial 4
-dnl Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/mkdir.m4 b/m4/mkdir.m4
index 1452999..99212d9 100644
--- a/m4/mkdir.m4
+++ b/m4/mkdir.m4
@@ -1,6 +1,6 @@
-# serial 14
+# serial 16
-# Copyright (C) 2001, 2003-2004, 2006, 2008-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003-2004, 2006, 2008-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -36,8 +36,8 @@ AC_DEFUN([gl_FUNC_MKDIR],
[gl_cv_func_mkdir_trailing_slash_works="guessing yes"],
[gl_cv_func_mkdir_trailing_slash_works="guessing no"])
;;
- # If we don't know, assume the worst.
- *) 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
@@ -62,10 +62,12 @@ AC_DEFUN([gl_FUNC_MKDIR],
[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, assume the worst.
- *) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;;
esac
])
rm -rf conftest.dir
diff --git a/m4/mkostemp.m4 b/m4/mkostemp.m4
index 245598e..3e5b555 100644
--- a/m4/mkostemp.m4
+++ b/m4/mkostemp.m4
@@ -1,5 +1,5 @@
# mkostemp.m4 serial 2
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/mmap-anon.m4 b/m4/mmap-anon.m4
index 55fea82..d5c69df 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-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/mode_t.m4 b/m4/mode_t.m4
index 83e276c..f190951 100644
--- a/m4/mode_t.m4
+++ b/m4/mode_t.m4
@@ -1,5 +1,5 @@
# mode_t.m4 serial 2
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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 55baeec..dcf398d 100644
--- a/m4/msvc-inval.m4
+++ b/m4/msvc-inval.m4
@@ -1,5 +1,5 @@
# msvc-inval.m4 serial 1
-dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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 74ae427..13198d8 100644
--- a/m4/msvc-nothrow.m4
+++ b/m4/msvc-nothrow.m4
@@ -1,5 +1,5 @@
# msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/multiarch.m4 b/m4/multiarch.m4
index 38a11cc..3c2034c 100644
--- a/m4/multiarch.m4
+++ b/m4/multiarch.m4
@@ -1,5 +1,5 @@
# multiarch.m4 serial 7
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/nanosleep.m4 b/m4/nanosleep.m4
index 7c945cc..1fb13ed 100644
--- a/m4/nanosleep.m4
+++ b/m4/nanosleep.m4
@@ -1,11 +1,11 @@
-# serial 38
+# serial 39
dnl From Jim Meyering.
dnl Check for the nanosleep function.
dnl If not found, use the supplied replacement.
dnl
-# Copyright (C) 1999-2001, 2003-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2001, 2003-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -119,8 +119,8 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;;
mingw*) # Guess no on native Windows.
gl_cv_func_nanosleep='guessing no' ;;
- *) # If we don't know, assume the worst.
- gl_cv_func_nanosleep='guessing no' ;;
+ *) # If we don't know, obey --enable-cross-guesses.
+ gl_cv_func_nanosleep="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/m4/netinet_in_h.m4 b/m4/netinet_in_h.m4
index 473e142..df9f383 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-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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 82d4750..6cafe9d 100644
--- a/m4/nl_langinfo.m4
+++ b/m4/nl_langinfo.m4
@@ -1,5 +1,5 @@
-# nl_langinfo.m4 serial 6
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+# nl_langinfo.m4 serial 7
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,6 +10,7 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
AC_REQUIRE([gl_LANGINFO_H])
AC_CHECK_FUNCS_ONCE([nl_langinfo])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
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],
@@ -50,4 +51,11 @@ 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])
])
diff --git a/m4/nocrash.m4 b/m4/nocrash.m4
index 4914007..637a0ea 100644
--- a/m4/nocrash.m4
+++ b/m4/nocrash.m4
@@ -1,5 +1,5 @@
# nocrash.m4 serial 5
-dnl Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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,7 +72,7 @@ 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);
}
diff --git a/m4/non-recursive-gnulib-prefix-hack.m4 b/m4/non-recursive-gnulib-prefix-hack.m4
index d2cb9e7..4c46a34 100644
--- a/m4/non-recursive-gnulib-prefix-hack.m4
+++ b/m4/non-recursive-gnulib-prefix-hack.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2012-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/obstack.m4 b/m4/obstack.m4
index 80e5b3c..52da95f 100644
--- a/m4/obstack.m4
+++ b/m4/obstack.m4
@@ -1,6 +1,6 @@
# See if we need to provide obstacks.
-dnl Copyright 1996-2018 Free Software Foundation, Inc.
+dnl Copyright 1996-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/off_t.m4 b/m4/off_t.m4
index f4d5787..6e19af8 100644
--- a/m4/off_t.m4
+++ b/m4/off_t.m4
@@ -1,5 +1,5 @@
# off_t.m4 serial 1
-dnl Copyright (C) 2012-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/open-cloexec.m4 b/m4/open-cloexec.m4
index a272784..11652d5 100644
--- a/m4/open-cloexec.m4
+++ b/m4/open-cloexec.m4
@@ -1,6 +1,6 @@
# Test whether O_CLOEXEC is defined.
-dnl Copyright 2017-2018 Free Software Foundation, Inc.
+dnl Copyright 2017-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/open-slash.m4 b/m4/open-slash.m4
new file mode 100644
index 0000000..1e57c96
--- /dev/null
+++ b/m4/open-slash.m4
@@ -0,0 +1,59 @@
+# open-slash.m4 serial 1
+dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+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
+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 8b3d402..552eedf 100644
--- a/m4/open.m4
+++ b/m4/open.m4
@@ -1,5 +1,5 @@
# open.m4 serial 15
-dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -19,48 +19,9 @@ AC_DEFUN([gl_FUNC_OPEN],
if test "$gl_cv_macro_O_CLOEXEC" != yes; then
REPLACE_OPEN=1
fi
- 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
- ])
+ 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/opendir.m4 b/m4/opendir.m4
index 5609536..fd3c1ec 100644
--- a/m4/opendir.m4
+++ b/m4/opendir.m4
@@ -1,5 +1,5 @@
# opendir.m4 serial 5
-dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/pathmax.m4 b/m4/pathmax.m4
index 292a256..bb4fdeb 100644
--- a/m4/pathmax.m4
+++ b/m4/pathmax.m4
@@ -1,5 +1,5 @@
# pathmax.m4 serial 11
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2018 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2020 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/perl.m4 b/m4/perl.m4
new file mode 100644
index 0000000..0003fcc
--- /dev/null
+++ b/m4/perl.m4
@@ -0,0 +1,46 @@
+# serial 10
+
+dnl From Jim Meyering.
+dnl Find a new-enough version of Perl.
+
+# Copyright (C) 1998-2001, 2003-2004, 2007, 2009-2020 Free Software Foundation,
+# Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_PERL],
+[
+ dnl FIXME: don't hard-code 5.005
+ AC_MSG_CHECKING([for perl5.005 or newer])
+ if test "${PERL+set}" = set; then
+ # 'PERL' is set in the user's environment.
+ candidate_perl_names="$PERL"
+ perl_specified=yes
+ else
+ candidate_perl_names='perl perl5'
+ perl_specified=no
+ fi
+
+ found=no
+ AC_SUBST([PERL])
+ PERL="$am_missing_run perl"
+ for perl in $candidate_perl_names; do
+ # Run test in a subshell; some versions of sh will print an error if
+ # an executable is not found, even if stderr is redirected.
+ if ( $perl -e 'require 5.005; use File::Compare; use warnings;' ) > /dev/null 2>&1; then
+ PERL=$perl
+ found=yes
+ break
+ fi
+ done
+
+ AC_MSG_RESULT([$found])
+ test $found = no && AC_MSG_WARN([
+WARNING: You don't seem to have perl5.005 or newer installed, or you lack
+ a usable version of the Perl File::Compare module. As a result,
+ you may be unable to run a few tests or to regenerate certain
+ files if you modify the sources from which they are derived.
+] )
+])
diff --git a/m4/perror.m4 b/m4/perror.m4
index 60568a7..6a36408 100644
--- a/m4/perror.m4
+++ b/m4/perror.m4
@@ -1,5 +1,5 @@
-# perror.m4 serial 7
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+# perror.m4 serial 9
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -48,10 +48,12 @@ AC_DEFUN([gl_FUNC_PERROR],
rm -rf conftest.txt1 conftest.txt2],
[gl_cv_func_perror_works=no],
[case "$host_os" in
- # Guess yes on native Windows.
- mingw*) gl_cv_func_perror_works="guessing yes" ;;
- # Otherwise guess no.
- *) gl_cv_func_perror_works="guessing no" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_perror_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_perror_works="guessing yes" ;;
+ # Otherwise obey --enable-cross-guesses.
+ *) gl_cv_func_perror_works="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/m4/pipe.m4 b/m4/pipe.m4
index 1d3e274..6b1fa2f 100644
--- a/m4/pipe.m4
+++ b/m4/pipe.m4
@@ -1,5 +1,5 @@
# pipe.m4 serial 2
-dnl Copyright (C) 2010-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/pthread-thread.m4 b/m4/pthread-thread.m4
new file mode 100644
index 0000000..5a95995
--- /dev/null
+++ b/m4/pthread-thread.m4
@@ -0,0 +1,69 @@
+# pthread-thread.m4 serial 2
+dnl Copyright (C) 2019-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_PTHREAD_THREAD],
+[
+ AC_REQUIRE([gl_PTHREAD_H])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ if { case "$host_os" in mingw*) true;; *) false;; esac; } \
+ && test $gl_threads_api = windows; then
+ dnl Choose function names that don't conflict with the mingw-w64 winpthreads
+ dnl library.
+ REPLACE_PTHREAD_CREATE=1
+ REPLACE_PTHREAD_ATTR_INIT=1
+ REPLACE_PTHREAD_ATTR_GETDETACHSTATE=1
+ REPLACE_PTHREAD_ATTR_SETDETACHSTATE=1
+ REPLACE_PTHREAD_ATTR_DESTROY=1
+ REPLACE_PTHREAD_SELF=1
+ REPLACE_PTHREAD_EQUAL=1
+ REPLACE_PTHREAD_DETACH=1
+ REPLACE_PTHREAD_JOIN=1
+ REPLACE_PTHREAD_EXIT=1
+ else
+ if test $HAVE_PTHREAD_H = 0; then
+ HAVE_PTHREAD_CREATE=0
+ HAVE_PTHREAD_ATTR_INIT=0
+ HAVE_PTHREAD_ATTR_GETDETACHSTATE=0
+ HAVE_PTHREAD_ATTR_SETDETACHSTATE=0
+ HAVE_PTHREAD_ATTR_DESTROY=0
+ HAVE_PTHREAD_SELF=0
+ HAVE_PTHREAD_EQUAL=0
+ HAVE_PTHREAD_DETACH=0
+ HAVE_PTHREAD_JOIN=0
+ HAVE_PTHREAD_EXIT=0
+ else
+ dnl On HP-UX 11.11, pthread_create() and pthread_attr_init() are only
+ dnl defined as inline functions.
+ AC_CACHE_CHECK([whether pthread_create exists as a global function],
+ [gl_cv_func_pthread_create],
+ [saved_LIBS="$LIBS"
+ LIBS="$LIBS $LIBPMULTITHREAD"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [[extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ int pthread_create (void);
+ int main ()
+ {
+ return pthread_create ();
+ }
+ ]])],
+ [gl_cv_func_pthread_create=yes],
+ [gl_cv_func_pthread_create=no])
+ LIBS="$saved_LIBS"
+ ])
+ if test $gl_cv_func_pthread_create = no; then
+ REPLACE_PTHREAD_CREATE=1
+ REPLACE_PTHREAD_ATTR_INIT=1
+ AC_DEFINE([PTHREAD_CREATE_IS_INLINE], [1],
+ [Define if pthread_create is an inline function.])
+ fi
+ fi
+ fi
+])
diff --git a/m4/pthread_h.m4 b/m4/pthread_h.m4
new file mode 100644
index 0000000..5b5e7ba
--- /dev/null
+++ b/m4/pthread_h.m4
@@ -0,0 +1,268 @@
+# pthread_h.m4 serial 5
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_PTHREAD_H],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_PTHREAD_H_DEFAULTS])
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_PTHREADLIB])
+
+ gl_CHECK_NEXT_HEADERS([pthread.h])
+ if test $ac_cv_header_pthread_h = yes; then
+ HAVE_PTHREAD_H=1
+ dnl On mingw, if --enable-threads=windows or gl_AVOID_WINPTHREAD is used,
+ dnl ignore the <pthread.h> from the mingw-w64 winpthreads library.
+ m4_ifdef([gl_][THREADLIB], [
+ AC_REQUIRE([gl_][THREADLIB])
+ if { case "$host_os" in mingw*) true;; *) false;; esac; } \
+ && test $gl_threads_api = windows; then
+ HAVE_PTHREAD_H=0
+ fi
+ ])
+ else
+ HAVE_PTHREAD_H=0
+ fi
+ AC_SUBST([HAVE_PTHREAD_H])
+
+ AC_CHECK_TYPES([pthread_t, pthread_spinlock_t], [], [],
+ [AC_INCLUDES_DEFAULT[
+ #if HAVE_PTHREAD_H
+ #include <pthread.h>
+ #endif]])
+ if test $ac_cv_type_pthread_t != yes; then
+ HAVE_PTHREAD_T=0
+ fi
+ if test $ac_cv_type_pthread_spinlock_t != yes; then
+ HAVE_PTHREAD_SPINLOCK_T=0
+ fi
+
+ dnl Constants may be defined as C preprocessor macros or as enum items.
+
+ AC_CACHE_CHECK([for PTHREAD_CREATE_DETACHED],
+ [gl_cv_const_PTHREAD_CREATE_DETACHED],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ int x = PTHREAD_CREATE_DETACHED;
+ ]],
+ [[]])],
+ [gl_cv_const_PTHREAD_CREATE_DETACHED=yes],
+ [gl_cv_const_PTHREAD_CREATE_DETACHED=no])
+ ])
+ if test $gl_cv_const_PTHREAD_CREATE_DETACHED != yes; then
+ HAVE_PTHREAD_CREATE_DETACHED=0
+ fi
+
+ AC_CACHE_CHECK([for PTHREAD_MUTEX_RECURSIVE],
+ [gl_cv_const_PTHREAD_MUTEX_RECURSIVE],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ int x = PTHREAD_MUTEX_RECURSIVE;
+ ]],
+ [[]])],
+ [gl_cv_const_PTHREAD_MUTEX_RECURSIVE=yes],
+ [gl_cv_const_PTHREAD_MUTEX_RECURSIVE=no])
+ ])
+ if test $gl_cv_const_PTHREAD_MUTEX_RECURSIVE != yes; then
+ HAVE_PTHREAD_MUTEX_RECURSIVE=0
+ fi
+
+ AC_CACHE_CHECK([for PTHREAD_MUTEX_ROBUST],
+ [gl_cv_const_PTHREAD_MUTEX_ROBUST],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ int x = PTHREAD_MUTEX_ROBUST;
+ ]],
+ [[]])],
+ [gl_cv_const_PTHREAD_MUTEX_ROBUST=yes],
+ [gl_cv_const_PTHREAD_MUTEX_ROBUST=no])
+ ])
+ if test $gl_cv_const_PTHREAD_MUTEX_ROBUST != yes; then
+ HAVE_PTHREAD_MUTEX_ROBUST=0
+ fi
+
+ AC_CACHE_CHECK([for PTHREAD_PROCESS_SHARED],
+ [gl_cv_const_PTHREAD_PROCESS_SHARED],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ int x = PTHREAD_PROCESS_SHARED;
+ ]],
+ [[]])],
+ [gl_cv_const_PTHREAD_PROCESS_SHARED=yes],
+ [gl_cv_const_PTHREAD_PROCESS_SHARED=no])
+ ])
+ if test $gl_cv_const_PTHREAD_PROCESS_SHARED != yes; then
+ HAVE_PTHREAD_PROCESS_SHARED=0
+ fi
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, if it is not common
+ dnl enough to be declared everywhere.
+ gl_WARN_ON_USE_PREPARE([[#include <pthread.h>
+ ]], [
+ pthread_create pthread_attr_init pthread_attr_getdetachstate
+ pthread_attr_setdetachstate pthread_attr_destroy pthread_self pthread_equal
+ pthread_detach pthread_join pthread_exit
+ pthread_once
+ pthread_mutex_init pthread_mutexattr_init pthread_mutexattr_gettype
+ pthread_mutexattr_settype pthread_mutexattr_getrobust
+ pthread_mutexattr_setrobust pthread_mutexattr_destroy pthread_mutex_lock
+ pthread_mutex_trylock pthread_mutex_timedlock pthread_mutex_unlock
+ pthread_mutex_destroy
+ pthread_rwlock_init pthread_rwlockattr_init pthread_rwlockattr_destroy
+ pthread_rwlock_rdlock pthread_rwlock_wrlock pthread_rwlock_tryrdlock
+ pthread_rwlock_trywrlock pthread_rwlock_timedrdlock
+ pthread_rwlock_timedwrlock pthread_rwlock_unlock pthread_rwlock_destroy
+ pthread_cond_init pthread_condattr_init pthread_condattr_destroy
+ pthread_cond_wait pthread_cond_timedwait pthread_cond_signal
+ pthread_cond_broadcast pthread_cond_destroy
+ pthread_key_create pthread_setspecific pthread_getspecific
+ pthread_key_delete
+ pthread_spin_init pthread_spin_lock pthread_spin_trylock pthread_spin_unlock
+ pthread_spin_destroy])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+
+ dnl For backward compatibility with gnulib versions <= 2019-07.
+ LIB_PTHREAD="$LIBPMULTITHREAD"
+ AC_SUBST([LIB_PTHREAD])
+])
+
+AC_DEFUN([gl_PTHREAD_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_PTHREAD_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_PTHREAD_H_DEFAULTS],
+[
+ GNULIB_PTHREAD_THREAD=0; AC_SUBST([GNULIB_PTHREAD_THREAD])
+ GNULIB_PTHREAD_ONCE=0; AC_SUBST([GNULIB_PTHREAD_ONCE])
+ GNULIB_PTHREAD_MUTEX=0; AC_SUBST([GNULIB_PTHREAD_MUTEX])
+ GNULIB_PTHREAD_RWLOCK=0; AC_SUBST([GNULIB_PTHREAD_RWLOCK])
+ GNULIB_PTHREAD_COND=0; AC_SUBST([GNULIB_PTHREAD_COND])
+ GNULIB_PTHREAD_TSS=0; AC_SUBST([GNULIB_PTHREAD_TSS])
+ GNULIB_PTHREAD_SPIN=0; AC_SUBST([GNULIB_PTHREAD_SPIN])
+ GNULIB_PTHREAD_MUTEX_TIMEDLOCK=0; AC_SUBST([GNULIB_PTHREAD_MUTEX_TIMEDLOCK])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_PTHREAD_T=1; AC_SUBST([HAVE_PTHREAD_T])
+ HAVE_PTHREAD_SPINLOCK_T=1; AC_SUBST([HAVE_PTHREAD_SPINLOCK_T])
+ HAVE_PTHREAD_CREATE_DETACHED=1; AC_SUBST([HAVE_PTHREAD_CREATE_DETACHED])
+ HAVE_PTHREAD_MUTEX_RECURSIVE=1; AC_SUBST([HAVE_PTHREAD_MUTEX_RECURSIVE])
+ HAVE_PTHREAD_MUTEX_ROBUST=1; AC_SUBST([HAVE_PTHREAD_MUTEX_ROBUST])
+ HAVE_PTHREAD_PROCESS_SHARED=1; AC_SUBST([HAVE_PTHREAD_PROCESS_SHARED])
+ HAVE_PTHREAD_CREATE=1; AC_SUBST([HAVE_PTHREAD_CREATE])
+ HAVE_PTHREAD_ATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_ATTR_INIT])
+ HAVE_PTHREAD_ATTR_GETDETACHSTATE=1; AC_SUBST([HAVE_PTHREAD_ATTR_GETDETACHSTATE])
+ HAVE_PTHREAD_ATTR_SETDETACHSTATE=1; AC_SUBST([HAVE_PTHREAD_ATTR_SETDETACHSTATE])
+ HAVE_PTHREAD_ATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_ATTR_DESTROY])
+ HAVE_PTHREAD_SELF=1; AC_SUBST([HAVE_PTHREAD_SELF])
+ HAVE_PTHREAD_EQUAL=1; AC_SUBST([HAVE_PTHREAD_EQUAL])
+ HAVE_PTHREAD_DETACH=1; AC_SUBST([HAVE_PTHREAD_DETACH])
+ HAVE_PTHREAD_JOIN=1; AC_SUBST([HAVE_PTHREAD_JOIN])
+ HAVE_PTHREAD_EXIT=1; AC_SUBST([HAVE_PTHREAD_EXIT])
+ HAVE_PTHREAD_ONCE=1; AC_SUBST([HAVE_PTHREAD_ONCE])
+ HAVE_PTHREAD_MUTEX_INIT=1; AC_SUBST([HAVE_PTHREAD_MUTEX_INIT])
+ HAVE_PTHREAD_MUTEXATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_INIT])
+ HAVE_PTHREAD_MUTEXATTR_GETTYPE=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_GETTYPE])
+ HAVE_PTHREAD_MUTEXATTR_SETTYPE=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_SETTYPE])
+ HAVE_PTHREAD_MUTEXATTR_GETROBUST=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_GETROBUST])
+ HAVE_PTHREAD_MUTEXATTR_SETROBUST=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_SETROBUST])
+ HAVE_PTHREAD_MUTEXATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_DESTROY])
+ HAVE_PTHREAD_MUTEX_LOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_LOCK])
+ HAVE_PTHREAD_MUTEX_TRYLOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_TRYLOCK])
+ HAVE_PTHREAD_MUTEX_TIMEDLOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_TIMEDLOCK])
+ HAVE_PTHREAD_MUTEX_UNLOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_UNLOCK])
+ HAVE_PTHREAD_MUTEX_DESTROY=1; AC_SUBST([HAVE_PTHREAD_MUTEX_DESTROY])
+ HAVE_PTHREAD_RWLOCK_INIT=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_INIT])
+ HAVE_PTHREAD_RWLOCKATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_RWLOCKATTR_INIT])
+ HAVE_PTHREAD_RWLOCKATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_RWLOCKATTR_DESTROY])
+ HAVE_PTHREAD_RWLOCK_RDLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_RDLOCK])
+ HAVE_PTHREAD_RWLOCK_WRLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_WRLOCK])
+ HAVE_PTHREAD_RWLOCK_TRYRDLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_TRYRDLOCK])
+ HAVE_PTHREAD_RWLOCK_TRYWRLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_TRYWRLOCK])
+ HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK])
+ HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK])
+ HAVE_PTHREAD_RWLOCK_UNLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_UNLOCK])
+ HAVE_PTHREAD_RWLOCK_DESTROY=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_DESTROY])
+ HAVE_PTHREAD_COND_INIT=1; AC_SUBST([HAVE_PTHREAD_COND_INIT])
+ HAVE_PTHREAD_CONDATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_CONDATTR_INIT])
+ HAVE_PTHREAD_CONDATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_CONDATTR_DESTROY])
+ HAVE_PTHREAD_COND_WAIT=1; AC_SUBST([HAVE_PTHREAD_COND_WAIT])
+ HAVE_PTHREAD_COND_TIMEDWAIT=1; AC_SUBST([HAVE_PTHREAD_COND_TIMEDWAIT])
+ HAVE_PTHREAD_COND_SIGNAL=1; AC_SUBST([HAVE_PTHREAD_COND_SIGNAL])
+ HAVE_PTHREAD_COND_BROADCAST=1; AC_SUBST([HAVE_PTHREAD_COND_BROADCAST])
+ HAVE_PTHREAD_COND_DESTROY=1; AC_SUBST([HAVE_PTHREAD_COND_DESTROY])
+ HAVE_PTHREAD_KEY_CREATE=1; AC_SUBST([HAVE_PTHREAD_KEY_CREATE])
+ HAVE_PTHREAD_SETSPECIFIC=1; AC_SUBST([HAVE_PTHREAD_SETSPECIFIC])
+ HAVE_PTHREAD_GETSPECIFIC=1; AC_SUBST([HAVE_PTHREAD_GETSPECIFIC])
+ HAVE_PTHREAD_KEY_DELETE=1; AC_SUBST([HAVE_PTHREAD_KEY_DELETE])
+ HAVE_PTHREAD_SPIN_INIT=1; AC_SUBST([HAVE_PTHREAD_SPIN_INIT])
+ HAVE_PTHREAD_SPIN_LOCK=1; AC_SUBST([HAVE_PTHREAD_SPIN_LOCK])
+ HAVE_PTHREAD_SPIN_TRYLOCK=1; AC_SUBST([HAVE_PTHREAD_SPIN_TRYLOCK])
+ HAVE_PTHREAD_SPIN_UNLOCK=1; AC_SUBST([HAVE_PTHREAD_SPIN_UNLOCK])
+ HAVE_PTHREAD_SPIN_DESTROY=1; AC_SUBST([HAVE_PTHREAD_SPIN_DESTROY])
+ REPLACE_PTHREAD_CREATE=0; AC_SUBST([REPLACE_PTHREAD_CREATE])
+ REPLACE_PTHREAD_ATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_ATTR_INIT])
+ REPLACE_PTHREAD_ATTR_GETDETACHSTATE=0; AC_SUBST([REPLACE_PTHREAD_ATTR_GETDETACHSTATE])
+ REPLACE_PTHREAD_ATTR_SETDETACHSTATE=0; AC_SUBST([REPLACE_PTHREAD_ATTR_SETDETACHSTATE])
+ REPLACE_PTHREAD_ATTR_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_ATTR_DESTROY])
+ REPLACE_PTHREAD_SELF=0; AC_SUBST([REPLACE_PTHREAD_SELF])
+ REPLACE_PTHREAD_EQUAL=0; AC_SUBST([REPLACE_PTHREAD_EQUAL])
+ REPLACE_PTHREAD_DETACH=0; AC_SUBST([REPLACE_PTHREAD_DETACH])
+ REPLACE_PTHREAD_JOIN=0; AC_SUBST([REPLACE_PTHREAD_JOIN])
+ REPLACE_PTHREAD_EXIT=0; AC_SUBST([REPLACE_PTHREAD_EXIT])
+ REPLACE_PTHREAD_ONCE=0; AC_SUBST([REPLACE_PTHREAD_ONCE])
+ REPLACE_PTHREAD_MUTEX_INIT=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_INIT])
+ REPLACE_PTHREAD_MUTEXATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_INIT])
+ REPLACE_PTHREAD_MUTEXATTR_GETTYPE=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_GETTYPE])
+ REPLACE_PTHREAD_MUTEXATTR_SETTYPE=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_SETTYPE])
+ REPLACE_PTHREAD_MUTEXATTR_GETROBUST=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_GETROBUST])
+ REPLACE_PTHREAD_MUTEXATTR_SETROBUST=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_SETROBUST])
+ REPLACE_PTHREAD_MUTEXATTR_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_DESTROY])
+ REPLACE_PTHREAD_MUTEX_LOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_LOCK])
+ REPLACE_PTHREAD_MUTEX_TRYLOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_TRYLOCK])
+ REPLACE_PTHREAD_MUTEX_TIMEDLOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_TIMEDLOCK])
+ REPLACE_PTHREAD_MUTEX_UNLOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_UNLOCK])
+ REPLACE_PTHREAD_MUTEX_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_DESTROY])
+ REPLACE_PTHREAD_RWLOCK_INIT=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_INIT])
+ REPLACE_PTHREAD_RWLOCKATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_RWLOCKATTR_INIT])
+ REPLACE_PTHREAD_RWLOCKATTR_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_RWLOCKATTR_DESTROY])
+ REPLACE_PTHREAD_RWLOCK_RDLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_RDLOCK])
+ REPLACE_PTHREAD_RWLOCK_WRLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_WRLOCK])
+ REPLACE_PTHREAD_RWLOCK_TRYRDLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_TRYRDLOCK])
+ REPLACE_PTHREAD_RWLOCK_TRYWRLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_TRYWRLOCK])
+ REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK])
+ REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK])
+ REPLACE_PTHREAD_RWLOCK_UNLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_UNLOCK])
+ REPLACE_PTHREAD_RWLOCK_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_DESTROY])
+ REPLACE_PTHREAD_COND_INIT=0; AC_SUBST([REPLACE_PTHREAD_COND_INIT])
+ REPLACE_PTHREAD_CONDATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_CONDATTR_INIT])
+ REPLACE_PTHREAD_CONDATTR_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_CONDATTR_DESTROY])
+ REPLACE_PTHREAD_COND_WAIT=0; AC_SUBST([REPLACE_PTHREAD_COND_WAIT])
+ REPLACE_PTHREAD_COND_TIMEDWAIT=0; AC_SUBST([REPLACE_PTHREAD_COND_TIMEDWAIT])
+ REPLACE_PTHREAD_COND_SIGNAL=0; AC_SUBST([REPLACE_PTHREAD_COND_SIGNAL])
+ REPLACE_PTHREAD_COND_BROADCAST=0; AC_SUBST([REPLACE_PTHREAD_COND_BROADCAST])
+ REPLACE_PTHREAD_COND_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_COND_DESTROY])
+ REPLACE_PTHREAD_KEY_CREATE=0; AC_SUBST([REPLACE_PTHREAD_KEY_CREATE])
+ REPLACE_PTHREAD_SETSPECIFIC=0; AC_SUBST([REPLACE_PTHREAD_SETSPECIFIC])
+ REPLACE_PTHREAD_GETSPECIFIC=0; AC_SUBST([REPLACE_PTHREAD_GETSPECIFIC])
+ REPLACE_PTHREAD_KEY_DELETE=0; AC_SUBST([REPLACE_PTHREAD_KEY_DELETE])
+ REPLACE_PTHREAD_SPIN_INIT=0; AC_SUBST([REPLACE_PTHREAD_SPIN_INIT])
+ REPLACE_PTHREAD_SPIN_LOCK=0; AC_SUBST([REPLACE_PTHREAD_SPIN_LOCK])
+ REPLACE_PTHREAD_SPIN_TRYLOCK=0; AC_SUBST([REPLACE_PTHREAD_SPIN_TRYLOCK])
+ REPLACE_PTHREAD_SPIN_UNLOCK=0; AC_SUBST([REPLACE_PTHREAD_SPIN_UNLOCK])
+ REPLACE_PTHREAD_SPIN_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_SPIN_DESTROY])
+])
diff --git a/m4/pthread_rwlock_rdlock.m4 b/m4/pthread_rwlock_rdlock.m4
index 6812b4f..049af50 100644
--- a/m4/pthread_rwlock_rdlock.m4
+++ b/m4/pthread_rwlock_rdlock.m4
@@ -1,5 +1,5 @@
-# pthread_rwlock_rdlock.m4 serial 2
-dnl Copyright (C) 2017-2018 Free Software Foundation, Inc.
+# pthread_rwlock_rdlock.m4 serial 4
+dnl Copyright (C) 2017-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -26,14 +26,16 @@ dnl
dnl POSIX:2017 makes this requirement only for implementations that support TPS
dnl (Thread Priority Scheduling) and only for the scheduling policies SCHED_FIFO
dnl and SCHED_RR, see
-dnl http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html
+dnl https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html
dnl but this test verifies the guarantee regardless of TPS and regardless of
dnl scheduling policy.
-dnl Glibc currently does not provide this guarantee, see
+dnl Glibc does not provide this guarantee (and never will on Linux), see
dnl https://sourceware.org/bugzilla/show_bug.cgi?id=13701
+dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052
AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER],
[
AC_REQUIRE([gl_THREADLIB_EARLY])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader],
[gl_cv_pthread_rwlock_rdlock_prefer_writer],
[save_LIBS="$LIBS"
@@ -153,7 +155,25 @@ main ()
]])],
[gl_cv_pthread_rwlock_rdlock_prefer_writer=yes],
[gl_cv_pthread_rwlock_rdlock_prefer_writer=no],
- [gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"])
+ [case "$host_os" in
+ # Guess no on glibc systems.
+ *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess no on musl systems.
+ *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess no on bionic systems.
+ *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+ # Guess yes on native Windows with the mingw-w64 winpthreads library.
+ # Guess no on native Windows with the gnulib windows-rwlock module.
+ mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+ gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
+ else
+ gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
+ fi
+ ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
+ esac
+ ])
LIBS="$save_LIBS"
])
case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4
new file mode 100644
index 0000000..d67511f
--- /dev/null
+++ b/m4/pthread_sigmask.m4
@@ -0,0 +1,273 @@
+# pthread_sigmask.m4 serial 18
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
+[
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+
+ AC_CHECK_FUNCS_ONCE([pthread_sigmask])
+
+ dnl On MinGW pthread_sigmask is just a macro which always returns 0.
+ dnl It does not exist as a real function, which is required by POSIX.
+ AC_CACHE_CHECK([whether pthread_sigmask is a macro],
+ [gl_cv_func_pthread_sigmask_macro],
+ [AC_EGREP_CPP([headers_define_pthread_sigmask], [
+#include <pthread.h>
+#include <signal.h>
+#ifdef pthread_sigmask
+ headers_define_pthread_sigmask
+#endif],
+ [gl_cv_func_pthread_sigmask_macro=yes],
+ [gl_cv_func_pthread_sigmask_macro=no])
+ ])
+
+ LIB_PTHREAD_SIGMASK=
+
+ if test $gl_cv_func_pthread_sigmask_macro = yes; then
+ dnl pthread_sigmask is a dummy macro.
+ HAVE_PTHREAD_SIGMASK=0
+ dnl Make sure to '#undef pthread_sigmask' before defining it.
+ REPLACE_PTHREAD_SIGMASK=1
+ else
+ dnl Test whether the gnulib module 'threadlib' is in use.
+ dnl Some packages like Emacs use --avoid=threadlib.
+ dnl Write the symbol in such a way that it does not cause 'aclocal' to pick
+ dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/.
+ m4_ifdef([gl_][THREADLIB], [
+ AC_REQUIRE([gl_][THREADLIB])
+
+ if test "$gl_threads_api" = posix; then
+ if test $ac_cv_func_pthread_sigmask = yes; then
+ dnl pthread_sigmask is available without -lpthread.
+ :
+ else
+ if test -n "$LIBMULTITHREAD"; then
+ AC_CACHE_CHECK([for pthread_sigmask in $LIBMULTITHREAD],
+ [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD],
+ [gl_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBMULTITHREAD"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ #include <signal.h>
+ ]],
+ [[return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);]])
+ ],
+ [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes],
+ [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no])
+ LIBS="$gl_save_LIBS"
+ ])
+ if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
+ dnl pthread_sigmask is available with -pthread or -lpthread.
+ LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
+ else
+ dnl pthread_sigmask is not available at all.
+ HAVE_PTHREAD_SIGMASK=0
+ fi
+ else
+ dnl pthread_sigmask is not available at all.
+ HAVE_PTHREAD_SIGMASK=0
+ fi
+ fi
+ else
+ dnl pthread_sigmask may exist but does not interoperate with the chosen
+ dnl multithreading facility.
+ if test $ac_cv_func_pthread_sigmask = yes; then
+ REPLACE_PTHREAD_SIGMASK=1
+ else
+ HAVE_PTHREAD_SIGMASK=0
+ fi
+ fi
+ ], [
+ dnl The module 'threadlib' is not in use, due to --avoid=threadlib being
+ dnl specified.
+ dnl The package either has prepared CPPFLAGS and LIBS for use of
+ dnl POSIX:2008 threads, or wants to build single-threaded programs.
+ if test $ac_cv_func_pthread_sigmask = yes; then
+ dnl pthread_sigmask exists and does not require extra libraries.
+ dnl Assume that it is declared.
+ :
+ else
+ dnl pthread_sigmask either does not exist or needs extra libraries.
+ HAVE_PTHREAD_SIGMASK=0
+ dnl Define the symbol rpl_pthread_sigmask, not pthread_sigmask,
+ dnl so as to not accidentally override the system's pthread_sigmask
+ dnl symbol from libpthread. This is necessary on IRIX 6.5.
+ REPLACE_PTHREAD_SIGMASK=1
+ fi
+ ])
+ fi
+
+ AC_SUBST([LIB_PTHREAD_SIGMASK])
+ dnl We don't need a variable LTLIB_PTHREAD_SIGMASK, because when
+ dnl "$gl_threads_api" = posix, $LTLIBMULTITHREAD and $LIBMULTITHREAD are the
+ dnl same.
+
+ dnl Now test for some bugs in the system function.
+ if test $HAVE_PTHREAD_SIGMASK = 1; then
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl On FreeBSD 6.4, HP-UX 11.31, Solaris 9, in programs that are not linked
+ dnl with -lpthread, the pthread_sigmask() function always returns 0 and has
+ dnl no effect.
+ if test -z "$LIB_PTHREAD_SIGMASK"; then
+ case " $LIBS " in
+ *' -pthread '*) ;;
+ *' -lpthread '*) ;;
+ *)
+ AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread],
+ [gl_cv_func_pthread_sigmask_in_libc_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+ #include <pthread.h>
+ #include <signal.h>
+ #include <stddef.h>
+ int main ()
+ {
+ sigset_t set;
+ sigemptyset (&set);
+ return pthread_sigmask (1729, &set, NULL) != 0;
+ }]])],
+ [gl_cv_func_pthread_sigmask_in_libc_works=no],
+ [gl_cv_func_pthread_sigmask_in_libc_works=yes],
+ [
+ changequote(,)dnl
+ case "$host_os" in
+ freebsd* | hpux* | solaris | solaris2.[2-9]*)
+ gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
+ *)
+ gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
+ esac
+ changequote([,])dnl
+ ])
+ ])
+ case "$gl_cv_func_pthread_sigmask_in_libc_works" in
+ *no)
+ REPLACE_PTHREAD_SIGMASK=1
+ AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1],
+ [Define to 1 if pthread_sigmask may return 0 and have no effect.])
+ ;;
+ esac;;
+ esac
+ fi
+
+ dnl On Cygwin 1.7.5, the pthread_sigmask() has a wrong return value
+ dnl convention: Upon failure, it returns -1 and sets errno.
+ AC_CACHE_CHECK([whether pthread_sigmask returns error numbers],
+ [gl_cv_func_pthread_sigmask_return_works],
+ [
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIB_PTHREAD_SIGMASK"
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <pthread.h>
+#include <signal.h>
+#include <stddef.h>
+int main ()
+{
+ sigset_t set;
+ sigemptyset (&set);
+ if (pthread_sigmask (1729, &set, NULL) == -1)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_pthread_sigmask_return_works=yes],
+ [gl_cv_func_pthread_sigmask_return_works=no],
+ [case "$host_os" in
+ cygwin*)
+ gl_cv_func_pthread_sigmask_return_works="guessing no";;
+ *)
+ gl_cv_func_pthread_sigmask_return_works="guessing yes";;
+ esac
+ ])
+ LIBS="$gl_save_LIBS"
+ ])
+ case "$gl_cv_func_pthread_sigmask_return_works" in
+ *no)
+ REPLACE_PTHREAD_SIGMASK=1
+ AC_DEFINE([PTHREAD_SIGMASK_FAILS_WITH_ERRNO], [1],
+ [Define to 1 if pthread_sigmask(), when it fails, returns -1 and sets errno.])
+ ;;
+ esac
+
+ dnl On IRIX 6.5, in a single-threaded program, pending signals are not
+ dnl immediately delivered when they are unblocked through pthread_sigmask,
+ dnl only a little while later.
+ AC_CACHE_CHECK([whether pthread_sigmask unblocks signals correctly],
+ [gl_cv_func_pthread_sigmask_unblock_works],
+ [
+ case "$host_os" in
+ irix*)
+ gl_cv_func_pthread_sigmask_unblock_works="guessing no";;
+ *)
+ gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
+ esac
+ m4_ifdef([gl_][THREADLIB],
+ [dnl Link against $LIBMULTITHREAD, not only $LIB_PTHREAD_SIGMASK.
+ dnl Otherwise we get a false positive on those platforms where
+ dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no".
+ gl_save_LIBS=$LIBS
+ LIBS="$LIBS $LIBMULTITHREAD"])
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+static volatile int sigint_occurred;
+static void
+sigint_handler (int sig)
+{
+ sigint_occurred++;
+}
+int main ()
+{
+ sigset_t set;
+ int pid = getpid ();
+ char command[80];
+ signal (SIGINT, sigint_handler);
+ sigemptyset (&set);
+ sigaddset (&set, SIGINT);
+ if (!(pthread_sigmask (SIG_BLOCK, &set, NULL) == 0))
+ return 1;
+ sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid);
+ if (!(system (command) == 0))
+ return 2;
+ sleep (2);
+ if (!(sigint_occurred == 0))
+ return 3;
+ if (!(pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0))
+ return 4;
+ if (!(sigint_occurred == 1)) /* This fails on IRIX. */
+ return 5;
+ return 0;
+}]])],
+ [:],
+ [gl_cv_func_pthread_sigmask_unblock_works=no],
+ [:])
+ m4_ifdef([gl_][THREADLIB], [LIBS=$gl_save_LIBS])
+ ])
+ case "$gl_cv_func_pthread_sigmask_unblock_works" in
+ *no)
+ REPLACE_PTHREAD_SIGMASK=1
+ AC_DEFINE([PTHREAD_SIGMASK_UNBLOCK_BUG], [1],
+ [Define to 1 if pthread_sigmask() unblocks signals incorrectly.])
+ ;;
+ esac
+ fi
+])
+
+# Prerequisite of lib/pthread_sigmask.c.
+AC_DEFUN([gl_PREREQ_PTHREAD_SIGMASK],
+[
+ if test $HAVE_PTHREAD_SIGMASK = 1; then
+ AC_DEFINE([HAVE_PTHREAD_SIGMASK], [1],
+ [Define to 1 if the pthread_sigmask function can be used (despite bugs).])
+ fi
+])
diff --git a/m4/putenv.m4 b/m4/putenv.m4
index f2a76b2..e38f8c5 100644
--- a/m4/putenv.m4
+++ b/m4/putenv.m4
@@ -1,5 +1,5 @@
-# putenv.m4 serial 22
-dnl Copyright (C) 2002-2018 Free Software Foundation, Inc.
+# putenv.m4 serial 24
+dnl Copyright (C) 2002-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -36,10 +36,12 @@ AC_DEFUN([gl_FUNC_PUTENV],
[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, assume the worst.
- *) 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
])
])
diff --git a/m4/quote.m4 b/m4/quote.m4
index 4d2198b..9efab95 100644
--- a/m4/quote.m4
+++ b/m4/quote.m4
@@ -1,5 +1,5 @@
# quote.m4 serial 6
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2018 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2020 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/quotearg.m4 b/m4/quotearg.m4
index c639e6f..b6eb16b 100644
--- a/m4/quotearg.m4
+++ b/m4/quotearg.m4
@@ -1,5 +1,5 @@
# quotearg.m4 serial 9
-dnl Copyright (C) 2002, 2004-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/raise.m4 b/m4/raise.m4
index 761e4b9..5b61b65 100644
--- a/m4/raise.m4
+++ b/m4/raise.m4
@@ -1,5 +1,5 @@
# raise.m4 serial 4
-dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/read-file.m4 b/m4/read-file.m4
index ee653dc..4638c7e 100644
--- a/m4/read-file.m4
+++ b/m4/read-file.m4
@@ -1,5 +1,5 @@
# read-file.m4 serial 3
-dnl Copyright (C) 2002-2006, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/readdir.m4 b/m4/readdir.m4
index f45a45f..ca4e741 100644
--- a/m4/readdir.m4
+++ b/m4/readdir.m4
@@ -1,5 +1,5 @@
# readdir.m4 serial 1
-dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/readlink.m4 b/m4/readlink.m4
index 4d0ab48..9aa9e46 100644
--- a/m4/readlink.m4
+++ b/m4/readlink.m4
@@ -1,5 +1,5 @@
-# readlink.m4 serial 14
-dnl Copyright (C) 2003, 2007, 2009-2018 Free Software Foundation, Inc.
+# readlink.m4 serial 15
+dnl Copyright (C) 2003, 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -38,8 +38,8 @@ AC_DEFUN([gl_FUNC_READLINK],
linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_readlink_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_readlink_works="$gl_cross_guess_normal" ;;
esac
])
rm -f conftest.link conftest.lnk2])
diff --git a/m4/realloc.m4 b/m4/realloc.m4
index 23c0d5d..85b8f87 100644
--- a/m4/realloc.m4
+++ b/m4/realloc.m4
@@ -1,11 +1,9 @@
-# realloc.m4 serial 15
-dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+# realloc.m4 serial 18
+dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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:
# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
AC_DEFUN([_AC_FUNC_REALLOC_IF],
@@ -32,19 +30,24 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF],
[ac_cv_func_realloc_0_nonnull=no],
[case "$host_os" in
# Guess yes on platforms where we know the result.
- *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \
+ *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
| hpux* | solaris* | cygwin* | mingw*)
- ac_cv_func_realloc_0_nonnull=yes ;;
- # If we don't know, assume the worst.
- *) ac_cv_func_realloc_0_nonnull=no ;;
+ ac_cv_func_realloc_0_nonnull="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_realloc_0_nonnull="$gl_cross_guess_normal" ;;
esac
])
])
- AS_IF([test $ac_cv_func_realloc_0_nonnull = yes], [$1], [$2])
+ case "$ac_cv_func_realloc_0_nonnull" in
+ *yes)
+ $1
+ ;;
+ *)
+ $2
+ ;;
+ esac
])# AC_FUNC_REALLOC
-])
-
# gl_FUNC_REALLOC_GNU
# -------------------
# Test whether 'realloc (0, 0)' is handled like in GNU libc, and replace
diff --git a/m4/regex.m4 b/m4/regex.m4
index 3a39b1a..65f5185 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,6 +1,6 @@
-# serial 68
+# serial 69
-# Copyright (C) 1996-2001, 2003-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -243,8 +243,8 @@ AC_DEFUN([gl_REGEX],
[case "$host_os" in
# Guess no on native Windows.
mingw*) gl_cv_func_re_compile_pattern_working="guessing no" ;;
- # Otherwise, assume it is not working.
- *) gl_cv_func_re_compile_pattern_working="guessing no" ;;
+ # Otherwise obey --enable-cross-guesses.
+ *) gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/m4/rename.m4 b/m4/rename.m4
index fcf230e..a1bd705 100644
--- a/m4/rename.m4
+++ b/m4/rename.m4
@@ -1,6 +1,6 @@
-# serial 31
+# serial 32
-# Copyright (C) 2001, 2003, 2005-2006, 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005-2006, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -61,8 +61,8 @@ AC_DEFUN([gl_FUNC_RENAME],
*-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, assume the worst.
- *) 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
@@ -117,8 +117,8 @@ AC_DEFUN([gl_FUNC_RENAME],
*-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, assume the worst.
- *) gl_cv_func_rename_slash_src_works="guessing no" ;;
+ # 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
@@ -140,53 +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 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>
- ]],
- [[int result = 0;
- if (rename ("conftest.f", "conftest.f1"))
- result |= 1;
- if (unlink ("conftest.f1"))
- result |= 2;
+ 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>
+ ]],
+ [[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;
+ /* 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 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, assume the worst.
- *) gl_cv_func_rename_link_works="guessing no" ;;
- esac
- ])
+ 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 conftest.f2
else
gl_cv_func_rename_link_works=yes
fi
@@ -232,8 +237,8 @@ AC_DEFUN([gl_FUNC_RENAME],
*-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, assume the worst.
- *) 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 a24d845..ad1b192 100644
--- a/m4/rmdir.m4
+++ b/m4/rmdir.m4
@@ -1,5 +1,5 @@
-# rmdir.m4 serial 16
-dnl Copyright (C) 2002, 2005, 2009-2018 Free Software Foundation, Inc.
+# rmdir.m4 serial 17
+dnl Copyright (C) 2002, 2005, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -39,8 +39,8 @@ AC_DEFUN([gl_FUNC_RMDIR],
*-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, assume the worst.
- *) 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/sched_h.m4 b/m4/sched_h.m4
new file mode 100644
index 0000000..af0c43d
--- /dev/null
+++ b/m4/sched_h.m4
@@ -0,0 +1,91 @@
+# sched_h.m4 serial 12
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Bruno Haible.
+
+AC_DEFUN([gl_SCHED_H],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_SCHED_H_DEFAULTS])
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
+ AC_CHECK_HEADERS([sched.h], [], [],
+ [[#if HAVE_SYS_CDEFS_H
+ #include <sys/cdefs.h>
+ #endif
+ ]])
+ gl_NEXT_HEADERS([sched.h])
+
+ if test "$ac_cv_header_sched_h" = yes; then
+ HAVE_SCHED_H=1
+ else
+ HAVE_SCHED_H=0
+ fi
+ AC_SUBST([HAVE_SCHED_H])
+
+ if test "$HAVE_SCHED_H" = 1; then
+ AC_CHECK_TYPE([struct sched_param],
+ [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
+ [[#if HAVE_SYS_CDEFS_H
+ #include <sys/cdefs.h>
+ #endif
+ #include <sched.h>
+ ]])
+ else
+ HAVE_STRUCT_SCHED_PARAM=0
+ case "$host_os" in
+ os2*)
+ dnl On OS/2 kLIBC, struct sched_param is in spawn.h.
+ AC_CHECK_TYPE([struct sched_param],
+ [HAVE_STRUCT_SCHED_PARAM=1], [],
+ [#include <spawn.h>])
+ ;;
+ vms)
+ dnl On OpenVMS 7.2 or newer, struct sched_param is in pthread.h.
+ AC_CHECK_TYPE([struct sched_param],
+ [HAVE_STRUCT_SCHED_PARAM=1], [],
+ [#include <pthread.h>])
+ ;;
+ esac
+ fi
+ AC_SUBST([HAVE_STRUCT_SCHED_PARAM])
+
+ if test "$ac_cv_header_sys_cdefs_h" = yes; then
+ HAVE_SYS_CDEFS_H=1
+ else
+ HAVE_SYS_CDEFS_H=0
+ fi
+ AC_SUBST([HAVE_SYS_CDEFS_H])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, if it is not common
+ dnl enough to be declared everywhere.
+ gl_WARN_ON_USE_PREPARE([[#include <sched.h>
+ ]], [sched_yield])
+])
+
+AC_DEFUN([gl_SCHED_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_SCHED_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_SCHED_H_DEFAULTS],
+[
+ GNULIB_SCHED_YIELD=0; AC_SUBST([GNULIB_SCHED_YIELD])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_SCHED_YIELD=1; AC_SUBST([HAVE_SCHED_YIELD])
+ REPLACE_SCHED_YIELD=0; AC_SUBST([REPLACE_SCHED_YIELD])
+])
diff --git a/m4/select.m4 b/m4/select.m4
index 098af8e..d950460 100644
--- a/m4/select.m4
+++ b/m4/select.m4
@@ -1,5 +1,5 @@
-# select.m4 serial 10
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+# select.m4 serial 11
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -78,8 +78,8 @@ changequote([,])dnl
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, assume the worst.
- *) gl_cv_func_select_detects_ebadf="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_select_detects_ebadf="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/m4/selinux-context-h.m4 b/m4/selinux-context-h.m4
index 4218dba..b271dfe 100644
--- a/m4/selinux-context-h.m4
+++ b/m4/selinux-context-h.m4
@@ -1,5 +1,5 @@
# serial 3 -*- Autoconf -*-
-# Copyright (C) 2006-2007, 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/selinux-selinux-h.m4 b/m4/selinux-selinux-h.m4
index 2065b04..b6a7a91 100644
--- a/m4/selinux-selinux-h.m4
+++ b/m4/selinux-selinux-h.m4
@@ -1,5 +1,5 @@
# serial 5 -*- Autoconf -*-
-# Copyright (C) 2006-2007, 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/setenv.m4 b/m4/setenv.m4
index 5d257f7..ef03673 100644
--- a/m4/setenv.m4
+++ b/m4/setenv.m4
@@ -1,5 +1,5 @@
-# setenv.m4 serial 27
-dnl Copyright (C) 2001-2004, 2006-2018 Free Software Foundation, Inc.
+# setenv.m4 serial 29
+dnl Copyright (C) 2001-2004, 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -37,8 +37,10 @@ AC_DEFUN([gl_FUNC_SETENV],
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu* | 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 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
@@ -129,8 +131,8 @@ int unsetenv (const char *name);
[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" ;;
+ # 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
diff --git a/m4/setlocale.m4 b/m4/setlocale.m4
index e0fb74a..a56bf4e 100644
--- a/m4/setlocale.m4
+++ b/m4/setlocale.m4
@@ -1,5 +1,5 @@
-# setlocale.m4 serial 5
-dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
+# setlocale.m4 serial 7
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,19 +7,72 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_SETLOCALE],
[
AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
AC_REQUIRE([AC_CANONICAL_HOST])
+
+ dnl Test whether we need to improve on the general working of setlocale.
+ NEED_SETLOCALE_IMPROVED=0
case "$host_os" in
dnl On native Windows systems, setlocale(category,NULL) does not look at
dnl the environment variables LC_ALL, category, and LANG.
- mingw*) REPLACE_SETLOCALE=1 ;;
+ mingw*) NEED_SETLOCALE_IMPROVED=1 ;;
dnl On Cygwin 1.5.x, setlocale always succeeds but setlocale(LC_CTYPE,NULL)
dnl is then still "C".
cygwin*)
case `uname -r` in
- 1.5.*) REPLACE_SETLOCALE=1 ;;
+ 1.5.*) NEED_SETLOCALE_IMPROVED=1 ;;
+ esac
+ ;;
+ dnl On Android 4.3, setlocale(category,"C") always fails.
+ *)
+ AC_CACHE_CHECK([whether setlocale supports the C locale],
+ [gl_cv_func_setlocale_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+int main ()
+{
+ return setlocale (LC_ALL, "C") == NULL;
+}]])],
+ [gl_cv_func_setlocale_works=yes],
+ [gl_cv_func_setlocale_works=no],
+ [case "$host_os" in
+ # Guess no on Android.
+ linux*-android*) gl_cv_func_setlocale_works="guessing no";;
+ # Guess yes otherwise.
+ *) gl_cv_func_setlocale_works="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_setlocale_works" in
+ *yes) ;;
+ *) NEED_SETLOCALE_IMPROVED=1 ;;
esac
;;
esac
+ AC_DEFINE_UNQUOTED([NEED_SETLOCALE_IMPROVED], [$NEED_SETLOCALE_IMPROVED],
+ [Define to 1 to enable general improvements of setlocale.])
+
+ dnl Test whether we need a multithread-safe setlocale(category,NULL).
+ NEED_SETLOCALE_MTSAFE=0
+ if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+ NEED_SETLOCALE_MTSAFE=1
+ fi
+ AC_DEFINE_UNQUOTED([NEED_SETLOCALE_MTSAFE], [$NEED_SETLOCALE_MTSAFE],
+ [Define to 1 to enable a multithread-safety fix of setlocale.])
+
+ if test $NEED_SETLOCALE_IMPROVED = 1 || test $NEED_SETLOCALE_MTSAFE = 1; then
+ REPLACE_SETLOCALE=1
+ fi
+
+ if test $NEED_SETLOCALE_MTSAFE = 1; then
+ LIB_SETLOCALE="$LIB_SETLOCALE_NULL"
+ else
+ LIB_SETLOCALE=
+ fi
+ dnl LIB_SETLOCALE is expected to be '-pthread' or '-lpthread' on AIX with gcc
+ dnl or xlc, and empty otherwise.
+ AC_SUBST([LIB_SETLOCALE])
])
# Prerequisites of lib/setlocale.c.
diff --git a/m4/setlocale_null.m4 b/m4/setlocale_null.m4
new file mode 100644
index 0000000..c1ee1f7
--- /dev/null
+++ b/m4/setlocale_null.m4
@@ -0,0 +1,98 @@
+# setlocale_null.m4 serial 2
+dnl Copyright (C) 2019-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_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/sigaction.m4 b/m4/sigaction.m4
index f6918fa..9a2d201 100644
--- a/m4/sigaction.m4
+++ b/m4/sigaction.m4
@@ -1,5 +1,5 @@
# sigaction.m4 serial 7
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/signal_h.m4 b/m4/signal_h.m4
index 394b91d..0868438 100644
--- a/m4/signal_h.m4
+++ b/m4/signal_h.m4
@@ -1,5 +1,5 @@
# signal_h.m4 serial 18
-dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/signalblocking.m4 b/m4/signalblocking.m4
index 4350b21..74de534 100644
--- a/m4/signalblocking.m4
+++ b/m4/signalblocking.m4
@@ -1,5 +1,5 @@
# signalblocking.m4 serial 14
-dnl Copyright (C) 2001-2002, 2006-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2002, 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sleep.m4 b/m4/sleep.m4
index 7ddaffa..d19170e 100644
--- a/m4/sleep.m4
+++ b/m4/sleep.m4
@@ -1,5 +1,5 @@
-# sleep.m4 serial 9
-dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
+# sleep.m4 serial 11
+dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -48,10 +48,12 @@ handle_alarm (int sig)
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_sleep_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_sleep_works="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_sleep_works="guessing no" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_sleep_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_sleep_works="$gl_cross_guess_normal" ;;
esac
])])
case "$gl_cv_func_sleep_works" in
diff --git a/m4/socketlib.m4 b/m4/socketlib.m4
index a725d3c..2372a27 100644
--- a/m4/socketlib.m4
+++ b/m4/socketlib.m4
@@ -1,5 +1,5 @@
# socketlib.m4 serial 2
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sockets.m4 b/m4/sockets.m4
index d941dad..7e53ef2 100644
--- a/m4/sockets.m4
+++ b/m4/sockets.m4
@@ -1,5 +1,5 @@
# sockets.m4 serial 7
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/socklen.m4 b/m4/socklen.m4
index fa79b07..251960b 100644
--- a/m4/socklen.m4
+++ b/m4/socklen.m4
@@ -1,5 +1,5 @@
# socklen.m4 serial 11
-dnl Copyright (C) 2005-2007, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sockpfaf.m4 b/m4/sockpfaf.m4
index cc47b8b..495a355 100644
--- a/m4/sockpfaf.m4
+++ b/m4/sockpfaf.m4
@@ -1,5 +1,5 @@
# sockpfaf.m4 serial 9
-dnl Copyright (C) 2004, 2006, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4
index 0977f20..6c0a588 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-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/stat-time.m4 b/m4/stat-time.m4
index d0d17ed..0ac3f72 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-2018 Free Software
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2020 Free Software
# Foundation, Inc.
# This file is free software; the Free Software Foundation
diff --git a/m4/stat.m4 b/m4/stat.m4
index e8ec3b2..46e9abc 100644
--- a/m4/stat.m4
+++ b/m4/stat.m4
@@ -1,6 +1,6 @@
-# serial 15
+# serial 16
-# Copyright (C) 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2009-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -47,8 +47,8 @@ AC_DEFUN([gl_FUNC_STAT],
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, assume the worst.
- *) gl_cv_func_stat_file_slash="guessing no" ;;
+ # 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])
diff --git a/m4/std-gnu11.m4 b/m4/std-gnu11.m4
index bae4ed1..c1ec624 100644
--- a/m4/std-gnu11.m4
+++ b/m4/std-gnu11.m4
@@ -7,7 +7,7 @@
# or later is installed everywhere a Gnulib program might be developed.
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
index c74fe9b..dcf778e 100644
--- a/m4/stdalign.m4
+++ b/m4/stdalign.m4
@@ -1,6 +1,6 @@
# Check for stdalign.h that conforms to C11.
-dnl Copyright 2011-2018 Free Software Foundation, Inc.
+dnl Copyright 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/stdarg.m4 b/m4/stdarg.m4
index f89d38b..69747f3 100644
--- a/m4/stdarg.m4
+++ b/m4/stdarg.m4
@@ -1,5 +1,5 @@
# stdarg.m4 serial 7
-dnl Copyright (C) 2006, 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
index f8c0577..6bb087e 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-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
index 07b040a..6bcfadb 100644
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -1,6 +1,6 @@
dnl A placeholder for <stddef.h>, for platforms that have issues.
# stddef_h.m4 serial 6
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index 81d065f..29ad826 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,5 +1,5 @@
-# stdint.m4 serial 53
-dnl Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# stdint.m4 serial 54
+dnl Copyright (C) 2001-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -17,21 +17,12 @@ AC_DEFUN_ONCE([gl_STDINT_H],
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])
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 0debe69..c603b51 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,5 +1,5 @@
# stdio_h.m4 serial 49
-dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4
index 49dc5d5..61a3e31 100644
--- a/m4/stdlib_h.m4
+++ b/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 45
-dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 48
+dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -23,10 +23,10 @@ AC_DEFUN([gl_STDLIB_H],
# include <random.h>
#endif
]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
- initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
+ initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps
posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray
realpath rpmatch secure_getenv setenv setstate setstate_r srandom
- srandom_r strtod strtoll strtoull unlockpt unsetenv])
+ srandom_r strtod strtold strtoll strtoull unlockpt unsetenv])
])
AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
@@ -68,6 +68,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
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])
@@ -81,7 +82,9 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
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])
@@ -100,8 +103,10 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
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])
@@ -110,6 +115,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC])
REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
+ 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])
@@ -117,11 +123,14 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R])
+ REPLACE_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 dddaa01..2d1fcc4 100644
--- a/m4/strdup.m4
+++ b/m4/strdup.m4
@@ -1,6 +1,6 @@
# strdup.m4 serial 13
-dnl Copyright (C) 2002-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/strerror.m4 b/m4/strerror.m4
index b886b8d..fd84ce8 100644
--- a/m4/strerror.m4
+++ b/m4/strerror.m4
@@ -1,5 +1,5 @@
-# strerror.m4 serial 19
-dnl Copyright (C) 2002, 2007-2018 Free Software Foundation, Inc.
+# strerror.m4 serial 21
+dnl Copyright (C) 2002, 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -26,8 +26,10 @@ AC_DEFUN([gl_FUNC_STRERROR],
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_working_strerror="guessing no" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_working_strerror="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
esac
])
])
@@ -80,10 +82,12 @@ AC_DEFUN([gl_FUNC_STRERROR_0],
[case "$host_os" in
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;;
# Guess yes on native Windows.
mingw*) gl_cv_func_strerror_0_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_strerror_0_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/m4/strerror_r.m4 b/m4/strerror_r.m4
index a3e3a4c..d431f23 100644
--- a/m4/strerror_r.m4
+++ b/m4/strerror_r.m4
@@ -1,5 +1,5 @@
-# strerror_r.m4 serial 19
-dnl Copyright (C) 2002, 2007-2018 Free Software Foundation, Inc.
+# strerror_r.m4 serial 20
+dnl Copyright (C) 2002, 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -163,7 +163,7 @@ changequote([,])dnl
[gl_cv_func_strerror_r_works=no],
[dnl Guess no on all platforms that have __xpg_strerror_r,
dnl at least until fixed glibc and cygwin are more common.
- gl_cv_func_strerror_r_works="guessing no"
+ gl_cv_func_strerror_r_works="$gl_cross_guess_normal"
])
])
fi
diff --git a/m4/string_h.m4 b/m4/string_h.m4
index 97c80dc..4c1f685 100644
--- a/m4/string_h.m4
+++ b/m4/string_h.m4
@@ -1,6 +1,6 @@
# Configure a GNU-like replacement for <string.h>.
-# Copyright (C) 2007-2018 Free Software Foundation, Inc.
+# Copyright (C) 2007-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/strverscmp.m4 b/m4/strverscmp.m4
index 5d32985..6803845 100644
--- a/m4/strverscmp.m4
+++ b/m4/strverscmp.m4
@@ -1,5 +1,5 @@
# strverscmp.m4 serial 8
-dnl Copyright (C) 2002, 2005-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/symlink.m4 b/m4/symlink.m4
index afaa941..9cfdf93 100644
--- a/m4/symlink.m4
+++ b/m4/symlink.m4
@@ -1,7 +1,7 @@
-# serial 8
+# serial 9
# See if we need to provide symlink replacement.
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -40,8 +40,8 @@ AC_DEFUN([gl_FUNC_SYMLINK],
linux-* | linux) gl_cv_func_symlink_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu* | gnu*) gl_cv_func_symlink_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_symlink_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_symlink_works="$gl_cross_guess_normal" ;;
esac
])
rm -f conftest.f conftest.link conftest.lnk2])
diff --git a/m4/sys_ioctl_h.m4 b/m4/sys_ioctl_h.m4
index 1ef67c0..303820e 100644
--- a/m4/sys_ioctl_h.m4
+++ b/m4/sys_ioctl_h.m4
@@ -1,5 +1,5 @@
# sys_ioctl_h.m4 serial 10
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_select_h.m4 b/m4/sys_select_h.m4
index 8e9eff4..fa19bb6 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-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
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 f210378..1471aea 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-2018 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 24
+dnl Copyright (C) 2005-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -104,17 +104,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 +136,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 52f06aa..d63df9e 100644
--- a/m4/sys_stat_h.m4
+++ b/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
# sys_stat_h.m4 serial 31 -*- Autoconf -*-
-dnl Copyright (C) 2006-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4
index d7e9268..8fc8599 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 9
-# Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4
index 2debfb0..be918dc 100644
--- a/m4/sys_types_h.m4
+++ b/m4/sys_types_h.m4
@@ -1,5 +1,5 @@
# sys_types_h.m4 serial 9
-dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sys_uio_h.m4 b/m4/sys_uio_h.m4
index 2cd01e1..a255dea 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-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/tempname.m4 b/m4/tempname.m4
index ed813f1..da439f0 100644
--- a/m4/tempname.m4
+++ b/m4/tempname.m4
@@ -1,6 +1,6 @@
#serial 5
-# Copyright (C) 2006-2007, 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/thread.m4 b/m4/thread.m4
new file mode 100644
index 0000000..d1e62b8
--- /dev/null
+++ b/m4/thread.m4
@@ -0,0 +1,17 @@
+# thread.m4 serial 3
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_THREAD],
+[
+ AC_REQUIRE([gl_THREADLIB])
+
+ if test $gl_threads_api = posix; then
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBMULTITHREAD"
+ AC_CHECK_FUNCS([pthread_atfork])
+ LIBS="$gl_save_LIBS"
+ fi
+])
diff --git a/m4/threadlib.m4 b/m4/threadlib.m4
index ed6ebd5..e64ad62 100644
--- a/m4/threadlib.m4
+++ b/m4/threadlib.m4
@@ -1,5 +1,5 @@
-# threadlib.m4 serial 15
-dnl Copyright (C) 2005-2018 Free Software Foundation, Inc.
+# threadlib.m4 serial 26
+dnl Copyright (C) 2005-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -8,6 +8,319 @@ 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_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
+ ])
+ 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.
@@ -16,8 +329,13 @@ 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_POSIX_THREADS, USE_SOLARIS_THREADS,
-dnl USE_PTH_THREADS, USE_WINDOWS_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).
@@ -27,6 +345,9 @@ 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],
[
@@ -50,8 +371,9 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY],
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],
-AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+AC_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
[gl_use_threads=$enableval],
[if test -n "$gl_use_threads_default"; then
@@ -62,41 +384,35 @@ changequote(,)dnl
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>.
- osf*) gl_use_threads=no ;;
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" = posix; then
- # For using <pthread.h>:
- 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
+ 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
])
@@ -112,144 +428,31 @@ AC_DEFUN([gl_THREADLIB_BODY],
LTLIBMULTITHREAD=
if test "$gl_use_threads" != no; then
dnl Check whether the compiler and linker support weak declarations.
- 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 Check whether the linker supports the --as-needed/--no-as-needed options.
- dnl Assume GCC, so that we can use the -Wl option.
- AC_CACHE_CHECK([whether the linker supports --as-needed],
- [gl_cv_linker_have_as_needed],
- [if test -n "$GCC"; then
- gl_saved_ldflags="$LDFLAGS"
- LDFLAGS="$gl_saved_ldflags -Wl,--as-needed -Wl,--no-as-needed"
- AC_LINK_IFELSE([AC_LANG_PROGRAM()],
- [gl_cv_linker_have_as_needed=yes],
- [gl_cv_linker_have_as_needed=no])
- LDFLAGS="$gl_saved_ldflags"
- else
- gl_cv_linker_have_as_needed=no
- fi
- ])
- dnl Check whether the linker supports the --push-state/--pop-state options.
- dnl Assume GCC, so that we can use the -Wl option.
- AC_CACHE_CHECK([whether the linker supports --push-state],
- [gl_cv_linker_have_push_state],
- [if test -n "$GCC"; then
- gl_saved_ldflags="$LDFLAGS"
- LDFLAGS="$gl_saved_ldflags -Wl,--push-state -Wl,--pop-state"
- AC_LINK_IFELSE([AC_LANG_PROGRAM()],
- [gl_cv_linker_have_push_state=yes],
- [gl_cv_linker_have_push_state=no])
- LDFLAGS="$gl_saved_ldflags"
- else
- gl_cv_linker_have_push_state=no
- fi
- ])
- if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
- # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
- # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
- 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
- gl_have_pthread=
- # 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_have_pthread=yes
- LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread
- LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread])
- LIBS=$save_LIBS
- test -n "$gl_have_pthread" && 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 -n "$gl_have_pthread" && test -z "$LIBTHREAD"; 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],
- [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-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 -z "$gl_have_pthread"; then
- # Some library is needed. Try libpthread and libc_r.
- AC_CHECK_LIB([pthread], [pthread_kill],
- [gl_have_pthread=yes
- LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
- LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
- if test -z "$gl_have_pthread"; then
- # For FreeBSD 4.
- AC_CHECK_LIB([c_r], [pthread_kill],
- [gl_have_pthread=yes
- LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
- LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
- fi
- fi
- if test -n "$gl_have_pthread"; then
+ 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.])
@@ -257,125 +460,23 @@ int main ()
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=
- dnl On platforms where GCC enables --as-needed by default, attempt
- dnl to make sure that LIBMULTITHREAD really links with -lpthread.
- dnl Otherwise linking with LIBMULTITHREAD has no effect; then
- dnl the weak symbols are not defined and thus evaluate to NULL.
- case "$LIBMULTITHREAD" in
- "") ;;
- -pthread)
- if test $gl_cv_linker_have_as_needed = yes; then
- if test $gl_cv_linker_have_push_state = yes; then
- LIBMULTITHREAD="$LIBMULTITHREAD -Wl,--push-state -Wl,--no-as-needed -lpthread -Wl,--pop-state"
- else
- LIBMULTITHREAD="$LIBMULTITHREAD -Wl,--no-as-needed -lpthread"
- fi
- fi
- ;;
- *)
- if test $gl_cv_linker_have_as_needed = yes; then
- if test $gl_cv_linker_have_push_state = yes; then
- LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
- else
- LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
- fi
- fi
- ;;
- esac
- # TODO: May need to modify LTLIBMULTITHREAD similarly.
- fi
- fi
- fi
- fi
- fi
- if test -z "$gl_have_pthread"; then
- if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
- gl_have_solaristhread=
- gl_save_LIBS="$LIBS"
- LIBS="$LIBS -lthread"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#include <thread.h>
-#include <synch.h>
- ]],
- [[thr_self();]])],
- [gl_have_solaristhread=yes])
- LIBS="$gl_save_LIBS"
- if test -n "$gl_have_solaristhread"; then
- gl_threads_api=solaris
- LIBTHREAD=-lthread
- LTLIBTHREAD=-lthread
- LIBMULTITHREAD="$LIBTHREAD"
- LTLIBMULTITHREAD="$LTLIBTHREAD"
- AC_DEFINE([USE_SOLARIS_THREADS], [1],
- [Define if the old Solaris multithreading library can be used.])
- if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
- AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
- [Define if references to the old Solaris multithreading library should be made weak.])
- LIBTHREAD=
- LTLIBTHREAD=
- dnl On platforms where GCC enables --as-needed by default, attempt
- dnl to make sure that LIBMULTITHREAD really links with -lthread.
- dnl Otherwise linking with LIBMULTITHREAD has no effect; then
- dnl the weak symbols are not defined and thus evaluate to NULL.
- if test $gl_cv_linker_have_as_needed = yes; then
- if test $gl_cv_linker_have_push_state = yes; then
- LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
- else
- LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
- fi
+ LIBTHREAD= LTLIBTHREAD=
fi
- # TODO: May need to modify LTLIBMULTITHREAD similarly.
fi
fi
fi
fi
- if test "$gl_use_threads" = pth; then
- gl_save_CPPFLAGS="$CPPFLAGS"
- AC_LIB_LINKFLAGS([pth])
- gl_have_pth=
- gl_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBPTH"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])],
- [gl_have_pth=yes])
- LIBS="$gl_save_LIBS"
- if test -n "$gl_have_pth"; then
- gl_threads_api=pth
- LIBTHREAD="$LIBPTH"
- LTLIBTHREAD="$LTLIBPTH"
- LIBMULTITHREAD="$LIBTHREAD"
- LTLIBMULTITHREAD="$LTLIBTHREAD"
- AC_DEFINE([USE_PTH_THREADS], [1],
- [Define if the GNU Pth 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_PTH_THREADS_WEAK], [1],
- [Define if references to the GNU Pth multithreading library should be made weak.])
- LIBTHREAD=
- LTLIBTHREAD=
- dnl On platforms where GCC enables --as-needed by default, attempt
- dnl to make sure that LIBMULTITHREAD really links with -lpth.
- dnl Otherwise linking with LIBMULTITHREAD has no effect; then
- dnl the weak symbols are not defined and thus evaluate to NULL.
- if test $gl_cv_linker_have_as_needed = yes; then
- if test $gl_cv_linker_have_push_state = yes; then
- LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
- else
- LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
- fi
- fi
- # TODO: May need to modify LTLIBMULTITHREAD similarly.
- fi
- fi
- else
- CPPFLAGS="$gl_save_CPPFLAGS"
+ 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 -z "$gl_have_pthread"; then
+ 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
@@ -417,6 +518,21 @@ AC_DEFUN([gl_DISABLE_THREADS], [
])
+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
@@ -446,7 +562,6 @@ 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 solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
dnl
dnl HP-UX 11 posix -lpthread N (cc) OK
dnl Y (gcc)
@@ -460,8 +575,6 @@ dnl -lpthread (gcc) Y
dnl
dnl Cygwin posix -lpthread Y OK
dnl
-dnl Any of the above pth -lpth 0.0
-dnl
dnl Mingw windows N OK
dnl
dnl BeOS 5 --
diff --git a/m4/time_h.m4 b/m4/time_h.m4
index ad6f2f5..aae0ae2 100644
--- a/m4/time_h.m4
+++ b/m4/time_h.m4
@@ -1,6 +1,6 @@
# Configure a more-standard replacement for <time.h>.
-# Copyright (C) 2000-2001, 2003-2007, 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2020 Free Software Foundation, Inc.
# serial 11
diff --git a/m4/ungetc.m4 b/m4/ungetc.m4
index 2e66c55..66492af 100644
--- a/m4/ungetc.m4
+++ b/m4/ungetc.m4
@@ -1,5 +1,5 @@
-# ungetc.m4 serial 6
-dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
+# ungetc.m4 serial 8
+dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -41,12 +41,16 @@ AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS],
remove ("conftest.tmp");])],
[gl_cv_func_ungetc_works=yes], [gl_cv_func_ungetc_works=no],
[case "$host_os" in
- # Guess yes on glibc and bionic systems.
- *-gnu* | gnu* | *-android*) gl_cv_func_ungetc_works="guessing yes" ;;
- # Guess yes on native Windows.
- mingw*) gl_cv_func_ungetc_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_ungetc_works="guessing no" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # Guess yes on musl systems.
+ *-musl*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # Guess yes on bionic systems.
+ *-android*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_ungetc_works="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index 3ba64da..ea2bb01 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 74
-dnl Copyright (C) 2006-2018 Free Software Foundation, Inc.
+# unistd_h.m4 serial 77
+dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -41,9 +41,9 @@ AC_DEFUN([gl_UNISTD_H],
# 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 getpass
+ ]], [access chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir
+ fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize
+ 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
@@ -61,9 +61,11 @@ 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])
@@ -82,6 +84,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
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])
@@ -113,6 +116,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN])
+ HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE])
HAVE_DUP2=1; AC_SUBST([HAVE_DUP2])
HAVE_DUP3=1; AC_SUBST([HAVE_DUP3])
HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS])
@@ -157,6 +161,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
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])
diff --git a/m4/unlocked-io.m4 b/m4/unlocked-io.m4
index 7e46367..38658e6 100644
--- a/m4/unlocked-io.m4
+++ b/m4/unlocked-io.m4
@@ -1,6 +1,6 @@
# unlocked-io.m4 serial 15
-# Copyright (C) 1998-2006, 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 1998-2006, 2009-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/m4/version-etc.m4 b/m4/version-etc.m4
index 815378a..a2455e8 100644
--- a/m4/version-etc.m4
+++ b/m4/version-etc.m4
@@ -1,5 +1,5 @@
# version-etc.m4 serial 1
-# Copyright (C) 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/visibility.m4 b/m4/visibility.m4
new file mode 100644
index 0000000..9f493ba
--- /dev/null
+++ b/m4/visibility.m4
@@ -0,0 +1,77 @@
+# visibility.m4 serial 6
+dnl Copyright (C) 2005, 2008, 2010-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl Mac OS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+AC_DEFUN([gl_VISIBILITY],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ CFLAG_VISIBILITY=
+ HAVE_VISIBILITY=0
+ if test -n "$GCC"; then
+ 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_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_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
+ fi
+ fi
+ AC_SUBST([CFLAG_VISIBILITY])
+ AC_SUBST([HAVE_VISIBILITY])
+ AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+ [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])
diff --git a/m4/warn-on-use.m4 b/m4/warn-on-use.m4
index 8e270cf..5c8ee45 100644
--- a/m4/warn-on-use.m4
+++ b/m4/warn-on-use.m4
@@ -1,5 +1,5 @@
# warn-on-use.m4 serial 6
-dnl Copyright (C) 2010-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index 07edda1..d272365 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -1,5 +1,5 @@
# warnings.m4 serial 14
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4
index a062ca9..d1b7228 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-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl Written by Eric Blake.
-# wchar_h.m4 serial 43
+# wchar_h.m4 serial 44
AC_DEFUN([gl_WCHAR_H],
[
@@ -237,4 +237,5 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
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 83bc3d5..e48d464 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-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/wcrtomb.m4 b/m4/wcrtomb.m4
index e71c57a..c45fd98 100644
--- a/m4/wcrtomb.m4
+++ b/m4/wcrtomb.m4
@@ -1,5 +1,5 @@
-# wcrtomb.m4 serial 13
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+# wcrtomb.m4 serial 16
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -31,9 +31,13 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
REPLACE_WCRTOMB=1
fi
else
- if test $REPLACE_MBSTATE_T = 1; then
- REPLACE_WCRTOMB=1
- else
+ 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])
@@ -42,6 +46,47 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
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>
+/* 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 <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,12 +94,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 on native Windows.
- mingw*) gl_cv_func_wcrtomb_retval="guessing yes" ;;
- # 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
@@ -70,6 +113,7 @@ changequote([,])dnl
#include <stdio.h>
#include <time.h>
#include <wchar.h>
+#include <stdlib.h>
int main ()
{
int result = 0;
@@ -82,6 +126,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)
{
@@ -102,7 +152,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/wctob.m4 b/m4/wctob.m4
index c7eeb5f..8013326 100644
--- a/m4/wctob.m4
+++ b/m4/wctob.m4
@@ -1,5 +1,5 @@
-# wctob.m4 serial 11
-dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
+# wctob.m4 serial 12
+dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -74,6 +74,7 @@ int main ()
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#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>.
diff --git a/m4/wctomb.m4 b/m4/wctomb.m4
index 962ed84..8e8c6a2 100644
--- a/m4/wctomb.m4
+++ b/m4/wctomb.m4
@@ -1,5 +1,5 @@
# wctomb.m4 serial 2
-dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4
index 15d1ef3..dc854e6 100644
--- a/m4/wctype_h.m4
+++ b/m4/wctype_h.m4
@@ -1,8 +1,8 @@
-# wctype_h.m4 serial 21
+# wctype_h.m4 serial 22
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
-dnl Copyright (C) 2006-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -69,10 +69,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
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
index 95f6854..877fd86 100644
--- a/m4/wint_t.m4
+++ b/m4/wint_t.m4
@@ -1,5 +1,5 @@
# wint_t.m4 serial 7
-dnl Copyright (C) 2003, 2007-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/xalloc.m4 b/m4/xalloc.m4
index 7bd360b..a556870 100644
--- a/m4/xalloc.m4
+++ b/m4/xalloc.m4
@@ -1,5 +1,5 @@
# xalloc.m4 serial 18
-dnl Copyright (C) 2002-2006, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.