summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/__inline.m422
-rw-r--r--m4/acl.m45
-rw-r--r--m4/asm-underscore.m472
-rw-r--r--m4/canonicalize.m44
-rw-r--r--m4/configmake.m455
-rw-r--r--m4/environ.m420
-rw-r--r--m4/errno_h.m410
-rw-r--r--m4/extern-inline.m416
-rw-r--r--m4/fcntl-o.m410
-rw-r--r--m4/fseeko.m49
-rw-r--r--m4/getcwd.m44
-rw-r--r--m4/getpagesize.m423
-rw-r--r--m4/gnulib-common.m4129
-rw-r--r--m4/gnulib-comp.m439
-rw-r--r--m4/hard-locale.m411
-rw-r--r--m4/host-cpu-c-abi.m4190
-rw-r--r--m4/intl-thread-locale.m4183
-rw-r--r--m4/intlmacosx.m424
-rw-r--r--m4/inttypes.m43
-rw-r--r--m4/lib-link.m417
-rw-r--r--m4/lib-prefix.m4110
-rw-r--r--m4/limits-h.m424
-rw-r--r--m4/link.m412
-rw-r--r--m4/localcharset.m48
-rw-r--r--m4/locale-fr.m46
-rw-r--r--m4/locale-ja.m44
-rw-r--r--m4/locale-tr.m44
-rw-r--r--m4/locale-zh.m44
-rw-r--r--m4/locale_h.m49
-rw-r--r--m4/localename.m424
-rw-r--r--m4/longlong.m410
-rw-r--r--m4/lstat.m45
-rw-r--r--m4/malloc.m44
-rw-r--r--m4/manywarnings.m4101
-rw-r--r--m4/mbrtowc.m43
-rw-r--r--m4/mkdir.m482
-rw-r--r--m4/nanosleep.m445
-rw-r--r--m4/nocrash.m44
-rw-r--r--m4/pathmax.m44
-rw-r--r--m4/pthread_rwlock_rdlock.m48
-rw-r--r--m4/readlink.m412
-rw-r--r--m4/regex.m413
-rw-r--r--m4/rename.m460
-rw-r--r--m4/rmdir.m416
-rw-r--r--m4/select.m412
-rw-r--r--m4/setlocale.m45
-rw-r--r--m4/socklen.m415
-rw-r--r--m4/sockpfaf.m417
-rw-r--r--m4/stat.m412
-rw-r--r--m4/std-gnu11.m44
-rw-r--r--m4/stdarg.m422
-rw-r--r--m4/stddef_h.m429
-rw-r--r--m4/stdint.m413
-rw-r--r--m4/stdio_h.m44
-rw-r--r--m4/symlink.m412
-rw-r--r--m4/threadlib.m490
-rw-r--r--m4/unistd_h.m411
-rw-r--r--m4/warn-on-use.m440
-rw-r--r--m4/wchar_h.m410
-rw-r--r--m4/wcrtomb.m46
60 files changed, 1103 insertions, 617 deletions
diff --git a/m4/__inline.m4 b/m4/__inline.m4
new file mode 100644
index 0000000..3d0c479
--- /dev/null
+++ b/m4/__inline.m4
@@ -0,0 +1,22 @@
+# Test for __inline keyword
+dnl Copyright 2017-2018 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl___INLINE],
+[
+ AC_CACHE_CHECK([whether the compiler supports the __inline keyword],
+ [gl_cv_c___inline],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[typedef int foo_t;
+ static __inline foo_t foo (void) { return 0; }]],
+ [[return foo ();]])],
+ [gl_cv_c___inline=yes],
+ [gl_cv_c___inline=no])])
+ if test $gl_cv_c___inline = yes; then
+ AC_DEFINE([HAVE___INLINE], [1],
+ [Define to 1 if the compiler supports the keyword '__inline'.])
+ fi
+])
diff --git a/m4/acl.m4 b/m4/acl.m4
index 485cf9a..b64aa84 100644
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,5 +1,5 @@
# acl.m4 - check for access control list (ACL) primitives
-# serial 22
+# serial 23
# Copyright (C) 2002, 2004-2018 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -30,7 +30,8 @@ AC_DEFUN([gl_FUNC_ACL],
ac_save_LIBS=$LIBS
dnl Test for POSIX-draft-like API (GNU/Linux, FreeBSD, Mac OS X,
- dnl IRIX, Tru64). -lacl is needed on GNU/Linux, -lpacl on OSF/1.
+ dnl IRIX, Tru64, Cygwin >= 2.5).
+ dnl -lacl is needed on GNU/Linux, -lpacl on OSF/1.
if test $use_acl = 0; then
AC_SEARCH_LIBS([acl_get_file], [acl pacl],
[if test "$ac_cv_search_acl_get_file" != "none required"; then
diff --git a/m4/asm-underscore.m4 b/m4/asm-underscore.m4
deleted file mode 100644
index 58a5299..0000000
--- a/m4/asm-underscore.m4
+++ /dev/null
@@ -1,72 +0,0 @@
-# asm-underscore.m4 serial 4
-dnl Copyright (C) 2010-2018 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
-
-# gl_ASM_SYMBOL_PREFIX
-# Tests for the prefix of C symbols at the assembly language level and the
-# linker level. This prefix is either an underscore or empty. Defines the
-# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to
-# a stringified variant of this prefix.
-
-AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
-[
- AC_REQUIRE([AC_PROG_EGREP])
- dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
- dnl 1. It works only for GCC.
- dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
- AC_REQUIRE([gl_C_ASM])
- AC_CACHE_CHECK(
- [whether C symbols are prefixed with underscore at the linker level],
- [gl_cv_prog_as_underscore],
- [cat > conftest.c <<EOF
-#ifdef __cplusplus
-extern "C" int foo (void);
-#endif
-int foo(void) { return 0; }
-EOF
- # Look for the assembly language name in the .s file.
- AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
- if LC_ALL=C $EGREP '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' conftest.$gl_asmext >/dev/null; then
- gl_cv_prog_as_underscore=yes
- else
- gl_cv_prog_as_underscore=no
- fi
- rm -f conftest*
- ])
- if test $gl_cv_prog_as_underscore = yes; then
- USER_LABEL_PREFIX=_
- else
- USER_LABEL_PREFIX=
- fi
- AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX],
- [Define to the prefix of C symbols at the assembler and linker level,
- either an underscore or empty.])
- ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
- AC_SUBST([ASM_SYMBOL_PREFIX])
-])
-
-# gl_C_ASM
-# Determines how to produce an assembly language file from C source code.
-# Sets the variables:
-# gl_asmext - the extension of assembly language output,
-# gl_c_asm_opt - the C compiler option that produces assembly language output.
-
-AC_DEFUN([gl_C_ASM],
-[
- AC_EGREP_CPP([MicrosoftCompiler],
- [
-#ifdef _MSC_VER
-MicrosoftCompiler
-#endif
- ],
- [gl_asmext='asm'
- gl_c_asm_opt='-c -Fa'
- ],
- [gl_asmext='s'
- gl_c_asm_opt='-S'
- ])
-])
diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4
index 9de4f13..0c23894 100644
--- a/m4/canonicalize.m4
+++ b/m4/canonicalize.m4
@@ -35,8 +35,8 @@ AC_DEFUN([gl_CANONICALIZE_LGPL],
HAVE_REALPATH=0
else
case "$gl_cv_func_realpath_works" in
- *yes) ;;
- *) REPLACE_REALPATH=1 ;;
+ *yes) ;;
+ *) REPLACE_REALPATH=1 ;;
esac
fi
else
diff --git a/m4/configmake.m4 b/m4/configmake.m4
deleted file mode 100644
index e0b5835..0000000
--- a/m4/configmake.m4
+++ /dev/null
@@ -1,55 +0,0 @@
-# configmake.m4 serial 2
-dnl Copyright (C) 2010-2018 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# gl_CONFIGMAKE_PREP
-# ------------------
-# Guarantee all of the standard directory variables, even when used with
-# autoconf 2.59 (datarootdir wasn't supported until 2.59c, and runstatedir
-# in 2.70) or automake 1.9.6 (pkglibexecdir wasn't supported until 1.10b,
-# and runstatedir in 1.14.1).
-AC_DEFUN([gl_CONFIGMAKE_PREP],
-[
- dnl Technically, datadir should default to datarootdir. But if
- dnl autoconf is too old to provide datarootdir, then reversing the
- dnl definition is a reasonable compromise. Only AC_SUBST a variable
- dnl if it was not already defined earlier by autoconf.
- if test "x$datarootdir" = x; then
- AC_SUBST([datarootdir], ['${datadir}'])
- fi
- dnl Copy the approach used in autoconf 2.60.
- if test "x$docdir" = x; then
- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
- ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
- ['${datarootdir}/doc/${PACKAGE}'])])
- fi
- dnl The remaining variables missing from autoconf 2.59 are easier.
- if test "x$htmldir" = x; then
- AC_SUBST([htmldir], ['${docdir}'])
- fi
- if test "x$dvidir" = x; then
- AC_SUBST([dvidir], ['${docdir}'])
- fi
- if test "x$pdfdir" = x; then
- AC_SUBST([pdfdir], ['${docdir}'])
- fi
- if test "x$psdir" = x; then
- AC_SUBST([psdir], ['${docdir}'])
- fi
- if test "x$lispdir" = x; then
- AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp'])
- fi
- if test "x$localedir" = x; then
- AC_SUBST([localedir], ['${datarootdir}/locale'])
- fi
- dnl Added in autoconf 2.70
- if test "x$runstatedir" = x; then
- AC_SUBST([runstatedir], ['${localstatedir}/run'])
- fi
-
- dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely
- dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe.
- AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}'])
-])
diff --git a/m4/environ.m4 b/m4/environ.m4
index 68b67ea..acee536 100644
--- a/m4/environ.m4
+++ b/m4/environ.m4
@@ -1,4 +1,4 @@
-# environ.m4 serial 6
+# environ.m4 serial 7
dnl Copyright (C) 2001-2004, 2006-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -29,16 +29,14 @@ AC_DEFUN_ONCE([gl_ENVIRON],
AC_DEFUN([gt_CHECK_VAR_DECL],
[
define([gt_cv_var], [gt_cv_var_]$2[_declaration])
- AC_MSG_CHECKING([if $2 is properly declared])
- AC_CACHE_VAL([gt_cv_var], [
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[$1
- extern struct { int foo; } $2;]],
- [[$2.foo = 1;]])],
- [gt_cv_var=no],
- [gt_cv_var=yes])])
- AC_MSG_RESULT([$gt_cv_var])
+ AC_CACHE_CHECK([if $2 is properly declared], [gt_cv_var],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[$1
+ extern struct { int foo; } $2;]],
+ [[$2.foo = 1;]])],
+ [gt_cv_var=no],
+ [gt_cv_var=yes])])
if test $gt_cv_var = yes; then
AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
[Define if you have the declaration of $2.])
diff --git a/m4/errno_h.m4 b/m4/errno_h.m4
index 9dbdedd..e1ae295 100644
--- a/m4/errno_h.m4
+++ b/m4/errno_h.m4
@@ -1,9 +1,11 @@
-# errno_h.m4 serial 12
+# errno_h.m4 serial 13
dnl Copyright (C) 2004, 2006, 2008-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+AC_PREREQ([2.61])
+
AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
[
AC_REQUIRE([AC_PROG_CC])
@@ -129,9 +131,3 @@ yes
AC_SUBST($1[_VALUE])
fi
])
-
-dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
-dnl Remove this when we can assume autoconf >= 2.61.
-m4_ifdef([AC_COMPUTE_INT], [], [
- AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
-])
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index da8a2cc..3661cbd 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -25,7 +25,8 @@ AC_DEFUN([gl_EXTERN_INLINE],
if isdigit is mistakenly implemented via a static inline function,
a program containing an extern inline function that calls isdigit
may not work since the C standard prohibits extern inline functions
- from calling static functions. This bug is known to occur on:
+ from calling static functions (ISO C 99 section 6.7.4.(3).
+ This bug is known to occur on:
OS X 10.8 and earlier; see:
https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
@@ -38,7 +39,18 @@ AC_DEFUN([gl_EXTERN_INLINE],
OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
- Assume DragonFly and FreeBSD will be similar. */
+ Assume DragonFly and FreeBSD will be similar.
+
+ GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. It defines a macro
+ __GNUC_STDC_INLINE__ to indicate this situation or a macro
+ __GNUC_GNU_INLINE__ to indicate the opposite situation.
+ GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
+ semantics but warns, unless -fgnu89-inline is used:
+ warning: C99 inline functions are not supported; using GNU89
+ warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
+ It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
+ */
#if (((defined __APPLE__ && defined __MACH__) \
|| defined __DragonFly__ || defined __FreeBSD__) \
&& (defined __header_inline \
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4
index 4dc3daa..cffb9de 100644
--- a/m4/fcntl-o.m4
+++ b/m4/fcntl-o.m4
@@ -1,4 +1,4 @@
-# fcntl-o.m4 serial 5
+# fcntl-o.m4 serial 6
dnl Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,17 +6,15 @@ dnl with or without modifications, as long as this notice is preserved.
dnl Written by Paul Eggert.
+AC_PREREQ([2.60])
+
# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
AC_DEFUN([gl_FCNTL_O_FLAGS],
[
dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
- dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
- dnl AC_GNU_SOURCE.
- m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
- [AC_REQUIRE([AC_GNU_SOURCE])])
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_HEADERS_ONCE([unistd.h])
diff --git a/m4/fseeko.m4 b/m4/fseeko.m4
index 8967cf1..86c246e 100644
--- a/m4/fseeko.m4
+++ b/m4/fseeko.m4
@@ -1,4 +1,4 @@
-# fseeko.m4 serial 18
+# fseeko.m4 serial 19
dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -68,7 +68,10 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
# Prerequisites of lib/fseeko.c.
AC_DEFUN([gl_PREREQ_FSEEKO],
[
- dnl Native Windows has the function _fseeki64. mingw hides it, but mingw64
- dnl makes it usable again.
+ dnl Native Windows has the function _fseeki64. mingw hides it in some
+ dnl circumstances, but mingw64 makes it usable again.
AC_CHECK_FUNCS([_fseeki64])
+ if test $ac_cv_func__fseeki64 = yes; then
+ AC_CHECK_DECLS([_fseeki64])
+ fi
])
diff --git a/m4/getcwd.m4 b/m4/getcwd.m4
index 2875fe5..019934d 100644
--- a/m4/getcwd.m4
+++ b/m4/getcwd.m4
@@ -6,7 +6,7 @@
# with or without modifications, as long as this notice is preserved.
# Written by Paul Eggert.
-# serial 15
+# serial 16
AC_DEFUN([gl_FUNC_GETCWD_NULL],
[
@@ -25,7 +25,7 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
char *getcwd ();
# endif
]], [[
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
/* mingw cwd does not start with '/', but getcwd does allocate.
However, mingw fails to honor non-zero size. */
#else
diff --git a/m4/getpagesize.m4 b/m4/getpagesize.m4
index 6492c78..eb17d60 100644
--- a/m4/getpagesize.m4
+++ b/m4/getpagesize.m4
@@ -1,4 +1,4 @@
-# getpagesize.m4 serial 9
+# getpagesize.m4 serial 10
dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2018 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -9,8 +9,8 @@ AC_DEFUN([gl_FUNC_GETPAGESIZE],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
- AC_CHECK_FUNCS([getpagesize])
- if test $ac_cv_func_getpagesize = no; then
+ gl_CHECK_FUNC_GETPAGESIZE
+ if test $gl_cv_func_getpagesize = no; then
HAVE_GETPAGESIZE=0
AC_CHECK_HEADERS([OS.h])
if test $ac_cv_header_OS_h = yes; then
@@ -30,3 +30,20 @@ AC_DEFUN([gl_FUNC_GETPAGESIZE],
dnl mingw has getpagesize() in libgcc.a but doesn't declare it.
AC_CHECK_DECL([getpagesize], , [HAVE_DECL_GETPAGESIZE=0])
])
+
+dnl Tests whether the function getpagesize() exists.
+dnl Sets gl_cv_func_getpagesize.
+AC_DEFUN([gl_CHECK_FUNC_GETPAGESIZE],
+[
+ dnl We can't use AC_CHECK_FUNC here, because getpagesize() is defined as a
+ dnl static inline function when compiling for Android 4.4 or older.
+ AC_CACHE_CHECK([for getpagesize], [gl_cv_func_getpagesize],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>]],
+ [[return getpagesize();]])
+ ],
+ [gl_cv_func_getpagesize=yes],
+ [gl_cv_func_getpagesize=no])
+ ])
+])
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index de65f6b..2b253da 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,9 +1,11 @@
-# gnulib-common.m4 serial 38
+# gnulib-common.m4 serial 41
dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+AC_PREREQ([2.62])
+
# gl_COMMON
# is expanded unconditionally through gnulib-tool magic.
AC_DEFUN([gl_COMMON], [
@@ -14,12 +16,15 @@ AC_DEFUN([gl_COMMON], [
AC_DEFUN([gl_COMMON_BODY], [
AH_VERBATIM([_Noreturn],
[/* The _Noreturn keyword of C11. */
-#if ! (defined _Noreturn \
- || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
-# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
- || 0x5110 <= __SUNPRO_C)
+#ifndef _Noreturn
+# if 201103 <= (defined __cplusplus ? __cplusplus : 0)
+# define _Noreturn [[noreturn]]
+# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+ || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))
+ /* _Noreturn works as-is. */
+# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
# define _Noreturn __attribute__ ((__noreturn__))
-# elif defined _MSC_VER && 1200 <= _MSC_VER
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
# define _Noreturn __declspec (noreturn)
# else
# define _Noreturn
@@ -72,6 +77,13 @@ AC_DEFUN([gl_COMMON_BODY], [
#else
# define _GL_ATTRIBUTE_CONST /* empty */
#endif
+
+/* The __malloc__ attribute was added in gcc 3. */
+#if 3 <= __GNUC__
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+#else
+# define _GL_ATTRIBUTE_MALLOC /* empty */
+#endif
])
dnl Preparation for running test programs:
dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
@@ -207,13 +219,6 @@ AC_DEFUN([gl_FEATURES_H],
AC_SUBST([HAVE_FEATURES_H])
])
-# m4_foreach_w
-# is a backport of autoconf-2.59c's m4_foreach_w.
-# Remove this macro when we can assume autoconf >= 2.60.
-m4_ifndef([m4_foreach_w],
- [m4_define([m4_foreach_w],
- [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
-
# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH])
# ----------------------------------------------------
# Backport of autoconf-2.63b's macro.
@@ -226,7 +231,6 @@ m4_ifndef([AS_VAR_IF],
# Modifies the value of the shell variable CC in an attempt to make $CC
# understand ISO C99 source code.
# This is like AC_PROG_CC_C99, except that
-# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60,
# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
# <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00367.html>,
# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
@@ -315,25 +319,6 @@ Amsterdam
AC_SUBST([RANLIB])
])
-# AC_PROG_MKDIR_P
-# is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
-# for interoperability with automake-1.9.6 from autoconf-2.62.
-# Remove this macro when we can assume autoconf >= 2.62 or
-# autoconf >= 2.60 && automake >= 1.10.
-# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
-m4_ifndef([AC_AUTOCONF_VERSION],[
-m4_ifdef([AC_PROG_MKDIR_P], [
- dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
- m4_define([AC_PROG_MKDIR_P],
- m4_defn([AC_PROG_MKDIR_P])[
- AC_SUBST([MKDIR_P])])], [
- dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P.
- AC_DEFUN_ONCE([AC_PROG_MKDIR_P],
- [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
- MKDIR_P='$(mkdir_p)'
- AC_SUBST([MKDIR_P])])])
-])
-
# AC_C_RESTRICT
# This definition is copied from post-2.69 Autoconf and overrides the
# AC_C_RESTRICT macro from autoconf 2.60..2.69. It can be removed
@@ -347,16 +332,16 @@ AC_DEFUN([AC_C_RESTRICT],
for ac_kw in __restrict __restrict__ _Restrict restrict; do
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
- [[typedef int *int_ptr;
- int foo (int_ptr $ac_kw ip) { return ip[0]; }
- int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
- int bar (int ip[$ac_kw]) { return ip[0]; }
- ]],
- [[int s[1];
- int *$ac_kw t = s;
- t[0] = 0;
- return foo (t) + bar (t);
- ]])],
+ [[typedef int *int_ptr;
+ int foo (int_ptr $ac_kw ip) { return ip[0]; }
+ int bar (int [$ac_kw]); /* Catch GCC bug 14050. */
+ int bar (int ip[$ac_kw]) { return ip[0]; }
+ ]],
+ [[int s[1];
+ int *$ac_kw t = s;
+ t[0] = 0;
+ return foo (t) + bar (t);
+ ]])],
[ac_cv_c_restrict=$ac_kw])
test "$ac_cv_c_restrict" != no && break
done
@@ -407,61 +392,3 @@ AC_DEFUN([gl_CACHE_VAL_SILENT],
# AS_VAR_COPY was added in autoconf 2.63b
m4_define_default([AS_VAR_COPY],
[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
-
-# AC_PROG_SED was added in autoconf 2.59b
-m4_ifndef([AC_PROG_SED],
-[AC_DEFUN([AC_PROG_SED],
-[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
- [dnl ac_script should not contain more than 99 commands (for HP-UX sed),
- dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed.
- ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
- for ac_i in 1 2 3 4 5 6 7; do
- ac_script="$ac_script$as_nl$ac_script"
- done
- echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
- AS_UNSET([ac_script])
- if test -z "$SED"; then
- ac_path_SED_found=false
- _AS_PATH_WALK([], [
- for ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
- AS_EXECUTABLE_P(["$ac_path_SED"]) || continue
- case `"$ac_path_SED" --version 2>&1` in
- *GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;;
- *)
- ac_count=0
- _AS_ECHO_N([0123456789]) >conftest.in
- while :
- do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >> conftest.nl
- "$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
- diff conftest.out conftest.nl >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_SED_max-0}; then
- # Best so far, but keep looking for better
- ac_cv_path_SED=$ac_path_SED
- ac_path_SED_max=$ac_count
- fi
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
- esac
- $ac_path_SED_found && break 3
- done
- done])
- if test -z "$ac_cv_path_SED"; then
- AC_ERROR([no acceptable sed could be found in \$PATH])
- fi
- else
- ac_cv_path_SED=$SED
- fi
- ])
- SED="$ac_cv_path_SED"
- AC_SUBST([SED])dnl
- rm -f conftest.sed
-])
-])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index f958ac1..0d8b64f 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -82,7 +82,6 @@ AC_DEFUN([gl_EARLY],
# Code from module close-tests:
# Code from module closedir:
# Code from module closeout:
- # Code from module configmake:
# Code from module connect:
# Code from module connect-tests:
# Code from module ctype:
@@ -172,7 +171,6 @@ AC_DEFUN([gl_EARLY],
# Code from module gnupload:
# Code from module hard-locale:
# Code from module havelib:
- # Code from module host-cpu-c-abi:
# Code from module ignore-value:
# Code from module ignore-value-tests:
# Code from module include_next:
@@ -191,6 +189,7 @@ AC_DEFUN([gl_EARLY],
# Code from module langinfo-tests:
# Code from module largefile:
AC_REQUIRE([AC_SYS_LARGEFILE])
+ # Code from module libc-config:
# Code from module limits-h:
# Code from module limits-h-tests:
# Code from module link:
@@ -198,6 +197,7 @@ AC_DEFUN([gl_EARLY],
# Code from module listen:
# Code from module listen-tests:
# Code from module localcharset:
+ # Code from module localcharset-tests:
# Code from module locale:
# Code from module locale-tests:
# Code from module localeconv:
@@ -226,6 +226,8 @@ AC_DEFUN([gl_EARLY],
# Code from module memrchr:
# Code from module memrchr-tests:
# Code from module minmax:
+ # Code from module mkdir:
+ # Code from module mkdir-tests:
# Code from module mkostemp:
# Code from module msvc-inval:
# Code from module msvc-nothrow:
@@ -425,7 +427,6 @@ AC_DEFUN([gl_INIT],
gl_CLOSE_STREAM
gl_MODULE_INDICATOR([close-stream])
gl_CLOSEOUT
- gl_CONFIGMAKE_PREP
gl_CTYPE_H
gl_DIRNAME_LGPL
gl_DOUBLE_SLASH_ROOT
@@ -496,8 +497,6 @@ AC_DEFUN([gl_INIT],
m4_defn([m4_PACKAGE_VERSION])), [1], [],
[AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
[GNUmakefile=$GNUmakefile])])
- gl_HARD_LOCALE
- AC_REQUIRE([gl_HOST_CPU_C_ABI])
gl_FUNC_ISBLANK
if test $HAVE_ISBLANK = 0; then
AC_LIBOBJ([isblank])
@@ -505,9 +504,11 @@ AC_DEFUN([gl_INIT],
gl_CTYPE_MODULE_INDICATOR([isblank])
gl_LANGINFO_H
AC_REQUIRE([gl_LARGEFILE])
+ gl___INLINE
gl_LIMITS_H
gl_LOCALCHARSET
- LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
+ dnl For backward compatibility. Some packages still use this.
+ LOCALCHARSET_TESTS_ENVIRONMENT=
AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
gl_LOCALE_H
gl_FUNC_LOCALECONV
@@ -572,6 +573,10 @@ AC_DEFUN([gl_INIT],
fi
gl_STRING_MODULE_INDICATOR([memrchr])
gl_MINMAX
+ gl_FUNC_MKDIR
+ if test $REPLACE_MKDIR = 1; then
+ AC_LIBOBJ([mkdir])
+ fi
gl_FUNC_MKOSTEMP
if test $HAVE_MKOSTEMP = 0; then
AC_LIBOBJ([mkostemp])
@@ -903,6 +908,7 @@ changequote([, ])dnl
gl_SYS_SOCKET_MODULE_INDICATOR([listen])
AC_CHECK_FUNCS_ONCE([newlocale])
gl_LOCALENAME
+ gl_LOCALE_MODULE_INDICATOR([localename])
AC_CHECK_FUNCS_ONCE([newlocale])
gl_FUNC_LSEEK
if test $REPLACE_LSEEK = 1; then
@@ -1209,6 +1215,8 @@ AC_DEFUN([gl_FILE_LIST], [
lib/alloca.in.h
lib/arg-nonnull.h
lib/basename-lgpl.c
+ lib/binary-io.c
+ lib/binary-io.h
lib/btowc.c
lib/c++defs.h
lib/c-ctype.c
@@ -1218,11 +1226,11 @@ AC_DEFUN([gl_FILE_LIST], [
lib/c-strcaseeq.h
lib/c-strncasecmp.c
lib/canonicalize-lgpl.c
+ lib/cdefs.h
lib/close-stream.c
lib/close-stream.h
lib/closeout.c
lib/closeout.h
- lib/config.charset
lib/copy-acl.c
lib/ctype.in.h
lib/dfa.c
@@ -1267,6 +1275,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/intprops.h
lib/isblank.c
lib/langinfo.in.h
+ lib/libc-config.h
lib/limits.in.h
lib/localcharset.c
lib/localcharset.h
@@ -1289,6 +1298,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/memchr.valgrind
lib/memrchr.c
lib/minmax.h
+ lib/mkdir.c
lib/mkostemp.c
lib/msvc-inval.c
lib/msvc-inval.h
@@ -1306,8 +1316,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/quotearg.c
lib/quotearg.h
lib/readlink.c
- lib/ref-add.sin
- lib/ref-del.sin
lib/regcomp.c
lib/regex.c
lib/regex.h
@@ -1371,11 +1379,11 @@ AC_DEFUN([gl_FILE_LIST], [
lib/xalloc.h
lib/xmalloc.c
m4/00gnulib.m4
+ m4/__inline.m4
m4/absolute-header.m4
m4/acl.m4
m4/alloca.m4
m4/arpa_inet_h.m4
- m4/asm-underscore.m4
m4/assert.m4
m4/btowc.m4
m4/builtin-expect.m4
@@ -1385,7 +1393,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/closedir.m4
m4/closeout.m4
m4/codeset.m4
- m4/configmake.m4
m4/ctype.m4
m4/dirent_h.m4
m4/dirfd.m4
@@ -1423,10 +1430,10 @@ AC_DEFUN([gl_FILE_LIST], [
m4/gettimeofday.m4
m4/glibc21.m4
m4/gnulib-common.m4
- m4/hard-locale.m4
m4/host-cpu-c-abi.m4
m4/include_next.m4
m4/inet_pton.m4
+ m4/intl-thread-locale.m4
m4/intlmacosx.m4
m4/inttypes-pri.m4
m4/inttypes.m4
@@ -1465,6 +1472,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/memchr.m4
m4/memrchr.m4
m4/minmax.m4
+ m4/mkdir.m4
m4/mkostemp.m4
m4/mmap-anon.m4
m4/mode_t.m4
@@ -1650,6 +1658,7 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-link.c
tests/test-link.h
tests/test-listen.c
+ tests/test-localcharset.c
tests/test-locale.c
tests/test-localeconv.c
tests/test-localename.c
@@ -1674,6 +1683,8 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-mbsinit.sh
tests/test-memchr.c
tests/test-memrchr.c
+ tests/test-mkdir.c
+ tests/test-mkdir.h
tests/test-nanosleep.c
tests/test-netinet_in.c
tests/test-nl_langinfo.c
@@ -1769,8 +1780,6 @@ AC_DEFUN([gl_FILE_LIST], [
tests=lib/accept.c
tests=lib/arg-nonnull.h
tests=lib/arpa_inet.in.h
- tests=lib/binary-io.c
- tests=lib/binary-io.h
tests=lib/bind.c
tests=lib/c++defs.h
tests=lib/cloexec.c
@@ -1805,6 +1814,8 @@ AC_DEFUN([gl_FILE_LIST], [
tests=lib/ioctl.c
tests=lib/link.c
tests=lib/listen.c
+ tests=lib/localename-table.c
+ tests=lib/localename-table.h
tests=lib/localename.c
tests=lib/localename.h
tests=lib/lseek.c
diff --git a/m4/hard-locale.m4 b/m4/hard-locale.m4
deleted file mode 100644
index 1922223..0000000
--- a/m4/hard-locale.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-# hard-locale.m4 serial 8
-dnl Copyright (C) 2002-2006, 2009-2018 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl No prerequisites of lib/hard-locale.c.
-AC_DEFUN([gl_HARD_LOCALE],
-[
- :
-])
diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4
index 3fac6f7..cd88070 100644
--- a/m4/host-cpu-c-abi.m4
+++ b/m4/host-cpu-c-abi.m4
@@ -1,4 +1,4 @@
-# host-cpu-c-abi.m4 serial 10
+# host-cpu-c-abi.m4 serial 11
dnl Copyright (C) 2002-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -454,3 +454,191 @@ 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 This is a simplified variant of gl_HOST_CPU_C_ABI.
+AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
+ [if test -n "$gl_cv_host_cpu_c_abi"; then
+ case "$gl_cv_host_cpu_c_abi" in
+ i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+ gl_cv_host_cpu_c_abi_32bit=yes ;;
+ *)
+ gl_cv_host_cpu_c_abi_32bit=no ;;
+ esac
+ else
+ case "$host_cpu" in
+
+changequote(,)dnl
+ i[4567]86 )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ x86_64 )
+ # On x86_64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+ # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+ # with native Windows (mingw, MSVC).
+ # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (defined __x86_64__ || defined __amd64__ \
+ || defined _M_X64 || defined _M_AMD64) \
+ && !(defined __ILP32__ || defined _ILP32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ arm* | aarch64 )
+ # Assume arm with EABI.
+ # On arm64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+ # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+ # On hppa, the C compiler may be generating 32-bit code or 64-bit
+ # code. In the latter case, it defines _LP64 and __LP64__.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ ia64* )
+ # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+ # 32-bit code. In the latter case, it defines _ILP32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=yes],
+ [gl_cv_host_cpu_c_abi_32bit=no])
+ ;;
+
+ mips* )
+ # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+ # at 32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ powerpc* )
+ # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+ # No need to distinguish them here; the caller may distinguish
+ # them based on the OS.
+ # On powerpc64 systems, the C compiler may still be generating
+ # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+ # be generating 64-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ rs6000 )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ riscv32 | riscv64 )
+ # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+ # Size of 'long' and 'void *':
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ s390* )
+ # On s390x, the C compiler may be generating 64-bit (= s390x) code
+ # or 31-bit (= s390) code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __s390x__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ sparc | sparc64 )
+ # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+ # C compiler still generates 32-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ *)
+ gl_cv_host_cpu_c_abi_32bit=no
+ ;;
+ esac
+ fi
+ ])
+
+ HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+])
diff --git a/m4/intl-thread-locale.m4 b/m4/intl-thread-locale.m4
new file mode 100644
index 0000000..661a23f
--- /dev/null
+++ b/m4/intl-thread-locale.m4
@@ -0,0 +1,183 @@
+# intl-thread-locale.m4 serial 4
+dnl Copyright (C) 2015-2018 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Check how to retrieve the name of a per-thread locale (POSIX locale_t).
+dnl Sets gt_nameless_locales.
+AC_DEFUN([gt_INTL_THREAD_LOCALE_NAME],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Persuade Solaris <locale.h> to define 'locale_t'.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ dnl Test whether uselocale() exists and works at all.
+ gt_FUNC_USELOCALE
+
+ dnl On OpenBSD >= 6.2, the locale_t type and the uselocale(), newlocale(),
+ dnl duplocale(), freelocale() functions exist but are effectively useless,
+ dnl because the locale_t value depends only on the LC_CTYPE category of the
+ dnl locale and furthermore contains only one bit of information (it
+ dnl distinguishes the "C" locale from the *.UTF-8 locales). See
+ dnl <https://cvsweb.openbsd.org/src/lib/libc/locale/newlocale.c?rev=1.1&content-type=text/x-cvsweb-markup>.
+ dnl In the setlocale() implementation they have thought about the programs
+ dnl that use the API ("Even though only LC_CTYPE has any effect in the
+ dnl OpenBSD base system, store complete information about the global locale,
+ dnl such that third-party software can access it"), but for uselocale()
+ dnl they did not think about the programs.
+ dnl In this situation, even the HAVE_NAMELESS_LOCALES support does not work.
+ dnl So, define HAVE_FAKE_LOCALES and disable all locale_t support.
+ case "$gt_cv_func_uselocale_works" in
+ *yes)
+ AC_CHECK_HEADERS_ONCE([xlocale.h])
+ AC_CACHE_CHECK([for fake locale system (OpenBSD)],
+ [gt_cv_locale_fake],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#if HAVE_XLOCALE_H
+# include <xlocale.h>
+#endif
+int main ()
+{
+ locale_t loc1, loc2;
+ if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL) return 1;
+ if (setlocale (LC_ALL, "fr_FR.UTF-8") == NULL) return 1;
+ loc1 = newlocale (LC_ALL_MASK, "de_DE.UTF-8", (locale_t)0);
+ loc2 = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", (locale_t)0);
+ return !(loc1 == loc2);
+}]])],
+ [gt_cv_locale_fake=yes],
+ [gt_cv_locale_fake=no],
+ [dnl Guess the locale system is fake only on OpenBSD.
+ case "$host_os" in
+ openbsd*) gt_cv_locale_fake="guessing yes" ;;
+ *) gt_cv_locale_fake="guessing no" ;;
+ esac
+ ])
+ ])
+ ;;
+ *) gt_cv_locale_fake=no ;;
+ esac
+ case "$gt_cv_locale_fake" in
+ *yes)
+ AC_DEFINE([HAVE_FAKE_LOCALES], [1],
+ [Define if the locale_t type contains insufficient information, as on OpenBSD.])
+ ;;
+ esac
+
+ case "$gt_cv_func_uselocale_works" in
+ *yes)
+ AC_CACHE_CHECK([for Solaris 11.4 locale system],
+ [gt_cv_locale_solaris114],
+ [case "$host_os" in
+ solaris*)
+ dnl Test whether <locale.h> defines locale_t as a typedef of
+ dnl 'struct _LC_locale_t **' (whereas Illumos defines it as a
+ dnl typedef of 'struct _locale *').
+ dnl Another possible test would be to include <sys/localedef.h>
+ dnl and test whether it defines the _LC_core_data_locale_t type.
+ dnl This type was added in Solaris 11.4.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <locale.h>
+ struct _LC_locale_t *x;
+ locale_t y;
+ ]],
+ [[*y = x;]])],
+ [gt_cv_locale_solaris114=yes],
+ [gt_cv_locale_solaris114=no])
+ ;;
+ *) gt_cv_locale_solaris114=no ;;
+ esac
+ ])
+ ;;
+ *) gt_cv_locale_solaris114=no ;;
+ esac
+ if test $gt_cv_locale_solaris114 = yes; then
+ AC_DEFINE([HAVE_SOLARIS114_LOCALES], [1],
+ [Define if the locale_t type is as on Solaris 11.4.])
+ fi
+
+ dnl Solaris 12 will maybe provide getlocalename_l. If it does, it will
+ dnl improve the implementation of gl_locale_name_thread(), by removing
+ dnl the use of undocumented structures.
+ case "$gt_cv_func_uselocale_works" in
+ *yes)
+ AC_CHECK_FUNCS([getlocalename_l])
+ ;;
+ esac
+
+ dnl This code is for future use, in case we some day have to port to a
+ dnl platform where the locale_t type does not provide access to the name of
+ dnl each locale category. This code has the drawback that it requires the
+ dnl gnulib overrides of 'newlocale', 'duplocale', 'freelocale', which is a
+ dnl problem for GNU libunistring. Therefore try hard to avoid enabling this
+ dnl code!
+ gt_nameless_locales=no
+ if false; then
+ gt_nameless_locales=yes
+ AC_DEFINE([HAVE_NAMELESS_LOCALES], [1],
+ [Define if the locale_t type does not contain the name of each locale category.])
+ fi
+])
+
+dnl Tests whether uselocale() exists and is usable.
+dnl Sets gt_cv_func_uselocale_works. Defines HAVE_WORKING_USELOCALE.
+AC_DEFUN([gt_FUNC_USELOCALE],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Persuade Solaris <locale.h> to define 'locale_t'.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_FUNCS_ONCE([uselocale])
+
+ dnl On AIX 7.2, the uselocale() function is not documented and leads to
+ dnl crashes in subsequent setlocale() invocations.
+ if test $ac_cv_func_uselocale = yes; then
+ AC_CHECK_HEADERS_ONCE([xlocale.h])
+ AC_CACHE_CHECK([whether uselocale works],
+ [gt_cv_func_uselocale_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <locale.h>
+#if HAVE_XLOCALE_H
+# include <xlocale.h>
+#endif
+int main ()
+{
+ uselocale (NULL);
+ setlocale (LC_ALL, "en_US.UTF-8");
+ return 0;
+}]])],
+ [gt_cv_func_uselocale_works=yes],
+ [gt_cv_func_uselocale_works=no],
+ [# Guess no on AIX, yes otherwise.
+ case "$host_os" in
+ aix*) gt_cv_func_uselocale_works="guessing no" ;;
+ *) gt_cv_func_uselocale_works="guessing yes" ;;
+ esac
+ ])
+ ])
+ else
+ gt_cv_func_uselocale_works=no
+ fi
+ case "$gt_cv_func_uselocale_works" in
+ *yes)
+ AC_DEFINE([HAVE_WORKING_USELOCALE], [1],
+ [Define if the uselocale function exists any may safely be called.])
+ ;;
+ esac
+])
diff --git a/m4/intlmacosx.m4 b/m4/intlmacosx.m4
index aca924c..17c1bd4 100644
--- a/m4/intlmacosx.m4
+++ b/m4/intlmacosx.m4
@@ -1,4 +1,4 @@
-# intlmacosx.m4 serial 5 (gettext-0.18.2)
+# intlmacosx.m4 serial 6 (gettext-0.19.9)
dnl Copyright (C) 2004-2014, 2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@ dnl Checks for special options needed on Mac OS X.
dnl Defines INTL_MACOSX_LIBS.
AC_DEFUN([gt_INTL_MACOSX],
[
- dnl Check for API introduced in Mac OS X 10.2.
+ dnl Check for API introduced in Mac OS X 10.4.
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
[gt_cv_func_CFPreferencesCopyAppValue],
[gt_save_LIBS="$LIBS"
@@ -33,7 +33,7 @@ AC_DEFUN([gt_INTL_MACOSX],
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
[Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
fi
- dnl Check for API introduced in Mac OS X 10.3.
+ dnl Check for API introduced in Mac OS X 10.5.
AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
[gt_save_LIBS="$LIBS"
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
@@ -48,8 +48,24 @@ AC_DEFUN([gt_INTL_MACOSX],
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
[Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
fi
+ AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
+ [gt_save_LIBS="$LIBS"
+ LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <CoreFoundation/CFLocale.h>]],
+ [[CFLocaleCopyPreferredLanguages();]])],
+ [gt_cv_func_CFLocaleCopyPreferredLanguages=yes],
+ [gt_cv_func_CFLocaleCopyPreferredLanguages=no])
+ LIBS="$gt_save_LIBS"])
+ if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+ AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1],
+ [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.])
+ fi
INTL_MACOSX_LIBS=
- if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+ if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
+ || test $gt_cv_func_CFLocaleCopyCurrent = yes \
+ || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
fi
AC_SUBST([INTL_MACOSX_LIBS])
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
index 8069493..d756f01 100644
--- a/m4/inttypes.m4
+++ b/m4/inttypes.m4
@@ -1,4 +1,4 @@
-# inttypes.m4 serial 26
+# inttypes.m4 serial 27
dnl Copyright (C) 2006-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -147,6 +147,7 @@ AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
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])
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
index df77db9..dee3300 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 26 (gettext-0.18.2)
+# lib-link.m4 serial 28
dnl Copyright (C) 2001-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,7 +6,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
-AC_PREREQ([2.54])
+AC_PREREQ([2.61])
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
dnl the libraries corresponding to explicit and implicit dependencies.
@@ -124,8 +124,8 @@ dnl acl_hardcode_direct,
dnl acl_hardcode_minus_L.
AC_DEFUN([AC_LIB_RPATH],
[
- dnl Tell automake >= 1.10 to complain if config.rpath is missing.
- m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
+ dnl Complain if config.rpath is missing.
+ AC_REQUIRE_AUX_FILE([config.rpath])
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
@@ -187,17 +187,15 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
- dnl Autoconf >= 2.61 supports dots in --with options.
- pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
- AC_ARG_WITH(P_A_C_K[-prefix],
-[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
- --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
+ AC_ARG_WITH(PACK[-prefix],
+[[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
+ --without-]]PACK[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
[
if test "X$withval" = "Xno"; then
use_additional=no
@@ -670,7 +668,6 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
done
fi
- popdef([P_A_C_K])
popdef([PACKLIBS])
popdef([PACKUP])
popdef([PACK])
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
index 16b26fb..2e90b11 100644
--- a/m4/lib-prefix.m4
+++ b/m4/lib-prefix.m4
@@ -1,4 +1,4 @@
-# lib-prefix.m4 serial 11
+# lib-prefix.m4 serial 14
dnl Copyright (C) 2001-2005, 2008-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,13 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
-dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
-dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
-dnl require excessive bracketing.
-ifdef([AC_HELP_STRING],
-[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
-[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
-
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
dnl to access previously installed libraries. The basic assumption is that
dnl a user will want packages to use other packages he previously installed
@@ -32,9 +25,9 @@ AC_DEFUN([AC_LIB_PREFIX],
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
- AC_LIB_ARG_WITH([lib-prefix],
-[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
- --without-lib-prefix don't search for libraries in includedir and libdir],
+ AC_ARG_WITH([lib-prefix],
+[[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+ --without-lib-prefix don't search for libraries in includedir and libdir]],
[
if test "X$withval" = "Xno"; then
use_additional=no
@@ -174,7 +167,24 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
AC_REQUIRE([AC_CANONICAL_HOST])
- AC_REQUIRE([gl_HOST_CPU_C_ABI])
+ 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
+
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],
@@ -187,18 +197,6 @@ 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.
- 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])
- ])
if test $gl_cv_solaris_64bit = yes; then
acl_libdirstem=lib/64
case "$host_cpu" in
@@ -210,40 +208,36 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
*)
dnl If $CC generates code for a 32-bit ABI, the libraries are
dnl surely under $prefix/lib, not $prefix/lib64.
- case "$gl_cv_host_cpu_c_abi" in
- i386 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | s390 | sparc)
- ;;
- *) # x86_64 | arm64 | hppa64 | ia64 | mips64 | powerpc64* | s390x | sparc64 | ...
- 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"
- fi
- ;;
- esac
+ 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"
+ fi
+ fi
;;
esac
test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
diff --git a/m4/limits-h.m4 b/m4/limits-h.m4
index 511dcef..3a2cd91 100644
--- a/m4/limits-h.m4
+++ b/m4/limits-h.m4
@@ -11,14 +11,18 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
[
gl_CHECK_NEXT_HEADERS([limits.h])
- AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.],
+ AC_CACHE_CHECK([whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.],
[gl_cv_header_limits_width],
[AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
- #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
- #endif
- #include <limits.h>
- int ullw = ULLONG_WIDTH;]])],
+ [AC_LANG_PROGRAM(
+ [[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+ #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+ #endif
+ #include <limits.h>
+ long long llm = LLONG_MAX;
+ int wb = WORD_BIT;
+ int ullw = ULLONG_WIDTH;
+ ]])],
[gl_cv_header_limits_width=yes],
[gl_cv_header_limits_width=no])])
if test "$gl_cv_header_limits_width" = yes; then
@@ -29,3 +33,11 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
AC_SUBST([LIMITS_H])
AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
])
+
+dnl Unconditionally enables the replacement of <limits.h>.
+AC_DEFUN([gl_REPLACE_LIMITS_H],
+[
+ AC_REQUIRE([gl_LIMITS_H])
+ LIMITS_H='limits.h'
+ AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+])
diff --git a/m4/link.m4 b/m4/link.m4
index b0b3ff2..d06b4f2 100644
--- a/m4/link.m4
+++ b/m4/link.m4
@@ -1,4 +1,4 @@
-# link.m4 serial 9
+# link.m4 serial 10
dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -39,10 +39,12 @@ AC_DEFUN([gl_FUNC_LINK],
]])],
[gl_cv_func_link_works=yes], [gl_cv_func_link_works=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_link_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_link_works="guessing no" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_link_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_link_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_link_works="guessing no" ;;
esac
])
rm -f conftest.a conftest.b conftest.lnk])
diff --git a/m4/localcharset.m4 b/m4/localcharset.m4
index 2d7ca64..d38a2c9 100644
--- a/m4/localcharset.m4
+++ b/m4/localcharset.m4
@@ -1,4 +1,4 @@
-# localcharset.m4 serial 7
+# localcharset.m4 serial 8
dnl Copyright (C) 2002, 2004, 2006, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,10 +8,4 @@ AC_DEFUN([gl_LOCALCHARSET],
[
dnl Prerequisites of lib/localcharset.c.
AC_REQUIRE([AM_LANGINFO_CODESET])
- AC_REQUIRE([gl_FCNTL_O_FLAGS])
- AC_CHECK_DECLS_ONCE([getc_unlocked])
-
- dnl Prerequisites of the lib/Makefile.am snippet.
- AC_REQUIRE([AC_CANONICAL_HOST])
- AC_REQUIRE([gl_GLIBC21])
])
diff --git a/m4/locale-fr.m4 b/m4/locale-fr.m4
index 30a1d94..a37a0d2 100644
--- a/m4/locale-fr.m4
+++ b/m4/locale-fr.m4
@@ -1,4 +1,4 @@
-# locale-fr.m4 serial 18
+# locale-fr.m4 serial 19
dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -31,7 +31,7 @@ int main () {
return 1;
#else
/* Check whether the given locale name is recognized by the system. */
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -160,7 +160,7 @@ int main () {
variables, and all locales use the UTF-8 encoding. */
#if !(defined __BEOS__ || defined __HAIKU__)
/* Check whether the given locale name is recognized by the system. */
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
diff --git a/m4/locale-ja.m4 b/m4/locale-ja.m4
index 2c34006..9f16231 100644
--- a/m4/locale-ja.m4
+++ b/m4/locale-ja.m4
@@ -1,4 +1,4 @@
-# locale-ja.m4 serial 13
+# locale-ja.m4 serial 14
dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -32,7 +32,7 @@ int main ()
return 1;
#else
/* Check whether the given locale name is recognized by the system. */
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
diff --git a/m4/locale-tr.m4 b/m4/locale-tr.m4
index 441cae6..2f2cf47 100644
--- a/m4/locale-tr.m4
+++ b/m4/locale-tr.m4
@@ -1,4 +1,4 @@
-# locale-tr.m4 serial 10
+# locale-tr.m4 serial 11
dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -30,7 +30,7 @@ int main () {
implement the Turkish upper-/lowercase mappings. Therefore, let this
program return 1 on BeOS. */
/* Check whether the given locale name is recognized by the system. */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
diff --git a/m4/locale-zh.m4 b/m4/locale-zh.m4
index f7e1901..cfb447f 100644
--- a/m4/locale-zh.m4
+++ b/m4/locale-zh.m4
@@ -1,4 +1,4 @@
-# locale-zh.m4 serial 13
+# locale-zh.m4 serial 14
dnl Copyright (C) 2003, 2005-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -33,7 +33,7 @@ int main ()
return 1;
#else
/* Check whether the given locale name is recognized by the system. */
-# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
/* On native Windows, setlocale(category, "") looks at the system settings,
not at the environment variables. Also, when an encoding suffix such
as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
diff --git a/m4/locale_h.m4 b/m4/locale_h.m4
index 4bd9e57..e619dcd 100644
--- a/m4/locale_h.m4
+++ b/m4/locale_h.m4
@@ -1,4 +1,4 @@
-# locale_h.m4 serial 20
+# locale_h.m4 serial 21
dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -96,7 +96,7 @@ AC_DEFUN([gl_LOCALE_H],
# include <xlocale.h>
#endif
]],
- [setlocale duplocale])
+ [setlocale newlocale duplocale freelocale])
])
AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
@@ -113,10 +113,15 @@ 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])
dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_NEWLOCALE=1; AC_SUBST([HAVE_NEWLOCALE])
HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE])
+ HAVE_FREELOCALE=1; AC_SUBST([HAVE_FREELOCALE])
REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV])
REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE])
+ REPLACE_NEWLOCALE=0; AC_SUBST([REPLACE_NEWLOCALE])
REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
+ REPLACE_FREELOCALE=0; AC_SUBST([REPLACE_FREELOCALE])
REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV])
])
diff --git a/m4/localename.m4 b/m4/localename.m4
index a0e1367..f093fa5 100644
--- a/m4/localename.m4
+++ b/m4/localename.m4
@@ -1,4 +1,4 @@
-# localename.m4 serial 3
+# localename.m4 serial 5
dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,13 +6,25 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_LOCALENAME],
[
+ AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
AC_REQUIRE([gt_LC_MESSAGES])
+ AC_REQUIRE([gt_INTL_THREAD_LOCALE_NAME])
AC_REQUIRE([gt_INTL_MACOSX])
AC_CHECK_HEADERS_ONCE([langinfo.h])
- AC_CHECK_FUNCS([setlocale uselocale])
- dnl Solaris 12 provides getlocalename_l, while Illumos doesn't have
- dnl it nor the equivalent.
- if test $ac_cv_func_uselocale = yes; then
- AC_CHECK_FUNCS([getlocalename_l])
+ AC_CHECK_FUNCS([setlocale])
+ AC_CHECK_FUNCS_ONCE([newlocale duplocale freelocale])
+ if test $ac_cv_func_newlocale != yes; then
+ HAVE_NEWLOCALE=0
+ fi
+ if test $ac_cv_func_duplocale != yes; then
+ HAVE_DUPLOCALE=0
+ fi
+ if test $ac_cv_func_freelocale != yes; then
+ HAVE_FREELOCALE=0
+ fi
+ if test $gt_nameless_locales = yes; then
+ REPLACE_NEWLOCALE=1
+ REPLACE_DUPLOCALE=1
+ REPLACE_FREELOCALE=1
fi
])
diff --git a/m4/longlong.m4 b/m4/longlong.m4
index 27e6326..582af53 100644
--- a/m4/longlong.m4
+++ b/m4/longlong.m4
@@ -1,4 +1,4 @@
-# longlong.m4 serial 17
+# longlong.m4 serial 18
dnl Copyright (C) 1999-2007, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,9 +6,10 @@ 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 fixes a bug in Autoconf 2.61, and can be faster
-# than what's in Autoconf 2.62 through 2.68.
+# 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
@@ -56,8 +57,7 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
])
# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
-# This fixes a bug in Autoconf 2.61, and can be faster
-# than what's in Autoconf 2.62 through 2.68.
+# 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
diff --git a/m4/lstat.m4 b/m4/lstat.m4
index ac6f143..3694e4c 100644
--- a/m4/lstat.m4
+++ b/m4/lstat.m4
@@ -1,4 +1,4 @@
-# serial 31
+# serial 32
# Copyright (C) 1997-2001, 2003-2018 Free Software Foundation, Inc.
#
@@ -53,6 +53,9 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
[gl_cv_func_lstat_dereferences_slashed_symlink=yes],
[gl_cv_func_lstat_dereferences_slashed_symlink=no],
[case "$host_os" in
+ linux-* | linux)
+ # Guess yes on Linux systems.
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
*-gnu* | gnu*)
# Guess yes on glibc systems.
gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
diff --git a/m4/malloc.m4 b/m4/malloc.m4
index 0ded9ba..4c182b4 100644
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -1,4 +1,4 @@
-# malloc.m4 serial 16
+# malloc.m4 serial 17
dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -91,7 +91,7 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[]],
- [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ [[#if defined _WIN32 && ! defined __CYGWIN__
choke me
#endif
]])],
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 18249b8..d831ed2 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -1,4 +1,4 @@
-# manywarnings.m4 serial 13
+# manywarnings.m4 serial 17
dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -51,54 +51,53 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
dnl Check if -W -Werror -Wno-missing-field-initializers is supported
dnl with the current $CC $CFLAGS $CPPFLAGS.
- AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported])
- AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [
- gl_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[]], [[]])],
- [gl_cv_cc_nomfi_supported=yes],
- [gl_cv_cc_nomfi_supported=no])
- CFLAGS="$gl_save_CFLAGS"])
- AC_MSG_RESULT([$gl_cv_cc_nomfi_supported])
+ AC_CACHE_CHECK([whether -Wno-missing-field-initializers is supported],
+ [gl_cv_cc_nomfi_supported],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [gl_cv_cc_nomfi_supported=yes],
+ [gl_cv_cc_nomfi_supported=no])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
if test "$gl_cv_cc_nomfi_supported" = yes; then
dnl Now check whether -Wno-missing-field-initializers is needed
dnl for the { 0, } construct.
- AC_MSG_CHECKING([whether -Wno-missing-field-initializers is needed])
- AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [
- gl_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -W -Werror"
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[int f (void)
- {
- typedef struct { int a; int b; } s_t;
- s_t s1 = { 0, };
- return s1.b;
- }
- ]],
- [[]])],
- [gl_cv_cc_nomfi_needed=no],
- [gl_cv_cc_nomfi_needed=yes])
- CFLAGS="$gl_save_CFLAGS"
- ])
- AC_MSG_RESULT([$gl_cv_cc_nomfi_needed])
+ AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed],
+ [gl_cv_cc_nomfi_needed],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -W -Werror"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[int f (void)
+ {
+ typedef struct { int a; int b; } s_t;
+ s_t s1 = { 0, };
+ return s1.b;
+ }
+ ]],
+ [[]])],
+ [gl_cv_cc_nomfi_needed=no],
+ [gl_cv_cc_nomfi_needed=yes])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
fi
dnl Next, check if -Werror -Wuninitialized is useful with the
dnl user's choice of $CFLAGS; some versions of gcc warn that it
dnl has no effect if -O is not also used
- AC_MSG_CHECKING([whether -Wuninitialized is supported])
- AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [
- gl_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Werror -Wuninitialized"
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[]], [[]])],
- [gl_cv_cc_uninitialized_supported=yes],
- [gl_cv_cc_uninitialized_supported=no])
- CFLAGS="$gl_save_CFLAGS"])
- AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported])
+ AC_CACHE_CHECK([whether -Wuninitialized is supported],
+ [gl_cv_cc_uninitialized_supported],
+ [gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror -Wuninitialized"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [gl_cv_cc_uninitialized_supported=yes],
+ [gl_cv_cc_uninitialized_supported=no])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
fi
@@ -106,18 +105,17 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
# To compare this list to your installed GCC's, run this Bash command:
#
# comm -3 \
- # <(sed -n 's/^ *\(-[^ 0-9][^ ]*\) .*/\1/p' manywarnings.m4 | sort) \
- # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort |
- # grep -v -x -F -f <(
- # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec))
+ # <((sed -n 's/^ *\(-[^ 0-9][^ ]*\) .*/\1/p' manywarnings.m4; \
+ # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec) | sort) \
+ # <(LC_ALL=C gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort)
gl_manywarn_set=
for gl_manywarn_item in -fno-common \
-W \
- -Wabi \
-Waddress \
-Waggressive-loop-optimizations \
-Wall \
+ -Wattribute-alias \
-Wattributes \
-Wbad-function-cast \
-Wbool-compare \
@@ -125,8 +123,9 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Wbuiltin-declaration-mismatch \
-Wbuiltin-macro-redefined \
-Wcast-align \
+ -Wcast-align=strict \
+ -Wcast-function-type \
-Wchar-subscripts \
- -Wchkp \
-Wclobbered \
-Wcomment \
-Wcomments \
@@ -160,6 +159,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Wframe-address \
-Wfree-nonheap-object \
-Whsa \
+ -Wif-not-aligned \
-Wignored-attributes \
-Wignored-qualifiers \
-Wimplicit \
@@ -173,7 +173,6 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Wint-to-pointer-cast \
-Winvalid-memory-model \
-Winvalid-pch \
- -Wjump-misses-init \
-Wlogical-not-parentheses \
-Wlogical-op \
-Wmain \
@@ -181,6 +180,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Wmemset-elt-size \
-Wmemset-transposed-args \
-Wmisleading-indentation \
+ -Wmissing-attributes \
-Wmissing-braces \
-Wmissing-declarations \
-Wmissing-field-initializers \
@@ -188,6 +188,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Wmissing-parameter-type \
-Wmissing-prototypes \
-Wmultichar \
+ -Wmultistatement-macros \
-Wnarrowing \
-Wnested-externs \
-Wnonnull \
@@ -202,6 +203,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Woverride-init \
-Wpacked \
-Wpacked-bitfield-compat \
+ -Wpacked-not-aligned \
-Wparentheses \
-Wpointer-arith \
-Wpointer-compare \
@@ -219,20 +221,23 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
-Wshift-count-overflow \
-Wshift-negative-value \
-Wsizeof-array-argument \
+ -Wsizeof-pointer-div \
-Wsizeof-pointer-memaccess \
-Wstack-protector \
-Wstrict-aliasing \
-Wstrict-overflow \
-Wstrict-prototypes \
+ -Wstringop-truncation \
+ -Wsuggest-attribute=cold \
-Wsuggest-attribute=const \
-Wsuggest-attribute=format \
+ -Wsuggest-attribute=malloc \
-Wsuggest-attribute=noreturn \
-Wsuggest-attribute=pure \
-Wsuggest-final-methods \
-Wsuggest-final-types \
-Wswitch \
-Wswitch-bool \
- -Wswitch-default \
-Wswitch-unreachable \
-Wsync-nand \
-Wsystem-headers \
diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4
index f789875..c706d04 100644
--- a/m4/mbrtowc.m4
+++ b/m4/mbrtowc.m4
@@ -1,4 +1,4 @@
-# mbrtowc.m4 serial 30 -*- coding: utf-8 -*-
+# mbrtowc.m4 serial 31 -*- coding: utf-8 -*-
dnl Copyright (C) 2001-2002, 2004-2005, 2008-2018 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -634,6 +634,7 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
# Prerequisites of lib/mbrtowc.c.
AC_DEFUN([gl_PREREQ_MBRTOWC], [
+ AC_REQUIRE([AC_C_INLINE])
:
])
diff --git a/m4/mkdir.m4 b/m4/mkdir.m4
new file mode 100644
index 0000000..1452999
--- /dev/null
+++ b/m4/mkdir.m4
@@ -0,0 +1,82 @@
+# serial 14
+
+# Copyright (C) 2001, 2003-2004, 2006, 2008-2018 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.
+
+# On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
+# On others, mkdir ("foo/./", 0700) mistakenly succeeds.
+# On such systems, arrange to use a wrapper function.
+AC_DEFUN([gl_FUNC_MKDIR],
+[dnl
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CACHE_CHECK([whether mkdir handles trailing slash],
+ [gl_cv_func_mkdir_trailing_slash_works],
+ [rm -rf conftest.dir
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+# include <sys/types.h>
+# include <sys/stat.h>
+]], [return mkdir ("conftest.dir/", 0700);])],
+ [gl_cv_func_mkdir_trailing_slash_works=yes],
+ [gl_cv_func_mkdir_trailing_slash_works=no],
+ [case "$host_os" in
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
+ # Guess yes on MSVC, no on mingw.
+ mingw*) AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+ ],
+ [gl_cv_func_mkdir_trailing_slash_works="guessing yes"],
+ [gl_cv_func_mkdir_trailing_slash_works="guessing no"])
+ ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_mkdir_trailing_slash_works="guessing no" ;;
+ esac
+ ])
+ rm -rf conftest.dir
+ ]
+ )
+ case "$gl_cv_func_mkdir_trailing_slash_works" in
+ *yes) ;;
+ *)
+ REPLACE_MKDIR=1
+ ;;
+ esac
+
+ AC_CACHE_CHECK([whether mkdir handles trailing dot],
+ [gl_cv_func_mkdir_trailing_dot_works],
+ [rm -rf conftest.dir
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+# include <sys/types.h>
+# include <sys/stat.h>
+]], [return !mkdir ("conftest.dir/./", 0700);])],
+ [gl_cv_func_mkdir_trailing_dot_works=yes],
+ [gl_cv_func_mkdir_trailing_dot_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) 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" ;;
+ esac
+ ])
+ rm -rf conftest.dir
+ ]
+ )
+ case "$gl_cv_func_mkdir_trailing_dot_works" in
+ *yes) ;;
+ *)
+ REPLACE_MKDIR=1
+ AC_DEFINE([FUNC_MKDIR_DOT_BUG], [1], [Define to 1 if mkdir mistakenly
+ creates a directory given with a trailing dot component.])
+ ;;
+ esac
+])
diff --git a/m4/nanosleep.m4 b/m4/nanosleep.m4
index 8903734..7c945cc 100644
--- a/m4/nanosleep.m4
+++ b/m4/nanosleep.m4
@@ -1,4 +1,4 @@
-# serial 37
+# serial 38
dnl From Jim Meyering.
dnl Check for the nanosleep function.
@@ -22,6 +22,8 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
AC_CHECK_HEADERS_ONCE([sys/time.h])
AC_REQUIRE([gl_FUNC_SELECT])
+ AC_CHECK_DECLS_ONCE([alarm])
+
nanosleep_save_libs=$LIBS
# Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
@@ -62,40 +64,49 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
? (t) -1 \
: ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+ #if HAVE_DECL_ALARM
static void
check_for_SIGALRM (int sig)
{
if (sig != SIGALRM)
_exit (1);
}
+ #endif
int
main ()
{
static struct timespec ts_sleep;
static struct timespec ts_remaining;
- static struct sigaction act;
/* Test for major problems first. */
if (! nanosleep)
return 2;
- act.sa_handler = check_for_SIGALRM;
- sigemptyset (&act.sa_mask);
- sigaction (SIGALRM, &act, NULL);
ts_sleep.tv_sec = 0;
ts_sleep.tv_nsec = 1;
- alarm (1);
- if (nanosleep (&ts_sleep, NULL) != 0)
+ #if HAVE_DECL_ALARM
+ {
+ static struct sigaction act;
+ act.sa_handler = check_for_SIGALRM;
+ sigemptyset (&act.sa_mask);
+ sigaction (SIGALRM, &act, NULL);
+ alarm (1);
+ if (nanosleep (&ts_sleep, NULL) != 0)
+ return 3;
+ /* Test for a minor problem: the handling of large arguments. */
+ ts_sleep.tv_sec = TYPE_MAXIMUM (time_t);
+ ts_sleep.tv_nsec = 999999999;
+ alarm (1);
+ if (nanosleep (&ts_sleep, &ts_remaining) != -1)
+ return 4;
+ if (errno != EINTR)
+ return 5;
+ if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10)
+ return 6;
+ }
+ #else /* A simpler test for native Windows. */
+ if (nanosleep (&ts_sleep, &ts_remaining) < 0)
return 3;
- /* Test for a minor problem: the handling of large arguments. */
- ts_sleep.tv_sec = TYPE_MAXIMUM (time_t);
- ts_sleep.tv_nsec = 999999999;
- alarm (1);
- if (nanosleep (&ts_sleep, &ts_remaining) != -1)
- return 4;
- if (errno != EINTR)
- return 5;
- if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10)
- return 6;
+ #endif
return 0;
}]])],
[gl_cv_func_nanosleep=yes],
diff --git a/m4/nocrash.m4 b/m4/nocrash.m4
index 87b2d4c..4914007 100644
--- a/m4/nocrash.m4
+++ b/m4/nocrash.m4
@@ -1,4 +1,4 @@
-# nocrash.m4 serial 4
+# nocrash.m4 serial 5
dnl Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -79,7 +79,7 @@ nocrash_init (void)
}
}
}
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
/* Avoid a crash on native Windows. */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
diff --git a/m4/pathmax.m4 b/m4/pathmax.m4
index 403a375..292a256 100644
--- a/m4/pathmax.m4
+++ b/m4/pathmax.m4
@@ -1,4 +1,4 @@
-# pathmax.m4 serial 10
+# pathmax.m4 serial 11
dnl Copyright (C) 2002-2003, 2005-2006, 2009-2018 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -29,7 +29,7 @@ AC_DEFUN([gl_PATHMAX_SNIPPET], [[
# undef PATH_MAX
# define PATH_MAX 1024
#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
# undef PATH_MAX
# define PATH_MAX 260
#endif
diff --git a/m4/pthread_rwlock_rdlock.m4 b/m4/pthread_rwlock_rdlock.m4
index 9c1d5d0..6812b4f 100644
--- a/m4/pthread_rwlock_rdlock.m4
+++ b/m4/pthread_rwlock_rdlock.m4
@@ -1,4 +1,4 @@
-# pthread_rwlock_rdlock.m4 serial 1
+# pthread_rwlock_rdlock.m4 serial 2
dnl Copyright (C) 2017-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -23,12 +23,14 @@ dnl time, a phenomenon called "writer starvation".
dnl Without such a guarantee, applications have a hard time avoiding writer
dnl starvation.
dnl
-dnl POSIX:2008 makes this requirement only for implementations that support TPS
+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 but test verifies the guarantee regardless of TPS and regardless of
+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 https://sourceware.org/bugzilla/show_bug.cgi?id=13701
AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER],
[
AC_REQUIRE([gl_THREADLIB_EARLY])
diff --git a/m4/readlink.m4 b/m4/readlink.m4
index 9d73f5c..4d0ab48 100644
--- a/m4/readlink.m4
+++ b/m4/readlink.m4
@@ -1,4 +1,4 @@
-# readlink.m4 serial 13
+# readlink.m4 serial 14
dnl Copyright (C) 2003, 2007, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -34,10 +34,12 @@ AC_DEFUN([gl_FUNC_READLINK],
return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])],
[gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no],
[case "$host_os" in
- # 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" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_readlink_works="guessing no" ;;
esac
])
rm -f conftest.link conftest.lnk2])
diff --git a/m4/regex.m4 b/m4/regex.m4
index 055d71b..3a39b1a 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,4 +1,4 @@
-# serial 67
+# serial 68
# Copyright (C) 1996-2001, 2003-2018 Free Software Foundation, Inc.
#
@@ -213,6 +213,17 @@ AC_DEFUN([gl_REGEX],
if (! REG_STARTEND)
result |= 64;
+ /* Matching with the compiled form of this regexp would provoke
+ an assertion failure prior to glibc-2.28:
+ regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed
+ With glibc-2.28, compilation fails and reports the invalid
+ back reference. */
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern ("0|()0|\\1|0", 10, &regex);
+ if (!s || strcmp (s, "Invalid back reference"))
+ result |= 64;
+
#if 0
/* It would be nice to reject hosts whose regoff_t values are too
narrow (including glibc on hosts with 64-bit ptrdiff_t and
diff --git a/m4/rename.m4 b/m4/rename.m4
index f7fa3bb..fcf230e 100644
--- a/m4/rename.m4
+++ b/m4/rename.m4
@@ -1,4 +1,4 @@
-# serial 29
+# serial 31
# Copyright (C) 2001, 2003, 2005-2006, 2009-2018 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -19,7 +19,7 @@ AC_DEFUN([gl_FUNC_RENAME],
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_CHECK_FUNCS_ONCE([lstat])
- dnl Solaris 11, AIX 7.1 mistakenly allow rename("file","name/").
+ dnl Solaris 11.3, AIX 7.1 mistakenly allow rename("file","name/").
dnl NetBSD 1.6 mistakenly forbids rename("dir","name/").
dnl FreeBSD 7.2 mistakenly allows rename("file","link-to-file/").
dnl The Solaris bug can be worked around without stripping
@@ -55,12 +55,14 @@ AC_DEFUN([gl_FUNC_RENAME],
[gl_cv_func_rename_slash_dst_works=no],
dnl When crosscompiling, assume rename is broken.
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
- # 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" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_rename_slash_dst_works="guessing no" ;;
esac
])
rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
@@ -109,12 +111,14 @@ AC_DEFUN([gl_FUNC_RENAME],
[gl_cv_func_rename_slash_src_works=no],
dnl When crosscompiling, assume rename is broken.
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
- # 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" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+ # Guess yes on native Windows.
+ mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_rename_slash_src_works="guessing no" ;;
esac
])
rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
@@ -169,12 +173,14 @@ AC_DEFUN([gl_FUNC_RENAME],
[gl_cv_func_rename_link_works=no],
dnl When crosscompiling, assume rename is broken.
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
- # 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" ;;
+ # 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
])
else
@@ -220,12 +226,14 @@ AC_DEFUN([gl_FUNC_RENAME],
[gl_cv_func_rename_dest_works=no],
dnl When crosscompiling, assume rename is broken.
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
- # 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" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_rename_dest_works="guessing no" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_rename_dest_works="guessing no" ;;
esac
])
rm -rf conftest.f conftest.d1 conftest.d2
diff --git a/m4/rmdir.m4 b/m4/rmdir.m4
index 36c4514..a24d845 100644
--- a/m4/rmdir.m4
+++ b/m4/rmdir.m4
@@ -1,4 +1,4 @@
-# rmdir.m4 serial 15
+# rmdir.m4 serial 16
dnl Copyright (C) 2002, 2005, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -33,12 +33,14 @@ AC_DEFUN([gl_FUNC_RMDIR],
]])],
[gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
- # Guess no on native Windows.
- mingw*) gl_cv_func_rmdir_works="guessing no" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_rmdir_works="guessing no" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_func_rmdir_works="guessing no" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_rmdir_works="guessing no" ;;
esac
])
rm -rf conftest.dir conftest.file])
diff --git a/m4/select.m4 b/m4/select.m4
index db58037..098af8e 100644
--- a/m4/select.m4
+++ b/m4/select.m4
@@ -1,4 +1,4 @@
-# select.m4 serial 9
+# select.m4 serial 10
dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -74,10 +74,12 @@ changequote([,])dnl
[gl_cv_func_select_detects_ebadf=no],
[
case "$host_os" in
- # 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" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_select_detects_ebadf="guessing no" ;;
esac
])
])
diff --git a/m4/setlocale.m4 b/m4/setlocale.m4
index 802ee01..e0fb74a 100644
--- a/m4/setlocale.m4
+++ b/m4/setlocale.m4
@@ -1,4 +1,4 @@
-# setlocale.m4 serial 4
+# setlocale.m4 serial 5
dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -25,5 +25,8 @@ AC_DEFUN([gl_FUNC_SETLOCALE],
# Prerequisites of lib/setlocale.c.
AC_DEFUN([gl_PREREQ_SETLOCALE],
[
+ dnl No need to check for CFLocaleCopyPreferredLanguages and
+ dnl CFPreferencesCopyAppValue because lib/setlocale.c is not used on Mac OS X.
+ dnl (The Mac OS X specific code is only used in libintl.)
:
])
diff --git a/m4/socklen.m4 b/m4/socklen.m4
index f2d996d..fa79b07 100644
--- a/m4/socklen.m4
+++ b/m4/socklen.m4
@@ -1,4 +1,4 @@
-# socklen.m4 serial 10
+# socklen.m4 serial 11
dnl Copyright (C) 2005-2007, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -15,8 +15,8 @@ dnl So we have to test to find something that will work.
AC_DEFUN([gl_TYPE_SOCKLEN_T],
[AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl
AC_CHECK_TYPE([socklen_t], ,
- [AC_MSG_CHECKING([for socklen_t equivalent])
- AC_CACHE_VAL([gl_cv_socklen_t_equiv],
+ [AC_CACHE_CHECK([for socklen_t equivalent],
+ [gl_cv_socklen_t_equiv],
[# Systems have either "struct sockaddr *" or
# "void *" as the second argument to getpeername
gl_cv_socklen_t_equiv=
@@ -34,11 +34,10 @@ AC_DEFUN([gl_TYPE_SOCKLEN_T],
done
test "$gl_cv_socklen_t_equiv" != "" && break
done
- ])
- if test "$gl_cv_socklen_t_equiv" = ""; then
- AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
- fi
- AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
+ if test "$gl_cv_socklen_t_equiv" = ""; then
+ AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
+ fi
+ ])
AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
[type to use in place of socklen_t if not defined])],
[gl_SOCKET_HEADERS])])
diff --git a/m4/sockpfaf.m4 b/m4/sockpfaf.m4
index e3fe2c4..cc47b8b 100644
--- a/m4/sockpfaf.m4
+++ b/m4/sockpfaf.m4
@@ -1,4 +1,4 @@
-# sockpfaf.m4 serial 8
+# sockpfaf.m4 serial 9
dnl Copyright (C) 2004, 2006, 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -16,8 +16,8 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
AC_CHECK_HEADERS_ONCE([netinet/in.h])
- AC_MSG_CHECKING([for IPv4 sockets])
- AC_CACHE_VAL([gl_cv_socket_ipv4],
+ AC_CACHE_CHECK([for IPv4 sockets],
+ [gl_cv_socket_ipv4],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -31,13 +31,12 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
[[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
if (&x && &y && &z) return 0;]])],
gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)])
- AC_MSG_RESULT([$gl_cv_socket_ipv4])
if test $gl_cv_socket_ipv4 = yes; then
AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if <sys/socket.h> defines AF_INET.])
fi
- AC_MSG_CHECKING([for IPv6 sockets])
- AC_CACHE_VAL([gl_cv_socket_ipv6],
+ AC_CACHE_CHECK([for IPv6 sockets],
+ [gl_cv_socket_ipv6],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -54,7 +53,6 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
if (&x && &y && &z) return 0;]])],
gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)])
- AC_MSG_RESULT([$gl_cv_socket_ipv6])
if test $gl_cv_socket_ipv6 = yes; then
AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.])
fi
@@ -65,8 +63,8 @@ AC_DEFUN([gl_SOCKET_FAMILY_UNIX],
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
AC_CHECK_HEADERS_ONCE([sys/un.h])
- AC_MSG_CHECKING([for UNIX domain sockets])
- AC_CACHE_VAL([gl_cv_socket_unix],
+ AC_CACHE_CHECK([for UNIX domain sockets],
+ [gl_cv_socket_unix],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -80,7 +78,6 @@ AC_DEFUN([gl_SOCKET_FAMILY_UNIX],
[[int x = AF_UNIX; struct sockaddr_un y;
if (&x && &y) return 0;]])],
gl_cv_socket_unix=yes, gl_cv_socket_unix=no)])
- AC_MSG_RESULT([$gl_cv_socket_unix])
if test $gl_cv_socket_unix = yes; then
AC_DEFINE([HAVE_UNIXSOCKET], [1], [Define to 1 if <sys/socket.h> defines AF_UNIX.])
fi
diff --git a/m4/stat.m4 b/m4/stat.m4
index d762cba..e8ec3b2 100644
--- a/m4/stat.m4
+++ b/m4/stat.m4
@@ -1,4 +1,4 @@
-# serial 14
+# serial 15
# Copyright (C) 2009-2018 Free Software Foundation, Inc.
#
@@ -43,10 +43,12 @@ AC_DEFUN([gl_FUNC_STAT],
]])],
[gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
[case "$host_os" in
- # 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" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_stat_file_slash="guessing no" ;;
esac
])
rm -f conftest.tmp conftest.lnk])
diff --git a/m4/std-gnu11.m4 b/m4/std-gnu11.m4
index c85ac43..bae4ed1 100644
--- a/m4/std-gnu11.m4
+++ b/m4/std-gnu11.m4
@@ -70,7 +70,7 @@ _AS_ECHO_LOG([checking for _AC_LANG compiler version])
set X $ac_compile
ac_compiler=$[2]
for ac_option in --version -v -V -qversion -version; do
- _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD])
+ m4_ifdef([_AC_DO_LIMIT],[_AC_DO_LIMIT],[_AC_DO])([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD])
done
m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
@@ -135,7 +135,7 @@ _AS_ECHO_LOG([checking for _AC_LANG compiler version])
set X $ac_compile
ac_compiler=$[2]
for ac_option in --version -v -V -qversion; do
- _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD])
+ m4_ifdef([_AC_DO_LIMIT],[_AC_DO_LIMIT],[_AC_DO])([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD])
done
m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
diff --git a/m4/stdarg.m4 b/m4/stdarg.m4
index d6f0508..f89d38b 100644
--- a/m4/stdarg.m4
+++ b/m4/stdarg.m4
@@ -1,4 +1,4 @@
-# stdarg.m4 serial 6
+# stdarg.m4 serial 7
dnl Copyright (C) 2006, 2008-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,19 +11,19 @@ AC_DEFUN([gl_STDARG_H],
[
STDARG_H=''
NEXT_STDARG_H='<stdarg.h>'
- AC_MSG_CHECKING([for va_copy])
- AC_CACHE_VAL([gl_cv_func_va_copy], [
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <stdarg.h>]],
- [[
+ AC_CACHE_CHECK([for va_copy],
+ [gl_cv_func_va_copy],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdarg.h>]],
+ [[
#ifndef va_copy
void (*func) (va_list, va_list) = va_copy;
#endif
- ]])],
- [gl_cv_func_va_copy=yes],
- [gl_cv_func_va_copy=no])])
- AC_MSG_RESULT([$gl_cv_func_va_copy])
+ ]])],
+ [gl_cv_func_va_copy=yes],
+ [gl_cv_func_va_copy=no])
+ ])
if test $gl_cv_func_va_copy = no; then
dnl Provide a substitute.
dnl Usually a simple definition in <config.h> is enough. Not so on AIX 5
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
index ba3d201..07b040a 100644
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -1,5 +1,5 @@
dnl A placeholder for <stddef.h>, for platforms that have issues.
-# stddef_h.m4 serial 5
+# stddef_h.m4 serial 6
dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,13 +10,33 @@ AC_DEFUN([gl_STDDEF_H],
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
AC_REQUIRE([gt_TYPE_WCHAR_T])
STDDEF_H=
- AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h],
- [[#include <stddef.h>
- ]])
+
+ dnl Test whether the type max_align_t exists and whether its alignment
+ dnl "is as great as is supported by the implementation in all contexts".
+ AC_CACHE_CHECK([for good max_align_t],
+ [gl_cv_type_max_align_t],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stddef.h>
+ unsigned int s = sizeof (max_align_t);
+ #if defined __GNUC__ || defined __IBM__ALIGNOF__
+ int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
+ int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
+ #endif
+ ]])],
+ [gl_cv_type_max_align_t=yes],
+ [gl_cv_type_max_align_t=no])
+ ])
+ if test $gl_cv_type_max_align_t = no; then
+ HAVE_MAX_ALIGN_T=0
+ STDDEF_H=stddef.h
+ fi
+
if test $gt_cv_c_wchar_t = no; then
HAVE_WCHAR_T=0
STDDEF_H=stddef.h
fi
+
AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
[gl_cv_decl_null_works],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
@@ -28,6 +48,7 @@ AC_DEFUN([gl_STDDEF_H],
REPLACE_NULL=1
STDDEF_H=stddef.h
fi
+
AC_SUBST([STDDEF_H])
AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"])
if test -n "$STDDEF_H"; then
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index b86184c..81d065f 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 51
+# stdint.m4 serial 53
dnl Copyright (C) 2001-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -7,6 +7,8 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert and Bruno Haible.
dnl Test whether <stdint.h> is supported or must be substituted.
+AC_PREREQ([2.61])
+
AC_DEFUN_ONCE([gl_STDINT_H],
[
AC_PREREQ([2.59])dnl
@@ -364,8 +366,7 @@ int32_t i32 = INT32_C (0x7fffffff);
esac
dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
- LIMITS_H=limits.h
- AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+ gl_REPLACE_LIMITS_H
AC_SUBST([HAVE_C99_STDINT_H])
AC_SUBST([HAVE_SYS_BITYPES_H])
@@ -541,9 +542,3 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
BITSIZEOF_WINT_T=32
fi
])
-
-dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
-dnl Remove this when we can assume autoconf >= 2.61.
-m4_ifdef([AC_COMPUTE_INT], [], [
- AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
-])
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index e06461e..0debe69 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 48
+# stdio_h.m4 serial 49
dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -28,7 +28,7 @@ AC_DEFUN([gl_STDIO_H],
/* For non-mingw systems, compilation will trivially succeed.
For mingw, compilation will succeed for older mingw (system
printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
- #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \
+ #if (defined _WIN32 && ! defined __CYGWIN__) && \
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
#endif
diff --git a/m4/symlink.m4 b/m4/symlink.m4
index a452f7c..afaa941 100644
--- a/m4/symlink.m4
+++ b/m4/symlink.m4
@@ -1,4 +1,4 @@
-# serial 7
+# serial 8
# See if we need to provide symlink replacement.
dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
@@ -36,10 +36,12 @@ AC_DEFUN([gl_FUNC_SYMLINK],
]])],
[gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no],
[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_symlink_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_symlink_works="guessing no" ;;
+ # Guess yes on Linux systems.
+ linux-* | linux) gl_cv_func_symlink_works="guessing yes" ;;
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_symlink_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_symlink_works="guessing no" ;;
esac
])
rm -f conftest.f conftest.link conftest.lnk2])
diff --git a/m4/threadlib.m4 b/m4/threadlib.m4
index 1f7b134..ed6ebd5 100644
--- a/m4/threadlib.m4
+++ b/m4/threadlib.m4
@@ -1,4 +1,4 @@
-# threadlib.m4 serial 13
+# threadlib.m4 serial 15
dnl Copyright (C) 2005-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,6 +6,8 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
+AC_PREREQ([2.60])
+
dnl gl_THREADLIB
dnl ------------
dnl Tests for a multithreading library to be used.
@@ -43,11 +45,7 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY],
AC_REQUIRE([AC_CANONICAL_HOST])
dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
- dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
- dnl AC_GNU_SOURCE.
- m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
- [AC_REQUIRE([AC_GNU_SOURCE])])
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
dnl Check for multithreading.
m4_ifdef([gl_THREADLIB_DEFAULT_NO],
[m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
@@ -153,6 +151,36 @@ int main ()
*" -static "*) gl_cv_have_weak=no ;;
esac
])
+ dnl Check whether the linker supports the --as-needed/--no-as-needed options.
+ dnl Assume GCC, so that we can use the -Wl option.
+ AC_CACHE_CHECK([whether the linker supports --as-needed],
+ [gl_cv_linker_have_as_needed],
+ [if test -n "$GCC"; then
+ gl_saved_ldflags="$LDFLAGS"
+ LDFLAGS="$gl_saved_ldflags -Wl,--as-needed -Wl,--no-as-needed"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+ [gl_cv_linker_have_as_needed=yes],
+ [gl_cv_linker_have_as_needed=no])
+ LDFLAGS="$gl_saved_ldflags"
+ else
+ gl_cv_linker_have_as_needed=no
+ fi
+ ])
+ dnl Check whether the linker supports the --push-state/--pop-state options.
+ dnl Assume GCC, so that we can use the -Wl option.
+ AC_CACHE_CHECK([whether the linker supports --push-state],
+ [gl_cv_linker_have_push_state],
+ [if test -n "$GCC"; then
+ gl_saved_ldflags="$LDFLAGS"
+ LDFLAGS="$gl_saved_ldflags -Wl,--push-state -Wl,--pop-state"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+ [gl_cv_linker_have_push_state=yes],
+ [gl_cv_linker_have_push_state=no])
+ LDFLAGS="$gl_saved_ldflags"
+ else
+ gl_cv_linker_have_push_state=no
+ fi
+ ])
if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
# On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
# it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
@@ -231,6 +259,32 @@ int main ()
[Define if references to the POSIX multithreading library should be made weak.])
LIBTHREAD=
LTLIBTHREAD=
+ dnl On platforms where GCC enables --as-needed by default, attempt
+ dnl to make sure that LIBMULTITHREAD really links with -lpthread.
+ dnl Otherwise linking with LIBMULTITHREAD has no effect; then
+ dnl the weak symbols are not defined and thus evaluate to NULL.
+ case "$LIBMULTITHREAD" in
+ "") ;;
+ -pthread)
+ if test $gl_cv_linker_have_as_needed = yes; then
+ if test $gl_cv_linker_have_push_state = yes; then
+ LIBMULTITHREAD="$LIBMULTITHREAD -Wl,--push-state -Wl,--no-as-needed -lpthread -Wl,--pop-state"
+ else
+ LIBMULTITHREAD="$LIBMULTITHREAD -Wl,--no-as-needed -lpthread"
+ fi
+ fi
+ ;;
+ *)
+ if test $gl_cv_linker_have_as_needed = yes; then
+ if test $gl_cv_linker_have_push_state = yes; then
+ LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
+ else
+ LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
+ fi
+ fi
+ ;;
+ esac
+ # TODO: May need to modify LTLIBMULTITHREAD similarly.
fi
fi
fi
@@ -263,6 +317,18 @@ int main ()
[Define if references to the old Solaris multithreading library should be made weak.])
LIBTHREAD=
LTLIBTHREAD=
+ dnl On platforms where GCC enables --as-needed by default, attempt
+ dnl to make sure that LIBMULTITHREAD really links with -lthread.
+ dnl Otherwise linking with LIBMULTITHREAD has no effect; then
+ dnl the weak symbols are not defined and thus evaluate to NULL.
+ if test $gl_cv_linker_have_as_needed = yes; then
+ if test $gl_cv_linker_have_push_state = yes; then
+ LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
+ else
+ LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
+ fi
+ fi
+ # TODO: May need to modify LTLIBMULTITHREAD similarly.
fi
fi
fi
@@ -291,6 +357,18 @@ int main ()
[Define if references to the GNU Pth multithreading library should be made weak.])
LIBTHREAD=
LTLIBTHREAD=
+ dnl On platforms where GCC enables --as-needed by default, attempt
+ dnl to make sure that LIBMULTITHREAD really links with -lpth.
+ dnl Otherwise linking with LIBMULTITHREAD has no effect; then
+ dnl the weak symbols are not defined and thus evaluate to NULL.
+ if test $gl_cv_linker_have_as_needed = yes; then
+ if test $gl_cv_linker_have_push_state = yes; then
+ LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
+ else
+ LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
+ fi
+ fi
+ # TODO: May need to modify LTLIBMULTITHREAD similarly.
fi
fi
else
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index b3b71ec..3ba64da 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 71
+# unistd_h.m4 serial 74
dnl Copyright (C) 2006-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -37,13 +37,13 @@ AC_DEFUN([gl_UNISTD_H],
# include <fcntl.h>
# include <stdio.h>
# include <stdlib.h>
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
# include <io.h>
# endif
#endif
]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat
fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups
- gethostname getlogin getlogin_r getpagesize
+ 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
@@ -83,6 +83,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN])
GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R])
GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
+ GNULIB_GETPASS=0; AC_SUBST([GNULIB_GETPASS])
GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL])
GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER])
GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY])
@@ -126,6 +127,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME])
HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN])
HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE])
+ HAVE_GETPASS=1; AC_SUBST([HAVE_GETPASS])
HAVE_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER])
HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN])
HAVE_LINK=1; AC_SUBST([HAVE_LINK])
@@ -140,7 +142,6 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK])
HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT])
- HAVE_TRUNCATE=1; AC_SUBST([HAVE_TRUNCATE])
HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT])
HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP])
HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
@@ -152,6 +153,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME])
+ HAVE_DECL_TRUNCATE=1; AC_SUBST([HAVE_DECL_TRUNCATE])
HAVE_DECL_TTYNAME_R=1; AC_SUBST([HAVE_DECL_TTYNAME_R])
HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
@@ -168,6 +170,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R])
REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS])
REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
+ REPLACE_GETPASS=0; AC_SUBST([REPLACE_GETPASS])
REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY])
REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
REPLACE_LINK=0; AC_SUBST([REPLACE_LINK])
diff --git a/m4/warn-on-use.m4 b/m4/warn-on-use.m4
index e9c48bb..8e270cf 100644
--- a/m4/warn-on-use.m4
+++ b/m4/warn-on-use.m4
@@ -1,4 +1,4 @@
-# warn-on-use.m4 serial 5
+# warn-on-use.m4 serial 6
dnl Copyright (C) 2010-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,6 +6,8 @@ dnl with or without modifications, as long as this notice is preserved.
# gl_WARN_ON_USE_PREPARE(INCLUDES, NAMES)
# ---------------------------------------
+# If the module 'posixcheck' is in use:
+#
# For each whitespace-separated element in the list of NAMES, define
# HAVE_RAW_DECL_name if the function has a declaration among INCLUDES
# even after being undefined as a macro.
@@ -23,25 +25,27 @@ dnl with or without modifications, as long as this notice is preserved.
# needing gl_WARN_ON_USE_PREPARE.
AC_DEFUN([gl_WARN_ON_USE_PREPARE],
[
- m4_foreach_w([gl_decl], [$2],
- [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
- [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
- undefining macros.])])dnl
+ m4_ifdef([gl_POSIXCHECK],
+ [m4_foreach_w([gl_decl], [$2],
+ [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
+ [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
+ undefining macros.])])dnl
dnl FIXME: gl_Symbol must be used unquoted until we can assume
dnl autoconf 2.64 or newer.
- for gl_func in m4_flatten([$2]); do
- AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
- AC_CACHE_CHECK([whether $gl_func is declared without a macro],
- gl_Symbol,
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
+ for gl_func in m4_flatten([$2]); do
+ AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
+ AC_CACHE_CHECK([whether $gl_func is declared without a macro],
+ gl_Symbol,
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
[@%:@undef $gl_func
(void) $gl_func;])],
- [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])])
- AS_VAR_IF(gl_Symbol, [yes],
- [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
- dnl shortcut - if the raw declaration exists, then set a cache
- dnl variable to allow skipping any later AC_CHECK_DECL efforts
- eval ac_cv_have_decl_$gl_func=yes])
- AS_VAR_POPDEF([gl_Symbol])dnl
- done
+ [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])])
+ AS_VAR_IF(gl_Symbol, [yes],
+ [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
+ dnl shortcut - if the raw declaration exists, then set a cache
+ dnl variable to allow skipping any later AC_CHECK_DECL efforts
+ eval ac_cv_have_decl_$gl_func=yes])
+ AS_VAR_POPDEF([gl_Symbol])dnl
+ done
+ ])
])
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4
index 416e0a1..a062ca9 100644
--- a/m4/wchar_h.m4
+++ b/m4/wchar_h.m4
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl Written by Eric Blake.
-# wchar_h.m4 serial 42
+# wchar_h.m4 serial 43
AC_DEFUN([gl_WCHAR_H],
[
@@ -90,7 +90,8 @@ int main () { return zero(); }
dnl that the object file has the latter name from the start.
save_ac_compile="$ac_compile"
ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
- if AC_TRY_EVAL([ac_compile]); then
+ if echo '#include "conftest.c"' >conftest1.c &&
+ AC_TRY_EVAL([ac_compile]); then
AC_LANG_CONFTEST([
AC_LANG_SOURCE([[#define wcstod renamed_wcstod
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
@@ -105,7 +106,8 @@ int zero (void) { return 0; }
]])])
dnl See note above about renaming object files.
ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
- if AC_TRY_EVAL([ac_compile]); then
+ if echo '#include "conftest.c"' >conftest2.c &&
+ AC_TRY_EVAL([ac_compile]); then
if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
:
else
@@ -114,7 +116,7 @@ int zero (void) { return 0; }
fi
fi
ac_compile="$save_ac_compile"
- rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
+ rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext
])
if test $gl_cv_header_wchar_h_correct_inline = no; then
AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
diff --git a/m4/wcrtomb.m4 b/m4/wcrtomb.m4
index c4e4463..e71c57a 100644
--- a/m4/wcrtomb.m4
+++ b/m4/wcrtomb.m4
@@ -1,4 +1,4 @@
-# wcrtomb.m4 serial 12
+# wcrtomb.m4 serial 13
dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -34,8 +34,8 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
if test $REPLACE_MBSTATE_T = 1; then
REPLACE_WCRTOMB=1
else
- dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes
- dnl returns 0 instead of 1.
+ dnl On AIX 4.3, OSF/1 5.1 and Solaris <= 11.3, wcrtomb (NULL, 0, NULL)
+ dnl sometimes returns 0 instead of 1.
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([gt_LOCALE_FR])
AC_REQUIRE([gt_LOCALE_FR_UTF8])