summaryrefslogtreecommitdiff
path: root/gl/m4
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2020-02-25 17:11:21 +0000
committerColin Watson <cjwatson@debian.org>2020-02-25 17:11:21 +0000
commitea9974fa9eea80f19126edbd7e132186d153d2b2 (patch)
tree5f722c1f0c58d3ee73321f7e1e6ef9f5b13ec6a3 /gl/m4
parentf2bcbd87a94c08fae249f6cc9c9fbc07aa49ef5f (diff)
parent639597d354c5b57145d6d53b079aeb4e2060d42b (diff)
Import man-db_2.9.1.orig.tar.xz
Diffstat (limited to 'gl/m4')
-rw-r--r--gl/m4/00gnulib.m481
-rw-r--r--gl/m4/__inline.m42
-rw-r--r--gl/m4/absolute-header.m42
-rw-r--r--gl/m4/alloca.m42
-rw-r--r--gl/m4/argp.m42
-rw-r--r--gl/m4/asm-underscore.m42
-rw-r--r--gl/m4/btowc.m42
-rw-r--r--gl/m4/builtin-expect.m42
-rw-r--r--gl/m4/canonicalize.m48
-rw-r--r--gl/m4/chdir-long.m42
-rw-r--r--gl/m4/chown.m423
-rw-r--r--gl/m4/clock_time.m42
-rw-r--r--gl/m4/close.m42
-rw-r--r--gl/m4/closedir.m42
-rw-r--r--gl/m4/codeset.m42
-rw-r--r--gl/m4/d-ino.m48
-rw-r--r--gl/m4/d-type.m42
-rw-r--r--gl/m4/dirent_h.m42
-rw-r--r--gl/m4/dirfd.m42
-rw-r--r--gl/m4/dirname.m42
-rw-r--r--gl/m4/double-slash-root.m42
-rw-r--r--gl/m4/dup.m42
-rw-r--r--gl/m4/dup2.m42
-rw-r--r--gl/m4/eealloc.m42
-rw-r--r--gl/m4/environ.m42
-rw-r--r--gl/m4/errno_h.m42
-rw-r--r--gl/m4/error.m42
-rw-r--r--gl/m4/exponentd.m42
-rw-r--r--gl/m4/extensions.m42
-rw-r--r--gl/m4/extern-inline.m44
-rw-r--r--gl/m4/fchdir.m48
-rw-r--r--gl/m4/fcntl-o.m42
-rw-r--r--gl/m4/fcntl.m42
-rw-r--r--gl/m4/fcntl_h.m46
-rw-r--r--gl/m4/fdopendir.m48
-rw-r--r--gl/m4/filenamecat.m42
-rw-r--r--gl/m4/flexmember.m42
-rw-r--r--gl/m4/float_h.m42
-rw-r--r--gl/m4/flock.m42
-rw-r--r--gl/m4/fnmatch.m42
-rw-r--r--gl/m4/fnmatch_h.m42
-rw-r--r--gl/m4/fstat.m42
-rw-r--r--gl/m4/fstatat.m42
-rw-r--r--gl/m4/futimens.m42
-rw-r--r--gl/m4/getcwd-abort-bug.m42
-rw-r--r--gl/m4/getcwd-path-max.m414
-rw-r--r--gl/m4/getcwd.m414
-rw-r--r--gl/m4/getdelim.m46
-rw-r--r--gl/m4/getdtablesize.m42
-rw-r--r--gl/m4/getline.m46
-rw-r--r--gl/m4/getlogin.m42
-rw-r--r--gl/m4/getlogin_r.m42
-rw-r--r--gl/m4/getopt.m410
-rw-r--r--gl/m4/getpagesize.m42
-rw-r--r--gl/m4/getprogname.m42
-rw-r--r--gl/m4/gettime.m42
-rw-r--r--gl/m4/gettimeofday.m48
-rw-r--r--gl/m4/glibc21.m42
-rw-r--r--gl/m4/glob.m448
-rw-r--r--gl/m4/glob_h.m42
-rw-r--r--gl/m4/gnulib-common.m461
-rw-r--r--gl/m4/gnulib-comp.m438
-rw-r--r--gl/m4/host-cpu-c-abi.m445
-rw-r--r--gl/m4/idpriv.m42
-rw-r--r--gl/m4/include_next.m42
-rw-r--r--gl/m4/intmax_t.m416
-rw-r--r--gl/m4/inttypes.m4159
-rw-r--r--gl/m4/inttypes_h.m42
-rw-r--r--gl/m4/ioctl.m42
-rw-r--r--gl/m4/langinfo_h.m42
-rw-r--r--gl/m4/largefile.m427
-rw-r--r--gl/m4/lchown.m42
-rw-r--r--gl/m4/lib-ignore.m42
-rw-r--r--gl/m4/lib-ld.m42
-rw-r--r--gl/m4/lib-link.m4154
-rw-r--r--gl/m4/lib-prefix.m4203
-rw-r--r--gl/m4/limits-h.m42
-rw-r--r--gl/m4/localcharset.m42
-rw-r--r--gl/m4/locale-fr.m42
-rw-r--r--gl/m4/locale-ja.m42
-rw-r--r--gl/m4/locale-zh.m42
-rw-r--r--gl/m4/locale_h.m4101
-rw-r--r--gl/m4/localeconv.m42
-rw-r--r--gl/m4/localtime-buffer.m42
-rw-r--r--gl/m4/lock.m42
-rw-r--r--gl/m4/longlong.m4113
-rw-r--r--gl/m4/lstat.m48
-rw-r--r--gl/m4/malloc.m412
-rw-r--r--gl/m4/malloca.m45
-rw-r--r--gl/m4/manywarnings.m42
-rw-r--r--gl/m4/math_h.m42
-rw-r--r--gl/m4/mbrtowc.m4219
-rw-r--r--gl/m4/mbsinit.m42
-rw-r--r--gl/m4/mbsrtowcs.m42
-rw-r--r--gl/m4/mbstate_t.m42
-rw-r--r--gl/m4/mbtowc.m42
-rw-r--r--gl/m4/memchr.m48
-rw-r--r--gl/m4/memmem.m48
-rw-r--r--gl/m4/mempcpy.m42
-rw-r--r--gl/m4/memrchr.m42
-rw-r--r--gl/m4/minmax.m42
-rw-r--r--gl/m4/mkdir.m412
-rw-r--r--gl/m4/mkdtemp.m42
-rw-r--r--gl/m4/mkstemp.m48
-rw-r--r--gl/m4/mmap-anon.m42
-rw-r--r--gl/m4/mode_t.m42
-rw-r--r--gl/m4/msvc-inval.m42
-rw-r--r--gl/m4/msvc-nothrow.m42
-rw-r--r--gl/m4/multiarch.m42
-rw-r--r--gl/m4/nanosleep.m48
-rw-r--r--gl/m4/nl_langinfo.m412
-rw-r--r--gl/m4/nocrash.m46
-rw-r--r--gl/m4/nonblocking.m42
-rw-r--r--gl/m4/off_t.m42
-rw-r--r--gl/m4/open-cloexec.m42
-rw-r--r--gl/m4/open-slash.m459
-rw-r--r--gl/m4/open.m443
-rw-r--r--gl/m4/openat.m42
-rw-r--r--gl/m4/opendir.m42
-rw-r--r--gl/m4/pathmax.m42
-rw-r--r--gl/m4/printf.m448
-rw-r--r--gl/m4/pthread_rwlock_rdlock.m430
-rw-r--r--gl/m4/raise.m42
-rw-r--r--gl/m4/rawmemchr.m42
-rw-r--r--gl/m4/readdir.m42
-rw-r--r--gl/m4/readlink.m48
-rw-r--r--gl/m4/realloc.m412
-rw-r--r--gl/m4/regex.m48
-rw-r--r--gl/m4/rename.m4107
-rw-r--r--gl/m4/renameat.m42
-rw-r--r--gl/m4/rewinddir.m42
-rw-r--r--gl/m4/rmdir.m48
-rw-r--r--gl/m4/same.m42
-rw-r--r--gl/m4/save-cwd.m42
-rw-r--r--gl/m4/select.m48
-rw-r--r--gl/m4/setenv.m412
-rw-r--r--gl/m4/setlocale_null.m498
-rw-r--r--gl/m4/sigaction.m42
-rw-r--r--gl/m4/signal_h.m46
-rw-r--r--gl/m4/signalblocking.m42
-rw-r--r--gl/m4/size_max.m42
-rw-r--r--gl/m4/sleep.m48
-rw-r--r--gl/m4/socketlib.m42
-rw-r--r--gl/m4/sockets.m42
-rw-r--r--gl/m4/socklen.m42
-rw-r--r--gl/m4/sockpfaf.m42
-rw-r--r--gl/m4/ssize_t.m42
-rw-r--r--gl/m4/stat-time.m42
-rw-r--r--gl/m4/stat.m48
-rw-r--r--gl/m4/std-gnu11.m42
-rw-r--r--gl/m4/stdalign.m42
-rw-r--r--gl/m4/stdarg.m42
-rw-r--r--gl/m4/stdbool.m424
-rw-r--r--gl/m4/stddef_h.m42
-rw-r--r--gl/m4/stdint.m425
-rw-r--r--gl/m4/stdint_h.m42
-rw-r--r--gl/m4/stdio_h.m46
-rw-r--r--gl/m4/stdlib_h.m46
-rw-r--r--gl/m4/strcase.m42
-rw-r--r--gl/m4/strcasestr.m48
-rw-r--r--gl/m4/strchrnul.m42
-rw-r--r--gl/m4/strdup.m42
-rw-r--r--gl/m4/strerror.m412
-rw-r--r--gl/m4/string_h.m47
-rw-r--r--gl/m4/strings_h.m42
-rw-r--r--gl/m4/strndup.m42
-rw-r--r--gl/m4/strnlen.m42
-rw-r--r--gl/m4/strsep.m42
-rw-r--r--gl/m4/sys_file_h.m42
-rw-r--r--gl/m4/sys_ioctl_h.m42
-rw-r--r--gl/m4/sys_select_h.m42
-rw-r--r--gl/m4/sys_socket_h.m46
-rw-r--r--gl/m4/sys_stat_h.m49
-rw-r--r--gl/m4/sys_time_h.m42
-rw-r--r--gl/m4/sys_types_h.m42
-rw-r--r--gl/m4/sys_uio_h.m42
-rw-r--r--gl/m4/sysexits.m42
-rw-r--r--gl/m4/tempname.m42
-rw-r--r--gl/m4/threadlib.m4522
-rw-r--r--gl/m4/time_h.m48
-rw-r--r--gl/m4/timespec.m42
-rw-r--r--gl/m4/unistd-safer.m42
-rw-r--r--gl/m4/unistd_h.m415
-rw-r--r--gl/m4/unlink.m412
-rw-r--r--gl/m4/unlinkat.m42
-rw-r--r--gl/m4/utime.m42
-rw-r--r--gl/m4/utime_h.m42
-rw-r--r--gl/m4/utimens.m48
-rw-r--r--gl/m4/utimes.m46
-rw-r--r--gl/m4/vasnprintf.m47
-rw-r--r--gl/m4/vasprintf.m42
-rw-r--r--gl/m4/visibility.m474
-rw-r--r--gl/m4/vsnprintf.m42
-rw-r--r--gl/m4/warn-on-use.m42
-rw-r--r--gl/m4/warnings.m42
-rw-r--r--gl/m4/wchar_h.m47
-rw-r--r--gl/m4/wchar_t.m42
-rw-r--r--gl/m4/wcrtomb.m437
-rw-r--r--gl/m4/wctype_h.m420
-rw-r--r--gl/m4/wint_t.m42
-rw-r--r--gl/m4/xalloc.m42
-rw-r--r--gl/m4/xgetcwd.m42
-rw-r--r--gl/m4/xsize.m42
-rw-r--r--gl/m4/xstrndup.m42
-rw-r--r--gl/m4/xvasprintf.m42
-rw-r--r--gl/m4/zzgnulib.m423
206 files changed, 2035 insertions, 1013 deletions
diff --git a/gl/m4/00gnulib.m4 b/gl/m4/00gnulib.m4
index e3e0fb6d..06eff4f3 100644
--- a/gl/m4/00gnulib.m4
+++ b/gl/m4/00gnulib.m4
@@ -1,13 +1,14 @@
-# 00gnulib.m4 serial 3
-dnl Copyright (C) 2009-2019 Free Software Foundation, Inc.
+# 00gnulib.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.
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,76 @@ 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.
+# It's not possible to AC_REQUIRE the extra tests from AC_CHECK_DECL,
+# because AC_CHECK_DECL, like other Autoconf built-ins, is not supposed
+# to AC_REQUIRE anything: some configure.ac files have their first
+# AC_CHECK_DECL executed conditionally. Therefore append the extra tests
+# to AC_PROG_CC.
+AC_DEFUN([gl_COMPILER_CLANG],
+[
+dnl AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([whether the compiler is clang],
+ [gl_cv_compiler_clang],
+ [dnl Use _AC_COMPILE_IFELSE instead of AC_EGREP_CPP, to avoid error
+ dnl "circular dependency of AC_LANG_COMPILER(C)" if AC_PROG_CC has
+ dnl not yet been invoked.
+ _AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #ifdef __clang__
+ barfbarf
+ #endif
+ ]],[[]])
+ ],
+ [gl_cv_compiler_clang=no],
+ [gl_cv_compiler_clang=yes])
+ ])
+])
+AC_DEFUN([gl_COMPILER_PREPARE_CHECK_DECL],
+[
+dnl AC_REQUIRE([AC_PROG_CC])
+dnl AC_REQUIRE([gl_COMPILER_CLANG])
+ AC_CACHE_CHECK([for compiler option needed when checking for declarations],
+ [gl_cv_compiler_check_decl_option],
+ [if test $gl_cv_compiler_clang = yes; then
+ dnl Test whether the compiler supports the option
+ dnl '-Werror=implicit-function-declaration'.
+ save_ac_compile="$ac_compile"
+ ac_compile="$ac_compile -Werror=implicit-function-declaration"
+ dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a
+ dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
+ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
+ [gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'],
+ [gl_cv_compiler_check_decl_option=none])
+ ac_compile="$save_ac_compile"
+ else
+ gl_cv_compiler_check_decl_option=none
+ fi
+ ])
+ if test "x$gl_cv_compiler_check_decl_option" != xnone; then
+ ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
+ else
+ ac_compile_for_check_decl="$ac_compile"
+ fi
+])
+dnl Redefine _AC_CHECK_DECL_BODY so that it references ac_compile_for_check_decl
+dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC
+dnl in zzgnulib.m4 is inactive, use the original ac_compile.
+m4_define([_AC_CHECK_DECL_BODY],
+[ ac_save_ac_compile="$ac_compile"
+ if test -n "$ac_compile_for_check_decl"; then
+ ac_compile="$ac_compile_for_check_decl"
+ fi]
+m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile"
+])
+
# gl_00GNULIB
# -----------
# Witness macro that this file has been included. Needed to force
diff --git a/gl/m4/__inline.m4 b/gl/m4/__inline.m4
index e1aa310c..520c8c4b 100644
--- a/gl/m4/__inline.m4
+++ b/gl/m4/__inline.m4
@@ -1,5 +1,5 @@
# Test for __inline keyword
-dnl Copyright 2017-2019 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/gl/m4/absolute-header.m4 b/gl/m4/absolute-header.m4
index a8f2cba1..39726ba5 100644
--- a/gl/m4/absolute-header.m4
+++ b/gl/m4/absolute-header.m4
@@ -1,5 +1,5 @@
# absolute-header.m4 serial 16
-dnl Copyright (C) 2006-2019 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/gl/m4/alloca.m4 b/gl/m4/alloca.m4
index 29bd289b..59225245 100644
--- a/gl/m4/alloca.m4
+++ b/gl/m4/alloca.m4
@@ -1,5 +1,5 @@
# alloca.m4 serial 15
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2019 Free Software Foundation,
+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,
diff --git a/gl/m4/argp.m4 b/gl/m4/argp.m4
index 8b2e2d85..bfe20240 100644
--- a/gl/m4/argp.m4
+++ b/gl/m4/argp.m4
@@ -1,5 +1,5 @@
# argp.m4 serial 15
-dnl Copyright (C) 2003-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-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/gl/m4/asm-underscore.m4 b/gl/m4/asm-underscore.m4
index 0f6bee4a..09be5eef 100644
--- a/gl/m4/asm-underscore.m4
+++ b/gl/m4/asm-underscore.m4
@@ -1,5 +1,5 @@
# asm-underscore.m4 serial 4
-dnl Copyright (C) 2010-2019 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/gl/m4/btowc.m4 b/gl/m4/btowc.m4
index 85c2cbf6..c28ccb24 100644
--- a/gl/m4/btowc.m4
+++ b/gl/m4/btowc.m4
@@ -1,5 +1,5 @@
# btowc.m4 serial 11
-dnl Copyright (C) 2008-2019 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/gl/m4/builtin-expect.m4 b/gl/m4/builtin-expect.m4
index b65fbf87..a6e88950 100644
--- a/gl/m4/builtin-expect.m4
+++ b/gl/m4/builtin-expect.m4
@@ -1,6 +1,6 @@
dnl Check for __builtin_expect.
-dnl Copyright 2016-2019 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/gl/m4/canonicalize.m4 b/gl/m4/canonicalize.m4
index b61747bd..bdc5c8f7 100644
--- a/gl/m4/canonicalize.m4
+++ b/gl/m4/canonicalize.m4
@@ -1,6 +1,6 @@
-# canonicalize.m4 serial 30
+# canonicalize.m4 serial 31
-dnl Copyright (C) 2003-2007, 2009-2019 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,
@@ -117,8 +117,8 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
*-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/gl/m4/chdir-long.m4 b/gl/m4/chdir-long.m4
index 64b5ef94..a528a5d6 100644
--- a/gl/m4/chdir-long.m4
+++ b/gl/m4/chdir-long.m4
@@ -6,7 +6,7 @@
# never fails with ENAMETOOLONG.
# Arrange to compile chdir-long.c only on systems that define PATH_MAX.
-dnl Copyright (C) 2004-2007, 2009-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-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/gl/m4/chown.m4 b/gl/m4/chown.m4
index b7983250..3638187a 100644
--- a/gl/m4/chown.m4
+++ b/gl/m4/chown.m4
@@ -1,7 +1,7 @@
-# serial 32
+# serial 34
# Determine whether we need the chown wrapper.
-dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009-2019 Free Software
+dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009-2020 Free Software
dnl Foundation, Inc.
dnl This file is free software; the Free Software Foundation
@@ -52,8 +52,8 @@ AC_DEFUN([AC_FUNC_CHOWN],
*-gnu* | gnu*) ac_cv_func_chown_works="guessing yes" ;;
# Guess no on native Windows.
mingw*) ac_cv_func_chown_works="guessing no" ;;
- # If we don't know, assume the worst.
- *) ac_cv_func_chown_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_chown_works="$gl_cross_guess_normal" ;;
esac
])
rm -f conftest.chown
@@ -80,9 +80,10 @@ AC_DEFUN_ONCE([gl_FUNC_CHOWN],
HAVE_CHOWN=0
else
dnl Some old systems treated chown like lchown.
- if test $gl_cv_func_chown_follows_symlink = no; then
- REPLACE_CHOWN=1
- fi
+ case "$gl_cv_func_chown_follows_symlink" in
+ *yes) ;;
+ *) REPLACE_CHOWN=1 ;;
+ esac
dnl Some old systems tried to use uid/gid -1 literally.
case "$ac_cv_func_chown_works" in
@@ -113,8 +114,8 @@ AC_DEFUN_ONCE([gl_FUNC_CHOWN],
*-gnu*) gl_cv_func_chown_slash_works="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_chown_slash_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_chown_slash_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_chown_slash_works="$gl_cross_guess_normal" ;;
esac
])
rm -f conftest.link conftest.file])
@@ -151,8 +152,8 @@ AC_DEFUN_ONCE([gl_FUNC_CHOWN],
*-gnu*) gl_cv_func_chown_ctime_works="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_chown_ctime_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_chown_ctime_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_chown_ctime_works="$gl_cross_guess_normal" ;;
esac
])
rm -f conftest.file])
diff --git a/gl/m4/clock_time.m4 b/gl/m4/clock_time.m4
index 8f7a7fcd..f4f51fa0 100644
--- a/gl/m4/clock_time.m4
+++ b/gl/m4/clock_time.m4
@@ -1,5 +1,5 @@
# clock_time.m4 serial 10
-dnl Copyright (C) 2002-2006, 2009-2019 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/gl/m4/close.m4 b/gl/m4/close.m4
index 7013a130..378ec4cb 100644
--- a/gl/m4/close.m4
+++ b/gl/m4/close.m4
@@ -1,5 +1,5 @@
# close.m4 serial 9
-dnl Copyright (C) 2008-2019 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/gl/m4/closedir.m4 b/gl/m4/closedir.m4
index 37dc5414..66f6d4eb 100644
--- a/gl/m4/closedir.m4
+++ b/gl/m4/closedir.m4
@@ -1,5 +1,5 @@
# closedir.m4 serial 6
-dnl Copyright (C) 2011-2019 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/gl/m4/codeset.m4 b/gl/m4/codeset.m4
index 280f556f..9b019cff 100644
--- a/gl/m4/codeset.m4
+++ b/gl/m4/codeset.m4
@@ -1,5 +1,5 @@
# codeset.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019 Free Software
+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,
diff --git a/gl/m4/d-ino.m4 b/gl/m4/d-ino.m4
index 87dcacc8..64ce9cec 100644
--- a/gl/m4/d-ino.m4
+++ b/gl/m4/d-ino.m4
@@ -1,11 +1,11 @@
-# serial 19
+# serial 20
dnl From Jim Meyering.
dnl
dnl Check whether struct dirent has a member named d_ino.
dnl
-# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2019 Free Software
+# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2020 Free Software
# Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -46,8 +46,8 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
- # If we don't know, assume the worst.
- *) gl_cv_struct_dirent_d_ino="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;;
esac
])])
case "$gl_cv_struct_dirent_d_ino" in
diff --git a/gl/m4/d-type.m4 b/gl/m4/d-type.m4
index 4ca56d61..d40220a1 100644
--- a/gl/m4/d-type.m4
+++ b/gl/m4/d-type.m4
@@ -5,7 +5,7 @@ dnl
dnl Check whether struct dirent has a member named d_type.
dnl
-# Copyright (C) 1997, 1999-2004, 2006, 2009-2019 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999-2004, 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/gl/m4/dirent_h.m4 b/gl/m4/dirent_h.m4
index 732aa554..8bef6a0c 100644
--- a/gl/m4/dirent_h.m4
+++ b/gl/m4/dirent_h.m4
@@ -1,5 +1,5 @@
# dirent_h.m4 serial 16
-dnl Copyright (C) 2008-2019 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/gl/m4/dirfd.m4 b/gl/m4/dirfd.m4
index 5c758699..d92445e6 100644
--- a/gl/m4/dirfd.m4
+++ b/gl/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-2019 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/gl/m4/dirname.m4 b/gl/m4/dirname.m4
index 32141ae6..9995ff3c 100644
--- a/gl/m4/dirname.m4
+++ b/gl/m4/dirname.m4
@@ -1,5 +1,5 @@
#serial 10 -*- autoconf -*-
-dnl Copyright (C) 2002-2006, 2009-2019 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/gl/m4/double-slash-root.m4 b/gl/m4/double-slash-root.m4
index 0c5afb17..c463ac41 100644
--- a/gl/m4/double-slash-root.m4
+++ b/gl/m4/double-slash-root.m4
@@ -1,5 +1,5 @@
# double-slash-root.m4 serial 4 -*- Autoconf -*-
-dnl Copyright (C) 2006, 2008-2019 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/gl/m4/dup.m4 b/gl/m4/dup.m4
index 005f1ea7..1bf02347 100644
--- a/gl/m4/dup.m4
+++ b/gl/m4/dup.m4
@@ -1,5 +1,5 @@
# dup.m4 serial 6
-dnl Copyright (C) 2011-2019 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/gl/m4/dup2.m4 b/gl/m4/dup2.m4
index b314247d..21b1ecc2 100644
--- a/gl/m4/dup2.m4
+++ b/gl/m4/dup2.m4
@@ -1,5 +1,5 @@
#serial 25
-dnl Copyright (C) 2002, 2005, 2007, 2009-2019 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/gl/m4/eealloc.m4 b/gl/m4/eealloc.m4
index 2a4b120a..236f373c 100644
--- a/gl/m4/eealloc.m4
+++ b/gl/m4/eealloc.m4
@@ -1,5 +1,5 @@
# eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2019 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/gl/m4/environ.m4 b/gl/m4/environ.m4
index c1a6fa37..bab85f13 100644
--- a/gl/m4/environ.m4
+++ b/gl/m4/environ.m4
@@ -1,5 +1,5 @@
# environ.m4 serial 7
-dnl Copyright (C) 2001-2004, 2006-2019 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/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4
index 2388854e..dd4994f3 100644
--- a/gl/m4/errno_h.m4
+++ b/gl/m4/errno_h.m4
@@ -1,5 +1,5 @@
# errno_h.m4 serial 13
-dnl Copyright (C) 2004, 2006, 2008-2019 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/gl/m4/error.m4 b/gl/m4/error.m4
index 393adb54..60c229d5 100644
--- a/gl/m4/error.m4
+++ b/gl/m4/error.m4
@@ -1,6 +1,6 @@
#serial 14
-# Copyright (C) 1996-1998, 2001-2004, 2009-2019 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/gl/m4/exponentd.m4 b/gl/m4/exponentd.m4
index 90870dfa..cca87978 100644
--- a/gl/m4/exponentd.m4
+++ b/gl/m4/exponentd.m4
@@ -1,5 +1,5 @@
# exponentd.m4 serial 3
-dnl Copyright (C) 2007-2008, 2010-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-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/gl/m4/extensions.m4 b/gl/m4/extensions.m4
index fd1ce817..d7c95eff 100644
--- a/gl/m4/extensions.m4
+++ b/gl/m4/extensions.m4
@@ -1,7 +1,7 @@
# serial 18 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2019 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/gl/m4/extern-inline.m4 b/gl/m4/extern-inline.m4
index ec9f2218..75c50087 100644
--- a/gl/m4/extern-inline.m4
+++ b/gl/m4/extern-inline.m4
@@ -1,6 +1,6 @@
dnl 'extern inline' a la ISO C99.
-dnl Copyright 2012-2019 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/gl/m4/fchdir.m4 b/gl/m4/fchdir.m4
index ea5a4f91..dc2ba251 100644
--- a/gl/m4/fchdir.m4
+++ b/gl/m4/fchdir.m4
@@ -1,5 +1,5 @@
-# fchdir.m4 serial 24
-dnl Copyright (C) 2006-2019 Free Software Foundation, Inc.
+# fchdir.m4 serial 25
+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.
@@ -37,8 +37,8 @@ AC_DEFUN([gl_FUNC_FCHDIR],
*-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_open_directory_works="guessing no" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_open_directory_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;;
esac
])])
case "$gl_cv_func_open_directory_works" in
diff --git a/gl/m4/fcntl-o.m4 b/gl/m4/fcntl-o.m4
index 6ab3387d..747b8657 100644
--- a/gl/m4/fcntl-o.m4
+++ b/gl/m4/fcntl-o.m4
@@ -1,5 +1,5 @@
# fcntl-o.m4 serial 6
-dnl Copyright (C) 2006, 2009-2019 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/gl/m4/fcntl.m4 b/gl/m4/fcntl.m4
index e409e96b..562ae239 100644
--- a/gl/m4/fcntl.m4
+++ b/gl/m4/fcntl.m4
@@ -1,5 +1,5 @@
# fcntl.m4 serial 9
-dnl Copyright (C) 2009-2019 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/gl/m4/fcntl_h.m4 b/gl/m4/fcntl_h.m4
index a86fdae5..6b253937 100644
--- a/gl/m4/fcntl_h.m4
+++ b/gl/m4/fcntl_h.m4
@@ -1,6 +1,6 @@
-# serial 15
+# serial 16
# Configure fcntl.h.
-dnl Copyright (C) 2006-2007, 2009-2019 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/gl/m4/fdopendir.m4 b/gl/m4/fdopendir.m4
index b2b3b037..d9cc1a00 100644
--- a/gl/m4/fdopendir.m4
+++ b/gl/m4/fdopendir.m4
@@ -1,7 +1,7 @@
-# serial 11
+# serial 12
# See if we need to provide fdopendir.
-dnl Copyright (C) 2009-2019 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.
@@ -49,8 +49,8 @@ DIR *fdopendir (int);
*-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_fdopendir_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_fdopendir_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
esac
])])
case "$gl_cv_func_fdopendir_works" in
diff --git a/gl/m4/filenamecat.m4 b/gl/m4/filenamecat.m4
index 351715a7..7eff5b96 100644
--- a/gl/m4/filenamecat.m4
+++ b/gl/m4/filenamecat.m4
@@ -1,5 +1,5 @@
# filenamecat.m4 serial 11
-dnl Copyright (C) 2002-2006, 2009-2019 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/gl/m4/flexmember.m4 b/gl/m4/flexmember.m4
index c245ab02..90f3dddc 100644
--- a/gl/m4/flexmember.m4
+++ b/gl/m4/flexmember.m4
@@ -1,7 +1,7 @@
# serial 5
# Check for flexible array member support.
-# Copyright (C) 2006, 2009-2019 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.
diff --git a/gl/m4/float_h.m4 b/gl/m4/float_h.m4
index 1cd28a0b..3ef0bb7b 100644
--- a/gl/m4/float_h.m4
+++ b/gl/m4/float_h.m4
@@ -1,5 +1,5 @@
# float_h.m4 serial 12
-dnl Copyright (C) 2007, 2009-2019 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/gl/m4/flock.m4 b/gl/m4/flock.m4
index 7197afac..bb487339 100644
--- a/gl/m4/flock.m4
+++ b/gl/m4/flock.m4
@@ -1,5 +1,5 @@
# flock.m4 serial 3
-dnl Copyright (C) 2008-2019 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/gl/m4/fnmatch.m4 b/gl/m4/fnmatch.m4
index 75ba55b4..0f41f8c7 100644
--- a/gl/m4/fnmatch.m4
+++ b/gl/m4/fnmatch.m4
@@ -1,6 +1,6 @@
# Check for fnmatch - serial 14. -*- coding: utf-8 -*-
-# Copyright (C) 2000-2007, 2009-2019 Free Software Foundation, Inc.
+# Copyright (C) 2000-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/gl/m4/fnmatch_h.m4 b/gl/m4/fnmatch_h.m4
index fba6f868..a21ec2c5 100644
--- a/gl/m4/fnmatch_h.m4
+++ b/gl/m4/fnmatch_h.m4
@@ -1,5 +1,5 @@
# fnmatch_h.m4 serial 4
-dnl Copyright (C) 2009-2019 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/gl/m4/fstat.m4 b/gl/m4/fstat.m4
index 2a59c8ff..53c08961 100644
--- a/gl/m4/fstat.m4
+++ b/gl/m4/fstat.m4
@@ -1,5 +1,5 @@
# fstat.m4 serial 6
-dnl Copyright (C) 2011-2019 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/gl/m4/fstatat.m4 b/gl/m4/fstatat.m4
index 489a55a3..19583ed1 100644
--- a/gl/m4/fstatat.m4
+++ b/gl/m4/fstatat.m4
@@ -1,5 +1,5 @@
# fstatat.m4 serial 4
-dnl Copyright (C) 2004-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 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/gl/m4/futimens.m4 b/gl/m4/futimens.m4
index b5f4be93..dc5cfa94 100644
--- a/gl/m4/futimens.m4
+++ b/gl/m4/futimens.m4
@@ -1,7 +1,7 @@
# serial 8
# See if we need to provide futimens replacement.
-dnl Copyright (C) 2009-2019 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/gl/m4/getcwd-abort-bug.m4 b/gl/m4/getcwd-abort-bug.m4
index 7227f08c..2715f0af 100644
--- a/gl/m4/getcwd-abort-bug.m4
+++ b/gl/m4/getcwd-abort-bug.m4
@@ -3,7 +3,7 @@
# name is unusually large. Any length between 4k and 16k trigger the bug
# when using glibc-2.4.90-9 or older.
-# Copyright (C) 2006, 2009-2019 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.
diff --git a/gl/m4/getcwd-path-max.m4 b/gl/m4/getcwd-path-max.m4
index 0ae3e1e8..1ff3f251 100644
--- a/gl/m4/getcwd-path-max.m4
+++ b/gl/m4/getcwd-path-max.m4
@@ -1,4 +1,4 @@
-# serial 22
+# serial 23
# Check for several getcwd bugs with long file names.
# If so, arrange to compile the wrapper function.
@@ -6,7 +6,7 @@
# I've heard that this is due to a Linux kernel bug, and that it has
# been fixed between 2.4.21-pre3 and 2.4.21-pre4.
-# Copyright (C) 2003-2007, 2009-2019 Free Software Foundation, Inc.
+# Copyright (C) 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.
@@ -220,17 +220,17 @@ main ()
[# Cross-compilation guesses:
case "$host_os" in
aix*) # On AIX, it has the AIX bug.
- gl_cv_func_getcwd_path_max='no, it has the AIX bug' ;;
+ gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;;
gnu*) # On Hurd, it is 'yes'.
- gl_cv_func_getcwd_path_max=yes ;;
+ gl_cv_func_getcwd_path_max='guessing yes' ;;
linux* | kfreebsd*)
# On older Linux+glibc it's 'no, but it is partly working',
# on newer Linux+glibc it's 'yes'.
# On Linux+musl libc, it's 'no, but it is partly working'.
# On kFreeBSD+glibc, it's 'no, but it is partly working'.
- gl_cv_func_getcwd_path_max='no, but it is partly working' ;;
- *) # If we don't know, assume the worst.
- gl_cv_func_getcwd_path_max=no ;;
+ gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;;
+ *) # If we don't know, obey --enable-cross-guesses.
+ gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/gl/m4/getcwd.m4 b/gl/m4/getcwd.m4
index 625171a2..ba68c5fb 100644
--- a/gl/m4/getcwd.m4
+++ b/gl/m4/getcwd.m4
@@ -1,12 +1,12 @@
# getcwd.m4 - check for working getcwd that is compatible with glibc
-# Copyright (C) 2001, 2003-2007, 2009-2019 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 17
+# serial 18
AC_DEFUN([gl_FUNC_GETCWD_NULL],
[
@@ -54,8 +54,8 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
*-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
]])])
])
@@ -127,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
@@ -135,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/gl/m4/getdelim.m4 b/gl/m4/getdelim.m4
index e77c3796..9f4c7f6e 100644
--- a/gl/m4/getdelim.m4
+++ b/gl/m4/getdelim.m4
@@ -1,6 +1,6 @@
-# getdelim.m4 serial 13
+# getdelim.m4 serial 14
-dnl Copyright (C) 2005-2007, 2009-2019 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,
@@ -72,7 +72,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
[gl_cv_func_working_getdelim="guessing yes"],
[case "$host_os" in
*-musl*) gl_cv_func_working_getdelim="guessing yes" ;;
- *) gl_cv_func_working_getdelim="guessing no" ;;
+ *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/gl/m4/getdtablesize.m4 b/gl/m4/getdtablesize.m4
index 96aa241b..ab2e3feb 100644
--- a/gl/m4/getdtablesize.m4
+++ b/gl/m4/getdtablesize.m4
@@ -1,5 +1,5 @@
# getdtablesize.m4 serial 7
-dnl Copyright (C) 2008-2019 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/gl/m4/getline.m4 b/gl/m4/getline.m4
index 32f771c1..0609f1d3 100644
--- a/gl/m4/getline.m4
+++ b/gl/m4/getline.m4
@@ -1,6 +1,6 @@
-# getline.m4 serial 29
+# getline.m4 serial 30
-dnl Copyright (C) 1998-2003, 2005-2007, 2009-2019 Free Software Foundation,
+dnl Copyright (C) 1998-2003, 2005-2007, 2009-2020 Free Software Foundation,
dnl Inc.
dnl
dnl This file is free software; the Free Software Foundation
@@ -80,7 +80,7 @@ AC_DEFUN([gl_FUNC_GETLINE],
[am_cv_func_working_getline="guessing yes"],
[case "$host_os" in
*-musl*) am_cv_func_working_getline="guessing yes" ;;
- *) am_cv_func_working_getline="guessing no" ;;
+ *) am_cv_func_working_getline="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/gl/m4/getlogin.m4 b/gl/m4/getlogin.m4
index c13d2e0b..a0678d00 100644
--- a/gl/m4/getlogin.m4
+++ b/gl/m4/getlogin.m4
@@ -1,5 +1,5 @@
# getlogin.m4 serial 5
-dnl Copyright (C) 2010-2019 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/gl/m4/getlogin_r.m4 b/gl/m4/getlogin_r.m4
index aff7086e..3ec76925 100644
--- a/gl/m4/getlogin_r.m4
+++ b/gl/m4/getlogin_r.m4
@@ -1,6 +1,6 @@
#serial 12
-# Copyright (C) 2005-2007, 2009-2019 Free Software Foundation, Inc.
+# Copyright (C) 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,
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
index 5991bf83..595483d5 100644
--- a/gl/m4/getopt.m4
+++ b/gl/m4/getopt.m4
@@ -1,5 +1,5 @@
-# getopt.m4 serial 46
-dnl Copyright (C) 2002-2006, 2008-2019 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/gl/m4/getpagesize.m4 b/gl/m4/getpagesize.m4
index 546c3ad1..8f0f0468 100644
--- a/gl/m4/getpagesize.m4
+++ b/gl/m4/getpagesize.m4
@@ -1,5 +1,5 @@
# getpagesize.m4 serial 10
-dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2019 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/gl/m4/getprogname.m4 b/gl/m4/getprogname.m4
index 4a96d066..6baefc91 100644
--- a/gl/m4/getprogname.m4
+++ b/gl/m4/getprogname.m4
@@ -1,6 +1,6 @@
# getprogname.m4 - check for getprogname or replacements for it
-# Copyright (C) 2016-2019 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/gl/m4/gettime.m4 b/gl/m4/gettime.m4
index 60d8ea18..e65455a2 100644
--- a/gl/m4/gettime.m4
+++ b/gl/m4/gettime.m4
@@ -1,5 +1,5 @@
# gettime.m4 serial 9
-dnl Copyright (C) 2002, 2004-2006, 2009-2019 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/gl/m4/gettimeofday.m4 b/gl/m4/gettimeofday.m4
index 5e2ef6f4..c72b3eac 100644
--- a/gl/m4/gettimeofday.m4
+++ b/gl/m4/gettimeofday.m4
@@ -1,6 +1,6 @@
-# serial 26
+# serial 27
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2019 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.
@@ -109,8 +109,8 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
*-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/gl/m4/glibc21.m4 b/gl/m4/glibc21.m4
index 0ab0f235..ece484b5 100644
--- a/gl/m4/glibc21.m4
+++ b/gl/m4/glibc21.m4
@@ -1,5 +1,5 @@
# glibc21.m4 serial 5
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2019 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/gl/m4/glob.m4 b/gl/m4/glob.m4
index 00b42972..dbd09e8f 100644
--- a/gl/m4/glob.m4
+++ b/gl/m4/glob.m4
@@ -1,5 +1,5 @@
-# glob.m4 serial 22
-dnl Copyright (C) 2005-2007, 2009-2019 Free Software Foundation, Inc.
+# glob.m4 serial 23
+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.
@@ -31,27 +31,33 @@ char a[_GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 ? 1
if test $REPLACE_GLOB = 0; then
AC_CACHE_CHECK([whether glob lists broken symlinks],
[gl_cv_glob_lists_symlinks],
- [if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
- gl_cv_glob_lists_symlinks=maybe
+ [if test $cross_compiling != yes; then
+ if ln -s conf-doesntexist conf$$-globtest 2>/dev/null; then
+ gl_cv_glob_lists_symlinks=maybe
+ else
+ # If we can't make a symlink, then we cannot test this issue. Be
+ # pessimistic about this.
+ gl_cv_glob_lists_symlinks=no
+ fi
+ if test $gl_cv_glob_lists_symlinks = maybe; then
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ #include <glob.h>]],
+ [[glob_t found;
+ if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH)
+ return 1;
+ ]])],
+ [gl_cv_glob_lists_symlinks=yes],
+ [gl_cv_glob_lists_symlinks=no],
+ [dnl We don't get here.
+ :
+ ])
+ fi
+ rm -f conf$$-globtest
else
- # If we can't make a symlink, then we cannot test this issue. Be
- # pessimistic about this.
- gl_cv_glob_lists_symlinks=no
+ gl_cv_glob_lists_symlinks="$gl_cross_guess_normal"
fi
- if test $gl_cv_glob_lists_symlinks = maybe; then
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <stddef.h>
- #include <glob.h>]],
- [[glob_t found;
- if (glob ("conf*-globtest", 0, NULL, &found) == GLOB_NOMATCH)
- return 1;
- ]])],
- [gl_cv_glob_lists_symlinks=yes],
- [gl_cv_glob_lists_symlinks=no],
- [gl_cv_glob_lists_symlinks="guessing no"])
- fi
- rm -f conf$$-globtest
])
case "$gl_cv_glob_lists_symlinks" in
*yes) ;;
diff --git a/gl/m4/glob_h.m4 b/gl/m4/glob_h.m4
index 9cc29d0c..7ecc0fdc 100644
--- a/gl/m4/glob_h.m4
+++ b/gl/m4/glob_h.m4
@@ -1,5 +1,5 @@
# glob_h.m4 serial 5
-dnl Copyright (C) 2018-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2018-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/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index 57b94ed5..b4795c18 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 44
-dnl Copyright (C) 2007-2019 Free Software Foundation, Inc.
+# gnulib-common.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.
@@ -12,6 +12,7 @@ AC_DEFUN([gl_COMMON], [
dnl Use AC_REQUIRE here, so that the code is expanded once only.
AC_REQUIRE([gl_00GNULIB])
AC_REQUIRE([gl_COMMON_BODY])
+ AC_REQUIRE([gl_ZZGNULIB])
])
AC_DEFUN([gl_COMMON_BODY], [
AH_VERBATIM([_Noreturn],
@@ -19,11 +20,21 @@ AC_DEFUN([gl_COMMON_BODY], [
#ifndef _Noreturn
# if (defined __cplusplus \
&& ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
- || (defined _MSC_VER && 1900 <= _MSC_VER)))
+ || (defined _MSC_VER && 1900 <= _MSC_VER)) \
+ && 0)
+ /* [[noreturn]] is not practically usable, because with it the syntax
+ extern _Noreturn void func (...);
+ would not be valid; such a declaration would only be valid with 'extern'
+ and '_Noreturn' swapped, or without the 'extern' keyword. However, some
+ AIX system header files and several gnulib header files use precisely
+ this syntax with 'extern'. */
# define _Noreturn [[noreturn]]
# elif ((!defined __cplusplus || defined __clang__) \
&& (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
- || 4 < __GNUC__ + (7 <= __GNUC_MINOR__)))
+ || 4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
+ || (defined __apple_build_version__ \
+ ? 6000000 <= __apple_build_version__ \
+ : 3 < __clang_major__ + (5 <= __clang_minor__))))
/* _Noreturn works as-is. */
# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
# define _Noreturn __attribute__ ((__noreturn__))
@@ -94,7 +105,7 @@ AC_DEFUN([gl_COMMON_BODY], [
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
- <http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04>
+ <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
@@ -115,6 +126,33 @@ AC_DEFUN([gl_COMMON_BODY], [
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
@@ -381,12 +419,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/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 0ea5c84c..39025961 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2019 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
@@ -126,6 +126,7 @@ AC_DEFUN([gl_EARLY],
# Code from module idpriv-droptemp:
# Code from module include_next:
# Code from module intprops:
+ # Code from module inttypes-incomplete:
# Code from module ioctl:
# Code from module langinfo:
# Code from module largefile:
@@ -193,6 +194,7 @@ AC_DEFUN([gl_EARLY],
# Code from module select:
# Code from module set:
# Code from module setenv:
+ # Code from module setlocale-null:
# Code from module sigaction:
# Code from module signal:
# Code from module signal-h:
@@ -306,7 +308,6 @@ AC_SUBST([LTALLOCA])
m4_ifdef([AM_XGETTEXT_OPTION],
[AM_][XGETTEXT_OPTION([--flag=argp_error:2:c-format])
AM_][XGETTEXT_OPTION([--flag=argp_failure:4:c-format])])
- AC_LIBOBJ([openat-proc])
gl_FUNC_BTOWC
if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
AC_LIBOBJ([btowc])
@@ -502,6 +503,7 @@ AC_SUBST([LTALLOCA])
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])
@@ -523,8 +525,12 @@ AC_SUBST([LTALLOCA])
fi
gl_GLOB_MODULE_INDICATOR([glob])
gl_GLOB_H
+ AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
+ LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
+ AC_SUBST([LIB_HARD_LOCALE])
gl_IDPRIV
gl_IDPRIV
+ gl_INTTYPES_INCOMPLETE
gl_FUNC_IOCTL
if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then
AC_LIBOBJ([ioctl])
@@ -575,6 +581,11 @@ AC_SUBST([LTALLOCA])
gl_FUNC_MBRTOWC
if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
AC_LIBOBJ([mbrtowc])
+ if test $REPLACE_MBSTATE_T = 1; then
+ AC_LIBOBJ([lc-charset-dispatch])
+ AC_LIBOBJ([mbtowc-lock])
+ gl_PREREQ_MBTOWC_LOCK
+ fi
gl_PREREQ_MBRTOWC
fi
gl_WCHAR_MODULE_INDICATOR([mbrtowc])
@@ -766,6 +777,12 @@ AC_SUBST([LTALLOCA])
AC_LIBOBJ([setenv])
fi
gl_STDLIB_MODULE_INDICATOR([setenv])
+ gl_FUNC_SETLOCALE_NULL
+ if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+ AC_LIBOBJ([setlocale-lock])
+ gl_PREREQ_SETLOCALE_LOCK
+ fi
+ gl_LOCALE_MODULE_INDICATOR([setlocale_null])
gl_SIGACTION
if test $HAVE_SIGACTION = 0; then
AC_LIBOBJ([sigaction])
@@ -920,6 +937,7 @@ AC_SUBST([LTALLOCA])
gl_UTIME_MODULE_INDICATOR([utime])
gl_UTIME_H
gl_UTIMENS
+ AC_REQUIRE([AC_C_RESTRICT])
gl_FUNC_VASNPRINTF
gl_FUNC_VASPRINTF
gl_STDIO_MODULE_INDICATOR([vasprintf])
@@ -1262,9 +1280,12 @@ AC_DEFUN([gl_FILE_LIST], [
lib/idpriv-droptemp.c
lib/idpriv.h
lib/intprops.h
+ lib/inttypes.in.h
lib/ioctl.c
lib/itold.c
lib/langinfo.in.h
+ lib/lc-charset-dispatch.c
+ lib/lc-charset-dispatch.h
lib/lchown.c
lib/libc-config.h
lib/limits.in.h
@@ -1282,12 +1303,16 @@ AC_DEFUN([gl_FILE_LIST], [
lib/malloc/scratch_buffer_set_array_size.c
lib/malloca.c
lib/malloca.h
+ lib/mbrtowc-impl-utf8.h
+ lib/mbrtowc-impl.h
lib/mbrtowc.c
lib/mbsinit.c
lib/mbsrtowcs-impl.h
lib/mbsrtowcs-state.c
lib/mbsrtowcs.c
lib/mbtowc-impl.h
+ lib/mbtowc-lock.c
+ lib/mbtowc-lock.h
lib/mbtowc.c
lib/memchr.c
lib/memchr.valgrind
@@ -1347,6 +1372,9 @@ AC_DEFUN([gl_FILE_LIST], [
lib/scratch_buffer.h
lib/select.c
lib/setenv.c
+ lib/setlocale-lock.c
+ lib/setlocale_null.c
+ lib/setlocale_null.h
lib/sig-handler.c
lib/sig-handler.h
lib/sigaction.c
@@ -1518,6 +1546,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/idpriv.m4
m4/include_next.m4
m4/intmax_t.m4
+ m4/inttypes.m4
m4/inttypes_h.m4
m4/ioctl.m4
m4/langinfo_h.m4
@@ -1536,7 +1565,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/localeconv.m4
m4/localtime-buffer.m4
m4/lock.m4
- m4/longlong.m4
m4/lstat.m4
m4/malloc.m4
m4/malloca.m4
@@ -1567,6 +1595,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/nonblocking.m4
m4/off_t.m4
m4/open-cloexec.m4
+ m4/open-slash.m4
m4/open.m4
m4/openat.m4
m4/opendir.m4
@@ -1587,6 +1616,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/save-cwd.m4
m4/select.m4
m4/setenv.m4
+ m4/setlocale_null.m4
m4/sigaction.m4
m4/signal_h.m4
m4/signalblocking.m4
@@ -1641,6 +1671,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/utimes.m4
m4/vasnprintf.m4
m4/vasprintf.m4
+ m4/visibility.m4
m4/vsnprintf.m4
m4/warn-on-use.m4
m4/warnings.m4
@@ -1654,4 +1685,5 @@ AC_DEFUN([gl_FILE_LIST], [
m4/xsize.m4
m4/xstrndup.m4
m4/xvasprintf.m4
+ m4/zzgnulib.m4
])
diff --git a/gl/m4/host-cpu-c-abi.m4 b/gl/m4/host-cpu-c-abi.m4
index 4407296d..6db2aa25 100644
--- a/gl/m4/host-cpu-c-abi.m4
+++ b/gl/m4/host-cpu-c-abi.m4
@@ -1,5 +1,5 @@
-# host-cpu-c-abi.m4 serial 11
-dnl Copyright (C) 2002-2019 Free Software Foundation, Inc.
+# host-cpu-c-abi.m4 serial 13
+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.
@@ -55,7 +55,7 @@ AC_DEFUN([gl_HOST_CPU_C_ABI],
[case "$host_cpu" in
changequote(,)dnl
- i[4567]86 )
+ i[34567]86 )
changequote([,])dnl
gl_cv_host_cpu_c_abi=i386
;;
@@ -457,7 +457,8 @@ EOF
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 (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
+dnl one, or to 'unknown' if unknown.
dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
[
@@ -467,14 +468,44 @@ AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
case "$gl_cv_host_cpu_c_abi" in
i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
gl_cv_host_cpu_c_abi_32bit=yes ;;
- *)
+ x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
gl_cv_host_cpu_c_abi_32bit=no ;;
+ *)
+ gl_cv_host_cpu_c_abi_32bit=unknown ;;
esac
else
case "$host_cpu" in
+ # CPUs that only support a 32-bit ABI.
+ arc \
+ | bfin \
+ | cris* \
+ | csky \
+ | epiphany \
+ | ft32 \
+ | h8300 \
+ | m68k \
+ | microblaze | microblazeel \
+ | nds32 | nds32le | nds32be \
+ | nios2 | nios2eb | nios2el \
+ | or1k* \
+ | or32 \
+ | sh | sh[1234] | sh[1234]e[lb] \
+ | tic6x \
+ | xtensa* )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ # CPUs that only support a 64-bit ABI.
changequote(,)dnl
- i[4567]86 )
+ alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+ | mmix )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi_32bit=no
+ ;;
+
+changequote(,)dnl
+ i[34567]86 )
changequote([,])dnl
gl_cv_host_cpu_c_abi_32bit=yes
;;
@@ -634,7 +665,7 @@ changequote([,])dnl
;;
*)
- gl_cv_host_cpu_c_abi_32bit=no
+ gl_cv_host_cpu_c_abi_32bit=unknown
;;
esac
fi
diff --git a/gl/m4/idpriv.m4 b/gl/m4/idpriv.m4
index 06fca5bd..bcc166c7 100644
--- a/gl/m4/idpriv.m4
+++ b/gl/m4/idpriv.m4
@@ -1,5 +1,5 @@
# idpriv.m4 serial 1
-dnl Copyright (C) 2009-2019 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/gl/m4/include_next.m4 b/gl/m4/include_next.m4
index 86eb2c97..9009e293 100644
--- a/gl/m4/include_next.m4
+++ b/gl/m4/include_next.m4
@@ -1,5 +1,5 @@
# include_next.m4 serial 24
-dnl Copyright (C) 2006-2019 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/gl/m4/intmax_t.m4 b/gl/m4/intmax_t.m4
index 5ded16e3..72fc8a9f 100644
--- a/gl/m4/intmax_t.m4
+++ b/gl/m4/intmax_t.m4
@@ -1,5 +1,5 @@
-# intmax_t.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2019 Free Software Foundation,
+# intmax_t.m4 serial 9
+dnl Copyright (C) 1997-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,
@@ -19,11 +19,7 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T],
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
- test $ac_cv_type_long_long_int = yes \
- && ac_type='long long' \
- || ac_type='long'
- AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
+ AC_DEFINE_UNQUOTED([intmax_t], [long long],
[Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
else
AC_DEFINE([HAVE_INTMAX_T], [1],
@@ -57,11 +53,7 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
AC_DEFINE([HAVE_INTMAX_T], [1],
[Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
else
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
- test $ac_cv_type_long_long_int = yes \
- && ac_type='long long' \
- || ac_type='long'
- AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
+ AC_DEFINE_UNQUOTED([intmax_t], [long long],
[Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
fi
])
diff --git a/gl/m4/inttypes.m4 b/gl/m4/inttypes.m4
new file mode 100644
index 00000000..224d0cdd
--- /dev/null
+++ b/gl/m4/inttypes.m4
@@ -0,0 +1,159 @@
+# inttypes.m4 serial 29
+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.
+
+dnl From Derek Price, Bruno Haible.
+dnl Test whether <inttypes.h> is supported or must be substituted.
+
+AC_DEFUN([gl_INTTYPES_H],
+[
+ AC_REQUIRE([gl_INTTYPES_INCOMPLETE])
+ gl_INTTYPES_PRI_SCN
+])
+
+AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE],
+[
+ AC_REQUIRE([gl_STDINT_H])
+ AC_CHECK_HEADERS_ONCE([inttypes.h])
+
+ dnl Override <inttypes.h> always, so that the portability warnings work.
+ AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+ gl_CHECK_NEXT_HEADERS([inttypes.h])
+
+ AC_REQUIRE([gl_MULTIARCH])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <inttypes.h>
+ ]], [imaxabs imaxdiv strtoimax strtoumax])
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
+
+# Ensure that the PRI* and SCN* macros are defined appropriately.
+AC_DEFUN([gl_INTTYPES_PRI_SCN],
+[
+ AC_REQUIRE([gt_INTTYPES_PRI])
+
+ PRIPTR_PREFIX=
+ if test -n "$STDINT_H"; then
+ dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'.
+ PRIPTR_PREFIX='"l"'
+ else
+ dnl Using the system's <stdint.h>.
+ for glpfx in '' l ll I64; do
+ case $glpfx in
+ '') gltype1='int';;
+ l) gltype1='long int';;
+ ll) gltype1='long long int';;
+ I64) gltype1='__int64';;
+ esac
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <stdint.h>
+ extern intptr_t foo;
+ extern $gltype1 foo;]])],
+ [PRIPTR_PREFIX='"'$glpfx'"'])
+ test -n "$PRIPTR_PREFIX" && break
+ done
+ fi
+ AC_SUBST([PRIPTR_PREFIX])
+
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [INT32_MAX_LT_INTMAX_MAX],
+ [defined INT32_MAX && defined INTMAX_MAX],
+ [INT32_MAX < INTMAX_MAX],
+ [sizeof (int) < sizeof (long long int)])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [INT64_MAX_EQ_LONG_MAX],
+ [defined INT64_MAX],
+ [INT64_MAX == LONG_MAX],
+ [sizeof (long long int) == sizeof (long int)])
+ else
+ INT64_MAX_EQ_LONG_MAX=-1
+ fi
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [UINT32_MAX_LT_UINTMAX_MAX],
+ [defined UINT32_MAX && defined UINTMAX_MAX],
+ [UINT32_MAX < UINTMAX_MAX],
+ [sizeof (unsigned int) < sizeof (unsigned long long int)])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [UINT64_MAX_EQ_ULONG_MAX],
+ [defined UINT64_MAX],
+ [UINT64_MAX == ULONG_MAX],
+ [sizeof (unsigned long long int) == sizeof (unsigned long int)])
+ else
+ UINT64_MAX_EQ_ULONG_MAX=-1
+ fi
+])
+
+# Define the symbol $1 to be 1 if the condition is true, 0 otherwise.
+# If $2 is true, the condition is $3; otherwise if long long int is supported
+# approximate the condition with $4; otherwise, assume the condition is false.
+# The condition should work on all C99 platforms; the approximations should be
+# good enough to work on all practical pre-C99 platforms.
+# $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants.
+AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
+[
+ AC_CACHE_CHECK([whether $3],
+ [gl_cv_test_$1],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Work also in C++ mode. */
+ #define __STDC_LIMIT_MACROS 1
+
+ /* Work if build is not clean. */
+ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+
+ #include <limits.h>
+ #if HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
+
+ #if $2
+ #define CONDITION ($3)
+ #else
+ #define CONDITION ($4)
+ #endif
+ int test[CONDITION ? 1 : -1];]])],
+ [gl_cv_test_$1=yes],
+ [gl_cv_test_$1=no])])
+ if test $gl_cv_test_$1 = yes; then
+ $1=1;
+ else
+ $1=0;
+ fi
+ AC_SUBST([$1])
+])
+
+AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
+[
+ GNULIB_IMAXABS=0; AC_SUBST([GNULIB_IMAXABS])
+ GNULIB_IMAXDIV=0; AC_SUBST([GNULIB_IMAXDIV])
+ GNULIB_STRTOIMAX=0; AC_SUBST([GNULIB_STRTOIMAX])
+ GNULIB_STRTOUMAX=0; AC_SUBST([GNULIB_STRTOUMAX])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DECL_IMAXABS=1; AC_SUBST([HAVE_DECL_IMAXABS])
+ HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV])
+ HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
+ HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
+ HAVE_IMAXDIV_T=1; AC_SUBST([HAVE_IMAXDIV_T])
+ REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX])
+ REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX])
+ INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
+ INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX])
+ PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN])
+ PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX])
+ UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX])
+ UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX])
+])
diff --git a/gl/m4/inttypes_h.m4 b/gl/m4/inttypes_h.m4
index d20422a4..ebb53203 100644
--- a/gl/m4/inttypes_h.m4
+++ b/gl/m4/inttypes_h.m4
@@ -1,5 +1,5 @@
# inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-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/gl/m4/ioctl.m4 b/gl/m4/ioctl.m4
index 2d00611b..263aaaec 100644
--- a/gl/m4/ioctl.m4
+++ b/gl/m4/ioctl.m4
@@ -1,5 +1,5 @@
# ioctl.m4 serial 5
-dnl Copyright (C) 2008-2019 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/gl/m4/langinfo_h.m4 b/gl/m4/langinfo_h.m4
index 76385d81..ef92f84a 100644
--- a/gl/m4/langinfo_h.m4
+++ b/gl/m4/langinfo_h.m4
@@ -1,5 +1,5 @@
# langinfo_h.m4 serial 8
-dnl Copyright (C) 2009-2019 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/gl/m4/largefile.m4 b/gl/m4/largefile.m4
index 1938188c..8017ca70 100644
--- a/gl/m4/largefile.m4
+++ b/gl/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-2019 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])
@@ -93,9 +113,6 @@ if test "$enable_largefile" != no; then
[Define for large files, on AIX-style hosts.],
[_AC_SYS_LARGEFILE_TEST_INCLUDES])
fi
-
- AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1],
- [Enable large inode numbers on Mac OS X 10.5.])
fi
])# AC_SYS_LARGEFILE
])# m4_version_prereq 2.70
diff --git a/gl/m4/lchown.m4 b/gl/m4/lchown.m4
index 3d524199..61adf5b6 100644
--- a/gl/m4/lchown.m4
+++ b/gl/m4/lchown.m4
@@ -1,7 +1,7 @@
# serial 17
# Determine whether we need the lchown wrapper.
-dnl Copyright (C) 1998, 2001, 2003-2007, 2009-2019 Free Software Foundation,
+dnl Copyright (C) 1998, 2001, 2003-2007, 2009-2020 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
diff --git a/gl/m4/lib-ignore.m4 b/gl/m4/lib-ignore.m4
index 1c198f96..1b7703f6 100644
--- a/gl/m4/lib-ignore.m4
+++ b/gl/m4/lib-ignore.m4
@@ -1,6 +1,6 @@
# If possible, ignore libraries that are not depended on.
-dnl Copyright (C) 2006, 2009-2019 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/gl/m4/lib-ld.m4 b/gl/m4/lib-ld.m4
index a1871963..98c348fa 100644
--- a/gl/m4/lib-ld.m4
+++ b/gl/m4/lib-ld.m4
@@ -1,5 +1,5 @@
# lib-ld.m4 serial 9
-dnl Copyright (C) 1996-2003, 2009-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-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/gl/m4/lib-link.m4 b/gl/m4/lib-link.m4
index 0ff10731..eecf70ec 100644
--- a/gl/m4/lib-link.m4
+++ b/gl/m4/lib-link.m4
@@ -1,5 +1,5 @@
-# lib-link.m4 serial 28
-dnl Copyright (C) 2001-2019 Free Software Foundation, Inc.
+# lib-link.m4 serial 31
+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.
@@ -192,6 +192,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
+ eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+ eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
])
AC_ARG_WITH(PACK[-prefix],
[[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
@@ -204,17 +206,23 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
+ eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+ eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
])
else
additional_includedir="$withval/include"
additional_libdir="$withval/$acl_libdirstem"
- if test "$acl_libdirstem2" != "$acl_libdirstem" \
- && test ! -d "$withval/$acl_libdirstem"; then
- additional_libdir="$withval/$acl_libdirstem2"
- fi
+ additional_libdir2="$withval/$acl_libdirstem2"
+ additional_libdir3="$withval/$acl_libdirstem3"
fi
fi
])
+ if test "X$additional_libdir2" = "X$additional_libdir"; then
+ additional_libdir2=
+ fi
+ if test "X$additional_libdir3" = "X$additional_libdir"; then
+ additional_libdir3=
+ fi
dnl Search the library and its dependencies in $additional_libdir and
dnl $LDFLAGS. Using breadth-first-seach.
LIB[]NAME=
@@ -270,48 +278,54 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
shrext=
fi
if test $use_additional = yes; then
- dir="$additional_libdir"
- dnl The same code as in the loop below:
- dnl First look for a shared library.
- if test -n "$acl_shlibext"; then
- if test -f "$dir/$libname$shrext"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext"
- else
- if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
- ver=`(cd "$dir" && \
- for f in "$libname$shrext".*; do echo "$f"; done \
- | sed -e "s,^$libname$shrext\\\\.,," \
- | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
- | sed 1q ) 2>/dev/null`
- if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext.$ver"
+ for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+ if test "X$found_dir" = "X"; then
+ eval dir=\$$additional_libdir_variable
+ if test -n "$dir"; then
+ dnl The same code as in the loop below:
+ dnl First look for a shared library.
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
fi
- else
- eval library_names=\"$acl_library_names_spec\"
- for f in $library_names; do
- if test -f "$dir/$f"; then
+ dnl Then look for a static library.
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
found_dir="$dir"
- found_so="$dir/$f"
- break
+ found_a="$dir/$libname.$acl_libext"
fi
- done
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
fi
fi
- fi
- dnl Then look for a static library.
- if test "X$found_dir" = "X"; then
- if test -f "$dir/$libname.$acl_libext"; then
- found_dir="$dir"
- found_a="$dir/$libname.$acl_libext"
- fi
- fi
- if test "X$found_dir" != "X"; then
- if test -f "$dir/$libname.la"; then
- found_la="$dir/$libname.la"
- fi
- fi
+ done
fi
if test "X$found_dir" = "X"; then
for x in $LDFLAGS $LTLIB[]NAME; do
@@ -321,7 +335,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dir=`echo "X$x" | sed -e 's/^X-L//'`
dnl First look for a shared library.
if test -n "$acl_shlibext"; then
- if test -f "$dir/$libname$shrext"; then
+ if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
found_dir="$dir"
found_so="$dir/$libname$shrext"
else
@@ -331,14 +345,14 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
| sed -e "s,^$libname$shrext\\\\.,," \
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
| sed 1q ) 2>/dev/null`
- if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
found_dir="$dir"
found_so="$dir/$libname$shrext.$ver"
fi
else
eval library_names=\"$acl_library_names_spec\"
for f in $library_names; do
- if test -f "$dir/$f"; then
+ if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
found_dir="$dir"
found_so="$dir/$f"
break
@@ -349,7 +363,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
fi
dnl Then look for a static library.
if test "X$found_dir" = "X"; then
- if test -f "$dir/$libname.$acl_libext"; then
+ if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
found_dir="$dir"
found_a="$dir/$libname.$acl_libext"
fi
@@ -375,7 +389,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
dnl standard /usr/lib.
if test "$enable_rpath" = no \
|| test "X$found_dir" = "X/usr/$acl_libdirstem" \
- || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
dnl No hardcoding is needed.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
@@ -475,6 +490,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
fi
additional_includedir="$basedir/include"
;;
+ */$acl_libdirstem3 | */$acl_libdirstem3/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
esac
if test "X$additional_includedir" != "X"; then
dnl Potentially add $additional_includedir to $INCNAME.
@@ -525,19 +547,21 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
for dep in $dependency_libs; do
case "$dep" in
-L*)
- additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
- dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+ dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+ dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME.
dnl But don't add it
dnl 1. if it's the standard /usr/lib,
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
dnl 3. if it's already present in $LDFLAGS or the already
dnl constructed $LIBNAME,
dnl 4. if it doesn't exist as a directory.
- if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
- && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+ if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
haveit=
- if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
- || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+ if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
@@ -548,29 +572,29 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
haveit=
for x in $LDFLAGS $LIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
- if test "X$x" = "X-L$additional_libdir"; then
+ if test "X$x" = "X-L$dependency_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
- if test -d "$additional_libdir"; then
- dnl Really add $additional_libdir to $LIBNAME.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+ if test -d "$dependency_libdir"; then
+ dnl Really add $dependency_libdir to $LIBNAME.
+ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir"
fi
fi
haveit=
for x in $LDFLAGS $LTLIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
- if test "X$x" = "X-L$additional_libdir"; then
+ if test "X$x" = "X-L$dependency_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
- if test -d "$additional_libdir"; then
- dnl Really add $additional_libdir to $LTLIBNAME.
- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+ if test -d "$dependency_libdir"; then
+ dnl Really add $dependency_libdir to $LTLIBNAME.
+ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir"
fi
fi
fi
@@ -718,7 +742,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
dir="$next"
dnl No need to hardcode the standard /usr/lib.
if test "X$dir" != "X/usr/$acl_libdirstem" \
- && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+ && test "X$dir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dir" != "X/usr/$acl_libdirstem3"; then
rpathdirs="$rpathdirs $dir"
fi
next=
@@ -728,7 +753,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
-L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
dnl No need to hardcode the standard /usr/lib.
if test "X$dir" != "X/usr/$acl_libdirstem" \
- && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+ && test "X$dir" != "X/usr/$acl_libdirstem2" \
+ && test "X$dir" != "X/usr/$acl_libdirstem3"; then
rpathdirs="$rpathdirs $dir"
fi
next= ;;
diff --git a/gl/m4/lib-prefix.m4 b/gl/m4/lib-prefix.m4
index 8adb17bb..c8a0b464 100644
--- a/gl/m4/lib-prefix.m4
+++ b/gl/m4/lib-prefix.m4
@@ -1,5 +1,5 @@
-# lib-prefix.m4 serial 14
-dnl Copyright (C) 2001-2005, 2008-2019 Free Software Foundation, Inc.
+# lib-prefix.m4 serial 17
+dnl Copyright (C) 2001-2005, 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.
@@ -147,21 +147,24 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
])
dnl AC_LIB_PREPARE_MULTILIB creates
-dnl - a variable acl_libdirstem, containing the basename of the libdir, either
-dnl "lib" or "lib64" or "lib/64",
-dnl - a variable acl_libdirstem2, as a secondary possible value for
-dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
-dnl "lib/amd64".
+dnl - a function acl_is_expected_elfclass, that tests whether standard input
+dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI,
+dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing
+dnl the basename of the libdir to try in turn, either "lib" or "lib64" or
+dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar.
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
[
- dnl There is no formal standard regarding lib and lib64.
- dnl On glibc systems, the current practice is that on a system supporting
+ dnl There is no formal standard regarding lib, lib32, and lib64.
+ dnl On most glibc systems, the current practice is that on a system supporting
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
- dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
- dnl the compiler's default mode by looking at the compiler's library search
- dnl path. If at least one of its elements ends in /lib64 or points to a
- dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
- dnl Otherwise we use the default, namely "lib".
+ dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on
+ dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go
+ dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib.
+ dnl We determine the compiler's default mode by looking at the compiler's
+ dnl library search path. If at least one of its elements ends in /lib64 or
+ dnl points to a directory whose absolute pathname ends in /lib64, we use that
+ dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default,
+ dnl namely "lib".
dnl On Solaris systems, the current practice is that on a system supporting
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
@@ -169,27 +172,72 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
- case "$host_os" in
- solaris*)
- 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
+ AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
+ [AC_EGREP_CPP([Extensible Linking Format],
+ [#ifdef __ELF__
+ Extensible Linking Format
+ #endif
+ ],
+ [gl_cv_elf=yes],
+ [gl_cv_elf=no])
+ ])
+ if test $gl_cv_elf; then
+ # Extract the ELF class of a file (5th byte) in decimal.
+ # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
+ if od -A x < /dev/null >/dev/null 2>/dev/null; then
+ # Use POSIX od.
+ func_elfclass ()
+ {
+ od -A n -t d1 -j 4 -N 1
+ }
+ else
+ # Use BSD hexdump.
+ func_elfclass ()
+ {
+ dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
+ echo
+ }
+ fi
+changequote(,)dnl
+ case $HOST_CPU_C_ABI_32BIT in
+ yes)
+ # 32-bit ABI.
+ acl_is_expected_elfclass ()
+ {
+ test "`func_elfclass | sed -e 's/[ ]//g'`" = 1
+ }
+ ;;
+ no)
+ # 64-bit ABI.
+ acl_is_expected_elfclass ()
+ {
+ test "`func_elfclass | sed -e 's/[ ]//g'`" = 2
+ }
+ ;;
+ *)
+ # Unknown.
+ acl_is_expected_elfclass ()
+ {
+ :
+ }
+ ;;
+ esac
+changequote([,])dnl
+ else
+ acl_is_expected_elfclass ()
+ {
+ :
+ }
+ fi
dnl Allow the user to override the result by setting acl_cv_libdirstems.
AC_CACHE_CHECK([for the common suffixes of directories in the library search path],
[acl_cv_libdirstems],
- [acl_libdirstem=lib
+ [dnl Try 'lib' first, because that's the default for libdir in GNU, see
+ dnl <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html>.
+ acl_libdirstem=lib
acl_libdirstem2=
+ acl_libdirstem3=
case "$host_os" in
solaris*)
dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
@@ -197,53 +245,76 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
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
+ if test $HOST_CPU_C_ABI_32BIT = no; then
+ acl_libdirstem2=lib/64
case "$host_cpu" in
- sparc*) acl_libdirstem2=lib/sparcv9 ;;
- i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
+ sparc*) acl_libdirstem3=lib/sparcv9 ;;
+ i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
esac
fi
;;
*)
dnl If $CC generates code for a 32-bit ABI, the libraries are
- dnl surely under $prefix/lib, 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
- 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"
+ dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64.
+ dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries
+ dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32.
+ dnl Find the compiler's search path. However, non-system compilers
+ dnl sometimes have odd library search paths. But we can't simply invoke
+ dnl '/usr/bin/gcc -print-search-dirs' because that would not take into
+ dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS.
+ searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
+ | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test $HOST_CPU_C_ABI_32BIT != no; then
+ # 32-bit or unknown ABI.
+ if test -d /usr/lib32; then
+ acl_libdirstem2=lib32
+ fi
+ fi
+ if test $HOST_CPU_C_ABI_32BIT != yes; then
+ # 64-bit or unknown ABI.
+ if test -d /usr/lib64; then
+ acl_libdirstem3=lib64
+ fi
+ fi
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
+ */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
+ */../ | */.. )
+ # Better ignore directories of this form. They are misleading.
+ ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib32 ) acl_libdirstem2=lib32 ;;
+ */lib64 ) acl_libdirstem3=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ if test $HOST_CPU_C_ABI_32BIT = yes; then
+ # 32-bit ABI.
+ acl_libdirstem3=
+ fi
+ if test $HOST_CPU_C_ABI_32BIT = no; then
+ # 64-bit ABI.
+ acl_libdirstem2=
fi
fi
;;
esac
test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
- acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2"
+ test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
+ acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
])
- # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2.
+ dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and
+ dnl acl_libdirstem3.
+changequote(,)dnl
acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
- acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'`
+ acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
+ acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
+changequote([,])dnl
])
diff --git a/gl/m4/limits-h.m4 b/gl/m4/limits-h.m4
index 68f724c7..0b4f092a 100644
--- a/gl/m4/limits-h.m4
+++ b/gl/m4/limits-h.m4
@@ -1,6 +1,6 @@
dnl Check whether limits.h has needed features.
-dnl Copyright 2016-2019 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/gl/m4/localcharset.m4 b/gl/m4/localcharset.m4
index 2a7f82d0..9d21c4f9 100644
--- a/gl/m4/localcharset.m4
+++ b/gl/m4/localcharset.m4
@@ -1,5 +1,5 @@
# localcharset.m4 serial 8
-dnl Copyright (C) 2002, 2004, 2006, 2009-2019 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/gl/m4/locale-fr.m4 b/gl/m4/locale-fr.m4
index cfa068d5..5abe0522 100644
--- a/gl/m4/locale-fr.m4
+++ b/gl/m4/locale-fr.m4
@@ -1,5 +1,5 @@
# locale-fr.m4 serial 19
-dnl Copyright (C) 2003, 2005-2019 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/gl/m4/locale-ja.m4 b/gl/m4/locale-ja.m4
index 487f68bd..0982ab1b 100644
--- a/gl/m4/locale-ja.m4
+++ b/gl/m4/locale-ja.m4
@@ -1,5 +1,5 @@
# locale-ja.m4 serial 14
-dnl Copyright (C) 2003, 2005-2019 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/gl/m4/locale-zh.m4 b/gl/m4/locale-zh.m4
index 8b813263..cde51403 100644
--- a/gl/m4/locale-zh.m4
+++ b/gl/m4/locale-zh.m4
@@ -1,5 +1,5 @@
# locale-zh.m4 serial 14
-dnl Copyright (C) 2003, 2005-2019 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/gl/m4/locale_h.m4 b/gl/m4/locale_h.m4
index d28ba0c2..32494cf2 100644
--- a/gl/m4/locale_h.m4
+++ b/gl/m4/locale_h.m4
@@ -1,5 +1,5 @@
-# locale_h.m4 serial 21
-dnl Copyright (C) 2007, 2009-2019 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/gl/m4/localeconv.m4 b/gl/m4/localeconv.m4
index 9bb78f0d..a926224f 100644
--- a/gl/m4/localeconv.m4
+++ b/gl/m4/localeconv.m4
@@ -1,5 +1,5 @@
# localeconv.m4 serial 1
-dnl Copyright (C) 2012-2019 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/gl/m4/localtime-buffer.m4 b/gl/m4/localtime-buffer.m4
index 6d998287..09df3c97 100644
--- a/gl/m4/localtime-buffer.m4
+++ b/gl/m4/localtime-buffer.m4
@@ -1,5 +1,5 @@
# localtime-buffer.m4 serial 1
-dnl Copyright (C) 2017-2019 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/gl/m4/lock.m4 b/gl/m4/lock.m4
index 93b76fa4..1c39591d 100644
--- a/gl/m4/lock.m4
+++ b/gl/m4/lock.m4
@@ -1,5 +1,5 @@
# lock.m4 serial 14
-dnl Copyright (C) 2005-2019 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/gl/m4/longlong.m4 b/gl/m4/longlong.m4
deleted file mode 100644
index 08d0e363..00000000
--- a/gl/m4/longlong.m4
+++ /dev/null
@@ -1,113 +0,0 @@
-# longlong.m4 serial 18
-dnl Copyright (C) 1999-2007, 2009-2019 Free Software Foundation, Inc.
-dnl This file is free software; the Free 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/gl/m4/lstat.m4 b/gl/m4/lstat.m4
index ace16386..3c2b214b 100644
--- a/gl/m4/lstat.m4
+++ b/gl/m4/lstat.m4
@@ -1,6 +1,6 @@
-# serial 32
+# serial 33
-# Copyright (C) 1997-2001, 2003-2019 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/gl/m4/malloc.m4 b/gl/m4/malloc.m4
index c469c450..c1f8ea32 100644
--- a/gl/m4/malloc.m4
+++ b/gl/m4/malloc.m4
@@ -1,11 +1,9 @@
-# malloc.m4 serial 19
-dnl Copyright (C) 2007, 2009-2019 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],
@@ -35,8 +33,8 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
*-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
| hpux* | solaris* | cygwin* | mingw*)
ac_cv_func_malloc_0_nonnull="guessing yes" ;;
- # If we don't know, assume the worst.
- *) ac_cv_func_malloc_0_nonnull="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
esac
])
])
@@ -50,8 +48,6 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
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/gl/m4/malloca.m4 b/gl/m4/malloca.m4
index 820f40a8..930199da 100644
--- a/gl/m4/malloca.m4
+++ b/gl/m4/malloca.m4
@@ -1,5 +1,5 @@
-# malloca.m4 serial 1
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2019 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/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4
index 6bb9f8f8..783620da 100644
--- a/gl/m4/manywarnings.m4
+++ b/gl/m4/manywarnings.m4
@@ -1,5 +1,5 @@
# manywarnings.m4 serial 18
-dnl Copyright (C) 2008-2019 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/gl/m4/math_h.m4 b/gl/m4/math_h.m4
index 3d5af84f..1d0169f7 100644
--- a/gl/m4/math_h.m4
+++ b/gl/m4/math_h.m4
@@ -1,5 +1,5 @@
# math_h.m4 serial 119
-dnl Copyright (C) 2007-2019 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/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4
index 4811af5d..755f8c90 100644
--- a/gl/m4/mbrtowc.m4
+++ b/gl/m4/mbrtowc.m4
@@ -1,5 +1,5 @@
-# mbrtowc.m4 serial 31 -*- coding: utf-8 -*-
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2019 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/gl/m4/mbsinit.m4 b/gl/m4/mbsinit.m4
index e2f45e75..8c26b6b9 100644
--- a/gl/m4/mbsinit.m4
+++ b/gl/m4/mbsinit.m4
@@ -1,5 +1,5 @@
# mbsinit.m4 serial 8
-dnl Copyright (C) 2008, 2010-2019 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/gl/m4/mbsrtowcs.m4 b/gl/m4/mbsrtowcs.m4
index cbdde2c5..e0bc229d 100644
--- a/gl/m4/mbsrtowcs.m4
+++ b/gl/m4/mbsrtowcs.m4
@@ -1,5 +1,5 @@
# mbsrtowcs.m4 serial 13
-dnl Copyright (C) 2008-2019 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/gl/m4/mbstate_t.m4 b/gl/m4/mbstate_t.m4
index f669753c..057ce12e 100644
--- a/gl/m4/mbstate_t.m4
+++ b/gl/m4/mbstate_t.m4
@@ -1,5 +1,5 @@
# mbstate_t.m4 serial 13
-dnl Copyright (C) 2000-2002, 2008-2019 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/gl/m4/mbtowc.m4 b/gl/m4/mbtowc.m4
index 5a4b92ee..befcffab 100644
--- a/gl/m4/mbtowc.m4
+++ b/gl/m4/mbtowc.m4
@@ -1,5 +1,5 @@
# mbtowc.m4 serial 3
-dnl Copyright (C) 2011-2019 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/gl/m4/memchr.m4 b/gl/m4/memchr.m4
index 0be394db..91eec88e 100644
--- a/gl/m4/memchr.m4
+++ b/gl/m4/memchr.m4
@@ -1,5 +1,5 @@
-# memchr.m4 serial 14
-dnl Copyright (C) 2002-2004, 2009-2019 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.
@@ -94,8 +94,8 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
# Guess yes on native Windows.
mingw*) gl_cv_func_memchr_works="guessing yes" ;;
- # Be pessimistic for now.
- *) gl_cv_func_memchr_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/gl/m4/memmem.m4 b/gl/m4/memmem.m4
index af2d5bbc..e034d7bd 100644
--- a/gl/m4/memmem.m4
+++ b/gl/m4/memmem.m4
@@ -1,5 +1,5 @@
-# memmem.m4 serial 25
-dnl Copyright (C) 2002-2004, 2007-2019 Free Software Foundation, Inc.
+# memmem.m4 serial 26
+dnl Copyright (C) 2002-2004, 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.
@@ -68,7 +68,7 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
#endif
],
[gl_cv_func_memmem_works_always="guessing yes"],
- [gl_cv_func_memmem_works_always="guessing no"])
+ [gl_cv_func_memmem_works_always="$gl_cross_guess_normal"])
])
])
case "$gl_cv_func_memmem_works_always" in
@@ -138,7 +138,7 @@ static void quit (int sig) { _exit (sig + 128); }
#endif
],
[gl_cv_func_memmem_works_fast="guessing yes"],
- [gl_cv_func_memmem_works_fast="guessing no"])
+ [gl_cv_func_memmem_works_fast="$gl_cross_guess_normal"])
])
])
case "$gl_cv_func_memmem_works_fast" in
diff --git a/gl/m4/mempcpy.m4 b/gl/m4/mempcpy.m4
index b6090eed..899f12a8 100644
--- a/gl/m4/mempcpy.m4
+++ b/gl/m4/mempcpy.m4
@@ -1,5 +1,5 @@
# mempcpy.m4 serial 11
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2019 Free Software Foundation,
+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,
diff --git a/gl/m4/memrchr.m4 b/gl/m4/memrchr.m4
index e907590e..95990ed6 100644
--- a/gl/m4/memrchr.m4
+++ b/gl/m4/memrchr.m4
@@ -1,5 +1,5 @@
# memrchr.m4 serial 10
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2019 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/gl/m4/minmax.m4 b/gl/m4/minmax.m4
index 1e0d30b9..e5b28b0b 100644
--- a/gl/m4/minmax.m4
+++ b/gl/m4/minmax.m4
@@ -1,5 +1,5 @@
# minmax.m4 serial 4
-dnl Copyright (C) 2005, 2009-2019 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/gl/m4/mkdir.m4 b/gl/m4/mkdir.m4
index 366a3cd7..99212d91 100644
--- a/gl/m4/mkdir.m4
+++ b/gl/m4/mkdir.m4
@@ -1,6 +1,6 @@
-# serial 15
+# serial 16
-# Copyright (C) 2001, 2003-2004, 2006, 2008-2019 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
@@ -66,8 +66,8 @@ AC_DEFUN([gl_FUNC_MKDIR],
*-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/gl/m4/mkdtemp.m4 b/gl/m4/mkdtemp.m4
index 412bb39b..da7b2ac1 100644
--- a/gl/m4/mkdtemp.m4
+++ b/gl/m4/mkdtemp.m4
@@ -1,5 +1,5 @@
# mkdtemp.m4 serial 8
-dnl Copyright (C) 2001-2003, 2006-2007, 2009-2019 Free Software Foundation,
+dnl Copyright (C) 2001-2003, 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,
diff --git a/gl/m4/mkstemp.m4 b/gl/m4/mkstemp.m4
index 1b15c2eb..28b78895 100644
--- a/gl/m4/mkstemp.m4
+++ b/gl/m4/mkstemp.m4
@@ -1,6 +1,6 @@
-#serial 26
+#serial 27
-# Copyright (C) 2001, 2003-2007, 2009-2019 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.
@@ -63,8 +63,8 @@ AC_DEFUN([gl_FUNC_MKSTEMP],
*-musl*) gl_cv_func_working_mkstemp="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_working_mkstemp="guessing no" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_working_mkstemp="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_working_mkstemp="$gl_cross_guess_normal" ;;
esac
])
rm -rf conftest.mkstemp
diff --git a/gl/m4/mmap-anon.m4 b/gl/m4/mmap-anon.m4
index 50c38082..d5c69df8 100644
--- a/gl/m4/mmap-anon.m4
+++ b/gl/m4/mmap-anon.m4
@@ -1,5 +1,5 @@
# mmap-anon.m4 serial 10
-dnl Copyright (C) 2005, 2007, 2009-2019 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/gl/m4/mode_t.m4 b/gl/m4/mode_t.m4
index ba840dca..f1909517 100644
--- a/gl/m4/mode_t.m4
+++ b/gl/m4/mode_t.m4
@@ -1,5 +1,5 @@
# mode_t.m4 serial 2
-dnl Copyright (C) 2009-2019 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/gl/m4/msvc-inval.m4 b/gl/m4/msvc-inval.m4
index 4b958762..dcf398d0 100644
--- a/gl/m4/msvc-inval.m4
+++ b/gl/m4/msvc-inval.m4
@@ -1,5 +1,5 @@
# msvc-inval.m4 serial 1
-dnl Copyright (C) 2011-2019 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/gl/m4/msvc-nothrow.m4 b/gl/m4/msvc-nothrow.m4
index 7e73b40b..13198d85 100644
--- a/gl/m4/msvc-nothrow.m4
+++ b/gl/m4/msvc-nothrow.m4
@@ -1,5 +1,5 @@
# msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2019 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/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4
index d48316e0..3c2034c5 100644
--- a/gl/m4/multiarch.m4
+++ b/gl/m4/multiarch.m4
@@ -1,5 +1,5 @@
# multiarch.m4 serial 7
-dnl Copyright (C) 2008-2019 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/gl/m4/nanosleep.m4 b/gl/m4/nanosleep.m4
index 971aae32..1fb13ed3 100644
--- a/gl/m4/nanosleep.m4
+++ b/gl/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-2019 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/gl/m4/nl_langinfo.m4 b/gl/m4/nl_langinfo.m4
index 66eee41d..6cafe9db 100644
--- a/gl/m4/nl_langinfo.m4
+++ b/gl/m4/nl_langinfo.m4
@@ -1,5 +1,5 @@
-# nl_langinfo.m4 serial 6
-dnl Copyright (C) 2009-2019 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/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4
index 4d9f0226..637a0ea4 100644
--- a/gl/m4/nocrash.m4
+++ b/gl/m4/nocrash.m4
@@ -1,5 +1,5 @@
# nocrash.m4 serial 5
-dnl Copyright (C) 2005, 2009-2019 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/gl/m4/nonblocking.m4 b/gl/m4/nonblocking.m4
index 7d885e55..67fcb727 100644
--- a/gl/m4/nonblocking.m4
+++ b/gl/m4/nonblocking.m4
@@ -1,5 +1,5 @@
# nonblocking.m4 serial 2
-dnl Copyright (C) 2011-2019 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/gl/m4/off_t.m4 b/gl/m4/off_t.m4
index 711a2d44..6e19af88 100644
--- a/gl/m4/off_t.m4
+++ b/gl/m4/off_t.m4
@@ -1,5 +1,5 @@
# off_t.m4 serial 1
-dnl Copyright (C) 2012-2019 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/gl/m4/open-cloexec.m4 b/gl/m4/open-cloexec.m4
index 52498d95..11652d5f 100644
--- a/gl/m4/open-cloexec.m4
+++ b/gl/m4/open-cloexec.m4
@@ -1,6 +1,6 @@
# Test whether O_CLOEXEC is defined.
-dnl Copyright 2017-2019 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/gl/m4/open-slash.m4 b/gl/m4/open-slash.m4
new file mode 100644
index 00000000..1e57c969
--- /dev/null
+++ b/gl/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/gl/m4/open.m4 b/gl/m4/open.m4
index 5d73f4de..552eedf8 100644
--- a/gl/m4/open.m4
+++ b/gl/m4/open.m4
@@ -1,5 +1,5 @@
# open.m4 serial 15
-dnl Copyright (C) 2007-2019 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/gl/m4/openat.m4 b/gl/m4/openat.m4
index 005a2b43..cf9f7173 100644
--- a/gl/m4/openat.m4
+++ b/gl/m4/openat.m4
@@ -1,7 +1,7 @@
# serial 46
# See if we need to use our replacement for Solaris' openat et al functions.
-dnl Copyright (C) 2004-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 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/gl/m4/opendir.m4 b/gl/m4/opendir.m4
index 8f0d8042..fd3c1ec4 100644
--- a/gl/m4/opendir.m4
+++ b/gl/m4/opendir.m4
@@ -1,5 +1,5 @@
# opendir.m4 serial 5
-dnl Copyright (C) 2011-2019 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/gl/m4/pathmax.m4 b/gl/m4/pathmax.m4
index 0770aca3..bb4fdeba 100644
--- a/gl/m4/pathmax.m4
+++ b/gl/m4/pathmax.m4
@@ -1,5 +1,5 @@
# pathmax.m4 serial 11
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2019 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/gl/m4/printf.m4 b/gl/m4/printf.m4
index 6d2280ef..9df21534 100644
--- a/gl/m4/printf.m4
+++ b/gl/m4/printf.m4
@@ -1,5 +1,5 @@
-# printf.m4 serial 61
-dnl Copyright (C) 2003, 2007-2019 Free Software Foundation, Inc.
+# printf.m4 serial 62
+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.
@@ -93,8 +93,8 @@ changequote([,])dnl
[gl_cv_func_printf_sizes_c99="guessing yes"],
[gl_cv_func_printf_sizes_c99="guessing no"])
;;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_sizes_c99="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_sizes_c99="$gl_cross_guess_normal";;
esac
])
])
@@ -271,8 +271,8 @@ changequote([,])dnl
[gl_cv_func_printf_infinite="guessing yes"],
[gl_cv_func_printf_infinite="guessing no"])
;;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_infinite="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_infinite="$gl_cross_guess_normal";;
esac
])
])
@@ -481,8 +481,8 @@ changequote([,])dnl
[gl_cv_func_printf_infinite_long_double="guessing yes"],
[gl_cv_func_printf_infinite_long_double="guessing no"])
;;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_infinite_long_double="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_infinite_long_double="$gl_cross_guess_normal";;
esac
;;
esac
@@ -587,8 +587,8 @@ int main ()
linux*-android*) gl_cv_func_printf_directive_a="guessing no";;
# Guess no on native Windows.
mingw*) gl_cv_func_printf_directive_a="guessing no";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_directive_a="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_directive_a="$gl_cross_guess_normal";;
esac
])
])
@@ -656,8 +656,8 @@ changequote([,])dnl
[gl_cv_func_printf_directive_f="guessing yes"],
[gl_cv_func_printf_directive_f="guessing no"])
;;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_directive_f="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_directive_f="$gl_cross_guess_normal";;
esac
])
])
@@ -978,8 +978,8 @@ changequote(,)dnl
linux*-android*) gl_cv_func_printf_flag_zero="guessing no";;
# Guess no on native Windows.
mingw*) gl_cv_func_printf_flag_zero="guessing no";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_flag_zero="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";;
esac
changequote([,])dnl
])
@@ -1156,8 +1156,8 @@ changequote(,)dnl
haiku*) gl_cv_func_printf_enomem="guessing yes";;
# Guess no on Android.
linux*-android*) gl_cv_func_printf_enomem="guessing no";;
- # If we don't know, assume the worst.
- *) gl_cv_func_printf_enomem="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_printf_enomem="$gl_cross_guess_normal";;
esac
changequote([,])dnl
fi
@@ -1255,8 +1255,8 @@ changequote(,)dnl
linux*-android*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess no on native Windows.
mingw*) gl_cv_func_snprintf_truncation_c99="guessing no";;
- # If we don't know, assume the worst.
- *) gl_cv_func_snprintf_truncation_c99="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";;
esac
changequote([,])dnl
])
@@ -1358,8 +1358,8 @@ changequote([,])dnl
[gl_cv_func_snprintf_retval_c99="guessing yes"],
[gl_cv_func_snprintf_retval_c99="guessing no"])
;;
- # If we don't know, assume the worst.
- *) gl_cv_func_snprintf_retval_c99="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_retval_c99="$gl_cross_guess_normal";;
esac
])
])
@@ -1446,8 +1446,8 @@ changequote(,)dnl
linux*-android*) gl_cv_func_snprintf_directive_n="guessing no";;
# Guess no on native Windows.
mingw*) gl_cv_func_snprintf_directive_n="guessing no";;
- # If we don't know, assume the worst.
- *) gl_cv_func_snprintf_directive_n="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_snprintf_directive_n="$gl_cross_guess_normal";;
esac
changequote([,])dnl
])
@@ -1601,8 +1601,8 @@ changequote(,)dnl
linux*-android*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on native Windows.
mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_vsnprintf_zerosize_c99="$gl_cross_guess_normal";;
esac
changequote([,])dnl
])
diff --git a/gl/m4/pthread_rwlock_rdlock.m4 b/gl/m4/pthread_rwlock_rdlock.m4
index 3c1d6456..049af50f 100644
--- a/gl/m4/pthread_rwlock_rdlock.m4
+++ b/gl/m4/pthread_rwlock_rdlock.m4
@@ -1,5 +1,5 @@
-# pthread_rwlock_rdlock.m4 serial 2
-dnl Copyright (C) 2017-2019 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/gl/m4/raise.m4 b/gl/m4/raise.m4
index f7661e65..5b61b65d 100644
--- a/gl/m4/raise.m4
+++ b/gl/m4/raise.m4
@@ -1,5 +1,5 @@
# raise.m4 serial 4
-dnl Copyright (C) 2011-2019 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/gl/m4/rawmemchr.m4 b/gl/m4/rawmemchr.m4
index 03a88049..c5bf0418 100644
--- a/gl/m4/rawmemchr.m4
+++ b/gl/m4/rawmemchr.m4
@@ -1,5 +1,5 @@
# rawmemchr.m4 serial 2
-dnl Copyright (C) 2003, 2007-2019 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/gl/m4/readdir.m4 b/gl/m4/readdir.m4
index d09cb9fe..ca4e7419 100644
--- a/gl/m4/readdir.m4
+++ b/gl/m4/readdir.m4
@@ -1,5 +1,5 @@
# readdir.m4 serial 1
-dnl Copyright (C) 2011-2019 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/gl/m4/readlink.m4 b/gl/m4/readlink.m4
index 2d768157..9aa9e46d 100644
--- a/gl/m4/readlink.m4
+++ b/gl/m4/readlink.m4
@@ -1,5 +1,5 @@
-# readlink.m4 serial 14
-dnl Copyright (C) 2003, 2007, 2009-2019 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/gl/m4/realloc.m4 b/gl/m4/realloc.m4
index 93066e80..85b8f874 100644
--- a/gl/m4/realloc.m4
+++ b/gl/m4/realloc.m4
@@ -1,11 +1,9 @@
-# realloc.m4 serial 17
-dnl Copyright (C) 2007, 2009-2019 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],
@@ -35,8 +33,8 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF],
*-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
| hpux* | solaris* | cygwin* | mingw*)
ac_cv_func_realloc_0_nonnull="guessing yes" ;;
- # If we don't know, assume the worst.
- *) ac_cv_func_realloc_0_nonnull="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) ac_cv_func_realloc_0_nonnull="$gl_cross_guess_normal" ;;
esac
])
])
@@ -50,8 +48,6 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF],
esac
])# AC_FUNC_REALLOC
-])
-
# gl_FUNC_REALLOC_GNU
# -------------------
# Test whether 'realloc (0, 0)' is handled like in GNU libc, and replace
diff --git a/gl/m4/regex.m4 b/gl/m4/regex.m4
index 35119c5c..65f51858 100644
--- a/gl/m4/regex.m4
+++ b/gl/m4/regex.m4
@@ -1,6 +1,6 @@
-# serial 68
+# serial 69
-# Copyright (C) 1996-2001, 2003-2019 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/gl/m4/rename.m4 b/gl/m4/rename.m4
index 7318e757..a1bd7057 100644
--- a/gl/m4/rename.m4
+++ b/gl/m4/rename.m4
@@ -1,6 +1,6 @@
-# serial 31
+# serial 32
-# Copyright (C) 2001, 2003, 2005-2006, 2009-2019 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/gl/m4/renameat.m4 b/gl/m4/renameat.m4
index fdbaeafc..d9dca07e 100644
--- a/gl/m4/renameat.m4
+++ b/gl/m4/renameat.m4
@@ -1,7 +1,7 @@
# serial 3
# See if we need to provide renameat replacement.
-dnl Copyright (C) 2009-2019 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/gl/m4/rewinddir.m4 b/gl/m4/rewinddir.m4
index c14224c3..51f476b2 100644
--- a/gl/m4/rewinddir.m4
+++ b/gl/m4/rewinddir.m4
@@ -1,5 +1,5 @@
# rewinddir.m4 serial 1
-dnl Copyright (C) 2011-2019 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/gl/m4/rmdir.m4 b/gl/m4/rmdir.m4
index 5d32caaa..ad1b1920 100644
--- a/gl/m4/rmdir.m4
+++ b/gl/m4/rmdir.m4
@@ -1,5 +1,5 @@
-# rmdir.m4 serial 16
-dnl Copyright (C) 2002, 2005, 2009-2019 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/gl/m4/same.m4 b/gl/m4/same.m4
index 48f314eb..75899b5a 100644
--- a/gl/m4/same.m4
+++ b/gl/m4/same.m4
@@ -1,5 +1,5 @@
#serial 10
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2019 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/gl/m4/save-cwd.m4 b/gl/m4/save-cwd.m4
index 816fd703..a401b1f5 100644
--- a/gl/m4/save-cwd.m4
+++ b/gl/m4/save-cwd.m4
@@ -1,5 +1,5 @@
# serial 10
-dnl Copyright (C) 2002-2006, 2009-2019 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/gl/m4/select.m4 b/gl/m4/select.m4
index 531c817a..d950460b 100644
--- a/gl/m4/select.m4
+++ b/gl/m4/select.m4
@@ -1,5 +1,5 @@
-# select.m4 serial 10
-dnl Copyright (C) 2009-2019 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/gl/m4/setenv.m4 b/gl/m4/setenv.m4
index a8f83d60..ef03673d 100644
--- a/gl/m4/setenv.m4
+++ b/gl/m4/setenv.m4
@@ -1,5 +1,5 @@
-# setenv.m4 serial 28
-dnl Copyright (C) 2001-2004, 2006-2019 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.
@@ -39,8 +39,8 @@ AC_DEFUN([gl_FUNC_SETENV],
*-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_setenv_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_setenv_works="guessing no" ;;
+ # 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
@@ -131,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/gl/m4/setlocale_null.m4 b/gl/m4/setlocale_null.m4
new file mode 100644
index 00000000..c1ee1f79
--- /dev/null
+++ b/gl/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/gl/m4/sigaction.m4 b/gl/m4/sigaction.m4
index 6117d1b4..9a2d201b 100644
--- a/gl/m4/sigaction.m4
+++ b/gl/m4/sigaction.m4
@@ -1,5 +1,5 @@
# sigaction.m4 serial 7
-dnl Copyright (C) 2008-2019 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/gl/m4/signal_h.m4 b/gl/m4/signal_h.m4
index 3acec64f..b2629809 100644
--- a/gl/m4/signal_h.m4
+++ b/gl/m4/signal_h.m4
@@ -1,5 +1,5 @@
-# signal_h.m4 serial 18
-dnl Copyright (C) 2007-2019 Free Software Foundation, Inc.
+# signal_h.m4 serial 19
+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.
@@ -34,6 +34,8 @@ AC_DEFUN([gl_SIGNAL_H],
]], [pthread_sigmask sigaction
sigaddset sigdelset sigemptyset sigfillset sigismember
sigpending sigprocmask])
+
+ AC_REQUIRE([AC_C_RESTRICT])
])
AC_DEFUN([gl_CHECK_TYPE_SIGSET_T],
diff --git a/gl/m4/signalblocking.m4 b/gl/m4/signalblocking.m4
index d722f65a..74de5344 100644
--- a/gl/m4/signalblocking.m4
+++ b/gl/m4/signalblocking.m4
@@ -1,5 +1,5 @@
# signalblocking.m4 serial 14
-dnl Copyright (C) 2001-2002, 2006-2019 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/gl/m4/size_max.m4 b/gl/m4/size_max.m4
index ab79052d..5240d799 100644
--- a/gl/m4/size_max.m4
+++ b/gl/m4/size_max.m4
@@ -1,5 +1,5 @@
# size_max.m4 serial 11
-dnl Copyright (C) 2003, 2005-2006, 2008-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-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/gl/m4/sleep.m4 b/gl/m4/sleep.m4
index 7bab4670..d19170e9 100644
--- a/gl/m4/sleep.m4
+++ b/gl/m4/sleep.m4
@@ -1,5 +1,5 @@
-# sleep.m4 serial 10
-dnl Copyright (C) 2007-2019 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.
@@ -52,8 +52,8 @@ handle_alarm (int sig)
*-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/gl/m4/socketlib.m4 b/gl/m4/socketlib.m4
index 90ba20c1..2372a278 100644
--- a/gl/m4/socketlib.m4
+++ b/gl/m4/socketlib.m4
@@ -1,5 +1,5 @@
# socketlib.m4 serial 2
-dnl Copyright (C) 2008-2019 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/gl/m4/sockets.m4 b/gl/m4/sockets.m4
index 06d3b9db..7e53ef20 100644
--- a/gl/m4/sockets.m4
+++ b/gl/m4/sockets.m4
@@ -1,5 +1,5 @@
# sockets.m4 serial 7
-dnl Copyright (C) 2008-2019 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/gl/m4/socklen.m4 b/gl/m4/socklen.m4
index deb5135f..251960b0 100644
--- a/gl/m4/socklen.m4
+++ b/gl/m4/socklen.m4
@@ -1,5 +1,5 @@
# socklen.m4 serial 11
-dnl Copyright (C) 2005-2007, 2009-2019 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/gl/m4/sockpfaf.m4 b/gl/m4/sockpfaf.m4
index 7b329823..495a3556 100644
--- a/gl/m4/sockpfaf.m4
+++ b/gl/m4/sockpfaf.m4
@@ -1,5 +1,5 @@
# sockpfaf.m4 serial 9
-dnl Copyright (C) 2004, 2006, 2009-2019 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/gl/m4/ssize_t.m4 b/gl/m4/ssize_t.m4
index 38bcee1c..6c0a5888 100644
--- a/gl/m4/ssize_t.m4
+++ b/gl/m4/ssize_t.m4
@@ -1,5 +1,5 @@
# ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2019 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/gl/m4/stat-time.m4 b/gl/m4/stat-time.m4
index 1685788e..0ac3f727 100644
--- a/gl/m4/stat-time.m4
+++ b/gl/m4/stat-time.m4
@@ -1,6 +1,6 @@
# Checks for stat-related time functions.
-# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2019 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/gl/m4/stat.m4 b/gl/m4/stat.m4
index 60040d13..46e9abce 100644
--- a/gl/m4/stat.m4
+++ b/gl/m4/stat.m4
@@ -1,6 +1,6 @@
-# serial 15
+# serial 16
-# Copyright (C) 2009-2019 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/gl/m4/std-gnu11.m4 b/gl/m4/std-gnu11.m4
index 23e7f75f..c1ec624b 100644
--- a/gl/m4/std-gnu11.m4
+++ b/gl/m4/std-gnu11.m4
@@ -7,7 +7,7 @@
# or later is installed everywhere a Gnulib program might be developed.
-# Copyright (C) 2001-2019 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/gl/m4/stdalign.m4 b/gl/m4/stdalign.m4
index 601fd21f..dcf778e6 100644
--- a/gl/m4/stdalign.m4
+++ b/gl/m4/stdalign.m4
@@ -1,6 +1,6 @@
# Check for stdalign.h that conforms to C11.
-dnl Copyright 2011-2019 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/gl/m4/stdarg.m4 b/gl/m4/stdarg.m4
index f43fe20b..69747f3e 100644
--- a/gl/m4/stdarg.m4
+++ b/gl/m4/stdarg.m4
@@ -1,5 +1,5 @@
# stdarg.m4 serial 7
-dnl Copyright (C) 2006, 2008-2019 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/gl/m4/stdbool.m4 b/gl/m4/stdbool.m4
index acb85224..6bb087eb 100644
--- a/gl/m4/stdbool.m4
+++ b/gl/m4/stdbool.m4
@@ -1,22 +1,36 @@
# Check for stdbool.h that conforms to C99.
-dnl Copyright (C) 2002-2006, 2009-2019 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/gl/m4/stddef_h.m4 b/gl/m4/stddef_h.m4
index 979e3cf7..6bcfadb7 100644
--- a/gl/m4/stddef_h.m4
+++ b/gl/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-2019 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/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index 11d8e8e5..29ad826d 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,5 +1,5 @@
-# stdint.m4 serial 53
-dnl Copyright (C) 2001-2019 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/gl/m4/stdint_h.m4 b/gl/m4/stdint_h.m4
index 6d5f1af0..9df9e048 100644
--- a/gl/m4/stdint_h.m4
+++ b/gl/m4/stdint_h.m4
@@ -1,5 +1,5 @@
# stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-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/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
index 6c9c1040..5f968bc2 100644
--- a/gl/m4/stdio_h.m4
+++ b/gl/m4/stdio_h.m4
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 49
-dnl Copyright (C) 2007-2019 Free Software Foundation, Inc.
+# stdio_h.m4 serial 50
+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.
@@ -107,6 +107,8 @@ AC_DEFUN([gl_STDIO_H],
gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen
renameat snprintf tmpfile vdprintf vsnprintf])
+
+ AC_REQUIRE([AC_C_RESTRICT])
])
AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4
index 6121602a..743066a6 100644
--- a/gl/m4/stdlib_h.m4
+++ b/gl/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 48
-dnl Copyright (C) 2007-2019 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 49
+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.
@@ -27,6 +27,8 @@ AC_DEFUN([gl_STDLIB_H],
posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray
realpath rpmatch secure_getenv setenv setstate setstate_r srandom
srandom_r strtod strtold strtoll strtoull unlockpt unsetenv])
+
+ AC_REQUIRE([AC_C_RESTRICT])
])
AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
diff --git a/gl/m4/strcase.m4 b/gl/m4/strcase.m4
index 9baef789..21d80c8c 100644
--- a/gl/m4/strcase.m4
+++ b/gl/m4/strcase.m4
@@ -1,5 +1,5 @@
# strcase.m4 serial 11
-dnl Copyright (C) 2002, 2005-2019 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/gl/m4/strcasestr.m4 b/gl/m4/strcasestr.m4
index 45abdbd2..4c2275fc 100644
--- a/gl/m4/strcasestr.m4
+++ b/gl/m4/strcasestr.m4
@@ -1,5 +1,5 @@
-# strcasestr.m4 serial 24
-dnl Copyright (C) 2005, 2007-2019 Free Software Foundation, Inc.
+# strcasestr.m4 serial 25
+dnl Copyright (C) 2005, 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.
@@ -64,7 +64,7 @@ AC_DEFUN([gl_FUNC_STRCASESTR_SIMPLE],
#endif
],
[gl_cv_func_strcasestr_works_always="guessing yes"],
- [gl_cv_func_strcasestr_works_always="guessing no"])
+ [gl_cv_func_strcasestr_works_always="$gl_cross_guess_normal"])
])
])
case "$gl_cv_func_strcasestr_works_always" in
@@ -136,7 +136,7 @@ static void quit (int sig) { _exit (sig + 128); }
#endif
],
[gl_cv_func_strcasestr_linear="guessing yes"],
- [gl_cv_func_strcasestr_linear="guessing no"])
+ [gl_cv_func_strcasestr_linear="$gl_cross_guess_normal"])
])
])
case "$gl_cv_func_strcasestr_linear" in
diff --git a/gl/m4/strchrnul.m4 b/gl/m4/strchrnul.m4
index 93cf112e..a18f0935 100644
--- a/gl/m4/strchrnul.m4
+++ b/gl/m4/strchrnul.m4
@@ -1,5 +1,5 @@
# strchrnul.m4 serial 9
-dnl Copyright (C) 2003, 2007, 2009-2019 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,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/strdup.m4 b/gl/m4/strdup.m4
index 82d74202..2d1fcc41 100644
--- a/gl/m4/strdup.m4
+++ b/gl/m4/strdup.m4
@@ -1,6 +1,6 @@
# strdup.m4 serial 13
-dnl Copyright (C) 2002-2019 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/gl/m4/strerror.m4 b/gl/m4/strerror.m4
index 2c90f316..fd84ce87 100644
--- a/gl/m4/strerror.m4
+++ b/gl/m4/strerror.m4
@@ -1,5 +1,5 @@
-# strerror.m4 serial 20
-dnl Copyright (C) 2002, 2007-2019 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.
@@ -28,8 +28,8 @@ AC_DEFUN([gl_FUNC_STRERROR],
*-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_working_strerror="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_working_strerror="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
esac
])
])
@@ -86,8 +86,8 @@ AC_DEFUN([gl_FUNC_STRERROR_0],
*-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/gl/m4/string_h.m4 b/gl/m4/string_h.m4
index 0c0e3a71..cc51337f 100644
--- a/gl/m4/string_h.m4
+++ b/gl/m4/string_h.m4
@@ -1,11 +1,11 @@
# Configure a GNU-like replacement for <string.h>.
-# Copyright (C) 2007-2019 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.
-# serial 22
+# serial 23
# Written by Paul Eggert.
@@ -18,7 +18,6 @@ AC_DEFUN([gl_HEADER_STRING_H],
AC_DEFUN([gl_HEADER_STRING_H_BODY],
[
- AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
gl_NEXT_HEADERS([string.h])
@@ -30,6 +29,8 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
[ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
strerror_r strsignal strverscmp])
+
+ AC_REQUIRE([AC_C_RESTRICT])
])
AC_DEFUN([gl_STRING_MODULE_INDICATOR],
diff --git a/gl/m4/strings_h.m4 b/gl/m4/strings_h.m4
index 76128cfb..4aadca02 100644
--- a/gl/m4/strings_h.m4
+++ b/gl/m4/strings_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <strings.h>.
# serial 6
-# Copyright (C) 2007, 2009-2019 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/gl/m4/strndup.m4 b/gl/m4/strndup.m4
index 325af5d1..006a31ad 100644
--- a/gl/m4/strndup.m4
+++ b/gl/m4/strndup.m4
@@ -1,5 +1,5 @@
# strndup.m4 serial 22
-dnl Copyright (C) 2002-2003, 2005-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-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/gl/m4/strnlen.m4 b/gl/m4/strnlen.m4
index c283c3ec..71b8e1ba 100644
--- a/gl/m4/strnlen.m4
+++ b/gl/m4/strnlen.m4
@@ -1,5 +1,5 @@
# strnlen.m4 serial 13
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2019 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/gl/m4/strsep.m4 b/gl/m4/strsep.m4
index 58720232..9efed38c 100644
--- a/gl/m4/strsep.m4
+++ b/gl/m4/strsep.m4
@@ -1,5 +1,5 @@
# strsep.m4 serial 10
-dnl Copyright (C) 2002-2004, 2007, 2009-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 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/gl/m4/sys_file_h.m4 b/gl/m4/sys_file_h.m4
index e30d45ec..045e01b9 100644
--- a/gl/m4/sys_file_h.m4
+++ b/gl/m4/sys_file_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <sys/file.h>.
# serial 6
-# Copyright (C) 2008-2019 Free Software Foundation, Inc.
+# Copyright (C) 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/gl/m4/sys_ioctl_h.m4 b/gl/m4/sys_ioctl_h.m4
index 54004219..303820ef 100644
--- a/gl/m4/sys_ioctl_h.m4
+++ b/gl/m4/sys_ioctl_h.m4
@@ -1,5 +1,5 @@
# sys_ioctl_h.m4 serial 10
-dnl Copyright (C) 2008-2019 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/gl/m4/sys_select_h.m4 b/gl/m4/sys_select_h.m4
index 918212a9..fa19bb65 100644
--- a/gl/m4/sys_select_h.m4
+++ b/gl/m4/sys_select_h.m4
@@ -1,5 +1,5 @@
# sys_select_h.m4 serial 20
-dnl Copyright (C) 2006-2019 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/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4
index d0a90206..bf902f08 100644
--- a/gl/m4/sys_socket_h.m4
+++ b/gl/m4/sys_socket_h.m4
@@ -1,5 +1,5 @@
-# sys_socket_h.m4 serial 24
-dnl Copyright (C) 2005-2019 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 25
+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.
@@ -95,6 +95,8 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
#include <sys/socket.h>
]], [socket connect accept bind getpeername getsockname getsockopt
listen recv send recvfrom sendto setsockopt shutdown accept4])
+
+ AC_REQUIRE([AC_C_RESTRICT])
])
AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
diff --git a/gl/m4/sys_stat_h.m4 b/gl/m4/sys_stat_h.m4
index 361ac3fc..3efba5a7 100644
--- a/gl/m4/sys_stat_h.m4
+++ b/gl/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
-# sys_stat_h.m4 serial 31 -*- Autoconf -*-
-dnl Copyright (C) 2006-2019 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 33 -*- Autoconf -*-
+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.
@@ -48,7 +48,9 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h>
]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
mknod mknodat stat utimensat])
-]) # gl_HEADER_SYS_STAT_H
+
+ AC_REQUIRE([AC_C_RESTRICT])
+])
AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
[
@@ -88,6 +90,7 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
HAVE_MKNOD=1; AC_SUBST([HAVE_MKNOD])
HAVE_MKNODAT=1; AC_SUBST([HAVE_MKNODAT])
HAVE_UTIMENSAT=1; AC_SUBST([HAVE_UTIMENSAT])
+ REPLACE_FCHMODAT=0; AC_SUBST([REPLACE_FCHMODAT])
REPLACE_FSTAT=0; AC_SUBST([REPLACE_FSTAT])
REPLACE_FSTATAT=0; AC_SUBST([REPLACE_FSTATAT])
REPLACE_FUTIMENS=0; AC_SUBST([REPLACE_FUTIMENS])
diff --git a/gl/m4/sys_time_h.m4 b/gl/m4/sys_time_h.m4
index 3d9233aa..8fc85992 100644
--- a/gl/m4/sys_time_h.m4
+++ b/gl/m4/sys_time_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <sys/time.h>.
# serial 9
-# Copyright (C) 2007, 2009-2019 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/gl/m4/sys_types_h.m4 b/gl/m4/sys_types_h.m4
index be065590..be918dc0 100644
--- a/gl/m4/sys_types_h.m4
+++ b/gl/m4/sys_types_h.m4
@@ -1,5 +1,5 @@
# sys_types_h.m4 serial 9
-dnl Copyright (C) 2011-2019 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/gl/m4/sys_uio_h.m4 b/gl/m4/sys_uio_h.m4
index 8b8ba6d6..a255dea9 100644
--- a/gl/m4/sys_uio_h.m4
+++ b/gl/m4/sys_uio_h.m4
@@ -1,5 +1,5 @@
# sys_uio_h.m4 serial 1
-dnl Copyright (C) 2011-2019 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/gl/m4/sysexits.m4 b/gl/m4/sysexits.m4
index 1e9f171b..2509b3f3 100644
--- a/gl/m4/sysexits.m4
+++ b/gl/m4/sysexits.m4
@@ -1,5 +1,5 @@
# sysexits.m4 serial 6
-dnl Copyright (C) 2003, 2005, 2007, 2009-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 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/gl/m4/tempname.m4 b/gl/m4/tempname.m4
index 664a6322..da439f07 100644
--- a/gl/m4/tempname.m4
+++ b/gl/m4/tempname.m4
@@ -1,6 +1,6 @@
#serial 5
-# Copyright (C) 2006-2007, 2009-2019 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/gl/m4/threadlib.m4 b/gl/m4/threadlib.m4
index 045d9dad..94441f68 100644
--- a/gl/m4/threadlib.m4
+++ b/gl/m4/threadlib.m4
@@ -1,5 +1,5 @@
-# threadlib.m4 serial 20
-dnl Copyright (C) 2005-2019 Free Software Foundation, Inc.
+# threadlib.m4 serial 27
+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,344 @@ dnl From Bruno Haible.
AC_PREREQ([2.60])
+dnl The general structure of the multithreading modules in gnulib is that we
+dnl have three set of modules:
+dnl
+dnl * POSIX API:
+dnl pthread, which combines
+dnl pthread-h
+dnl pthread-thread
+dnl pthread-once
+dnl pthread-mutex
+dnl pthread-rwlock
+dnl pthread-cond
+dnl pthread-tss
+dnl pthread-spin
+dnl sched_yield
+dnl
+dnl * ISO C API:
+dnl threads, which combines
+dnl threads-h
+dnl thrd
+dnl mtx
+dnl cnd
+dnl tss
+dnl
+dnl * Gnulib API, with an implementation that can be chosen at configure
+dnl time through the option --enable-threads=...
+dnl thread
+dnl lock
+dnl cond
+dnl tls
+dnl yield
+dnl
+dnl They are independent, except for the fact that
+dnl - the implementation of the ISO C API may use the POSIX (or some other
+dnl platform dependent) API,
+dnl - the implementation of the Gnulib API may use the POSIX or ISO C or
+dnl some other platform dependent API, depending on the --enable-threads
+dnl option.
+dnl
+dnl This file contains macros for all of these APIs!
+
+dnl ============================================================================
+dnl Macros for all thread APIs
+
+AC_DEFUN([gl_ANYTHREADLIB_EARLY],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ if test -z "$gl_anythreadlib_early_done"; then
+ case "$host_os" in
+ osf*)
+ # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+ # groks <pthread.h>. cc also understands the flag -pthread, but
+ # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+ # 2. putting a flag into CPPFLAGS that has an effect on the linker
+ # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
+ # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+ ;;
+ esac
+ # Some systems optimize for single-threaded programs by default, and
+ # need special flags to disable these optimizations. For example, the
+ # definition of 'errno' in <errno.h>.
+ case "$host_os" in
+ aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+ solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
+ esac
+ gl_anythreadlib_early_done=done
+ fi
+])
+
+dnl Checks whether the compiler and linker support weak declarations of symbols.
+
+AC_DEFUN([gl_WEAK_SYMBOLS],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether imported symbols can be declared weak],
+ [gl_cv_have_weak],
+ [gl_cv_have_weak=no
+ dnl First, test whether the compiler accepts it syntactically.
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern void xyzzy ();
+#pragma weak xyzzy]],
+ [[xyzzy();]])],
+ [gl_cv_have_weak=maybe])
+ if test $gl_cv_have_weak = maybe; then
+ dnl Second, test whether it actually works. On Cygwin 1.7.2, with
+ dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+ return (fputs == NULL);
+}]])],
+ [gl_cv_have_weak=yes],
+ [gl_cv_have_weak=no],
+ [dnl When cross-compiling, assume that only ELF platforms support
+ dnl weak symbols.
+ AC_EGREP_CPP([Extensible Linking Format],
+ [#ifdef __ELF__
+ Extensible Linking Format
+ #endif
+ ],
+ [gl_cv_have_weak="guessing yes"],
+ [gl_cv_have_weak="guessing no"])
+ ])
+ fi
+ dnl But when linking statically, weak symbols don't work.
+ case " $LDFLAGS " in
+ *" -static "*) gl_cv_have_weak=no ;;
+ esac
+ dnl Test for a bug in FreeBSD 11: A link error occurs when using a weak
+ dnl symbol and linking against a shared library that has a dependency on
+ dnl the shared library that defines the symbol.
+ case "$gl_cv_have_weak" in
+ *yes)
+ case "$host_os" in
+ freebsd* | dragonfly*)
+ : > conftest1.c
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&AS_MESSAGE_LOG_FD 2>&1
+ cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+ return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+ $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&AS_MESSAGE_LOG_FD 2>&1 \
+ || gl_cv_have_weak=no
+ rm -f conftest1.c libempty.so conftest2.c conftest
+ ;;
+ esac
+ ;;
+ esac
+ ])
+ case "$gl_cv_have_weak" in
+ *yes)
+ AC_DEFINE([HAVE_WEAK_SYMBOLS], [1],
+ [Define to 1 if the compiler and linker support weak declarations of symbols.])
+ ;;
+ esac
+])
+
+dnl ============================================================================
+dnl Macros for the POSIX API
+
+dnl gl_PTHREADLIB
+dnl -------------
+dnl Tests for the libraries needs for using the POSIX threads API.
+dnl Sets the variable LIBPTHREAD to the linker options for use in a Makefile.
+dnl Sets the variable LIBPMULTITHREAD, for programs that really need
+dnl multithread functionality. The difference between LIBPTHREAD and
+dnl LIBPMULTITHREAD is that on platforms supporting weak symbols, typically
+dnl LIBPTHREAD is empty whereas LIBPMULTITHREAD is not.
+dnl Sets the variable LIB_SCHED_YIELD to the linker options needed to use the
+dnl sched_yield() function.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Defines the C macro HAVE_PTHREAD_API if (at least parts of) the POSIX
+dnl threads API is available.
+
+dnl The guts of gl_PTHREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_PTHREADLIB_BODY],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ if test -z "$gl_pthreadlib_body_done"; then
+ gl_pthread_api=no
+ LIBPTHREAD=
+ LIBPMULTITHREAD=
+ # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+ # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+ AC_CHECK_HEADER([pthread.h],
+ [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
+ if test "$gl_have_pthread_h" = yes; then
+ # Other possible tests:
+ # -lpthreads (FSU threads, PCthreads)
+ # -lgthreads
+ # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+ # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+ # the second one only in libpthread, and lock.c needs it.
+ #
+ # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+ # needs -pthread for some reason. See:
+ # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+ save_LIBS=$LIBS
+ for gl_pthread in '' '-pthread'; do
+ LIBS="$LIBS $gl_pthread"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ pthread_mutex_t m;
+ pthread_mutexattr_t ma;
+ ]],
+ [[pthread_mutex_lock (&m);
+ pthread_mutexattr_init (&ma);]])],
+ [gl_pthread_api=yes
+ LIBPTHREAD=$gl_pthread
+ LIBPMULTITHREAD=$gl_pthread])
+ LIBS=$save_LIBS
+ test $gl_pthread_api = yes && break
+ done
+
+ # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+ # since it is defined as a macro on OSF/1.)
+ if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+ # The program links fine without libpthread. But it may actually
+ # need to link with libpthread in order to create multiple threads.
+ AC_CHECK_LIB([pthread], [pthread_kill],
+ [LIBPMULTITHREAD=-lpthread
+ # On Solaris and HP-UX, most pthread functions exist also in libc.
+ # Therefore pthread_in_use() needs to actually try to create a
+ # thread: pthread_create from libc will fail, whereas
+ # pthread_create will actually create a thread.
+ # On Solaris 10 or newer, this test is no longer needed, because
+ # libc contains the fully functional pthread functions.
+ case "$host_os" in
+ solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
+ AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
+ [Define if the pthread_in_use() detection is hard.])
+ esac
+ ])
+ elif test $gl_pthread_api != yes; then
+ # Some library is needed. Try libpthread and libc_r.
+ AC_CHECK_LIB([pthread], [pthread_kill],
+ [gl_pthread_api=yes
+ LIBPTHREAD=-lpthread
+ LIBPMULTITHREAD=-lpthread])
+ if test $gl_pthread_api != yes; then
+ # For FreeBSD 4.
+ AC_CHECK_LIB([c_r], [pthread_kill],
+ [gl_pthread_api=yes
+ LIBPTHREAD=-lc_r
+ LIBPMULTITHREAD=-lc_r])
+ fi
+ fi
+ fi
+ AC_MSG_CHECKING([whether POSIX threads API is available])
+ AC_MSG_RESULT([$gl_pthread_api])
+ AC_SUBST([LIBPTHREAD])
+ AC_SUBST([LIBPMULTITHREAD])
+ if test $gl_pthread_api = yes; then
+ AC_DEFINE([HAVE_PTHREAD_API], [1],
+ [Define if you have the <pthread.h> header and the POSIX threads API.])
+ fi
+
+ dnl On some systems, sched_yield is in librt, rather than in libpthread.
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sched.h>]],
+ [[sched_yield ();]])],
+ [LIB_SCHED_YIELD=
+ ],
+ [dnl Solaris 7...10 has sched_yield in librt, not in libpthread or libc.
+ AC_CHECK_LIB([rt], [sched_yield], [LIB_SCHED_YIELD=-lrt],
+ [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
+ AC_CHECK_LIB([posix4], [sched_yield], [LIB_SCHED_YIELD=-lposix4])])
+ ])
+ AC_SUBST([LIB_SCHED_YIELD])
+
+ gl_pthreadlib_body_done=done
+ fi
+])
+
+AC_DEFUN([gl_PTHREADLIB],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ gl_PTHREADLIB_BODY
+])
+
+dnl ============================================================================
+dnl Macros for the ISO C API
+
+dnl gl_STDTHREADLIB
+dnl ---------------
+dnl Tests for the libraries needs for using the ISO C threads API.
+dnl Sets the variable LIBSTDTHREAD to the linker options for use in a Makefile.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Defines the C macro HAVE_THREADS_H if (at least parts of) the ISO C threads
+dnl API is available.
+
+dnl The guts of gl_STDTHREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_STDTHREADLIB_BODY],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ if test -z "$gl_stdthreadlib_body_done"; then
+ AC_CHECK_HEADERS_ONCE([threads.h])
+
+ case "$host_os" in
+ mingw*)
+ LIBSTDTHREAD=
+ ;;
+ *)
+ gl_PTHREADLIB_BODY
+ if test $ac_cv_header_threads_h = yes; then
+ dnl glibc >= 2.29 has thrd_create in libpthread.
+ dnl FreeBSD >= 10 has thrd_create in libstdthreads; this library depends
+ dnl on libpthread (for the symbol 'pthread_mutexattr_gettype').
+ dnl AIX >= 7.1 and Solaris >= 11.4 have thrd_create in libc.
+ AC_CHECK_FUNCS([thrd_create])
+ if test $ac_cv_func_thrd_create = yes; then
+ LIBSTDTHREAD=
+ else
+ AC_CHECK_LIB([stdthreads], [thrd_create], [
+ LIBSTDTHREAD='-lstdthreads -lpthread'
+ ], [
+ dnl Guess that thrd_create is in libpthread.
+ LIBSTDTHREAD="$LIBPMULTITHREAD"
+ ])
+ fi
+ else
+ dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c.
+ LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
+ fi
+ ;;
+ esac
+ AC_SUBST([LIBSTDTHREAD])
+
+ AC_MSG_CHECKING([whether ISO C threads API is available])
+ AC_MSG_RESULT([$ac_cv_header_threads_h])
+ gl_stdthreadlib_body_done=done
+ fi
+])
+
+AC_DEFUN([gl_STDTHREADLIB],
+[
+ AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+ gl_STDTHREADLIB_BODY
+])
+
+dnl ============================================================================
+dnl Macros for the Gnulib API
+
dnl gl_THREADLIB
dnl ------------
dnl Tests for a multithreading library to be used.
@@ -16,7 +354,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_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).
@@ -54,7 +398,7 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY],
[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|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
@@ -88,26 +432,12 @@ changequote(,)dnl
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
])
@@ -123,45 +453,7 @@ 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
- ])
+ 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
@@ -169,75 +461,23 @@ int main ()
AC_CHECK_HEADERS_ONCE([threads.h])
:
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
+ 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.])
@@ -245,14 +485,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=
+ LIBTHREAD= LTLIBTHREAD=
fi
fi
fi
fi
fi
- if test -z "$gl_have_pthread"; then
+ if test $gl_threads_api = none; then
+ if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
+ gl_STDTHREADLIB_BODY
+ LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
+ LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
+ gl_threads_api=isoc
+ AC_DEFINE([USE_ISOC_THREADS], [1],
+ [Define if the ISO C multithreading library can be used.])
+ fi
+ fi
+ if test $gl_threads_api = none; then
case "$gl_use_threads" in
yes | windows | win32) # The 'win32' is for backward compatibility.
if { case "$host_os" in
@@ -306,6 +555,9 @@ AC_DEFUN([gl_AVOID_WINPTHREAD], [
])
+dnl ============================================================================
+
+
dnl Survey of platforms:
dnl
dnl Platform Available Compiler Supports test-lock
diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4
index f08f29b3..d0f89327 100644
--- a/gl/m4/time_h.m4
+++ b/gl/m4/time_h.m4
@@ -1,8 +1,8 @@
# Configure a more-standard replacement for <time.h>.
-# Copyright (C) 2000-2001, 2003-2007, 2009-2019 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2020 Free Software Foundation, Inc.
-# serial 11
+# serial 12
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -19,10 +19,12 @@ AC_DEFUN([gl_HEADER_TIME_H],
AC_DEFUN([gl_HEADER_TIME_H_BODY],
[
- AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+
gl_NEXT_HEADERS([time.h])
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
+
+ AC_REQUIRE([AC_C_RESTRICT])
])
dnl Check whether 'struct timespec' is declared
diff --git a/gl/m4/timespec.m4 b/gl/m4/timespec.m4
index 3db9943a..e71628dc 100644
--- a/gl/m4/timespec.m4
+++ b/gl/m4/timespec.m4
@@ -1,6 +1,6 @@
#serial 15
-# Copyright (C) 2000-2001, 2003-2007, 2009-2019 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,
diff --git a/gl/m4/unistd-safer.m4 b/gl/m4/unistd-safer.m4
index 5e2a1bed..65dfdf20 100644
--- a/gl/m4/unistd-safer.m4
+++ b/gl/m4/unistd-safer.m4
@@ -1,5 +1,5 @@
#serial 9
-dnl Copyright (C) 2002, 2005-2006, 2009-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2006, 2009-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index a3b3905f..e776f3bd 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 75
-dnl Copyright (C) 2006-2019 Free Software Foundation, Inc.
+# unistd_h.m4 serial 78
+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,13 +41,15 @@ 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
truncate ttyname_r unlink unlinkat usleep])
+
+ AC_REQUIRE([AC_C_RESTRICT])
])
AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -61,6 +63,7 @@ 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])
@@ -83,6 +86,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])
@@ -159,6 +163,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/gl/m4/unlink.m4 b/gl/m4/unlink.m4
index 69fd1af7..b0bb731d 100644
--- a/gl/m4/unlink.m4
+++ b/gl/m4/unlink.m4
@@ -1,5 +1,5 @@
-# unlink.m4 serial 13
-dnl Copyright (C) 2009-2019 Free Software Foundation, Inc.
+# unlink.m4 serial 14
+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.
@@ -49,8 +49,8 @@ AC_DEFUN([gl_FUNC_UNLINK],
*-gnu*) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_unlink_honors_slashes="guessing no" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_unlink_honors_slashes="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_unlink_honors_slashes="$gl_cross_guess_normal" ;;
esac
])
rm -f conftest.file conftest.lnk])
@@ -110,8 +110,8 @@ AC_DEFUN([gl_FUNC_UNLINK],
]])],
[gl_cv_func_unlink_parent_fails=yes],
[gl_cv_func_unlink_parent_fails=no],
- [# If we don't know, assume the worst.
- gl_cv_func_unlink_parent_fails="guessing no"
+ [# If we don't know, obey --enable-cross-guesses.
+ gl_cv_func_unlink_parent_fails="$gl_cross_guess_normal"
])
unset GL_SUBDIR_FOR_UNLINK
rm -rf "$tmp"
diff --git a/gl/m4/unlinkat.m4 b/gl/m4/unlinkat.m4
index 8a1e2758..36e59e34 100644
--- a/gl/m4/unlinkat.m4
+++ b/gl/m4/unlinkat.m4
@@ -1,5 +1,5 @@
# unlinkat.m4 serial 2
-dnl Copyright (C) 2004-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 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/gl/m4/utime.m4 b/gl/m4/utime.m4
index ddd4ee15..25d6243d 100644
--- a/gl/m4/utime.m4
+++ b/gl/m4/utime.m4
@@ -1,5 +1,5 @@
# utime.m4 serial 1
-dnl Copyright (C) 2017-2019 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/gl/m4/utime_h.m4 b/gl/m4/utime_h.m4
index b0950d01..2a73636f 100644
--- a/gl/m4/utime_h.m4
+++ b/gl/m4/utime_h.m4
@@ -1,5 +1,5 @@
# utime_h.m4 serial 3
-dnl Copyright (C) 2017-2019 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/gl/m4/utimens.m4 b/gl/m4/utimens.m4
index dda86b09..65617ac8 100644
--- a/gl/m4/utimens.m4
+++ b/gl/m4/utimens.m4
@@ -1,9 +1,9 @@
-dnl Copyright (C) 2003-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-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 serial 9
+dnl serial 10
AC_DEFUN([gl_UTIMENS],
[
@@ -35,8 +35,8 @@ AC_DEFUN([gl_UTIMENS],
linux-* | linux) gl_cv_func_futimesat_works="guessing yes" ;;
# Guess yes on glibc systems.
*-gnu*) gl_cv_func_futimesat_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_futimesat_works="guessing no" ;;
+ # If we don't know, obey --enable-cross-guesses.
+ *) gl_cv_func_futimesat_works="$gl_cross_guess_normal" ;;
esac
])
rm -f conftest.file])
diff --git a/gl/m4/utimes.m4 b/gl/m4/utimes.m4
index 5806d8fb..e1056bbb 100644
--- a/gl/m4/utimes.m4
+++ b/gl/m4/utimes.m4
@@ -1,7 +1,7 @@
# Detect some bugs in glibc's implementation of utimes.
-# serial 6
+# serial 7
-dnl Copyright (C) 2003-2005, 2009-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-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.
@@ -147,7 +147,7 @@ main ()
*-musl*) gl_cv_func_working_utimes="guessing yes" ;;
# Guess no on native Windows.
mingw*) gl_cv_func_working_utimes="guessing no" ;;
- *) gl_cv_func_working_utimes="guessing no" ;;
+ *) gl_cv_func_working_utimes="$gl_cross_guess_normal" ;;
esac
])
])
diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4
index b763a3da..45670618 100644
--- a/gl/m4/vasnprintf.m4
+++ b/gl/m4/vasnprintf.m4
@@ -1,5 +1,5 @@
-# vasnprintf.m4 serial 36
-dnl Copyright (C) 2002-2004, 2006-2019 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 37
+dnl Copyright (C) 2002-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.
@@ -32,7 +32,6 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
# Prerequisites of lib/printf-args.h, lib/printf-args.c.
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
])
@@ -41,7 +40,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([gl_FEATURES_H])
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_REQUIRE([AC_TYPE_SIZE_T])
@@ -56,7 +54,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
[
AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
diff --git a/gl/m4/vasprintf.m4 b/gl/m4/vasprintf.m4
index cd96229c..299f46df 100644
--- a/gl/m4/vasprintf.m4
+++ b/gl/m4/vasprintf.m4
@@ -1,5 +1,5 @@
# vasprintf.m4 serial 6
-dnl Copyright (C) 2002-2003, 2006-2007, 2009-2019 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 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,
diff --git a/gl/m4/visibility.m4 b/gl/m4/visibility.m4
index 6cbd7e5f..9f493bab 100644
--- a/gl/m4/visibility.m4
+++ b/gl/m4/visibility.m4
@@ -1,5 +1,5 @@
-# visibility.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2005, 2008, 2010-2013 Free Software Foundation, Inc.
+# 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.
@@ -29,42 +29,42 @@ AC_DEFUN([gl_VISIBILITY],
dnl First, check whether -Werror can be added to the command line, or
dnl whether it leads to an error because of some other option that the
dnl user has put into $CC $CFLAGS $CPPFLAGS.
- AC_MSG_CHECKING([whether the -Werror option is usable])
- AC_CACHE_VAL([gl_cv_cc_vis_werror], [
- gl_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Werror"
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[]], [[]])],
- [gl_cv_cc_vis_werror=yes],
- [gl_cv_cc_vis_werror=no])
- CFLAGS="$gl_save_CFLAGS"])
- AC_MSG_RESULT([$gl_cv_cc_vis_werror])
+ AC_CACHE_CHECK([whether the -Werror option is usable],
+ [gl_cv_cc_vis_werror],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [gl_cv_cc_vis_werror=yes],
+ [gl_cv_cc_vis_werror=no])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
dnl Now check whether visibility declarations are supported.
- AC_MSG_CHECKING([for simple visibility declarations])
- AC_CACHE_VAL([gl_cv_cc_visibility], [
- gl_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -fvisibility=hidden"
- dnl We use the option -Werror and a function dummyfunc, because on some
- dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
- dnl "visibility attribute not supported in this configuration; ignored"
- dnl at the first function definition in every compilation unit, and we
- dnl don't want to use the option in this case.
- if test $gl_cv_cc_vis_werror = yes; then
- CFLAGS="$CFLAGS -Werror"
- fi
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
- extern __attribute__((__visibility__("default"))) int exportedvar;
- extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
- extern __attribute__((__visibility__("default"))) int exportedfunc (void);
- void dummyfunc (void) {}
- ]],
- [[]])],
- [gl_cv_cc_visibility=yes],
- [gl_cv_cc_visibility=no])
- CFLAGS="$gl_save_CFLAGS"])
- AC_MSG_RESULT([$gl_cv_cc_visibility])
+ AC_CACHE_CHECK([for simple visibility declarations],
+ [gl_cv_cc_visibility],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ dnl We use the option -Werror and a function dummyfunc, because on some
+ dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
+ dnl "visibility attribute not supported in this configuration; ignored"
+ dnl at the first function definition in every compilation unit, and we
+ dnl don't want to use the option in this case.
+ if test $gl_cv_cc_vis_werror = yes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void) {}
+ ]],
+ [[]])],
+ [gl_cv_cc_visibility=yes],
+ [gl_cv_cc_visibility=no])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
if test $gl_cv_cc_visibility = yes; then
CFLAG_VISIBILITY="-fvisibility=hidden"
HAVE_VISIBILITY=1
diff --git a/gl/m4/vsnprintf.m4 b/gl/m4/vsnprintf.m4
index 739c9048..065d2346 100644
--- a/gl/m4/vsnprintf.m4
+++ b/gl/m4/vsnprintf.m4
@@ -1,5 +1,5 @@
# vsnprintf.m4 serial 7
-dnl Copyright (C) 2002-2004, 2007-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 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/gl/m4/warn-on-use.m4 b/gl/m4/warn-on-use.m4
index 7ebe2d31..5c8ee450 100644
--- a/gl/m4/warn-on-use.m4
+++ b/gl/m4/warn-on-use.m4
@@ -1,5 +1,5 @@
# warn-on-use.m4 serial 6
-dnl Copyright (C) 2010-2019 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/gl/m4/warnings.m4 b/gl/m4/warnings.m4
index 235cac61..d272365f 100644
--- a/gl/m4/warnings.m4
+++ b/gl/m4/warnings.m4
@@ -1,5 +1,5 @@
# warnings.m4 serial 14
-dnl Copyright (C) 2008-2019 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/gl/m4/wchar_h.m4 b/gl/m4/wchar_h.m4
index cd20e7a0..be09020b 100644
--- a/gl/m4/wchar_h.m4
+++ b/gl/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-2019 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 45
AC_DEFUN([gl_WCHAR_H],
[
@@ -57,6 +57,8 @@ AC_DEFUN([gl_WCHAR_H],
wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr
wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime
])
+
+ AC_REQUIRE([AC_C_RESTRICT])
])
dnl Check whether <wchar.h> is usable at all.
@@ -237,4 +239,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/gl/m4/wchar_t.m4 b/gl/m4/wchar_t.m4
index 5db58152..e48d4649 100644
--- a/gl/m4/wchar_t.m4
+++ b/gl/m4/wchar_t.m4
@@ -1,5 +1,5 @@
# wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2019 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/gl/m4/wcrtomb.m4 b/gl/m4/wcrtomb.m4
index fec22f34..c45fd983 100644
--- a/gl/m4/wcrtomb.m4
+++ b/gl/m4/wcrtomb.m4
@@ -1,5 +1,5 @@
-# wcrtomb.m4 serial 14
-dnl Copyright (C) 2008-2019 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,11 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
REPLACE_WCRTOMB=1
fi
else
- if test $REPLACE_MBSTATE_T = 1; then
- REPLACE_WCRTOMB=1
- fi
+ 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)
@@ -79,7 +81,9 @@ int main ()
])
case "$gl_cv_func_wcrtomb_works" in
*yes) ;;
- *) REPLACE_WCRTOMB=1 ;;
+ *) 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
@@ -90,12 +94,10 @@ int main ()
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
@@ -111,6 +113,7 @@ changequote([,])dnl
#include <stdio.h>
#include <time.h>
#include <wchar.h>
+#include <stdlib.h>
int main ()
{
int result = 0;
@@ -123,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)
{
@@ -143,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/gl/m4/wctype_h.m4 b/gl/m4/wctype_h.m4
index 6903d758..5c844b60 100644
--- a/gl/m4/wctype_h.m4
+++ b/gl/m4/wctype_h.m4
@@ -1,8 +1,8 @@
-# wctype_h.m4 serial 21
+# wctype_h.m4 serial 24
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
-dnl Copyright (C) 2006-2019 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
@@ -200,6 +204,8 @@ AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
[
GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK])
+ GNULIB_ISWDIGIT=0; AC_SUBST([GNULIB_ISWDIGIT])
+ GNULIB_ISWXDIGIT=0; AC_SUBST([GNULIB_ISWXDIGIT])
GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE])
GNULIB_ISWCTYPE=0; AC_SUBST([GNULIB_ISWCTYPE])
GNULIB_WCTRANS=0; AC_SUBST([GNULIB_WCTRANS])
@@ -209,4 +215,6 @@ AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T])
HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T])
REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK])
+ REPLACE_ISWDIGIT=0; AC_SUBST([REPLACE_ISWDIGIT])
+ REPLACE_ISWXDIGIT=0; AC_SUBST([REPLACE_ISWXDIGIT])
])
diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4
index 61e8a23d..877fd86c 100644
--- a/gl/m4/wint_t.m4
+++ b/gl/m4/wint_t.m4
@@ -1,5 +1,5 @@
# wint_t.m4 serial 7
-dnl Copyright (C) 2003, 2007-2019 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/gl/m4/xalloc.m4 b/gl/m4/xalloc.m4
index dfff9431..a5568700 100644
--- a/gl/m4/xalloc.m4
+++ b/gl/m4/xalloc.m4
@@ -1,5 +1,5 @@
# xalloc.m4 serial 18
-dnl Copyright (C) 2002-2006, 2009-2019 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/gl/m4/xgetcwd.m4 b/gl/m4/xgetcwd.m4
index c7e5e014..b188584c 100644
--- a/gl/m4/xgetcwd.m4
+++ b/gl/m4/xgetcwd.m4
@@ -1,5 +1,5 @@
#serial 8
-dnl Copyright (C) 2002-2006, 2009-2019 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/gl/m4/xsize.m4 b/gl/m4/xsize.m4
index f2898ba1..978f99ab 100644
--- a/gl/m4/xsize.m4
+++ b/gl/m4/xsize.m4
@@ -1,5 +1,5 @@
# xsize.m4 serial 5
-dnl Copyright (C) 2003-2004, 2008-2019 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 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/gl/m4/xstrndup.m4 b/gl/m4/xstrndup.m4
index 32dc51be..3846f914 100644
--- a/gl/m4/xstrndup.m4
+++ b/gl/m4/xstrndup.m4
@@ -1,5 +1,5 @@
# xstrndup.m4 serial 2
-dnl Copyright (C) 2003, 2009-2019 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/gl/m4/xvasprintf.m4 b/gl/m4/xvasprintf.m4
index c6a7f7c8..27eff71e 100644
--- a/gl/m4/xvasprintf.m4
+++ b/gl/m4/xvasprintf.m4
@@ -1,5 +1,5 @@
# xvasprintf.m4 serial 2
-dnl Copyright (C) 2006, 2009-2019 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/gl/m4/zzgnulib.m4 b/gl/m4/zzgnulib.m4
new file mode 100644
index 00000000..98fa68f5
--- /dev/null
+++ b/gl/m4/zzgnulib.m4
@@ -0,0 +1,23 @@
+# zzgnulib.m4 serial 1
+dnl Copyright (C) 2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This file must be named something that sorts after all other
+dnl package- or gnulib-provided .m4 files - at least for those packages
+dnl that redefine AC_PROG_CC.
+
+dnl Redefine AC_PROG_CC so that it ends with invocations of gl_COMPILER_CLANG
+dnl and gl_COMPILER_PREPARE_CHECK_DECL.
+m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[
+gl_COMPILER_CLANG
+gl_COMPILER_PREPARE_CHECK_DECL
+])
+
+# gl_ZZGNULIB
+# -----------
+# Witness macro that this file has been included. Needed to force
+# Automake to include this file after all other gnulib .m4 files.
+AC_DEFUN([gl_ZZGNULIB])