summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/00gnulib.m42
-rw-r--r--m4/alloca.m482
-rw-r--r--m4/ansi-c++.m422
-rw-r--r--m4/asm-underscore.m471
-rw-r--r--m4/assert.m42
-rw-r--r--m4/autobuild.m42
-rw-r--r--m4/btowc.m49
-rw-r--r--m4/c-stack.m411
-rw-r--r--m4/canonicalize.m472
-rw-r--r--m4/close-stream.m48
-rw-r--r--m4/close.m429
-rw-r--r--m4/closedir.m425
-rw-r--r--m4/closein.m48
-rw-r--r--m4/closeout.m48
-rw-r--r--m4/codeset.m42
-rw-r--r--m4/config-h.m42
-rw-r--r--m4/configmake.m42
-rw-r--r--m4/dirent_h.m464
-rw-r--r--m4/dirname.m410
-rw-r--r--m4/double-slash-root.m42
-rw-r--r--m4/dup.m425
-rw-r--r--m4/dup2.m468
-rw-r--r--m4/eealloc.m45
-rw-r--r--m4/environ.m415
-rw-r--r--m4/errno_h.m423
-rw-r--r--m4/error.m420
-rw-r--r--m4/execute.m45
-rw-r--r--m4/exponentd.m47
-rw-r--r--m4/exponentf.m42
-rw-r--r--m4/exponentl.m42
-rw-r--r--m4/extensions.m456
-rw-r--r--m4/extern-inline.m479
-rw-r--r--m4/fatal-signal.m45
-rw-r--r--m4/fclose.m420
-rw-r--r--m4/fcntl-o.m430
-rw-r--r--m4/fcntl.m413
-rw-r--r--m4/fcntl_h.m427
-rw-r--r--m4/fdopen.m447
-rw-r--r--m4/fflush.m452
-rw-r--r--m4/filenamecat.m47
-rw-r--r--m4/float_h.m487
-rw-r--r--m4/fopen.m413
-rw-r--r--m4/fpending.m4136
-rw-r--r--m4/fpieee.m48
-rw-r--r--m4/fpurge.m48
-rw-r--r--m4/freadahead.m4 (renamed from m4/gl_list.m4)8
-rw-r--r--m4/freading.m42
-rw-r--r--m4/frexp.m425
-rw-r--r--m4/frexpl.m460
-rw-r--r--m4/fseek.m415
-rw-r--r--m4/fseeko.m464
-rw-r--r--m4/fstat.m436
-rw-r--r--m4/ftell.m47
-rw-r--r--m4/ftello.m421
-rw-r--r--m4/getcwd.m4155
-rw-r--r--m4/getdtablesize.m48
-rw-r--r--m4/getopt.m4357
-rw-r--r--m4/getpagesize.m45
-rw-r--r--m4/gettimeofday.m452
-rw-r--r--m4/glibc21.m42
-rw-r--r--m4/gnulib-cache.m429
-rw-r--r--m4/gnulib-common.m4161
-rw-r--r--m4/gnulib-comp.m4868
-rw-r--r--m4/include_next.m454
-rw-r--r--m4/inline.m440
-rw-r--r--m4/intlmacosx.m414
-rw-r--r--m4/intmax_t.m42
-rw-r--r--m4/inttypes-pri.m442
-rw-r--r--m4/inttypes.m4157
-rw-r--r--m4/inttypes_h.m42
-rw-r--r--m4/isnand.m415
-rw-r--r--m4/isnanf.m414
-rw-r--r--m4/isnanl.m417
-rw-r--r--m4/langinfo_h.m42
-rw-r--r--m4/largefile.m4146
-rw-r--r--m4/lcmessage.m42
-rw-r--r--m4/ldexp.m42
-rw-r--r--m4/ldexpl.m431
-rw-r--r--m4/lib-ld.m460
-rw-r--r--m4/lib-link.m42
-rw-r--r--m4/lib-prefix.m42
-rw-r--r--m4/libsigsegv.m42
-rw-r--r--m4/link.m430
-rw-r--r--m4/localcharset.m42
-rw-r--r--m4/locale-fr.m428
-rw-r--r--m4/locale-ja.m417
-rw-r--r--m4/locale-tr.m414
-rw-r--r--m4/locale-zh.m420
-rw-r--r--m4/locale_h.m463
-rw-r--r--m4/localeconv.m422
-rw-r--r--m4/localename.m42
-rw-r--r--m4/lock.m415
-rw-r--r--m4/longlong.m48
-rw-r--r--m4/lseek.m480
-rw-r--r--m4/lstat.m458
-rw-r--r--m4/malloc.m452
-rw-r--r--m4/malloca.m42
-rw-r--r--m4/manywarnings.m4258
-rw-r--r--m4/math_h.m4285
-rw-r--r--m4/mbrtowc.m428
-rw-r--r--m4/mbsinit.m425
-rw-r--r--m4/mbstate_t.m42
-rw-r--r--m4/mbtowc.m48
-rw-r--r--m4/memchr.m422
-rw-r--r--m4/mkdtemp.m49
-rw-r--r--m4/mkstemp.m438
-rw-r--r--m4/mmap-anon.m414
-rw-r--r--m4/mode_t.m42
-rw-r--r--m4/msvc-inval.m419
-rw-r--r--m4/msvc-nothrow.m4 (renamed from m4/cloexec.m4)8
-rw-r--r--m4/multiarch.m46
-rw-r--r--m4/nl_langinfo.m46
-rw-r--r--m4/nocrash.m434
-rw-r--r--m4/off_t.m418
-rw-r--r--m4/open.m436
-rw-r--r--m4/opendir.m425
-rw-r--r--m4/pathmax.m435
-rw-r--r--m4/pipe2.m42
-rw-r--r--m4/posix_spawn.m4137
-rw-r--r--m4/printf-frexp.m42
-rw-r--r--m4/printf-frexpl.m414
-rw-r--r--m4/printf.m4175
-rw-r--r--m4/putenv.m429
-rw-r--r--m4/quotearg.m46
-rw-r--r--m4/raise.m434
-rw-r--r--m4/rawmemchr.m47
-rw-r--r--m4/readdir.m415
-rw-r--r--m4/readlink.m439
-rw-r--r--m4/regex.m4104
-rw-r--r--m4/rename.m4161
-rw-r--r--m4/rmdir.m430
-rw-r--r--m4/sched_h.m49
-rw-r--r--m4/secure_getenv.m425
-rw-r--r--m4/setenv.m477
-rw-r--r--m4/setlocale.m416
-rw-r--r--m4/sig_atomic_t.m46
-rw-r--r--m4/sigaction.m411
-rw-r--r--m4/signal_h.m440
-rw-r--r--m4/signalblocking.m429
-rw-r--r--m4/signbit.m4179
-rw-r--r--m4/sigpipe.m429
-rw-r--r--m4/size_max.m42
-rw-r--r--m4/sleep.m462
-rw-r--r--m4/snprintf.m415
-rw-r--r--m4/spawn-pipe.m45
-rw-r--r--m4/spawn_h.m424
-rw-r--r--m4/ssize_t.m42
-rw-r--r--m4/stat.m425
-rw-r--r--m4/stdarg.m411
-rw-r--r--m4/stdbool.m45
-rw-r--r--m4/stddef_h.m48
-rw-r--r--m4/stdint.m419
-rw-r--r--m4/stdint_h.m42
-rw-r--r--m4/stdio-safer.m425
-rw-r--r--m4/stdio_h.m472
-rw-r--r--m4/stdlib-safer.m410
-rw-r--r--m4/stdlib_h.m424
-rw-r--r--m4/strchrnul.m437
-rw-r--r--m4/strdup.m413
-rw-r--r--m4/strerror.m4116
-rw-r--r--m4/string_h.m415
-rw-r--r--m4/strndup.m420
-rw-r--r--m4/strnlen.m412
-rw-r--r--m4/strsignal.m419
-rw-r--r--m4/strstr.m437
-rw-r--r--m4/strtod.m442
-rw-r--r--m4/strtol.m410
-rw-r--r--m4/symlink.m424
-rw-r--r--m4/sys_socket_h.m4176
-rw-r--r--m4/sys_stat_h.m426
-rw-r--r--m4/sys_time_h.m444
-rw-r--r--m4/sys_types_h.m424
-rw-r--r--m4/sys_wait_h.m47
-rw-r--r--m4/tempname.m47
-rw-r--r--m4/threadlib.m484
-rw-r--r--m4/time_h.m46
-rw-r--r--m4/tls.m42
-rw-r--r--m4/tmpdir.m49
-rw-r--r--m4/ungetc.m424
-rw-r--r--m4/unistd-safer.m47
-rw-r--r--m4/unistd_h.m4126
-rw-r--r--m4/unlocked-io.m42
-rw-r--r--m4/vasnprintf.m414
-rw-r--r--m4/vasprintf-posix.m42
-rw-r--r--m4/vasprintf.m42
-rw-r--r--m4/version-etc.m42
-rw-r--r--m4/wait-process.m45
-rw-r--r--m4/waitpid.m49
-rw-r--r--m4/warnings.m479
-rw-r--r--m4/wchar_h.m411
-rw-r--r--m4/wchar_t.m42
-rw-r--r--m4/wcrtomb.m425
-rw-r--r--m4/wctob.m420
-rw-r--r--m4/wctomb.m48
-rw-r--r--m4/wctype_h.m457
-rw-r--r--m4/wint_t.m42
-rw-r--r--m4/write.m432
-rw-r--r--m4/xalloc.m423
-rw-r--r--m4/xsize.m45
-rw-r--r--m4/xstrndup.m42
-rw-r--r--m4/xvasprintf.m411
201 files changed, 5510 insertions, 2142 deletions
diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4
index 7feed46..d4ad759 100644
--- a/m4/00gnulib.m4
+++ b/m4/00gnulib.m4
@@ -1,5 +1,5 @@
# 00gnulib.m4 serial 2
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/alloca.m4 b/m4/alloca.m4
index e2e8a05..270abd0 100644
--- a/m4/alloca.m4
+++ b/m4/alloca.m4
@@ -1,5 +1,5 @@
-# alloca.m4 serial 10
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation,
+# alloca.m4 serial 14
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2013 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -36,8 +36,86 @@ AC_DEFUN([gl_FUNC_ALLOCA],
ALLOCA_H=alloca.h
fi
AC_SUBST([ALLOCA_H])
+ AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"])
])
# Prerequisites of lib/alloca.c.
# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
AC_DEFUN([gl_PREREQ_ALLOCA], [:])
+
+# This works around a bug in autoconf <= 2.68.
+# See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>.
+
+m4_version_prereq([2.69], [] ,[
+
+# This is taken from the following Autoconf patch:
+# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
+
+# _AC_LIBOBJ_ALLOCA
+# -----------------
+# Set up the LIBOBJ replacement of 'alloca'. Well, not exactly
+# AC_LIBOBJ since we actually set the output variable 'ALLOCA'.
+# Nevertheless, for Automake, AC_LIBSOURCES it.
+m4_define([_AC_LIBOBJ_ALLOCA],
+[# The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+AC_LIBSOURCES(alloca.c)
+AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
+AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.])
+
+AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray,
+[AC_EGREP_CPP(webecray,
+[#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#endif
+], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
+if test $ac_cv_os_cray = yes; then
+ for ac_func in _getb67 GETB67 getb67; do
+ AC_CHECK_FUNC($ac_func,
+ [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
+ [Define to one of '_getb67', 'GETB67',
+ 'getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for
+ 'alloca.c' support on those systems.])
+ break])
+ done
+fi
+
+AC_CACHE_CHECK([stack direction for C alloca],
+ [ac_cv_c_stack_direction],
+[AC_RUN_IFELSE([AC_LANG_SOURCE(
+[AC_INCLUDES_DEFAULT
+int
+find_stack_direction (int *addr, int depth)
+{
+ int dir, dummy = 0;
+ if (! addr)
+ addr = &dummy;
+ *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+ dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+ return dir + dummy;
+}
+
+int
+main (int argc, char **argv)
+{
+ return find_stack_direction (0, argc + !argv + 20) < 0;
+}])],
+ [ac_cv_c_stack_direction=1],
+ [ac_cv_c_stack_direction=-1],
+ [ac_cv_c_stack_direction=0])])
+AH_VERBATIM([STACK_DIRECTION],
+[/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+@%:@undef STACK_DIRECTION])dnl
+AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
+])# _AC_LIBOBJ_ALLOCA
+])
diff --git a/m4/ansi-c++.m4 b/m4/ansi-c++.m4
index d6352ee..8319dd3 100644
--- a/m4/ansi-c++.m4
+++ b/m4/ansi-c++.m4
@@ -1,5 +1,5 @@
-# ansi-c++.m4 serial 7
-dnl Copyright (C) 2002-2003, 2005, 2010-2011 Free Software Foundation, Inc.
+# ansi-c++.m4 serial 9
+dnl Copyright (C) 2002-2003, 2005, 2010-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -41,7 +41,7 @@ AC_DEFUN([gl_CXX_CHOICE],
# gl_PROG_ANSI_CXX([ANSICXX_VARIABLE], [ANSICXX_CONDITIONAL])
# Sets ANSICXX_VARIABLE to the name of a sufficiently ANSI C++ compliant
-# compiler, or to ":" if none is found.
+# compiler, or to "no" if none is found.
# Defines the Automake condition ANSICXX_CONDITIONAL to true if such a compiler
# was found, or to false if not.
@@ -51,7 +51,7 @@ AC_DEFUN([gl_PROG_ANSI_CXX],
m4_if([$1], [CXX], [],
[gl_save_CXX="$CXX"])
if test "$CXX_CHOICE" = no; then
- CXX=":"
+ CXX=no
fi
if test -z "$CXX"; then
if test -n "$CCC"; then
@@ -62,7 +62,7 @@ AC_DEFUN([gl_PROG_ANSI_CXX],
[:])
fi
fi
- if test "$CXX" != ":"; then
+ if test "$CXX" != no; then
dnl Use a modified version of AC_PROG_CXX_WORKS that does not exit
dnl upon failure.
AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works])
@@ -84,7 +84,7 @@ AC_DEFUN([gl_PROG_ANSI_CXX],
AC_LANG_POP([C++])
AC_MSG_RESULT([$gl_cv_prog_ansicxx_works])
if test $gl_cv_prog_ansicxx_works = no; then
- CXX=:
+ CXX=no
else
dnl Test for namespaces.
dnl We don't bother supporting pre-ANSI-C++ compilers.
@@ -105,7 +105,7 @@ EOF
AC_LANG_POP([C++])
AC_MSG_RESULT([$gl_cv_prog_ansicxx_namespaces])
if test $gl_cv_prog_ansicxx_namespaces = no; then
- CXX=:
+ CXX=no
fi
fi
fi
@@ -114,13 +114,13 @@ EOF
CXX="$gl_save_CXX"])
AC_SUBST([$1])
- AM_CONDITIONAL([$2], [test "$$1" != ":"])
+ AM_CONDITIONAL([$2], [test "$$1" != no])
- if test "$$1" != ":"; then
+ if test "$$1" != no; then
dnl This macro invocation resolves an automake error:
dnl /usr/local/share/automake-1.11/am/depend2.am: am__fastdepCXX does not appear in AM_CONDITIONAL
- dnl /usr/local/share/automake-1.11/am/depend2.am: The usual way to define `am__fastdepCXX' is to add `AC_PROG_CXX'
- dnl /usr/local/share/automake-1.11/am/depend2.am: to `configure.ac' and run `aclocal' and `autoconf' again.
+ dnl /usr/local/share/automake-1.11/am/depend2.am: The usual way to define 'am__fastdepCXX' is to add 'AC_PROG_CXX'
+ dnl /usr/local/share/automake-1.11/am/depend2.am: to 'configure.ac' and run 'aclocal' and 'autoconf' again.
_AM_DEPENDENCIES([CXX])
else
AM_CONDITIONAL([am__fastdepCXX], [false])
diff --git a/m4/asm-underscore.m4 b/m4/asm-underscore.m4
new file mode 100644
index 0000000..b1159d5
--- /dev/null
+++ b/m4/asm-underscore.m4
@@ -0,0 +1,71 @@
+# asm-underscore.m4 serial 2
+dnl Copyright (C) 2010-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free 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],
+[
+ 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 grep _foo 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/assert.m4 b/m4/assert.m4
index 2de5ef5..013fade 100644
--- a/m4/assert.m4
+++ b/m4/assert.m4
@@ -1,6 +1,6 @@
#serial 7
-# Copyright (C) 1998-1999, 2001, 2004, 2008-2011 Free Software Foundation, Inc.
+# Copyright (C) 1998-1999, 2001, 2004, 2008-2013 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/autobuild.m4 b/m4/autobuild.m4
index 04971d4..3147b5b 100644
--- a/m4/autobuild.m4
+++ b/m4/autobuild.m4
@@ -1,5 +1,5 @@
# autobuild.m4 serial 7
-dnl Copyright (C) 2004, 2006-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2006-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/btowc.m4 b/m4/btowc.m4
index 603298f..978a06e 100644
--- a/m4/btowc.m4
+++ b/m4/btowc.m4
@@ -1,5 +1,5 @@
-# btowc.m4 serial 8
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# btowc.m4 serial 10
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -108,11 +108,6 @@ int main ()
*) REPLACE_BTOWC=1 ;;
esac
fi
- if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
- gl_REPLACE_WCHAR_H
- AC_LIBOBJ([btowc])
- gl_PREREQ_BTOWC
- fi
])
# Prerequisites of lib/btowc.c.
diff --git a/m4/c-stack.m4 b/m4/c-stack.m4
index d613fa8..5760dbe 100644
--- a/m4/c-stack.m4
+++ b/m4/c-stack.m4
@@ -1,17 +1,16 @@
# Check prerequisites for compiling lib/c-stack.c.
-# Copyright (C) 2002-2004, 2008-2011 Free Software Foundation, Inc.
+# Copyright (C) 2002-2004, 2008-2013 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Written by Paul Eggert.
-# serial 12
+# serial 15
AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
- [# for STACK_DIRECTION
- AC_REQUIRE([AC_FUNC_ALLOCA])
+ [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_CHECK_FUNCS_ONCE([setrlimit])
AC_CHECK_HEADERS_ONCE([ucontext.h])
@@ -24,7 +23,7 @@ AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
FAULT_YIELDS_SIGBUS=1 ;;
hpux*) # HP-UX
FAULT_YIELDS_SIGBUS=1 ;;
- macos* | darwin*) # MacOS X
+ macos* | darwin*) # Mac OS X
FAULT_YIELDS_SIGBUS=1 ;;
gnu*) # Hurd
FAULT_YIELDS_SIGBUS=1 ;;
@@ -339,7 +338,7 @@ AC_DEFUN([gl_PREREQ_C_STACK],
AC_REQUIRE([AC_FUNC_ALLOCA])
AC_CHECK_FUNCS_ONCE([sigaltstack])
- AC_CHECK_DECLS([sigaltstack], , , [#include <signal.h>])
+ AC_CHECK_DECLS([sigaltstack], , , [[#include <signal.h>]])
AC_CHECK_HEADERS_ONCE([unistd.h ucontext.h])
diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4
index dcc6039..cef3124 100644
--- a/m4/canonicalize.m4
+++ b/m4/canonicalize.m4
@@ -1,6 +1,6 @@
-# canonicalize.m4 serial 17
+# canonicalize.m4 serial 26
-dnl Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2007, 2009-2013 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,40 +10,49 @@ dnl with or without modifications, as long as this notice is preserved.
# not provide or fix realpath.
AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
[
- AC_LIBOBJ([canonicalize])
-
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_FUNCS_ONCE([canonicalize_file_name])
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
if test $ac_cv_func_canonicalize_file_name = no; then
HAVE_CANONICALIZE_FILE_NAME=0
- elif test "$gl_cv_func_realpath_works" != yes; then
- REPLACE_CANONICALIZE_FILE_NAME=1
+ else
+ case "$gl_cv_func_realpath_works" in
+ *yes) ;;
+ *) REPLACE_CANONICALIZE_FILE_NAME=1 ;;
+ esac
fi
])
# Provides canonicalize_file_name and realpath.
AC_DEFUN([gl_CANONICALIZE_LGPL],
[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([gl_CANONICALIZE_LGPL_SEPARATE])
if test $ac_cv_func_canonicalize_file_name = no; then
HAVE_CANONICALIZE_FILE_NAME=0
- AC_LIBOBJ([canonicalize-lgpl])
if test $ac_cv_func_realpath = no; then
HAVE_REALPATH=0
- elif test "$gl_cv_func_realpath_works" != yes; then
- REPLACE_REALPATH=1
+ else
+ case "$gl_cv_func_realpath_works" in
+ *yes) ;;
+ *) REPLACE_REALPATH=1 ;;
+ esac
fi
- elif test "$gl_cv_func_realpath_works" != yes; then
- AC_LIBOBJ([canonicalize-lgpl])
- REPLACE_REALPATH=1
- REPLACE_CANONICALIZE_FILE_NAME=1
+ else
+ case "$gl_cv_func_realpath_works" in
+ *yes)
+ ;;
+ *)
+ REPLACE_CANONICALIZE_FILE_NAME=1
+ REPLACE_REALPATH=1
+ ;;
+ esac
fi
])
# Like gl_CANONICALIZE_LGPL, except prepare for separate compilation
-# (no AC_LIBOBJ).
+# (no REPLACE_CANONICALIZE_FILE_NAME, no REPLACE_REALPATH, no AC_LIBOBJ).
AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
[
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
@@ -59,11 +68,15 @@ AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
AC_DEFUN([gl_FUNC_REALPATH_WORKS],
[
AC_CHECK_FUNCS_ONCE([realpath])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [
touch conftest.a
+ mkdir conftest.d
AC_RUN_IFELSE([
AC_LANG_PROGRAM([[
+ ]GL_NOCRASH[
#include <stdlib.h>
+ #include <string.h>
]], [[
int result = 0;
{
@@ -81,14 +94,31 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
if (name != NULL)
result |= 4;
}
+ {
+ char *name1 = realpath (".", NULL);
+ char *name2 = realpath ("conftest.d//./..", NULL);
+ if (strcmp (name1, name2) != 0)
+ result |= 8;
+ }
return result;
]])
- ], [gl_cv_func_realpath_works=yes], [gl_cv_func_realpath_works=no],
- [gl_cv_func_realpath_works="guessing no"])
+ ],
+ [gl_cv_func_realpath_works=yes],
+ [gl_cv_func_realpath_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_realpath_works="guessing no" ;;
+ esac
+ ])
+ rm -rf conftest.a conftest.d
])
- if test "$gl_cv_func_realpath_works" = yes; then
- AC_DEFINE([FUNC_REALPATH_WORKS], [1], [Define to 1 if realpath()
- can malloc memory, always gives an absolute path, and handles
- trailing slash correctly.])
- fi
+ case "$gl_cv_func_realpath_works" in
+ *yes)
+ AC_DEFINE([FUNC_REALPATH_WORKS], [1], [Define to 1 if realpath()
+ can malloc memory, always gives an absolute path, and handles
+ trailing slash correctly.])
+ ;;
+ esac
])
diff --git a/m4/close-stream.m4 b/m4/close-stream.m4
index 2a7349c..0a80c37 100644
--- a/m4/close-stream.m4
+++ b/m4/close-stream.m4
@@ -1,13 +1,11 @@
-#serial 3
-dnl Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
+#serial 4
+dnl Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl Prerequisites of lib/close-stream.c.
AC_DEFUN([gl_CLOSE_STREAM],
[
- AC_LIBOBJ([close-stream])
-
- dnl Prerequisites of lib/close-stream.c.
:
])
diff --git a/m4/close.m4 b/m4/close.m4
index fc13138..bccd981 100644
--- a/m4/close.m4
+++ b/m4/close.m4
@@ -1,26 +1,33 @@
-# close.m4 serial 5
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# close.m4 serial 8
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_CLOSE],
[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_CLOSE=1
+ fi
m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [
gl_PREREQ_SYS_H_WINSOCK2
if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
dnl Even if the 'socket' module is not used here, another part of the
dnl application may use it and pass file descriptors that refer to
dnl sockets to the close() function. So enable the support for sockets.
- gl_REPLACE_CLOSE
+ REPLACE_CLOSE=1
+ fi
+ ])
+ dnl Replace close() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ if test $REPLACE_CLOSE = 0; then
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ REPLACE_CLOSE=1
+ fi
fi
])
-])
-
-AC_DEFUN([gl_REPLACE_CLOSE],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- REPLACE_CLOSE=1
- AC_LIBOBJ([close])
- gl_REPLACE_FCLOSE
])
diff --git a/m4/closedir.m4 b/m4/closedir.m4
new file mode 100644
index 0000000..bb8708b
--- /dev/null
+++ b/m4/closedir.m4
@@ -0,0 +1,25 @@
+# closedir.m4 serial 2
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_CLOSEDIR],
+[
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+ AC_CHECK_FUNCS([closedir])
+ if test $ac_cv_func_closedir = no; then
+ HAVE_CLOSEDIR=0
+ fi
+ dnl Replace closedir() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ if test $HAVE_CLOSEDIR = 1; then
+ REPLACE_CLOSEDIR=1
+ fi
+ fi
+ ])
+])
diff --git a/m4/closein.m4 b/m4/closein.m4
index a5731ee..ca03c76 100644
--- a/m4/closein.m4
+++ b/m4/closein.m4
@@ -1,13 +1,11 @@
-# closein.m4 serial 1
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# closein.m4 serial 2
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl Prerequisites of lib/closein.c.
AC_DEFUN([gl_CLOSEIN],
[
- AC_LIBOBJ([closein])
-
- dnl Prerequisites of lib/closein.c.
:
])
diff --git a/m4/closeout.m4 b/m4/closeout.m4
index 0586b32..759feaa 100644
--- a/m4/closeout.m4
+++ b/m4/closeout.m4
@@ -1,14 +1,12 @@
-# closeout.m4 serial 5
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
+# closeout.m4 serial 6
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2013 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl Prerequisites of lib/closeout.c.
AC_DEFUN([gl_CLOSEOUT],
[
- AC_LIBOBJ([closeout])
-
- dnl Prerequisites of lib/closeout.c.
:
])
diff --git a/m4/codeset.m4 b/m4/codeset.m4
index da73552..c2761be 100644
--- a/m4/codeset.m4
+++ b/m4/codeset.m4
@@ -1,5 +1,5 @@
# codeset.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2006, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2006, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/config-h.m4 b/m4/config-h.m4
index 2dc77a6..9158d66 100644
--- a/m4/config-h.m4
+++ b/m4/config-h.m4
@@ -1,6 +1,6 @@
# Say that -DHAVE_CONFIG_H is not needed.
-dnl Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/configmake.m4 b/m4/configmake.m4
index a029823..823ffc0 100644
--- a/m4/configmake.m4
+++ b/m4/configmake.m4
@@ -1,5 +1,5 @@
# configmake.m4 serial 1
-dnl Copyright (C) 2010-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4
new file mode 100644
index 0000000..54c1663
--- /dev/null
+++ b/m4/dirent_h.m4
@@ -0,0 +1,64 @@
+# dirent_h.m4 serial 16
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Bruno Haible.
+
+AC_DEFUN([gl_DIRENT_H],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+ dnl <dirent.h> is always overridden, because of GNULIB_POSIXCHECK.
+ gl_CHECK_NEXT_HEADERS([dirent.h])
+ if test $ac_cv_header_dirent_h = yes; then
+ HAVE_DIRENT_H=1
+ else
+ HAVE_DIRENT_H=0
+ fi
+ AC_SUBST([HAVE_DIRENT_H])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <dirent.h>
+ ]], [alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir])
+])
+
+AC_DEFUN([gl_DIRENT_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_DIRENT_H_DEFAULTS],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
+ GNULIB_OPENDIR=0; AC_SUBST([GNULIB_OPENDIR])
+ GNULIB_READDIR=0; AC_SUBST([GNULIB_READDIR])
+ GNULIB_REWINDDIR=0; AC_SUBST([GNULIB_REWINDDIR])
+ GNULIB_CLOSEDIR=0; AC_SUBST([GNULIB_CLOSEDIR])
+ GNULIB_DIRFD=0; AC_SUBST([GNULIB_DIRFD])
+ GNULIB_FDOPENDIR=0; AC_SUBST([GNULIB_FDOPENDIR])
+ GNULIB_SCANDIR=0; AC_SUBST([GNULIB_SCANDIR])
+ GNULIB_ALPHASORT=0; AC_SUBST([GNULIB_ALPHASORT])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_OPENDIR=1; AC_SUBST([HAVE_OPENDIR])
+ HAVE_READDIR=1; AC_SUBST([HAVE_READDIR])
+ HAVE_REWINDDIR=1; AC_SUBST([HAVE_REWINDDIR])
+ HAVE_CLOSEDIR=1; AC_SUBST([HAVE_CLOSEDIR])
+ HAVE_DECL_DIRFD=1; AC_SUBST([HAVE_DECL_DIRFD])
+ HAVE_DECL_FDOPENDIR=1;AC_SUBST([HAVE_DECL_FDOPENDIR])
+ HAVE_FDOPENDIR=1; AC_SUBST([HAVE_FDOPENDIR])
+ HAVE_SCANDIR=1; AC_SUBST([HAVE_SCANDIR])
+ HAVE_ALPHASORT=1; AC_SUBST([HAVE_ALPHASORT])
+ REPLACE_OPENDIR=0; AC_SUBST([REPLACE_OPENDIR])
+ REPLACE_CLOSEDIR=0; AC_SUBST([REPLACE_CLOSEDIR])
+ REPLACE_DIRFD=0; AC_SUBST([REPLACE_DIRFD])
+ REPLACE_FDOPENDIR=0; AC_SUBST([REPLACE_FDOPENDIR])
+])
diff --git a/m4/dirname.m4 b/m4/dirname.m4
index 9d5f40d..5897a2a 100644
--- a/m4/dirname.m4
+++ b/m4/dirname.m4
@@ -1,5 +1,5 @@
-#serial 9 -*- autoconf -*-
-dnl Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
+#serial 10 -*- autoconf -*-
+dnl Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,16 +7,10 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_DIRNAME],
[
AC_REQUIRE([gl_DIRNAME_LGPL])
- AC_LIBOBJ([basename])
- AC_LIBOBJ([dirname])
])
AC_DEFUN([gl_DIRNAME_LGPL],
[
- AC_LIBOBJ([basename-lgpl])
- AC_LIBOBJ([dirname-lgpl])
- AC_LIBOBJ([stripslash])
-
dnl Prerequisites of lib/dirname.h.
AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
diff --git a/m4/double-slash-root.m4 b/m4/double-slash-root.m4
index 16a4e3e..bd6f867 100644
--- a/m4/double-slash-root.m4
+++ b/m4/double-slash-root.m4
@@ -1,5 +1,5 @@
# double-slash-root.m4 serial 4 -*- Autoconf -*-
-dnl Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/dup.m4 b/m4/dup.m4
new file mode 100644
index 0000000..5105b6e
--- /dev/null
+++ b/m4/dup.m4
@@ -0,0 +1,25 @@
+# dup.m4 serial 3
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_DUP],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_DUP=1
+ fi
+ dnl Replace dup() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ REPLACE_DUP=1
+ fi
+ ])
+])
+
+# Prerequisites of lib/dup.c.
+AC_DEFUN([gl_PREREQ_DUP], [:])
diff --git a/m4/dup2.m4 b/m4/dup2.m4
index def263b..269cfdc 100644
--- a/m4/dup2.m4
+++ b/m4/dup2.m4
@@ -1,5 +1,5 @@
-#serial 12
-dnl Copyright (C) 2002, 2005, 2007, 2009-2011 Free Software Foundation, Inc.
+#serial 19
+dnl Copyright (C) 2002, 2005, 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -8,24 +8,28 @@ AC_DEFUN([gl_FUNC_DUP2],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
- AC_CHECK_FUNCS_ONCE([dup2 fcntl])
- if test $ac_cv_func_dup2 = no; then
- HAVE_DUP2=0
- AC_LIBOBJ([dup2])
- else
+ m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [
+ AC_CHECK_FUNCS_ONCE([dup2])
+ if test $ac_cv_func_dup2 = no; then
+ HAVE_DUP2=0
+ fi
+ ], [
+ AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.])
+ ])
+ if test $HAVE_DUP2 = 1; then
AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
[AC_RUN_IFELSE([
AC_LANG_PROGRAM([[#include <unistd.h>
#include <fcntl.h>
#include <errno.h>]],
[int result = 0;
-#if HAVE_FCNTL
+#ifdef FD_CLOEXEC
if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
result |= 1;
-#endif HAVE_FCNTL
+#endif
if (dup2 (1, 1) == 0)
result |= 2;
-#if HAVE_FCNTL
+#ifdef FD_CLOEXEC
if (fcntl (1, F_GETFD) != FD_CLOEXEC)
result |= 4;
#endif
@@ -35,36 +39,46 @@ AC_DEFUN([gl_FUNC_DUP2],
/* Many gnulib modules require POSIX conformance of EBADF. */
if (dup2 (2, 1000000) == -1 && errno != EBADF)
result |= 16;
+ /* Flush out a cygwin core dump. */
+ if (dup2 (2, -1) != -1 || errno != EBADF)
+ result |= 32;
return result;
])
],
[gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
[case "$host_os" in
mingw*) # on this platform, dup2 always returns 0 for success
- gl_cv_func_dup2_works=no;;
+ gl_cv_func_dup2_works="guessing no" ;;
cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
- gl_cv_func_dup2_works=no;;
+ gl_cv_func_dup2_works="guessing no" ;;
linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
# closed fd may yield -EBADF instead of -1 / errno=EBADF.
- gl_cv_func_dup2_works=no;;
+ gl_cv_func_dup2_works="guessing no" ;;
freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
- gl_cv_func_dup2_works=no;;
+ gl_cv_func_dup2_works="guessing no" ;;
haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
- gl_cv_func_dup2_works=no;;
- *) gl_cv_func_dup2_works=yes;;
+ gl_cv_func_dup2_works="guessing no" ;;
+ *) gl_cv_func_dup2_works="guessing yes" ;;
esac])
])
- if test "$gl_cv_func_dup2_works" = no; then
- gl_REPLACE_DUP2
- fi
+ case "$gl_cv_func_dup2_works" in
+ *yes) ;;
+ *)
+ REPLACE_DUP2=1
+ ;;
+ esac
fi
+ dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ if test $HAVE_DUP2 = 1; then
+ REPLACE_DUP2=1
+ fi
+ fi
+ ])
])
-AC_DEFUN([gl_REPLACE_DUP2],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- if test $ac_cv_func_dup2 = yes; then
- REPLACE_DUP2=1
- fi
- AC_LIBOBJ([dup2])
-])
+# Prerequisites of lib/dup2.c.
+AC_DEFUN([gl_PREREQ_DUP2], [])
diff --git a/m4/eealloc.m4 b/m4/eealloc.m4
index 3006c48..c640ec1 100644
--- a/m4/eealloc.m4
+++ b/m4/eealloc.m4
@@ -1,5 +1,5 @@
-# eealloc.m4 serial 2
-dnl Copyright (C) 2003, 2009-2011 Free Software Foundation, Inc.
+# eealloc.m4 serial 3
+dnl Copyright (C) 2003, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -8,7 +8,6 @@ AC_DEFUN([gl_EEALLOC],
[
AC_REQUIRE([gl_EEMALLOC])
AC_REQUIRE([gl_EEREALLOC])
- AC_REQUIRE([AC_C_INLINE])
])
AC_DEFUN([gl_EEMALLOC],
diff --git a/m4/environ.m4 b/m4/environ.m4
index 7457ad1..593a33e 100644
--- a/m4/environ.m4
+++ b/m4/environ.m4
@@ -1,5 +1,5 @@
-# environ.m4 serial 5
-dnl Copyright (C) 2001-2004, 2006-2011 Free Software Foundation, Inc.
+# environ.m4 serial 6
+dnl Copyright (C) 2001-2004, 2006-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,16 @@ AC_DEFUN_ONCE([gl_ENVIRON],
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
dnl Persuade glibc <unistd.h> to declare environ.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
+
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ gt_CHECK_VAR_DECL(
+ [#if HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+ /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
+ #include <stdlib.h>
+ ],
+ [environ])
if test $gt_cv_var_environ_declaration != yes; then
HAVE_DECL_ENVIRON=0
fi
diff --git a/m4/errno_h.m4 b/m4/errno_h.m4
index 687baff..c813ea5 100644
--- a/m4/errno_h.m4
+++ b/m4/errno_h.m4
@@ -1,5 +1,5 @@
-# errno_h.m4 serial 8
-dnl Copyright (C) 2004, 2006, 2008-2011 Free Software Foundation, Inc.
+# errno_h.m4 serial 12
+dnl Copyright (C) 2004, 2006, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,6 +10,9 @@ AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
AC_EGREP_CPP([booboo],[
#include <errno.h>
+#if !defined ETXTBSY
+booboo
+#endif
#if !defined ENOMSG
booboo
#endif
@@ -34,6 +37,12 @@ booboo
#if !defined ENOTSUP
booboo
#endif
+#if !defined ENETRESET
+booboo
+#endif
+#if !defined ECONNABORTED
+booboo
+#endif
#if !defined ESTALE
booboo
#endif
@@ -43,6 +52,15 @@ booboo
#if !defined ECANCELED
booboo
#endif
+#if !defined EOWNERDEAD
+booboo
+#endif
+#if !defined ENOTRECOVERABLE
+booboo
+#endif
+#if !defined EILSEQ
+booboo
+#endif
],
[gl_cv_header_errno_h_complete=no],
[gl_cv_header_errno_h_complete=yes])
@@ -54,6 +72,7 @@ booboo
ERRNO_H='errno.h'
fi
AC_SUBST([ERRNO_H])
+ AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"])
gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
gl_REPLACE_ERRNO_VALUE([ENOLINK])
gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
diff --git a/m4/error.m4 b/m4/error.m4
index 6ea75ac..29e6fdc 100644
--- a/m4/error.m4
+++ b/m4/error.m4
@@ -1,6 +1,6 @@
-#serial 13
+#serial 14
-# Copyright (C) 1996-1998, 2001-2004, 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 1996-1998, 2001-2004, 2009-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -8,16 +8,8 @@
AC_DEFUN([gl_ERROR],
[
- AC_FUNC_ERROR_AT_LINE
- dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
- gl_PREREQ_ERROR
-])
-
-# Redefine AC_FUNC_ERROR_AT_LINE, because it is no longer maintained in
-# Autoconf.
-AC_DEFUN([AC_FUNC_ERROR_AT_LINE],
-[
- AC_LIBSOURCES([error.h, error.c])dnl
+ dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
+ dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
@@ -25,15 +17,11 @@ AC_DEFUN([AC_FUNC_ERROR_AT_LINE],
[[error_at_line (0, 0, "", 0, "an error occurred");]])],
[ac_cv_lib_error_at_line=yes],
[ac_cv_lib_error_at_line=no])])
- if test $ac_cv_lib_error_at_line = no; then
- AC_LIBOBJ([error])
- fi
])
# Prerequisites of lib/error.c.
AC_DEFUN([gl_PREREQ_ERROR],
[
AC_REQUIRE([AC_FUNC_STRERROR_R])
- AC_REQUIRE([AC_C_INLINE])
:
])
diff --git a/m4/execute.m4 b/m4/execute.m4
index 6ab4076..0b0836d 100644
--- a/m4/execute.m4
+++ b/m4/execute.m4
@@ -1,5 +1,5 @@
-# execute.m4 serial 4
-dnl Copyright (C) 2003, 2008-2011 Free Software Foundation, Inc.
+# execute.m4 serial 5
+dnl Copyright (C) 2003, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,5 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_EXECUTE],
[
dnl Prerequisites of lib/execute.c.
- AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([AC_TYPE_MODE_T])
])
diff --git a/m4/exponentd.m4 b/m4/exponentd.m4
index 7e91924..09df468 100644
--- a/m4/exponentd.m4
+++ b/m4/exponentd.m4
@@ -1,5 +1,5 @@
-# exponentd.m4 serial 2
-dnl Copyright (C) 2007-2008, 2010-2011 Free Software Foundation, Inc.
+# exponentd.m4 serial 3
+dnl Copyright (C) 2007-2008, 2010-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -80,7 +80,8 @@ int main ()
dnl different sets of instructions: The older FPA instructions assume
dnl that they are stored in big-endian word order, while the words
dnl (like integer types) are stored in little-endian byte order.
- dnl The newer VFP instructions assume little-endian order consistenly.
+ dnl The newer VFP instructions assume little-endian order
+ dnl consistently.
AC_EGREP_CPP([mixed_endianness], [
#if defined arm || defined __arm || defined __arm__
mixed_endianness
diff --git a/m4/exponentf.m4 b/m4/exponentf.m4
index 3a00840..55a04e6 100644
--- a/m4/exponentf.m4
+++ b/m4/exponentf.m4
@@ -1,5 +1,5 @@
# exponentf.m4 serial 2
-dnl Copyright (C) 2007-2008, 2010-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2008, 2010-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/exponentl.m4 b/m4/exponentl.m4
index 2e706b2..f877cf1 100644
--- a/m4/exponentl.m4
+++ b/m4/exponentl.m4
@@ -1,5 +1,5 @@
# exponentl.m4 serial 3
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/extensions.m4 b/m4/extensions.m4
index 1330503..e30f122 100644
--- a/m4/extensions.m4
+++ b/m4/extensions.m4
@@ -1,14 +1,14 @@
-# serial 9 -*- Autoconf -*-
+# serial 13 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2013 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.
-# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
# Autoconf. Perhaps we can remove this once we can assume Autoconf
-# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
+# 2.70 or later everywhere, but since Autoconf mutates rapidly
# enough in this area it's likely we'll need to redefine
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
@@ -30,6 +30,7 @@
# ------------------------
# Enable extensions on systems that normally disable them,
# typically due to standards-conformance issues.
+#
# Remember that #undef in AH_VERBATIM gets replaced with #define by
# AC_DEFINE. The goal here is to define all known feature-enabling
# macros, then, if reports of conflicts are made, disable macros that
@@ -38,35 +39,31 @@ AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
- AC_REQUIRE([AC_CANONICAL_HOST])
-
AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
if test "$MINIX" = yes; then
AC_DEFINE([_POSIX_SOURCE], [1],
- [Define to 1 if you need to in order for `stat' and other
+ [Define to 1 if you need to in order for 'stat' and other
things to work.])
AC_DEFINE([_POSIX_1_SOURCE], [2],
[Define to 2 if the system does not provide POSIX.1 features
except with this defined.])
AC_DEFINE([_MINIX], [1],
[Define to 1 if on MINIX.])
+ AC_DEFINE([_NETBSD_SOURCE], [1],
+ [Define to 1 to make NetBSD features available. MINIX 3 needs this.])
fi
- dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500,
- dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already
- dnl provided.
- case "$host_os" in
- hpux*)
- AC_DEFINE([_XOPEN_SOURCE], [500],
- [Define to 500 only on HP-UX.])
- ;;
- esac
-
- AH_VERBATIM([__EXTENSIONS__],
+dnl Use a different key than __EXTENSIONS__, as that name broke existing
+dnl configure.ac when using autoheader 2.62.
+ AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
[/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
+/* Enable general extensions on OS X. */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
@@ -79,6 +76,12 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
+/* Enable X/Open extensions if necessary. HP-UX 11.11 defines
+ mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
+ whether compiling with -Ae or -D_HPUX_SOURCE=1. */
+#ifndef _XOPEN_SOURCE
+# undef _XOPEN_SOURCE
+#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
@@ -95,9 +98,26 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
test $ac_cv_safe_to_define___extensions__ = yes &&
AC_DEFINE([__EXTENSIONS__])
AC_DEFINE([_ALL_SOURCE])
+ AC_DEFINE([_DARWIN_C_SOURCE])
AC_DEFINE([_GNU_SOURCE])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
AC_DEFINE([_TANDEM_SOURCE])
+ AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
+ [ac_cv_should_define__xopen_source],
+ [ac_cv_should_define__xopen_source=no
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #define _XOPEN_SOURCE 500
+ #include <wchar.h>
+ mbstate_t x;]])],
+ [ac_cv_should_define__xopen_source=yes])])])
+ test $ac_cv_should_define__xopen_source = yes &&
+ AC_DEFINE([_XOPEN_SOURCE], [500])
])# AC_USE_SYSTEM_EXTENSIONS
# gl_USE_SYSTEM_EXTENSIONS
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
new file mode 100644
index 0000000..4862d60
--- /dev/null
+++ b/m4/extern-inline.m4
@@ -0,0 +1,79 @@
+dnl 'extern inline' a la ISO C99.
+
+dnl Copyright 2012-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free 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_EXTERN_INLINE],
+[
+ AH_VERBATIM([extern_inline],
+[/* Please see the Gnulib manual for how to use these macros.
+
+ Suppress extern inline with HP-UX cc, as it appears to be broken; see
+ <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
+
+ Suppress extern inline with Sun C in standards-conformance mode, as it
+ mishandles inline functions that call each other. E.g., for 'inline void f
+ (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+ 'reference to static identifier "f" in extern inline function'.
+ This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
+
+ Suppress the use of extern inline on problematic Apple configurations, as
+ Libc at least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
+ <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+ Perhaps Apple will fix this some day. */
+#if (defined __APPLE__ \
+ && ((! defined _DONT_USE_CTYPE_INLINE_ \
+ && (defined __GNUC__ || defined __cplusplus)) \
+ || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
+ && defined __GNUC__ && ! defined __cplusplus)))
+# define _GL_EXTERN_INLINE_APPLE_BUG
+#endif
+#if ((__GNUC__ \
+ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+ : (199901L <= __STDC_VERSION__ \
+ && !defined __HP_cc \
+ && !(defined __SUNPRO_C && __STDC__))) \
+ && !defined _GL_EXTERN_INLINE_APPLE_BUG)
+# define _GL_INLINE inline
+# define _GL_EXTERN_INLINE extern inline
+# define _GL_EXTERN_INLINE_IN_USE
+#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
+ && !defined _GL_EXTERN_INLINE_APPLE_BUG)
+# if __GNUC_GNU_INLINE__
+ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
+# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
+# else
+# define _GL_INLINE extern inline
+# endif
+# define _GL_EXTERN_INLINE extern
+# define _GL_EXTERN_INLINE_IN_USE
+#else
+# define _GL_INLINE static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
+#endif
+
+#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
+# define _GL_INLINE_HEADER_CONST_PRAGMA
+# else
+# define _GL_INLINE_HEADER_CONST_PRAGMA \
+ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
+# endif
+ /* Suppress GCC's bogus "no previous prototype for 'FOO'"
+ and "no previous declaration for 'FOO'" diagnostics,
+ when FOO is an inline function in the header; see
+ <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>. */
+# define _GL_INLINE_HEADER_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
+ _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
+ _GL_INLINE_HEADER_CONST_PRAGMA
+# define _GL_INLINE_HEADER_END \
+ _Pragma ("GCC diagnostic pop")
+#else
+# define _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_END
+#endif])
+])
diff --git a/m4/fatal-signal.m4 b/m4/fatal-signal.m4
index 1a3281a..ae8b65c 100644
--- a/m4/fatal-signal.m4
+++ b/m4/fatal-signal.m4
@@ -1,12 +1,11 @@
-# fatal-signal.m4 serial 8
-dnl Copyright (C) 2003-2004, 2006, 2008-2011 Free Software Foundation, Inc.
+# fatal-signal.m4 serial 9
+dnl Copyright (C) 2003-2004, 2006, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free 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_FATAL_SIGNAL],
[
- AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([gt_TYPE_SIG_ATOMIC_T])
AC_CHECK_HEADERS_ONCE([unistd.h])
gl_PREREQ_SIG_HANDLER_H
diff --git a/m4/fclose.m4 b/m4/fclose.m4
index 278859c..b306b6d 100644
--- a/m4/fclose.m4
+++ b/m4/fclose.m4
@@ -1,16 +1,20 @@
-# fclose.m4 serial 2
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# fclose.m4 serial 6
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FCLOSE],
[
-])
-
-AC_DEFUN([gl_REPLACE_FCLOSE],
-[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- REPLACE_FCLOSE=1
- AC_LIBOBJ([fclose])
+
+ gl_FUNC_FFLUSH_STDIN
+ if test $gl_cv_func_fflush_stdin != yes; then
+ REPLACE_FCLOSE=1
+ fi
+
+ AC_REQUIRE([gl_FUNC_CLOSE])
+ if test $REPLACE_CLOSE = 1; then
+ REPLACE_FCLOSE=1
+ fi
])
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4
index 88db07e..87cc4bd 100644
--- a/m4/fcntl-o.m4
+++ b/m4/fcntl-o.m4
@@ -1,5 +1,5 @@
-# fcntl-o.m4 serial 3
-dnl Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
+# fcntl-o.m4 serial 4
+dnl Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -17,12 +17,21 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
[AC_REQUIRE([AC_GNU_SOURCE])])
+
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CHECK_FUNCS_ONCE([symlink])
AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/types.h>
#include <sys/stat.h>
- #include <unistd.h>
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #else /* on Windows with MSVC */
+ # include <io.h>
+ # include <stdlib.h>
+ # defined sleep(n) _sleep ((n) * 1000)
+ #endif
#include <fcntl.h>
#ifndef O_NOATIME
#define O_NOATIME 0
@@ -38,9 +47,21 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
]],
[[
int result = !constants;
+ #if HAVE_SYMLINK
{
static char const sym[] = "conftest.sym";
- if (symlink (".", sym) != 0)
+ if (symlink ("/dev/null", sym) != 0)
+ result |= 2;
+ else
+ {
+ int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
+ if (fd >= 0)
+ {
+ close (fd);
+ result |= 4;
+ }
+ }
+ if (unlink (sym) != 0 || symlink (".", sym) != 0)
result |= 2;
else
{
@@ -53,6 +74,7 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
}
unlink (sym);
}
+ #endif
{
static char const file[] = "confdefs.h";
int fd = open (file, O_RDONLY | O_NOATIME);
diff --git a/m4/fcntl.m4 b/m4/fcntl.m4
index a93ed85..5481cae 100644
--- a/m4/fcntl.m4
+++ b/m4/fcntl.m4
@@ -1,5 +1,5 @@
-# fcntl.m4 serial 4
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# fcntl.m4 serial 5
+dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -73,6 +73,14 @@ choke me
dnl No witness macro needed for this bug.
fi
fi
+ dnl Replace fcntl() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ gl_REPLACE_FCNTL
+ fi
+ ])
])
AC_DEFUN([gl_REPLACE_FCNTL],
@@ -84,5 +92,4 @@ AC_DEFUN([gl_REPLACE_FCNTL],
else
REPLACE_FCNTL=1
fi
- AC_LIBOBJ([fcntl])
])
diff --git a/m4/fcntl_h.m4 b/m4/fcntl_h.m4
index 1ef4f45..3cff1fd 100644
--- a/m4/fcntl_h.m4
+++ b/m4/fcntl_h.m4
@@ -1,6 +1,6 @@
-# serial 13
+# serial 15
# Configure fcntl.h.
-dnl Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -13,6 +13,12 @@ AC_DEFUN([gl_FCNTL_H],
AC_REQUIRE([gl_FCNTL_O_FLAGS])
gl_NEXT_HEADERS([fcntl.h])
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Ensure the type mode_t gets defined.
+ AC_REQUIRE([AC_TYPE_MODE_T])
+
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, if it is not common
dnl enough to be declared everywhere.
@@ -31,13 +37,14 @@ AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
AC_DEFUN([gl_FCNTL_H_DEFAULTS],
[
- GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL])
- GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN])
- GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT])
+ GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL])
+ GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING])
+ GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN])
+ GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT])
dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL])
- HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT])
- REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
- REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
- REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
+ HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL])
+ HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT])
+ REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL])
+ REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN])
+ REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
])
diff --git a/m4/fdopen.m4 b/m4/fdopen.m4
new file mode 100644
index 0000000..74d1649
--- /dev/null
+++ b/m4/fdopen.m4
@@ -0,0 +1,47 @@
+# fdopen.m4 serial 3
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FDOPEN],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_FDOPEN=1
+ else
+ dnl Test whether fdopen() sets errno when it fails due to a bad fd argument.
+ AC_CACHE_CHECK([whether fdopen sets errno], [gl_cv_func_fdopen_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <errno.h>
+int
+main (void)
+{
+ FILE *fp;
+ errno = 0;
+ fp = fdopen (-1, "r");
+ if (fp == NULL && errno == 0)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_fdopen_works=yes],
+ [gl_cv_func_fdopen_works=no],
+ [case "$host_os" in
+ mingw*) gl_cv_func_fdopen_works="guessing no" ;;
+ *) gl_cv_func_fdopen_works="guessing yes" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_fdopen_works" in
+ *no) REPLACE_FDOPEN=1 ;;
+ esac
+ fi
+])
+
+dnl Prerequisites of lib/fdopen.c.
+AC_DEFUN([gl_PREREQ_FDOPEN], [])
diff --git a/m4/fflush.m4 b/m4/fflush.m4
index f7645de..c16b314 100644
--- a/m4/fflush.m4
+++ b/m4/fflush.m4
@@ -1,6 +1,6 @@
-# fflush.m4 serial 8
+# fflush.m4 serial 15
-# Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# Copyright (C) 2007-2013 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -12,13 +12,30 @@ dnl unread input on seekable streams, rather than C99 undefined semantics.
AC_DEFUN([gl_FUNC_FFLUSH],
[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ gl_FUNC_FFLUSH_STDIN
+ if test $gl_cv_func_fflush_stdin != yes; then
+ REPLACE_FFLUSH=1
+ fi
+])
+
+dnl Determine whether fflush works on input streams.
+dnl Sets gl_cv_func_fflush_stdin.
+
+AC_DEFUN([gl_FUNC_FFLUSH_STDIN],
+[
+ AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CACHE_CHECK([whether fflush works on input streams],
[gl_cv_func_fflush_stdin],
[echo hello world > conftest.txt
AC_RUN_IFELSE([AC_LANG_PROGRAM(
[[
#include <stdio.h>
-#include <unistd.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
]], [[FILE *f = fopen ("conftest.txt", "r");
char buffer[10];
int fd;
@@ -55,27 +72,18 @@ AC_DEFUN([gl_FUNC_FFLUSH],
return 7;
return 0;
]])], [gl_cv_func_fflush_stdin=yes], [gl_cv_func_fflush_stdin=no],
- [dnl Pessimistically assume fflush is broken.
- gl_cv_func_fflush_stdin=no])
+ [gl_cv_func_fflush_stdin=cross])
rm conftest.txt
])
- if test $gl_cv_func_fflush_stdin = no; then
- gl_REPLACE_FFLUSH
- fi
-])
-
-AC_DEFUN([gl_REPLACE_FFLUSH],
-[
- AC_LIBOBJ([fflush])
- AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- REPLACE_FFLUSH=1
- gl_PREREQ_FFLUSH
- gl_REPLACE_FSEEKO
+ case $gl_cv_func_fflush_stdin in
+ yes) gl_func_fflush_stdin=1 ;;
+ no) gl_func_fflush_stdin=0 ;;
+ *) gl_func_fflush_stdin='(-1)' ;;
+ esac
+ AC_DEFINE_UNQUOTED([FUNC_FFLUSH_STDIN], [$gl_func_fflush_stdin],
+ [Define to 1 if fflush is known to work on stdin as per POSIX.1-2008,
+ 0 if fflush is known to not work, -1 if unknown.])
])
# Prerequisites of lib/fflush.c.
-AC_DEFUN([gl_PREREQ_FFLUSH],
-[
- AC_REQUIRE([AC_C_INLINE])
- :
-])
+AC_DEFUN([gl_PREREQ_FFLUSH], [:])
diff --git a/m4/filenamecat.m4 b/m4/filenamecat.m4
index b90cf9e..40946e8 100644
--- a/m4/filenamecat.m4
+++ b/m4/filenamecat.m4
@@ -1,5 +1,5 @@
-# filenamecat.m4 serial 10
-dnl Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
+# filenamecat.m4 serial 11
+dnl Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,13 +7,10 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FILE_NAME_CONCAT],
[
AC_REQUIRE([gl_FILE_NAME_CONCAT_LGPL])
- AC_LIBOBJ([filenamecat])
])
AC_DEFUN([gl_FILE_NAME_CONCAT_LGPL],
[
- AC_LIBOBJ([filenamecat-lgpl])
-
dnl Prerequisites of lib/filenamecat-lgpl.c.
AC_CHECK_FUNCS_ONCE([mempcpy])
])
diff --git a/m4/float_h.m4 b/m4/float_h.m4
index 265a4c1..397f2d1 100644
--- a/m4/float_h.m4
+++ b/m4/float_h.m4
@@ -1,5 +1,5 @@
-# float_h.m4 serial 5
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# float_h.m4 serial 9
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,11 +9,90 @@ AC_DEFUN([gl_FLOAT_H],
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
FLOAT_H=
+ REPLACE_FLOAT_LDBL=0
case "$host_os" in
- beos* | openbsd* | mirbsd*)
+ aix* | beos* | openbsd* | mirbsd* | irix*)
FLOAT_H=float.h
- gl_NEXT_HEADERS([float.h])
+ ;;
+ freebsd*)
+ case "$host_cpu" in
+changequote(,)dnl
+ i[34567]86 )
+changequote([,])dnl
+ FLOAT_H=float.h
+ ;;
+ x86_64 )
+ # On x86_64 systems, the C compiler may still be generating
+ # 32-bit code.
+ AC_EGREP_CPP([yes],
+ [#if defined __LP64__ || defined __x86_64__ || defined __amd64__
+ yes
+ #endif],
+ [],
+ [FLOAT_H=float.h])
+ ;;
+ esac
+ ;;
+ linux*)
+ case "$host_cpu" in
+ powerpc*)
+ FLOAT_H=float.h
+ ;;
+ esac
+ ;;
+ esac
+ case "$host_os" in
+ aix* | freebsd* | linux*)
+ if test -n "$FLOAT_H"; then
+ REPLACE_FLOAT_LDBL=1
+ fi
;;
esac
+
+ dnl Test against glibc-2.7 Linux/SPARC64 bug.
+ REPLACE_ITOLD=0
+ AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],
+ [gl_cv_func_itold_works],
+ [
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+int i = -1;
+volatile long double ld;
+int main ()
+{
+ ld += i * 1.0L;
+ if (ld > 0)
+ return 1;
+ return 0;
+}]])],
+ [gl_cv_func_itold_works=yes],
+ [gl_cv_func_itold_works=no],
+ [case "$host" in
+ sparc*-*-linux*)
+ AC_EGREP_CPP([yes],
+ [#if defined __LP64__ || defined __arch64__
+ yes
+ #endif],
+ [gl_cv_func_itold_works="guessing no"],
+ [gl_cv_func_itold_works="guessing yes"])
+ ;;
+ *) gl_cv_func_itold_works="guessing yes" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_itold_works" in
+ *no)
+ REPLACE_ITOLD=1
+ dnl We add the workaround to <float.h> but also to <math.h>,
+ dnl to increase the chances that the fix function gets pulled in.
+ FLOAT_H=float.h
+ ;;
+ esac
+
+ if test -n "$FLOAT_H"; then
+ gl_NEXT_HEADERS([float.h])
+ fi
AC_SUBST([FLOAT_H])
+ AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"])
+ AC_SUBST([REPLACE_ITOLD])
])
diff --git a/m4/fopen.m4 b/m4/fopen.m4
index 8407ed4..3337cc9 100644
--- a/m4/fopen.m4
+++ b/m4/fopen.m4
@@ -1,5 +1,5 @@
-# fopen.m4 serial 7
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# fopen.m4 serial 9
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -52,14 +52,7 @@ changequote([,])dnl
REPLACE_FOPEN=1
;;
esac
- if test $REPLACE_FOPEN = 1; then
- AC_LIBOBJ([fopen])
- gl_PREREQ_FOPEN
- fi
])
# Prerequisites of lib/fopen.c.
-AC_DEFUN([gl_PREREQ_FOPEN],
-[
- AC_REQUIRE([AC_C_INLINE])
-])
+AC_DEFUN([gl_PREREQ_FOPEN], [:])
diff --git a/m4/fpending.m4 b/m4/fpending.m4
index 314e003..c8d9e8b 100644
--- a/m4/fpending.m4
+++ b/m4/fpending.m4
@@ -1,6 +1,6 @@
-# serial 15
+# serial 20
-# Copyright (C) 2000-2001, 2004-2011 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2004-2013 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -16,68 +16,80 @@ dnl we have to grub around in the FILE struct.
AC_DEFUN([gl_FUNC_FPENDING],
[
AC_CHECK_HEADERS_ONCE([stdio_ext.h])
- AC_CHECK_FUNCS_ONCE([__fpending])
- fp_headers='
-# include <stdio.h>
-# if HAVE_STDIO_EXT_H
-# include <stdio_ext.h>
-# endif
-'
- AC_CHECK_DECLS([__fpending], , , $fp_headers)
- if test $ac_cv_func___fpending = no; then
- AC_CACHE_CHECK(
+ AC_CACHE_CHECK([for __fpending], [gl_cv_func___fpending],
+ [
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdio.h>
+ #if HAVE_STDIO_EXT_H
+ # include <stdio_ext.h>
+ #endif
+ ]],
+ [[return ! __fpending (stdin);]])],
+ [gl_cv_func___fpending=yes],
+ [gl_cv_func___fpending=no])
+ ])
+])
+
+AC_DEFUN([gl_PREREQ_FPENDING],
+[
+ AC_CACHE_CHECK(
[how to determine the number of pending output bytes on a stream],
- ac_cv_sys_pending_output_n_bytes,
- [
- for ac_expr in \
- \
- '# glibc2' \
- 'fp->_IO_write_ptr - fp->_IO_write_base' \
- \
- '# traditional Unix' \
- 'fp->_ptr - fp->_base' \
- \
- '# BSD' \
- 'fp->_p - fp->_bf._base' \
- \
- '# SCO, Unixware' \
- '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \
- \
- '# QNX' \
- '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \
- \
- '# old glibc?' \
- 'fp->__bufp - fp->__buffer' \
- \
- '# old glibc iostream?' \
- 'fp->_pptr - fp->_pbase' \
- \
- '# emx+gcc' \
- 'fp->_ptr - fp->_buffer' \
- \
- '# VMS' \
- '(*fp)->_ptr - (*fp)->_base' \
- \
- '# e.g., DGUX R4.11; the info is not available' \
- 1 \
- ; do
+ ac_cv_sys_pending_output_n_bytes,
+ [
+ for ac_expr in \
+ \
+ '# glibc2' \
+ 'fp->_IO_write_ptr - fp->_IO_write_base' \
+ \
+ '# traditional Unix' \
+ 'fp->_ptr - fp->_base' \
+ \
+ '# BSD' \
+ 'fp->_p - fp->_bf._base' \
+ \
+ '# SCO, Unixware' \
+ '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \
+ \
+ '# QNX' \
+ '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \
+ \
+ '# old glibc?' \
+ 'fp->__bufp - fp->__buffer' \
+ \
+ '# old glibc iostream?' \
+ 'fp->_pptr - fp->_pbase' \
+ \
+ '# emx+gcc' \
+ 'fp->_ptr - fp->_buffer' \
+ \
+ '# Minix' \
+ 'fp->_ptr - fp->_buf' \
+ \
+ '# Plan9' \
+ 'fp->wp - fp->buf' \
+ \
+ '# VMS' \
+ '(*fp)->_ptr - (*fp)->_base' \
+ \
+ '# e.g., DGUX R4.11; the info is not available' \
+ 1 \
+ ; do
- # Skip each embedded comment.
- case "$ac_expr" in '#'*) continue;; esac
+ # Skip each embedded comment.
+ case "$ac_expr" in '#'*) continue;; esac
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
- [[FILE *fp = stdin; (void) ($ac_expr);]])],
- [fp_done=yes]
- )
- test "$fp_done" = yes && break
- done
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
+ [[FILE *fp = stdin; (void) ($ac_expr);]])],
+ [fp_done=yes]
+ )
+ test "$fp_done" = yes && break
+ done
- ac_cv_sys_pending_output_n_bytes=$ac_expr
- ]
- )
- AC_DEFINE_UNQUOTED([PENDING_OUTPUT_N_BYTES],
- $ac_cv_sys_pending_output_n_bytes,
- [the number of pending output bytes on stream `fp'])
- AC_LIBOBJ([fpending])
- fi
+ ac_cv_sys_pending_output_n_bytes=$ac_expr
+ ]
+ )
+ AC_DEFINE_UNQUOTED([PENDING_OUTPUT_N_BYTES],
+ $ac_cv_sys_pending_output_n_bytes,
+ [the number of pending output bytes on stream 'fp'])
])
diff --git a/m4/fpieee.m4 b/m4/fpieee.m4
index 7872876..97941bb 100644
--- a/m4/fpieee.m4
+++ b/m4/fpieee.m4
@@ -1,5 +1,5 @@
-# fpieee.m4 serial 1
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# fpieee.m4 serial 2
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -36,9 +36,11 @@ AC_DEFUN([gl_FP_IEEE],
# <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM>
if test -n "$GCC"; then
# GCC has the option -mieee.
+ # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
CPPFLAGS="$CPPFLAGS -mieee"
else
- # Compaq (ex-DEC) C has the option -ieee.
+ # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
+ # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
CPPFLAGS="$CPPFLAGS -ieee"
fi
;;
diff --git a/m4/fpurge.m4 b/m4/fpurge.m4
index a62c2fe..2059a56 100644
--- a/m4/fpurge.m4
+++ b/m4/fpurge.m4
@@ -1,5 +1,5 @@
-# fpurge.m4 serial 6
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# fpurge.m4 serial 7
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_FPURGE],
AC_CHECK_FUNCS_ONCE([__fpurge])
AC_CHECK_DECLS([fpurge], , , [[#include <stdio.h>]])
if test "x$ac_cv_func_fpurge" = xyes; then
+ HAVE_FPURGE=1
# Detect BSD bug. Only cygwin 1.7 is known to be immune.
AC_CACHE_CHECK([whether fpurge works], [gl_cv_func_fpurge_works],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
@@ -34,10 +35,9 @@ AC_DEFUN([gl_FUNC_FPURGE],
[gl_cv_func_fpurge_works='guessing no'])])
if test "x$gl_cv_func_fpurge_works" != xyes; then
REPLACE_FPURGE=1
- AC_LIBOBJ([fpurge])
fi
else
- AC_LIBOBJ([fpurge])
+ HAVE_FPURGE=0
fi
if test "x$ac_cv_have_decl_fpurge" = xno; then
HAVE_DECL_FPURGE=0
diff --git a/m4/gl_list.m4 b/m4/freadahead.m4
index 5cefb32..0f2d47c 100644
--- a/m4/gl_list.m4
+++ b/m4/freadahead.m4
@@ -1,10 +1,10 @@
-# gl_list.m4 serial 2
-dnl Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
+# freadahead.m4 serial 1
+dnl Copyright (C) 2012-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free 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_LIST],
+AC_DEFUN([gl_FUNC_FREADAHEAD],
[
- AC_REQUIRE([gl_INLINE])
+ AC_CHECK_FUNCS_ONCE([__freadahead])
])
diff --git a/m4/freading.m4 b/m4/freading.m4
index 59d502e..1e1f6f2 100644
--- a/m4/freading.m4
+++ b/m4/freading.m4
@@ -1,5 +1,5 @@
# freading.m4 serial 1
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/frexp.m4 b/m4/frexp.m4
index 2e0fb3b..2eb98a1 100644
--- a/m4/frexp.m4
+++ b/m4/frexp.m4
@@ -1,5 +1,5 @@
-# frexp.m4 serial 10
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# frexp.m4 serial 15
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -44,8 +44,6 @@ AC_DEFUN([gl_FUNC_FREXP],
if test $gl_func_frexp = yes; then
AC_DEFINE([HAVE_FREXP], [1],
[Define if the frexp() function is available and works.])
- else
- AC_LIBOBJ([frexp])
fi
AC_SUBST([FREXP_LIBM])
])
@@ -68,8 +66,6 @@ AC_DEFUN([gl_FUNC_FREXP_NO_LIBM],
if test $gl_func_frexp_no_libm = yes; then
AC_DEFINE([HAVE_FREXP_IN_LIBC], [1],
[Define if the frexp() function is available in libc.])
- else
- AC_LIBOBJ([frexp])
fi
])
@@ -92,11 +88,12 @@ AC_DEFUN([gl_CHECK_FREXP_NO_LIBM],
dnl Test whether frexp() works also on denormalized numbers (this fails e.g. on
dnl NetBSD 3.0), on infinite numbers (this fails e.g. on IRIX 6.5 and mingw),
-dnl and on negative zero (this fails e.g. on NetBSD 4.99).
+dnl and on negative zero (this fails e.g. on NetBSD 4.99 and mingw).
AC_DEFUN([gl_FUNC_FREXP_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_DECLS_ONCE([alarm])
AC_CACHE_CHECK([whether frexp works], [gl_cv_func_frexp_works],
[
AC_RUN_IFELSE(
@@ -104,10 +101,14 @@ AC_DEFUN([gl_FUNC_FREXP_WORKS],
#include <float.h>
#include <math.h>
#include <string.h>
+#if HAVE_DECL_ALARM
+# include <signal.h>
+# include <unistd.h>
+#endif
/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
ICC 10.0 has a bug when optimizing the expression -zero.
The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
- to PowerPC on MacOS X 10.5. */
+ to PowerPC on Mac OS X 10.5. */
#if defined __hpux || defined __sgi || defined __ICC
static double
compute_minus_zero (void)
@@ -124,6 +125,12 @@ int main()
int i;
volatile double x;
double zero = 0.0;
+#if HAVE_DECL_ALARM
+ /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
+ number. Let the test fail in this case. */
+ signal (SIGALRM, SIG_DFL);
+ alarm (5);
+#endif
/* Test on denormalized numbers. */
for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
;
@@ -137,7 +144,7 @@ int main()
result |= 1;
}
/* Test on infinite numbers. */
- x = 1.0 / 0.0;
+ x = 1.0 / zero;
{
int exp;
double y = frexp (x, &exp);
diff --git a/m4/frexpl.m4 b/m4/frexpl.m4
index 49d8821..3b64c52 100644
--- a/m4/frexpl.m4
+++ b/m4/frexpl.m4
@@ -1,5 +1,5 @@
-# frexpl.m4 serial 13
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# frexpl.m4 serial 20
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,9 +7,15 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FREXPL],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
+
+ dnl Persuade glibc <math.h> to declare frexpl().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
dnl Check whether it's declared.
- dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>])
+ dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
+
FREXPL_LIBM=
if test $HAVE_DECL_FREXPL = 1; then
gl_CHECK_FREXPL_NO_LIBM
@@ -40,7 +46,7 @@ AC_DEFUN([gl_FUNC_FREXPL],
LIBS="$save_LIBS"
case "$gl_cv_func_frexpl_works" in
*yes) gl_func_frexpl=yes ;;
- *) gl_func_frexpl=no; REPLACE_FREXPL=1; FREXPL_LIBM= ;;
+ *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;;
esac
else
gl_func_frexpl=no
@@ -51,7 +57,13 @@ AC_DEFUN([gl_FUNC_FREXPL],
fi
fi
if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
- AC_LIBOBJ([frexpl])
+ dnl Find libraries needed to link lib/frexpl.c.
+ if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
+ AC_REQUIRE([gl_FUNC_FREXP])
+ FREXPL_LIBM="$FREXP_LIBM"
+ else
+ FREXPL_LIBM=
+ fi
fi
AC_SUBST([FREXPL_LIBM])
])
@@ -59,9 +71,10 @@ AC_DEFUN([gl_FUNC_FREXPL],
AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
dnl Check whether it's declared.
- dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>])
+ dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
if test $HAVE_DECL_FREXPL = 1; then
gl_CHECK_FREXPL_NO_LIBM
if test $gl_cv_func_frexpl_no_libm = yes; then
@@ -80,9 +93,6 @@ AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM],
[Define if the frexpl() function is available in libc.])
fi
fi
- if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then
- AC_LIBOBJ([frexpl])
- fi
])
dnl Test whether frexpl() can be used without linking with libm.
@@ -103,8 +113,8 @@ AC_DEFUN([gl_CHECK_FREXPL_NO_LIBM],
])
dnl Test whether frexpl() works on finite numbers (this fails on
-dnl MacOS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers
-dnl (this fails on MacOS X 10.5/i386), and also on infinite numbers (this
+dnl Mac OS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers
+dnl (this fails on Mac OS X 10.5/i386), and also on infinite numbers (this
dnl fails e.g. on IRIX 6.5 and mingw).
AC_DEFUN([gl_FUNC_FREXPL_WORKS],
[
@@ -121,7 +131,25 @@ AC_DEFUN([gl_FUNC_FREXPL_WORKS],
# undef LDBL_MIN_EXP
# define LDBL_MIN_EXP (-16381)
#endif
-extern long double frexpl (long double, int *);
+#if defined __i386__ && defined __FreeBSD__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP (-16381)
+#endif
+#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+#endif
+#if defined __sgi && (LDBL_MANT_DIG >= 106)
+# if defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+# endif
+#endif
+extern
+#ifdef __cplusplus
+"C"
+#endif
+long double frexpl (long double, int *);
int main()
{
int result = 0;
@@ -134,7 +162,7 @@ int main()
if (exp != 5)
result |= 1;
}
- /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl
+ /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
function returns an invalid (incorrectly normalized) value: it returns
y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
but the correct result is
@@ -173,7 +201,7 @@ int main()
int exp;
long double y = frexpl (x, &exp);
/* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
- exp = -16382, y = 0.5. On MacOS X 10.5: exp = -16384, y = 0.5. */
+ exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */
if (exp != LDBL_MIN_EXP - 1)
result |= 8;
}
diff --git a/m4/fseek.m4 b/m4/fseek.m4
new file mode 100644
index 0000000..74f6656
--- /dev/null
+++ b/m4/fseek.m4
@@ -0,0 +1,15 @@
+# fseek.m4 serial 4
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FSEEK],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_FSEEKO])
+ dnl When fseeko needs fixes, fseek needs them too.
+ if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
+ REPLACE_FSEEK=1
+ fi
+])
diff --git a/m4/fseeko.m4 b/m4/fseeko.m4
index 76507d1..ca9da28 100644
--- a/m4/fseeko.m4
+++ b/m4/fseeko.m4
@@ -1,5 +1,5 @@
-# fseeko.m4 serial 11
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# fseeko.m4 serial 17
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,28 +7,8 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FSEEKO],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- AC_REQUIRE([gl_HAVE_FSEEKO])
AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
-
- AC_CHECK_DECLS_ONCE([fseeko])
- if test $ac_cv_have_decl_fseeko = no; then
- HAVE_DECL_FSEEKO=0
- fi
-
- if test $gl_cv_func_fseeko = no; then
- HAVE_FSEEKO=0
- gl_REPLACE_FSEEKO
- else
- if test $gl_cv_var_stdin_large_offset = no; then
- gl_REPLACE_FSEEKO
- fi
- fi
-])
-
-dnl Tests whether fseeko is available.
-dnl Result is gl_cv_func_fseeko.
-AC_DEFUN([gl_HAVE_FSEEKO],
-[
+ AC_REQUIRE([gl_SYS_TYPES_H])
AC_REQUIRE([AC_PROG_CC])
dnl Persuade glibc <stdio.h> to declare fseeko().
@@ -40,18 +20,28 @@ AC_DEFUN([gl_HAVE_FSEEKO],
]], [fseeko (stdin, 0, 0);])],
[gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
])
-])
-AC_DEFUN([gl_REPLACE_FSEEKO],
-[
- AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- AC_REQUIRE([gl_HAVE_FSEEKO])
- if test $gl_cv_func_fseeko = yes; then
- REPLACE_FSEEKO=1
+ AC_CHECK_DECLS_ONCE([fseeko])
+ if test $ac_cv_have_decl_fseeko = no; then
+ HAVE_DECL_FSEEKO=0
+ fi
+
+ if test $gl_cv_func_fseeko = no; then
+ HAVE_FSEEKO=0
+ else
+ if test $WINDOWS_64_BIT_OFF_T = 1; then
+ REPLACE_FSEEKO=1
+ fi
+ if test $gl_cv_var_stdin_large_offset = no; then
+ REPLACE_FSEEKO=1
+ fi
+ m4_ifdef([gl_FUNC_FFLUSH_STDIN], [
+ gl_FUNC_FFLUSH_STDIN
+ if test $gl_cv_func_fflush_stdin != yes; then
+ REPLACE_FSEEKO=1
+ fi
+ ])
fi
- AC_LIBOBJ([fseeko])
- dnl If we are also using the fseek module, then fseek needs replacing, too.
- m4_ifdef([gl_REPLACE_FSEEK], [gl_REPLACE_FSEEK])
])
dnl Code shared by fseeko and ftello. Determine if large files are supported,
@@ -73,3 +63,11 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
[gl_cv_var_stdin_large_offset=yes],
[gl_cv_var_stdin_large_offset=no])])
])
+
+# 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.
+ AC_CHECK_FUNCS([_fseeki64])
+])
diff --git a/m4/fstat.m4 b/m4/fstat.m4
new file mode 100644
index 0000000..b2cf2ad
--- /dev/null
+++ b/m4/fstat.m4
@@ -0,0 +1,36 @@
+# fstat.m4 serial 4
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FSTAT],
+[
+ AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_FSTAT=1
+ fi
+
+ AC_REQUIRE([gl_HEADER_SYS_STAT_H])
+ if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+ REPLACE_FSTAT=1
+ fi
+
+ dnl Replace fstat() for supporting the gnulib-defined open() on directories.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ case "$gl_cv_func_open_directory_works" in
+ *yes) ;;
+ *)
+ REPLACE_FSTAT=1
+ ;;
+ esac
+ fi
+ ])
+])
+
+# Prerequisites of lib/fstat.c.
+AC_DEFUN([gl_PREREQ_FSTAT], [:])
diff --git a/m4/ftell.m4 b/m4/ftell.m4
index 8d88485..5acd752 100644
--- a/m4/ftell.m4
+++ b/m4/ftell.m4
@@ -1,5 +1,5 @@
-# ftell.m4 serial 1
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# ftell.m4 serial 3
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,8 +9,7 @@ AC_DEFUN([gl_FUNC_FTELL],
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_REQUIRE([gl_FUNC_FTELLO])
dnl When ftello needs fixes, ftell needs them too.
- if test $REPLACE_FTELLO != 0; then
- AC_LIBOBJ([ftell])
+ if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
REPLACE_FTELL=1
fi
])
diff --git a/m4/ftello.m4 b/m4/ftello.m4
index 599f8f2..678039e 100644
--- a/m4/ftello.m4
+++ b/m4/ftello.m4
@@ -1,5 +1,5 @@
-# ftello.m4 serial 9
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# ftello.m4 serial 11
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,6 +9,7 @@ AC_DEFUN([gl_FUNC_FTELLO],
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
+ AC_REQUIRE([gl_SYS_TYPES_H])
dnl Persuade glibc <stdio.h> to declare ftello().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
@@ -30,9 +31,13 @@ AC_DEFUN([gl_FUNC_FTELLO],
if test $gl_cv_func_ftello = no; then
HAVE_FTELLO=0
else
+ if test $WINDOWS_64_BIT_OFF_T = 1; then
+ REPLACE_FTELLO=1
+ fi
if test $gl_cv_var_stdin_large_offset = no; then
REPLACE_FTELLO=1
- else
+ fi
+ if test $REPLACE_FTELLO = 0; then
dnl Detect bug on Solaris.
dnl ftell and ftello produce incorrect results after putc that followed a
dnl getc call that reached EOF on Solaris. This is because the _IOREAD
@@ -124,12 +129,12 @@ main (void)
esac
fi
fi
- if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
- gl_REPLACE_FTELLO
- fi
])
-AC_DEFUN([gl_REPLACE_FTELLO],
+# Prerequisites of lib/ftello.c.
+AC_DEFUN([gl_PREREQ_FTELLO],
[
- AC_LIBOBJ([ftello])
+ dnl Native Windows has the function _ftelli64. mingw hides it, but mingw64
+ dnl makes it usable again.
+ AC_CHECK_FUNCS([_ftelli64])
])
diff --git a/m4/getcwd.m4 b/m4/getcwd.m4
new file mode 100644
index 0000000..6f91bd9
--- /dev/null
+++ b/m4/getcwd.m4
@@ -0,0 +1,155 @@
+# getcwd.m4 - check for working getcwd that is compatible with glibc
+
+# Copyright (C) 2001, 2003-2007, 2009-2013 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Paul Eggert.
+# serial 12
+
+AC_DEFUN([gl_FUNC_GETCWD_NULL],
+ [
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_CHECK_HEADERS_ONCE([unistd.h])
+ AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
+ [gl_cv_func_getcwd_null],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+# if HAVE_UNISTD_H
+# include <unistd.h>
+# else /* on Windows with MSVC */
+# include <direct.h>
+# endif
+# ifndef getcwd
+ char *getcwd ();
+# endif
+]], [[
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* mingw cwd does not start with '/', but getcwd does allocate.
+ However, mingw fails to honor non-zero size. */
+#else
+ if (chdir ("/") != 0)
+ return 1;
+ else
+ {
+ char *f = getcwd (NULL, 0);
+ if (! f)
+ return 2;
+ if (f[0] != '/')
+ return 3;
+ if (f[1] != '\0')
+ return 4;
+ return 0;
+ }
+#endif
+ ]])],
+ [gl_cv_func_getcwd_null=yes],
+ [gl_cv_func_getcwd_null=no],
+ [[case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_getcwd_null="guessing yes";;
+ # Guess yes on Cygwin.
+ cygwin*) gl_cv_func_getcwd_null="guessing yes";;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_getcwd_null="guessing no";;
+ esac
+ ]])])
+])
+
+AC_DEFUN([gl_FUNC_GETCWD_SIGNATURE],
+[
+ AC_CACHE_CHECK([for getcwd with POSIX signature],
+ [gl_cv_func_getcwd_posix_signature],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>]],
+ [[extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ char *getcwd (char *, size_t);
+ ]])
+ ],
+ [gl_cv_func_getcwd_posix_signature=yes],
+ [gl_cv_func_getcwd_posix_signature=no])
+ ])
+])
+
+dnl Guarantee that getcwd will malloc with a NULL first argument. Assumes
+dnl that either the system getcwd is robust, or that calling code is okay
+dnl with spurious failures when run from a directory with an absolute name
+dnl larger than 4k bytes.
+dnl
+dnl Assumes that getcwd exists; if you are worried about obsolete
+dnl platforms that lacked getcwd(), then you need to use the GPL module.
+AC_DEFUN([gl_FUNC_GETCWD_LGPL],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_GETCWD_NULL])
+ AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE])
+
+ case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
+ *yes,yes) ;;
+ *)
+ dnl Minimal replacement lib/getcwd-lgpl.c.
+ REPLACE_GETCWD=1
+ ;;
+ esac
+])
+
+dnl Check for all known getcwd bugs; useful for a program likely to be
+dnl executed from an arbitrary location.
+AC_DEFUN([gl_FUNC_GETCWD],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_GETCWD_NULL])
+ AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ gl_abort_bug=no
+ case "$host_os" in
+ mingw*)
+ gl_cv_func_getcwd_path_max=yes
+ ;;
+ *)
+ gl_FUNC_GETCWD_PATH_MAX
+ case "$gl_cv_func_getcwd_null" in
+ *yes)
+ gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes])
+ ;;
+ esac
+ ;;
+ esac
+ dnl Define HAVE_MINIMALLY_WORKING_GETCWD and HAVE_PARTLY_WORKING_GETCWD
+ dnl if appropriate.
+ case "$gl_cv_func_getcwd_path_max" in
+ "no"|"no, it has the AIX bug") ;;
+ *)
+ AC_DEFINE([HAVE_MINIMALLY_WORKING_GETCWD], [1],
+ [Define to 1 if getcwd minimally works, that is, its result can be
+ trusted when it succeeds.])
+ ;;
+ esac
+ case "$gl_cv_func_getcwd_path_max" in
+ "no, but it is partly working")
+ AC_DEFINE([HAVE_PARTLY_WORKING_GETCWD], [1],
+ [Define to 1 if getcwd works, except it sometimes fails when it
+ shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT.])
+ ;;
+ esac
+
+ if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
+ || test $gl_cv_func_getcwd_posix_signature != yes \
+ || test "$gl_cv_func_getcwd_path_max" != yes \
+ || test $gl_abort_bug = yes; then
+ REPLACE_GETCWD=1
+ fi
+])
+
+# Prerequisites of lib/getcwd.c, when full replacement is in effect.
+AC_DEFUN([gl_PREREQ_GETCWD],
+[
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO])
+ :
+])
diff --git a/m4/getdtablesize.m4 b/m4/getdtablesize.m4
index 55bda5a..8f04b3b 100644
--- a/m4/getdtablesize.m4
+++ b/m4/getdtablesize.m4
@@ -1,5 +1,5 @@
-# getdtablesize.m4 serial 1
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# getdtablesize.m4 serial 4
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,6 +10,8 @@ AC_DEFUN([gl_FUNC_GETDTABLESIZE],
AC_CHECK_FUNCS_ONCE([getdtablesize])
if test $ac_cv_func_getdtablesize != yes; then
HAVE_GETDTABLESIZE=0
- AC_LIBOBJ([getdtablesize])
fi
])
+
+# Prerequisites of lib/getdtablesize.c.
+AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [:])
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index 035a530..50f4509 100644
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -1,5 +1,5 @@
-# getopt.m4 serial 34
-dnl Copyright (C) 2002-2006, 2008-2011 Free Software Foundation, Inc.
+# getopt.m4 serial 44
+dnl Copyright (C) 2002-2006, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,10 +9,22 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
[
m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- gl_GETOPT_IFELSE([
- gl_REPLACE_GETOPT
- ],
- [])
+ AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
+ dnl Other modules can request the gnulib implementation of the getopt
+ dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
+ dnl argp.m4 does this.
+ m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
+ REPLACE_GETOPT=1
+ ], [
+ REPLACE_GETOPT=0
+ if test -n "$gl_replace_getopt"; then
+ REPLACE_GETOPT=1
+ fi
+ ])
+ if test $REPLACE_GETOPT = 1; then
+ dnl Arrange for getopt.h to be created.
+ gl_GETOPT_SUBSTITUTE_HEADER
+ fi
])
# Request a POSIX compliant getopt function with GNU extensions (such as
@@ -25,27 +37,6 @@ AC_DEFUN([gl_FUNC_GETOPT_GNU],
AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
])
-# Request the gnulib implementation of the getopt functions unconditionally.
-# argp.m4 uses this.
-AC_DEFUN([gl_REPLACE_GETOPT],
-[
- dnl Arrange for getopt.h to be created.
- gl_GETOPT_SUBSTITUTE_HEADER
- dnl Arrange for unistd.h to include getopt.h.
- GNULIB_UNISTD_H_GETOPT=1
- dnl Arrange to compile the getopt implementation.
- AC_LIBOBJ([getopt])
- AC_LIBOBJ([getopt1])
- gl_PREREQ_GETOPT
-])
-
-# emacs' configure.in uses this.
-AC_DEFUN([gl_GETOPT_IFELSE],
-[
- AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
- AS_IF([test -n "$gl_replace_getopt"], [$1], [$2])
-])
-
# Determine whether to replace the entire getopt facility.
AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
[
@@ -75,11 +66,6 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
fi
- dnl mingw's getopt (in libmingwex.a) does weird things when the options
- dnl strings starts with '+' and it's not the first call. Some internal state
- dnl is left over from earlier calls, and neither setting optind = 0 nor
- dnl setting optreset = 1 get rid of this internal state.
- dnl POSIX is silent on optind vs. optreset, so we allow either behavior.
dnl POSIX 2008 does not specify leading '+' behavior, but see
dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
dnl the next version of POSIX. For now, we only guarantee leading '+'
@@ -88,30 +74,16 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
AC_CACHE_CHECK([whether getopt is POSIX compatible],
[gl_cv_func_getopt_posix],
[
- dnl BSD getopt_long uses an incompatible method to reset
- dnl option processing. Existence of the variable, in and of
- dnl itself, is not a reason to replace getopt, but knowledge
- dnl of the variable is needed to determine how to reset and
- dnl whether a reset reparses the environment. Solaris
- dnl supports neither optreset nor optind=0, but keeps no state
- dnl that needs a reset beyond setting optind=1; detect Solaris
- dnl by getopt_clip.
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <unistd.h>]],
- [[int *p = &optreset; return optreset;]])],
- [gl_optind_min=1],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <getopt.h>]],
- [[return !getopt_clip;]])],
- [gl_optind_min=1],
- [gl_optind_min=0])])
-
- dnl This test fails on mingw and succeeds on many other platforms.
- gl_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min"
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ dnl Merging these three different test programs into a single one
+ dnl would require a reset mechanism. On BSD systems, it can be done
+ dnl through 'optreset'; on some others (glibc), it can be done by
+ dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1,
+ dnl Solaris 9, musl libc), there is no such mechanism.
+ if test $cross_compiling = no; then
+ dnl Sanity check. Succeeds everywhere (except on MSVC,
+ dnl which lacks <unistd.h> and getopt() entirely).
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
@@ -119,91 +91,107 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
int
main ()
{
- {
- int argc = 0;
- char *argv[10];
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-a";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = OPTIND_MIN;
- opterr = 0;
+ static char program[] = "program";
+ static char a[] = "-a";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, a, foo, bar, NULL };
+ int c;
- c = getopt (argc, argv, "ab");
- if (!(c == 'a'))
- return 1;
- c = getopt (argc, argv, "ab");
- if (!(c == -1))
- return 2;
- if (!(optind == 2))
- return 3;
- }
- /* Some internal state exists at this point. */
- {
- int argc = 0;
- char *argv[10];
- int c;
+ c = getopt (4, argv, "ab");
+ if (!(c == 'a'))
+ return 1;
+ c = getopt (4, argv, "ab");
+ if (!(c == -1))
+ return 2;
+ if (!(optind == 2))
+ return 3;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=maybe],
+ [gl_cv_func_getopt_posix=no])
+ if test $gl_cv_func_getopt_posix = maybe; then
+ dnl Sanity check with '+'. Succeeds everywhere (except on MSVC,
+ dnl which lacks <unistd.h> and getopt() entirely).
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = OPTIND_MIN;
- opterr = 0;
+int
+main ()
+{
+ static char program[] = "program";
+ static char donald[] = "donald";
+ static char p[] = "-p";
+ static char billy[] = "billy";
+ static char duck[] = "duck";
+ static char a[] = "-a";
+ static char bar[] = "bar";
+ char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+ int c;
- c = getopt (argc, argv, "+abp:q:");
- if (!(c == -1))
- return 4;
- if (!(strcmp (argv[0], "program") == 0))
- return 5;
- if (!(strcmp (argv[1], "donald") == 0))
- return 6;
- if (!(strcmp (argv[2], "-p") == 0))
- return 7;
- if (!(strcmp (argv[3], "billy") == 0))
- return 8;
- if (!(strcmp (argv[4], "duck") == 0))
- return 9;
- if (!(strcmp (argv[5], "-a") == 0))
- return 10;
- if (!(strcmp (argv[6], "bar") == 0))
- return 11;
- if (!(optind == 1))
- return 12;
- }
- /* Detect MacOS 10.5, AIX 7.1 bug. */
- {
- char *argv[3] = { "program", "-ab", NULL };
- optind = OPTIND_MIN;
- opterr = 0;
- if (getopt (2, argv, "ab:") != 'a')
- return 13;
- if (getopt (2, argv, "ab:") != '?')
- return 14;
- if (optopt != 'b')
- return 15;
- if (optind != 2)
- return 16;
- }
+ c = getopt (7, argv, "+abp:q:");
+ if (!(c == -1))
+ return 4;
+ if (!(strcmp (argv[0], "program") == 0))
+ return 5;
+ if (!(strcmp (argv[1], "donald") == 0))
+ return 6;
+ if (!(strcmp (argv[2], "-p") == 0))
+ return 7;
+ if (!(strcmp (argv[3], "billy") == 0))
+ return 8;
+ if (!(strcmp (argv[4], "duck") == 0))
+ return 9;
+ if (!(strcmp (argv[5], "-a") == 0))
+ return 10;
+ if (!(strcmp (argv[6], "bar") == 0))
+ return 11;
+ if (!(optind == 1))
+ return 12;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=maybe],
+ [gl_cv_func_getopt_posix=no])
+ fi
+ if test $gl_cv_func_getopt_posix = maybe; then
+ dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug.
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+int
+main ()
+{
+ static char program[] = "program";
+ static char ab[] = "-ab";
+ char *argv[3] = { program, ab, NULL };
+ if (getopt (2, argv, "ab:") != 'a')
+ return 13;
+ if (getopt (2, argv, "ab:") != '?')
+ return 14;
+ if (optopt != 'b')
+ return 15;
+ if (optind != 2)
+ return 16;
return 0;
}
]])],
- [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no],
- [case "$host_os" in
- mingw*) gl_cv_func_getopt_posix="guessing no";;
- darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
- *) gl_cv_func_getopt_posix="guessing yes";;
- esac
- ])
- CPPFLAGS=$gl_save_CPPFLAGS
+ [gl_cv_func_getopt_posix=yes],
+ [gl_cv_func_getopt_posix=no])
+ fi
+ else
+ case "$host_os" in
+ darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
+ *) gl_cv_func_getopt_posix="guessing yes";;
+ esac
+ fi
])
case "$gl_cv_func_getopt_posix" in
*no) gl_replace_getopt=yes ;;
@@ -232,25 +220,32 @@ dnl is ambiguous with environment values that contain newlines.
[AC_LANG_PROGRAM([[#include <getopt.h>
#include <stddef.h>
#include <string.h>
+ ]GL_NOCRASH[
]], [[
int result = 0;
+
+ nocrash_init();
+
/* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
- and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+ and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
OSF/1 5.1, Solaris 10. */
{
- char *myargv[3];
- myargv[0] = "conftest";
- myargv[1] = "-+";
- myargv[2] = 0;
+ static char conftest[] = "conftest";
+ static char plus[] = "-+";
+ char *argv[3] = { conftest, plus, NULL };
opterr = 0;
- if (getopt (2, myargv, "+a") != '?')
+ if (getopt (2, argv, "+a") != '?')
result |= 1;
}
/* This code succeeds on glibc 2.8, mingw,
- and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+ and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */
{
- char *argv[] = { "program", "-p", "foo", "bar", NULL };
+ static char program[] = "program";
+ static char p[] = "-p";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, p, foo, bar, NULL };
optind = 1;
if (getopt (4, argv, "p::") != 'p')
@@ -264,32 +259,44 @@ dnl is ambiguous with environment values that contain newlines.
}
/* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */
{
- char *argv[] = { "program", "foo", "-p", NULL };
+ static char program[] = "program";
+ static char foo[] = "foo";
+ static char p[] = "-p";
+ char *argv[] = { program, foo, p, NULL };
optind = 0;
if (getopt (3, argv, "-p") != 1)
result |= 16;
else if (getopt (3, argv, "-p") != 'p')
- result |= 32;
+ result |= 16;
}
/* This code fails on glibc 2.11. */
{
- char *argv[] = { "program", "-b", "-a", NULL };
+ static char program[] = "program";
+ static char b[] = "-b";
+ static char a[] = "-a";
+ char *argv[] = { program, b, a, NULL };
optind = opterr = 0;
if (getopt (3, argv, "+:a:b") != 'b')
- result |= 64;
+ result |= 32;
else if (getopt (3, argv, "+:a:b") != ':')
+ result |= 32;
+ }
+ /* This code dumps core on glibc 2.14. */
+ {
+ static char program[] = "program";
+ static char w[] = "-W";
+ static char dummy[] = "dummy";
+ char *argv[] = { program, w, dummy, NULL };
+ optind = opterr = 1;
+ if (getopt (3, argv, "W;") != 'W')
result |= 64;
}
return result;
]])],
[gl_cv_func_getopt_gnu=yes],
[gl_cv_func_getopt_gnu=no],
- [dnl Cross compiling. Guess based on host and declarations.
- case $host_os:$ac_cv_have_decl_optreset in
- *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
- *:yes) gl_cv_func_getopt_gnu=no;;
- *) gl_cv_func_getopt_gnu=yes;;
- esac
+ [dnl Cross compiling. Assume the worst, even on glibc platforms.
+ gl_cv_func_getopt_gnu="guessing no"
])
case $gl_had_POSIXLY_CORRECT in
exported) ;;
@@ -297,13 +304,54 @@ dnl is ambiguous with environment values that contain newlines.
*) AS_UNSET([POSIXLY_CORRECT]) ;;
esac
])
- if test "$gl_cv_func_getopt_gnu" = "no"; then
+ if test "$gl_cv_func_getopt_gnu" != yes; then
gl_replace_getopt=yes
+ else
+ AC_CACHE_CHECK([for working GNU getopt_long function],
+ [gl_cv_func_getopt_long_gnu],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+ ]],
+ [[static const struct option long_options[] =
+ {
+ { "xtremely-",no_argument, NULL, 1003 },
+ { "xtra", no_argument, NULL, 1001 },
+ { "xtreme", no_argument, NULL, 1002 },
+ { "xtremely", no_argument, NULL, 1003 },
+ { NULL, 0, NULL, 0 }
+ };
+ /* This code fails on OpenBSD 5.0. */
+ {
+ static char program[] = "program";
+ static char xtremel[] = "--xtremel";
+ char *argv[] = { program, xtremel, NULL };
+ int option_index;
+ optind = 1; opterr = 0;
+ if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
+ return 1;
+ }
+ return 0;
+ ]])],
+ [gl_cv_func_getopt_long_gnu=yes],
+ [gl_cv_func_getopt_long_gnu=no],
+ [dnl Cross compiling. Guess no on OpenBSD, yes otherwise.
+ case "$host_os" in
+ openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
+ *) gl_cv_func_getopt_long_gnu="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_getopt_long_gnu" in
+ *yes) ;;
+ *) gl_replace_getopt=yes ;;
+ esac
fi
fi
])
-# emacs' configure.in uses this.
AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
[
GETOPT_H=getopt.h
@@ -314,7 +362,6 @@ AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
])
# Prerequisites of lib/getopt*.
-# emacs' configure.in uses this.
AC_DEFUN([gl_PREREQ_GETOPT],
[
AC_CHECK_DECLS_ONCE([getenv])
diff --git a/m4/getpagesize.m4 b/m4/getpagesize.m4
index 79dfbbe..06e893d 100644
--- a/m4/getpagesize.m4
+++ b/m4/getpagesize.m4
@@ -1,5 +1,5 @@
-# getpagesize.m4 serial 8
-dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2011 Free Software Foundation,
+# getpagesize.m4 serial 9
+dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2013 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -24,7 +24,6 @@ AC_DEFUN([gl_FUNC_GETPAGESIZE],
case "$host_os" in
mingw*)
REPLACE_GETPAGESIZE=1
- AC_LIBOBJ([getpagesize])
;;
esac
dnl Also check whether it's declared.
diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4
index 84acadf..3c05e59 100644
--- a/m4/gettimeofday.m4
+++ b/m4/gettimeofday.m4
@@ -1,6 +1,6 @@
-# serial 15
+# serial 20
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2013 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -17,8 +17,6 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
gl_gettimeofday_timezone=void
if test $ac_cv_func_gettimeofday != yes; then
HAVE_GETTIMEOFDAY=0
- AC_LIBOBJ([gettimeofday])
- gl_PREREQ_GETTIMEOFDAY
else
gl_FUNC_GETTIMEOFDAY_CLOBBER
AC_CACHE_CHECK([for gettimeofday with POSIX signature],
@@ -51,9 +49,24 @@ int gettimeofday (struct timeval *restrict, struct timezone *restrict);
gl_gettimeofday_timezone='struct timezone'
elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
REPLACE_GETTIMEOFDAY=1
- AC_LIBOBJ([gettimeofday])
- gl_PREREQ_GETTIMEOFDAY
fi
+ dnl If we override 'struct timeval', we also have to override gettimeofday.
+ if test $REPLACE_STRUCT_TIMEVAL = 1; then
+ REPLACE_GETTIMEOFDAY=1
+ fi
+ m4_ifdef([gl_FUNC_TZSET_CLOBBER], [
+ gl_FUNC_TZSET_CLOBBER
+ case "$gl_cv_func_tzset_clobber" in
+ *yes)
+ REPLACE_GETTIMEOFDAY=1
+ gl_GETTIMEOFDAY_REPLACE_LOCALTIME
+ AC_DEFINE([tzset], [rpl_tzset],
+ [Define to rpl_tzset if the wrapper function should be used.])
+ AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1],
+ [Define if tzset clobbers localtime's static buffer.])
+ ;;
+ esac
+ ])
fi
AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone],
[Define this to 'void' or 'struct timezone' to match the system's
@@ -71,6 +84,7 @@ dnl the wrapper functions that work around the problem.
AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
[
AC_REQUIRE([gl_HEADER_SYS_TIME_H])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
[gl_cv_func_gettimeofday_clobber],
@@ -93,20 +107,26 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
]])],
[gl_cv_func_gettimeofday_clobber=no],
[gl_cv_func_gettimeofday_clobber=yes],
- dnl When crosscompiling, assume it is broken.
- [gl_cv_func_gettimeofday_clobber=yes])])
+ [# When cross-compiling:
+ case "$host_os" in
+ # Guess all is fine on glibc systems.
+ *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
+ esac
+ ])])
- if test $gl_cv_func_gettimeofday_clobber = yes; then
- REPLACE_GETTIMEOFDAY=1
- gl_GETTIMEOFDAY_REPLACE_LOCALTIME
- AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
- [Define if gettimeofday clobbers the localtime buffer.])
- fi
+ case "$gl_cv_func_gettimeofday_clobber" in
+ *yes)
+ REPLACE_GETTIMEOFDAY=1
+ gl_GETTIMEOFDAY_REPLACE_LOCALTIME
+ AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
+ [Define if gettimeofday clobbers the localtime buffer.])
+ ;;
+ esac
])
AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [
- AC_LIBOBJ([gettimeofday])
- gl_PREREQ_GETTIMEOFDAY
AC_DEFINE([gmtime], [rpl_gmtime],
[Define to rpl_gmtime if the replacement function should be used.])
AC_DEFINE([localtime], [rpl_localtime],
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
index bc81c11..613fb2a 100644
--- a/m4/glibc21.m4
+++ b/m4/glibc21.m4
@@ -1,5 +1,5 @@
# glibc21.m4 serial 5
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2011 Free Software Foundation,
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2013 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
index d7aa3bb..34a8b37 100644
--- a/m4/gnulib-cache.m4
+++ b/m4/gnulib-cache.m4
@@ -1,9 +1,21 @@
-# Copyright (C) 2002-2011 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
#
-# This file is free software, distributed under the terms of the GNU
-# General Public License. As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
@@ -15,10 +27,10 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --local-dir=local --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --with-c++-tests --avoid=lock-tests --avoid=tls-tests --makefile-name=gnulib.mk --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io c-stack clean-temp cloexec close-stream closein config-h dirname error execute fclose fdl-1.3 fflush filenamecat fopen fopen-safer fseeko gendocs getopt-gnu git-version-gen gnu-web-doc-update gnumakefile gnupload gpl-3.0 ignore-value intprops maintainer-makefile manywarnings memchr2 mkstemp obstack progname regex rename sigaction spawn-pipe stdbool stdint stdlib-safer strsignal strstr strtod strtol unlocked-io update-copyright vc-list-files verror version-etc version-etc-fsf wait-process xalloc xoset xprintf xvasprintf-posix
+# gnulib-tool --import --dir=. --local-dir=gl --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --with-c++-tests --avoid=lock-tests --avoid=tls-tests --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io c-stack clean-temp cloexec close-stream closein config-h dirname error execute fclose fdl-1.3 fflush filenamecat fopen fopen-safer fseeko gendocs getopt-gnu git-version-gen gnu-web-doc-update gnumakefile gnupload gpl-3.0 ignore-value intprops maintainer-makefile manywarnings memchr2 mkstemp obstack progname regex rename sigaction sigpipe spawn-pipe stdbool stdint stdlib-safer strsignal strstr strtod unlocked-io update-copyright vc-list-files verror version-etc version-etc-fsf wait-process xalloc xoset xprintf xvasprintf-posix
# Specification in the form of a few gnulib-tool.m4 macro invocations:
-gl_LOCAL_DIR([local])
+gl_LOCAL_DIR([gl])
gl_MODULES([
announce-gen
assert
@@ -59,6 +71,7 @@ gl_MODULES([
regex
rename
sigaction
+ sigpipe
spawn-pipe
stdbool
stdint
@@ -66,7 +79,6 @@ gl_MODULES([
strsignal
strstr
strtod
- strtol
unlocked-io
update-copyright
vc-list-files
@@ -91,3 +103,4 @@ gl_LIB([libm4])
gl_MAKEFILE_NAME([gnulib.mk])
gl_MACRO_PREFIX([M4])
gl_PO_DOMAIN([])
+gl_WITNESS_C_MACRO([])
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index ecbf336..0ae5a9e 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 23
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 33
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,11 +12,25 @@ AC_DEFUN([gl_COMMON], [
AC_REQUIRE([gl_COMMON_BODY])
])
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)
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif defined _MSC_VER && 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
+])
AH_VERBATIM([isoc99_inline],
[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
- __APPLE__ && __MACH__ test for MacOS X.
+ __APPLE__ && __MACH__ test for Mac OS X.
__APPLE_CC__ tests for the Apple compiler and its version.
__STDC_VERSION__ tests for the C99 mode. */
#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
@@ -34,6 +48,20 @@ AC_DEFUN([gl_COMMON_BODY], [
/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
is a misnomer outside of parameter lists. */
#define _UNUSED_PARAMETER_ _GL_UNUSED
+
+/* The __pure__ attribute was added in gcc 2.96. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The __const__ attribute was added in gcc 2.95. */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+#else
+# define _GL_ATTRIBUTE_CONST /* empty */
+#endif
])
dnl Preparation for running test programs:
dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
@@ -47,16 +75,49 @@ AC_DEFUN([gl_COMMON_BODY], [
# expands to a C preprocessor expression that evaluates to 1 or 0, depending
# whether a gnulib module that has been requested shall be considered present
# or not.
-AC_DEFUN([gl_MODULE_INDICATOR_CONDITION], [1])
+m4_define([gl_MODULE_INDICATOR_CONDITION], [1])
# gl_MODULE_INDICATOR_SET_VARIABLE([modulename])
# sets the shell variable that indicates the presence of the given module to
# a C preprocessor expression that will evaluate to 1.
AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
[
- GNULIB_[]m4_translit([[$1]],
- [abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION
+ gl_MODULE_INDICATOR_SET_VARIABLE_AUX(
+ [GNULIB_[]m4_translit([[$1]],
+ [abcdefghijklmnopqrstuvwxyz./-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
+ [gl_MODULE_INDICATOR_CONDITION])
+])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable])
+# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION.
+# The shell variable's value is a C preprocessor expression that evaluates
+# to 0 or 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX],
+[
+ m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1],
+ [
+ dnl Simplify the expression VALUE || 1 to 1.
+ $1=1
+ ],
+ [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1],
+ [gl_MODULE_INDICATOR_CONDITION])])
+])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition])
+# modifies the shell variable to include the given condition. The shell
+# variable's value is a C preprocessor expression that evaluates to 0 or 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR],
+[
+ dnl Simplify the expression 1 || CONDITION to 1.
+ if test "$[]$1" != 1; then
+ dnl Simplify the expression 0 || CONDITION to CONDITION.
+ if test "$[]$1" = 0; then
+ $1=$2
+ else
+ $1="($[]$1 || $2)"
+ fi
+ fi
])
# gl_MODULE_INDICATOR([modulename])
@@ -109,7 +170,8 @@ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
[
dnl Override gl_WARN_ON_USE_PREPARE.
- AC_DEFUN([gl_WARN_ON_USE_PREPARE], [])
+ dnl But hide this definition from 'aclocal'.
+ AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], [])
])
# gl_ASSERT_NO_GNULIB_TESTS
@@ -150,11 +212,90 @@ m4_ifndef([AS_VAR_IF],
[m4_define([AS_VAR_IF],
[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
+# gl_PROG_CC_C99
+# Modifies the value of the shell variable CC in an attempt to make $CC
+# understand ISO C99 source code.
+# This is like AC_PROG_CC_C99, except that
+# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60,
+# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
+# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>,
+# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
+# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>.
+# Remaining problems:
+# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
+# to CC twice
+# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>.
+# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
+AC_DEFUN([gl_PROG_CC_C99],
+[
+ dnl Change that version number to the minimum Autoconf version that supports
+ dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls.
+ m4_version_prereq([9.0],
+ [AC_REQUIRE([AC_PROG_CC_C99])],
+ [AC_REQUIRE([AC_PROG_CC_STDC])])
+])
+
+# gl_PROG_AR_RANLIB
+# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler.
+# The user can set the variables AR, ARFLAGS, RANLIB if he wants to override
+# the values.
+AC_DEFUN([gl_PROG_AR_RANLIB],
+[
+ dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
+ dnl as "cc", and GCC as "gcc". They have different object file formats and
+ dnl library formats. In particular, the GNU binutils programs ar, ranlib
+ dnl produce libraries that work only with gcc, not with cc.
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
+ [
+ AC_EGREP_CPP([Amsterdam],
+ [
+#ifdef __ACK__
+Amsterdam
+#endif
+ ],
+ [gl_cv_c_amsterdam_compiler=yes],
+ [gl_cv_c_amsterdam_compiler=no])
+ ])
+ if test -z "$AR"; then
+ if test $gl_cv_c_amsterdam_compiler = yes; then
+ AR='cc -c.a'
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='-o'
+ fi
+ else
+ dnl Use the Automake-documented default values for AR and ARFLAGS,
+ dnl but prefer ${host}-ar over ar (useful for cross-compiling).
+ AC_CHECK_TOOL([AR], [ar], [ar])
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='cru'
+ fi
+ fi
+ else
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='cru'
+ fi
+ fi
+ AC_SUBST([AR])
+ AC_SUBST([ARFLAGS])
+ if test -z "$RANLIB"; then
+ if test $gl_cv_c_amsterdam_compiler = yes; then
+ RANLIB=':'
+ else
+ dnl Use the ranlib program if it is available.
+ AC_PROG_RANLIB
+ fi
+ fi
+ 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],
@@ -165,13 +306,15 @@ m4_ifdef([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 overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61,
# so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++
# works.
# This definition can be removed once autoconf >= 2.62 can be assumed.
-m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.62]),[-1],[
+# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
+m4_ifndef([AC_AUTOCONF_VERSION],[
AC_DEFUN([AC_C_RESTRICT],
[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
[ac_cv_c_restrict=no
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 9a51c9f..2fe7131 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -1,10 +1,22 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2011 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
#
-# This file is free software, distributed under the terms of the GNU
-# General Public License. As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
@@ -25,13 +37,12 @@ AC_DEFUN([M4_EARLY],
m4_pattern_allow([^gl_ES$])dnl a valid locale name
m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
- AC_REQUIRE([AC_PROG_RANLIB])
+ AC_REQUIRE([gl_PROG_AR_RANLIB])
AC_REQUIRE([AM_PROG_CC_C_O])
# Code from module alloca-opt:
# Code from module alloca-opt-tests:
# Code from module announce-gen:
# Code from module ansi-c++-opt:
- # Code from module arg-nonnull:
# Code from module array-list:
# Code from module array-list-tests:
# Code from module array-oset:
@@ -45,31 +56,39 @@ AC_DEFUN([M4_EARLY],
# Code from module binary-io-tests:
# Code from module btowc:
# Code from module btowc-tests:
- # Code from module c++defs:
# Code from module c-ctype:
# Code from module c-ctype-tests:
# Code from module c-stack:
# Code from module c-stack-tests:
# Code from module c-strcase:
# Code from module c-strcase-tests:
+ # Code from module c-strcaseeq:
# Code from module canonicalize-lgpl:
# Code from module canonicalize-lgpl-tests:
+ # Code from module chdir:
+ # Code from module chdir-tests:
# Code from module clean-temp:
# Code from module cloexec:
# Code from module cloexec-tests:
# Code from module close:
- # Code from module close-hook:
# Code from module close-stream:
+ # Code from module close-tests:
+ # Code from module closedir:
# Code from module closein:
# Code from module closein-tests:
# Code from module closeout:
# Code from module config-h:
# Code from module configmake:
+ # Code from module dirent:
+ # Code from module dirent-c++-tests:
+ # Code from module dirent-tests:
# Code from module dirname:
# Code from module dirname-lgpl:
# Code from module dirname-tests:
# Code from module dosname:
# Code from module double-slash-root:
+ # Code from module dup:
+ # Code from module dup-tests:
# Code from module dup2:
# Code from module dup2-tests:
# Code from module environ:
@@ -81,22 +100,30 @@ AC_DEFUN([M4_EARLY],
# Code from module exitfail:
# Code from module extensions:
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ # Code from module extern-inline:
# Code from module fatal-signal:
# Code from module fclose:
+ # Code from module fclose-tests:
# Code from module fcntl:
# Code from module fcntl-h:
# Code from module fcntl-h-c++-tests:
# Code from module fcntl-h-tests:
# Code from module fcntl-tests:
+ # Code from module fd-hook:
# Code from module fd-safer-flag:
# Code from module fdl-1.3:
+ # Code from module fdopen:
+ # Code from module fdopen-tests:
# Code from module fflush:
AC_REQUIRE([AC_FUNC_FSEEKO])
# Code from module fflush-tests:
+ # Code from module fgetc-tests:
+ # Code from module filename:
# Code from module filenamecat:
# Code from module filenamecat-lgpl:
# Code from module filenamecat-tests:
# Code from module float:
+ # Code from module float-tests:
# Code from module fopen:
# Code from module fopen-safer:
# Code from module fopen-safer-tests:
@@ -108,6 +135,8 @@ AC_DEFUN([M4_EARLY],
# Code from module fpucw:
# Code from module fpurge:
# Code from module fpurge-tests:
+ # Code from module fputc-tests:
+ # Code from module fread-tests:
# Code from module freadahead:
# Code from module freadahead-tests:
# Code from module freading:
@@ -116,15 +145,22 @@ AC_DEFUN([M4_EARLY],
# Code from module frexp-nolibm-tests:
# Code from module frexpl-nolibm:
# Code from module frexpl-nolibm-tests:
+ # Code from module fseek:
+ # Code from module fseek-tests:
# Code from module fseeko:
AC_REQUIRE([AC_FUNC_FSEEKO])
# Code from module fseeko-tests:
+ # Code from module fstat:
+ # Code from module fstat-tests:
# Code from module ftell:
# Code from module ftell-tests:
# Code from module ftello:
AC_REQUIRE([AC_FUNC_FSEEKO])
# Code from module ftello-tests:
+ # Code from module fwrite-tests:
# Code from module gendocs:
+ # Code from module getcwd-lgpl:
+ # Code from module getcwd-lgpl-tests:
# Code from module getdtablesize:
# Code from module getdtablesize-tests:
# Code from module getopt-gnu:
@@ -143,8 +179,11 @@ AC_DEFUN([M4_EARLY],
# Code from module ignore-value:
# Code from module ignore-value-tests:
# Code from module include_next:
- # Code from module inline:
# Code from module intprops:
+ # Code from module intprops-tests:
+ # Code from module inttypes:
+ # Code from module inttypes-incomplete:
+ # Code from module inttypes-tests:
# Code from module isnand-nolibm:
# Code from module isnand-nolibm-tests:
# Code from module isnanf-nolibm:
@@ -154,6 +193,8 @@ AC_DEFUN([M4_EARLY],
# Code from module langinfo:
# Code from module langinfo-c++-tests:
# Code from module langinfo-tests:
+ # Code from module largefile:
+ AC_REQUIRE([AC_SYS_LARGEFILE])
# Code from module libsigsegv:
# Code from module link:
# Code from module link-tests:
@@ -164,6 +205,8 @@ AC_DEFUN([M4_EARLY],
# Code from module locale:
# Code from module locale-c++-tests:
# Code from module locale-tests:
+ # Code from module localeconv:
+ # Code from module localeconv-tests:
# Code from module localename:
# Code from module localename-tests:
# Code from module lock:
@@ -192,6 +235,8 @@ AC_DEFUN([M4_EARLY],
# Code from module memchr2-tests:
# Code from module mkdtemp:
# Code from module mkstemp:
+ # Code from module msvc-inval:
+ # Code from module msvc-nothrow:
# Code from module multiarch:
# Code from module nl_langinfo:
# Code from module nl_langinfo-tests:
@@ -199,15 +244,20 @@ AC_DEFUN([M4_EARLY],
# Code from module obstack:
# Code from module open:
# Code from module open-tests:
+ # Code from module opendir:
# Code from module oset:
# Code from module pathmax:
+ # Code from module pathmax-tests:
# Code from module pipe2:
# Code from module pipe2-safer:
# Code from module pipe2-tests:
# Code from module posix_spawn-internal:
# Code from module posix_spawn_file_actions_addclose:
+ # Code from module posix_spawn_file_actions_addclose-tests:
# Code from module posix_spawn_file_actions_adddup2:
+ # Code from module posix_spawn_file_actions_adddup2-tests:
# Code from module posix_spawn_file_actions_addopen:
+ # Code from module posix_spawn_file_actions_addopen-tests:
# Code from module posix_spawn_file_actions_destroy:
# Code from module posix_spawn_file_actions_init:
# Code from module posix_spawnattr_destroy:
@@ -226,11 +276,15 @@ AC_DEFUN([M4_EARLY],
# Code from module quotearg:
# Code from module quotearg-simple:
# Code from module quotearg-simple-tests:
+ # Code from module raise:
+ # Code from module raise-tests:
# Code from module rawmemchr:
# Code from module rawmemchr-tests:
+ # Code from module readdir:
# Code from module readlink:
# Code from module readlink-tests:
# Code from module regex:
+ # Code from module regex-tests:
# Code from module rename:
# Code from module rename-tests:
# Code from module rmdir:
@@ -238,19 +292,30 @@ AC_DEFUN([M4_EARLY],
# Code from module same-inode:
# Code from module sched:
# Code from module sched-tests:
+ # Code from module secure_getenv:
# Code from module setenv:
# Code from module setenv-tests:
# Code from module setlocale:
# Code from module setlocale-tests:
# Code from module sigaction:
# Code from module sigaction-tests:
- # Code from module signal:
- # Code from module signal-c++-tests:
- # Code from module signal-tests:
+ # Code from module signal-h:
+ # Code from module signal-h-c++-tests:
+ # Code from module signal-h-tests:
# Code from module signbit:
# Code from module signbit-tests:
+ # Code from module sigpipe:
+ # Code from module sigpipe-tests:
# Code from module sigprocmask:
+ # Code from module sigprocmask-tests:
# Code from module size_max:
+ # Code from module sleep:
+ # Code from module sleep-tests:
+ # Code from module snippet/_Noreturn:
+ # Code from module snippet/arg-nonnull:
+ # Code from module snippet/c++defs:
+ # Code from module snippet/unused-parameter:
+ # Code from module snippet/warn-on-use:
# Code from module snprintf:
# Code from module snprintf-tests:
# Code from module spawn:
@@ -264,9 +329,9 @@ AC_DEFUN([M4_EARLY],
# Code from module stdarg:
dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
dnl for the builtin va_copy to work. With Autoconf 2.60 or later,
- dnl AC_PROG_CC_STDC arranges for this. With older Autoconf AC_PROG_CC_STDC
+ dnl gl_PROG_CC_C99 arranges for this. With older Autoconf gl_PROG_CC_C99
dnl shouldn't hurt, though installers are on their own to set c99 mode.
- AC_REQUIRE([AC_PROG_CC_STDC])
+ gl_PROG_CC_C99
# Code from module stdbool:
# Code from module stdbool-tests:
# Code from module stddef:
@@ -285,6 +350,7 @@ AC_DEFUN([M4_EARLY],
# Code from module strdup-posix:
# Code from module streq:
# Code from module strerror:
+ # Code from module strerror-override:
# Code from module strerror-tests:
# Code from module string:
# Code from module string-c++-tests:
@@ -299,7 +365,6 @@ AC_DEFUN([M4_EARLY],
# Code from module strstr-tests:
# Code from module strtod:
# Code from module strtod-tests:
- # Code from module strtol:
# Code from module symlink:
# Code from module symlink-tests:
# Code from module sys_stat:
@@ -308,10 +373,15 @@ AC_DEFUN([M4_EARLY],
# Code from module sys_time:
# Code from module sys_time-c++-tests:
# Code from module sys_time-tests:
+ # Code from module sys_types:
+ # Code from module sys_types-c++-tests:
+ # Code from module sys_types-tests:
# Code from module sys_wait:
# Code from module sys_wait-c++-tests:
# Code from module sys_wait-tests:
# Code from module tempname:
+ # Code from module test-framework-sh:
+ # Code from module test-framework-sh-tests:
# Code from module threadlib:
gl_THREADLIB_EARLY
# Code from module time:
@@ -346,7 +416,6 @@ AC_DEFUN([M4_EARLY],
# Code from module version-etc-tests:
# Code from module wait-process:
# Code from module waitpid:
- # Code from module warn-on-use:
# Code from module warnings:
# Code from module wchar:
# Code from module wchar-c++-tests:
@@ -358,9 +427,12 @@ AC_DEFUN([M4_EARLY],
# Code from module wctype-h:
# Code from module wctype-h-c++-tests:
# Code from module wctype-h-tests:
+ # Code from module write:
+ # Code from module write-tests:
# Code from module xalloc:
# Code from module xalloc-die:
# Code from module xalloc-die-tests:
+ # Code from module xalloc-oversized:
# Code from module xlist:
# Code from module xmalloca:
# Code from module xoset:
@@ -388,141 +460,182 @@ AC_DEFUN([M4_INIT],
m4_pushdef([M4_LIBSOURCES_DIR], [])
gl_COMMON
gl_source_base='lib'
- # Code from module alloca-opt:
gl_FUNC_ALLOCA
- # Code from module announce-gen:
- # Code from module arg-nonnull:
- # Code from module assert:
gl_ASSERT
- # Code from module autobuild:
- # Code from module avltree-oset:
- # Code from module binary-io:
- # Code from module btowc:
gl_FUNC_BTOWC
+ if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
+ AC_LIBOBJ([btowc])
+ gl_PREREQ_BTOWC
+ fi
gl_WCHAR_MODULE_INDICATOR([btowc])
- # Code from module c++defs:
- # Code from module c-ctype:
- # Code from module c-stack:
gl_C_STACK
- # Code from module canonicalize-lgpl:
gl_CANONICALIZE_LGPL
+ if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
+ AC_LIBOBJ([canonicalize-lgpl])
+ fi
gl_MODULE_INDICATOR([canonicalize-lgpl])
gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
gl_STDLIB_MODULE_INDICATOR([realpath])
- # Code from module clean-temp:
+ gl_UNISTD_MODULE_INDICATOR([chdir])
AC_DEFINE([SIGNAL_SAFE_LIST], [1], [Define if lists must be signal-safe.])
- # Code from module cloexec:
- gl_CLOEXEC
gl_MODULE_INDICATOR_FOR_TESTS([cloexec])
- # Code from module close:
gl_FUNC_CLOSE
+ if test $REPLACE_CLOSE = 1; then
+ AC_LIBOBJ([close])
+ fi
gl_UNISTD_MODULE_INDICATOR([close])
- # Code from module close-hook:
- # Code from module close-stream:
gl_CLOSE_STREAM
gl_MODULE_INDICATOR([close-stream])
- # Code from module closein:
gl_CLOSEIN
- # Code from module closeout:
gl_CLOSEOUT
- # Code from module config-h:
gl_CONFIG_H
- # Code from module configmake:
gl_CONFIGMAKE_PREP
- # Code from module dirname:
gl_DIRNAME
gl_MODULE_INDICATOR([dirname])
- # Code from module dirname-lgpl:
gl_DIRNAME_LGPL
- # Code from module dosname:
- # Code from module double-slash-root:
gl_DOUBLE_SLASH_ROOT
- # Code from module dup2:
gl_FUNC_DUP2
+ if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
+ AC_LIBOBJ([dup2])
+ gl_PREREQ_DUP2
+ fi
gl_UNISTD_MODULE_INDICATOR([dup2])
- # Code from module environ:
gl_ENVIRON
gl_UNISTD_MODULE_INDICATOR([environ])
- # Code from module errno:
gl_HEADER_ERRNO_H
- # Code from module error:
gl_ERROR
+ if test $ac_cv_lib_error_at_line = no; then
+ AC_LIBOBJ([error])
+ gl_PREREQ_ERROR
+ fi
m4_ifdef([AM_XGETTEXT_OPTION],
[AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
- # Code from module execute:
gl_EXECUTE
- # Code from module exitfail:
- # Code from module extensions:
- # Code from module fatal-signal:
+ AC_REQUIRE([gl_EXTERN_INLINE])
gl_FATAL_SIGNAL
- # Code from module fclose:
gl_FUNC_FCLOSE
+ if test $REPLACE_FCLOSE = 1; then
+ AC_LIBOBJ([fclose])
+ fi
gl_STDIO_MODULE_INDICATOR([fclose])
- # Code from module fcntl:
gl_FUNC_FCNTL
+ if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
+ AC_LIBOBJ([fcntl])
+ fi
gl_FCNTL_MODULE_INDICATOR([fcntl])
- # Code from module fcntl-h:
gl_FCNTL_H
- # Code from module fd-safer-flag:
gl_MODULE_INDICATOR([fd-safer-flag])
- # Code from module fdl-1.3:
- # Code from module fflush:
gl_FUNC_FFLUSH
+ if test $REPLACE_FFLUSH = 1; then
+ AC_LIBOBJ([fflush])
+ gl_PREREQ_FFLUSH
+ fi
+ gl_MODULE_INDICATOR([fflush])
gl_STDIO_MODULE_INDICATOR([fflush])
- # Code from module filenamecat:
gl_FILE_NAME_CONCAT
gl_MODULE_INDICATOR([filenamecat])
- # Code from module filenamecat-lgpl:
gl_FILE_NAME_CONCAT_LGPL
- # Code from module float:
gl_FLOAT_H
- # Code from module fopen:
+ if test $REPLACE_FLOAT_LDBL = 1; then
+ AC_LIBOBJ([float])
+ fi
+ if test $REPLACE_ITOLD = 1; then
+ AC_LIBOBJ([itold])
+ fi
gl_FUNC_FOPEN
+ if test $REPLACE_FOPEN = 1; then
+ AC_LIBOBJ([fopen])
+ gl_PREREQ_FOPEN
+ fi
gl_STDIO_MODULE_INDICATOR([fopen])
- # Code from module fopen-safer:
- gl_FOPEN_SAFER
gl_MODULE_INDICATOR([fopen-safer])
- # Code from module fpending:
gl_FUNC_FPENDING
- # Code from module fpieee:
- # Code from module fpucw:
- # Code from module fpurge:
+ if test $gl_cv_func___fpending = no; then
+ AC_LIBOBJ([fpending])
+ gl_PREREQ_FPENDING
+ fi
gl_FUNC_FPURGE
+ if test $HAVE_FPURGE = 0 || test $REPLACE_FPURGE = 1; then
+ AC_LIBOBJ([fpurge])
+ fi
gl_STDIO_MODULE_INDICATOR([fpurge])
- # Code from module freadahead:
- # Code from module freading:
+ gl_FUNC_FREADAHEAD
+ if test $ac_cv_func___freadahead = no; then
+ AC_LIBOBJ([freadahead])
+ fi
gl_FUNC_FREADING
- # Code from module frexp-nolibm:
gl_FUNC_FREXP_NO_LIBM
+ if test $gl_func_frexp_no_libm != yes; then
+ AC_LIBOBJ([frexp])
+ fi
gl_MATH_MODULE_INDICATOR([frexp])
- # Code from module frexpl-nolibm:
gl_FUNC_FREXPL_NO_LIBM
+ if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then
+ AC_LIBOBJ([frexpl])
+ fi
gl_MATH_MODULE_INDICATOR([frexpl])
- # Code from module fseeko:
+ gl_FUNC_FSEEK
+ if test $REPLACE_FSEEK = 1; then
+ AC_LIBOBJ([fseek])
+ fi
+ gl_STDIO_MODULE_INDICATOR([fseek])
gl_FUNC_FSEEKO
+ if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
+ AC_LIBOBJ([fseeko])
+ gl_PREREQ_FSEEKO
+ fi
gl_STDIO_MODULE_INDICATOR([fseeko])
- # Code from module ftello:
+ gl_FUNC_FSTAT
+ if test $REPLACE_FSTAT = 1; then
+ AC_LIBOBJ([fstat])
+ gl_PREREQ_FSTAT
+ fi
+ gl_SYS_STAT_MODULE_INDICATOR([fstat])
+ gl_FUNC_FTELL
+ if test $REPLACE_FTELL = 1; then
+ AC_LIBOBJ([ftell])
+ fi
+ gl_STDIO_MODULE_INDICATOR([ftell])
gl_FUNC_FTELLO
+ if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
+ AC_LIBOBJ([ftello])
+ gl_PREREQ_FTELLO
+ fi
gl_STDIO_MODULE_INDICATOR([ftello])
- # Code from module gendocs:
- # Code from module getdtablesize:
gl_FUNC_GETDTABLESIZE
+ if test $HAVE_GETDTABLESIZE = 0; then
+ AC_LIBOBJ([getdtablesize])
+ gl_PREREQ_GETDTABLESIZE
+ fi
gl_UNISTD_MODULE_INDICATOR([getdtablesize])
- # Code from module getopt-gnu:
gl_FUNC_GETOPT_GNU
+ if test $REPLACE_GETOPT = 1; then
+ AC_LIBOBJ([getopt])
+ AC_LIBOBJ([getopt1])
+ gl_PREREQ_GETOPT
+ dnl Arrange for unistd.h to include getopt.h.
+ GNULIB_GL_M4_UNISTD_H_GETOPT=1
+ fi
+ AC_SUBST([GNULIB_GL_M4_UNISTD_H_GETOPT])
gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
- # Code from module getopt-posix:
gl_FUNC_GETOPT_POSIX
- # Code from module gettext-h:
+ if test $REPLACE_GETOPT = 1; then
+ AC_LIBOBJ([getopt])
+ AC_LIBOBJ([getopt1])
+ gl_PREREQ_GETOPT
+ dnl Arrange for unistd.h to include getopt.h.
+ GNULIB_GL_M4_UNISTD_H_GETOPT=1
+ fi
+ AC_SUBST([GNULIB_GL_M4_UNISTD_H_GETOPT])
AC_SUBST([LIBINTL])
AC_SUBST([LTLIBINTL])
- # Code from module gettimeofday:
gl_FUNC_GETTIMEOFDAY
+ if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
+ AC_LIBOBJ([gettimeofday])
+ gl_PREREQ_GETTIMEOFDAY
+ fi
gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
- # Code from module git-version-gen:
- # Code from module gnu-web-doc-update:
- # Code from module gnumakefile:
# Autoconf 2.61a.99 and earlier don't support linking a file only
# in VPATH builds. But since GNUmakefile is for maintainer use
# only, it does not matter if we skip the link with older autoconf.
@@ -530,350 +643,379 @@ AC_DEFUN([M4_INIT],
# builds, so use a shell variable to bypass this.
GNUmakefile=GNUmakefile
m4_if(m4_version_compare([2.61a.100],
- m4_defn([m4_PACKAGE_VERSION])), [1], [],
+ m4_defn([m4_PACKAGE_VERSION])), [1], [],
[AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
- [GNUmakefile=$GNUmakefile])])
- # Code from module gnupload:
- # Code from module gpl-3.0:
- # Code from module havelib:
- # Code from module ignore-value:
- AC_REQUIRE([AC_C_INLINE])
- # Code from module include_next:
- # Code from module inline:
- gl_INLINE
- # Code from module intprops:
- # Code from module isnand-nolibm:
+ [GNUmakefile=$GNUmakefile])])
gl_FUNC_ISNAND_NO_LIBM
- # Code from module isnanf-nolibm:
+ if test $gl_func_isnand_no_libm != yes; then
+ AC_LIBOBJ([isnand])
+ gl_PREREQ_ISNAND
+ fi
gl_FUNC_ISNANF_NO_LIBM
- # Code from module isnanl-nolibm:
+ if test $gl_func_isnanf_no_libm != yes; then
+ AC_LIBOBJ([isnanf])
+ gl_PREREQ_ISNANF
+ fi
gl_FUNC_ISNANL_NO_LIBM
- # Code from module langinfo:
+ if test $gl_func_isnanl_no_libm != yes; then
+ AC_LIBOBJ([isnanl])
+ gl_PREREQ_ISNANL
+ fi
gl_LANGINFO_H
- # Code from module libsigsegv:
+ AC_REQUIRE([gl_LARGEFILE])
gl_LIBSIGSEGV
- # Code from module linkedhash-list:
- # Code from module list:
- gl_LIST
- # Code from module localcharset:
gl_LOCALCHARSET
- LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
+ LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
- # Code from module lock:
+ gl_LOCALE_H
+ gl_FUNC_LOCALECONV
+ if test $REPLACE_LOCALECONV = 1; then
+ AC_LIBOBJ([localeconv])
+ gl_PREREQ_LOCALECONV
+ fi
+ gl_LOCALE_MODULE_INDICATOR([localeconv])
gl_LOCK
- # Code from module lseek:
+ gl_MODULE_INDICATOR([lock])
gl_FUNC_LSEEK
+ if test $REPLACE_LSEEK = 1; then
+ AC_LIBOBJ([lseek])
+ fi
gl_UNISTD_MODULE_INDICATOR([lseek])
- # Code from module lstat:
gl_FUNC_LSTAT
+ if test $REPLACE_LSTAT = 1; then
+ AC_LIBOBJ([lstat])
+ gl_PREREQ_LSTAT
+ fi
gl_SYS_STAT_MODULE_INDICATOR([lstat])
- # Code from module maintainer-makefile:
AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
[AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
- # Code from module malloc-gnu:
gl_FUNC_MALLOC_GNU
+ if test $REPLACE_MALLOC = 1; then
+ AC_LIBOBJ([malloc])
+ fi
gl_MODULE_INDICATOR([malloc-gnu])
- # Code from module malloc-posix:
gl_FUNC_MALLOC_POSIX
+ if test $REPLACE_MALLOC = 1; then
+ AC_LIBOBJ([malloc])
+ fi
gl_STDLIB_MODULE_INDICATOR([malloc-posix])
- # Code from module malloca:
gl_MALLOCA
- # Code from module manywarnings:
- # Code from module math:
gl_MATH_H
- # Code from module mbrtowc:
gl_FUNC_MBRTOWC
+ if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
+ AC_LIBOBJ([mbrtowc])
+ gl_PREREQ_MBRTOWC
+ fi
gl_WCHAR_MODULE_INDICATOR([mbrtowc])
- # Code from module mbsinit:
gl_FUNC_MBSINIT
+ if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
+ AC_LIBOBJ([mbsinit])
+ gl_PREREQ_MBSINIT
+ fi
gl_WCHAR_MODULE_INDICATOR([mbsinit])
- # Code from module mbtowc:
gl_FUNC_MBTOWC
+ if test $REPLACE_MBTOWC = 1; then
+ AC_LIBOBJ([mbtowc])
+ gl_PREREQ_MBTOWC
+ fi
gl_STDLIB_MODULE_INDICATOR([mbtowc])
- # Code from module memchr:
gl_FUNC_MEMCHR
+ if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+ AC_LIBOBJ([memchr])
+ gl_PREREQ_MEMCHR
+ fi
gl_STRING_MODULE_INDICATOR([memchr])
- # Code from module memchr2:
- # Code from module mkdtemp:
- gt_FUNC_MKDTEMP
+ gl_FUNC_MKDTEMP
+ if test $HAVE_MKDTEMP = 0; then
+ AC_LIBOBJ([mkdtemp])
+ gl_PREREQ_MKDTEMP
+ fi
gl_STDLIB_MODULE_INDICATOR([mkdtemp])
- # Code from module mkstemp:
gl_FUNC_MKSTEMP
+ if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then
+ AC_LIBOBJ([mkstemp])
+ gl_PREREQ_MKSTEMP
+ fi
gl_STDLIB_MODULE_INDICATOR([mkstemp])
- # Code from module multiarch:
+ gl_MSVC_INVAL
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ AC_LIBOBJ([msvc-inval])
+ fi
+ gl_MSVC_NOTHROW
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ AC_LIBOBJ([msvc-nothrow])
+ fi
gl_MULTIARCH
- # Code from module nl_langinfo:
gl_FUNC_NL_LANGINFO
+ if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
+ AC_LIBOBJ([nl_langinfo])
+ fi
gl_LANGINFO_MODULE_INDICATOR([nl_langinfo])
- # Code from module nocrash:
- # Code from module obstack:
AC_FUNC_OBSTACK
dnl Note: AC_FUNC_OBSTACK does AC_LIBSOURCES([obstack.h, obstack.c]).
- # Code from module open:
gl_FUNC_OPEN
+ if test $REPLACE_OPEN = 1; then
+ AC_LIBOBJ([open])
+ gl_PREREQ_OPEN
+ fi
gl_FCNTL_MODULE_INDICATOR([open])
- # Code from module oset:
- gl_LIST
- # Code from module pathmax:
gl_PATHMAX
- # Code from module pipe2:
gl_FUNC_PIPE2
gl_UNISTD_MODULE_INDICATOR([pipe2])
- # Code from module pipe2-safer:
gl_MODULE_INDICATOR([pipe2-safer])
- # Code from module posix_spawn-internal:
- # Code from module posix_spawn_file_actions_addclose:
- gl_POSIX_SPAWN
- if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
- gl_REPLACE_SPAWN_H
+ gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
+ if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = 1; then
AC_LIBOBJ([spawn_faction_addclose])
fi
gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_addclose])
- # Code from module posix_spawn_file_actions_adddup2:
- gl_POSIX_SPAWN
- if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
- gl_REPLACE_SPAWN_H
+ gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
+ if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = 1; then
AC_LIBOBJ([spawn_faction_adddup2])
fi
gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_adddup2])
- # Code from module posix_spawn_file_actions_addopen:
- gl_POSIX_SPAWN
- if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
- gl_REPLACE_SPAWN_H
+ gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
+ if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = 1; then
AC_LIBOBJ([spawn_faction_addopen])
fi
gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_addopen])
- # Code from module posix_spawn_file_actions_destroy:
gl_POSIX_SPAWN
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
- gl_REPLACE_SPAWN_H
AC_LIBOBJ([spawn_faction_destroy])
fi
gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_destroy])
- # Code from module posix_spawn_file_actions_init:
gl_POSIX_SPAWN
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
- gl_REPLACE_SPAWN_H
AC_LIBOBJ([spawn_faction_init])
fi
gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_init])
- # Code from module posix_spawnattr_destroy:
gl_POSIX_SPAWN
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
- gl_REPLACE_SPAWN_H
AC_LIBOBJ([spawnattr_destroy])
fi
gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_destroy])
- # Code from module posix_spawnattr_init:
gl_POSIX_SPAWN
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
- gl_REPLACE_SPAWN_H
AC_LIBOBJ([spawnattr_init])
fi
gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_init])
- # Code from module posix_spawnattr_setflags:
gl_POSIX_SPAWN
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
- gl_REPLACE_SPAWN_H
AC_LIBOBJ([spawnattr_setflags])
fi
gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setflags])
- # Code from module posix_spawnattr_setsigmask:
gl_POSIX_SPAWN
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
- gl_REPLACE_SPAWN_H
AC_LIBOBJ([spawnattr_setsigmask])
fi
gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setsigmask])
- # Code from module posix_spawnp:
gl_POSIX_SPAWN
if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
- gl_REPLACE_SPAWN_H
AC_LIBOBJ([spawnp])
- gl_POSIX_SPAWN_INTERNAL
+ AC_LIBOBJ([spawni])
+ gl_PREREQ_POSIX_SPAWN_INTERNAL
fi
gl_SPAWN_MODULE_INDICATOR([posix_spawnp])
- # Code from module printf-frexp:
gl_FUNC_PRINTF_FREXP
- # Code from module printf-frexpl:
gl_FUNC_PRINTF_FREXPL
- # Code from module printf-safe:
m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes])
- # Code from module progname:
AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
- # Code from module quotearg:
gl_QUOTEARG
- # Code from module quotearg-simple:
- # Code from module rawmemchr:
+ gl_FUNC_RAISE
+ if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then
+ AC_LIBOBJ([raise])
+ gl_PREREQ_RAISE
+ fi
+ gl_SIGNAL_MODULE_INDICATOR([raise])
gl_FUNC_RAWMEMCHR
+ if test $HAVE_RAWMEMCHR = 0; then
+ AC_LIBOBJ([rawmemchr])
+ gl_PREREQ_RAWMEMCHR
+ fi
gl_STRING_MODULE_INDICATOR([rawmemchr])
- # Code from module readlink:
gl_FUNC_READLINK
+ if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
+ AC_LIBOBJ([readlink])
+ gl_PREREQ_READLINK
+ fi
gl_UNISTD_MODULE_INDICATOR([readlink])
- # Code from module regex:
gl_REGEX
- # Code from module rename:
+ if test $ac_use_included_regex = yes; then
+ AC_LIBOBJ([regex])
+ gl_PREREQ_REGEX
+ fi
gl_FUNC_RENAME
+ if test $REPLACE_RENAME = 1; then
+ AC_LIBOBJ([rename])
+ fi
gl_STDIO_MODULE_INDICATOR([rename])
- # Code from module rmdir:
gl_FUNC_RMDIR
+ if test $REPLACE_RMDIR = 1; then
+ AC_LIBOBJ([rmdir])
+ fi
gl_UNISTD_MODULE_INDICATOR([rmdir])
- # Code from module same-inode:
- # Code from module sched:
gl_SCHED_H
- # Code from module sigaction:
+ gl_FUNC_SECURE_GETENV
+ if test $HAVE_SECURE_GETENV = 0; then
+ AC_LIBOBJ([secure_getenv])
+ gl_PREREQ_SECURE_GETENV
+ fi
+ gl_STDLIB_MODULE_INDICATOR([secure_getenv])
gl_SIGACTION
+ if test $HAVE_SIGACTION = 0; then
+ AC_LIBOBJ([sigaction])
+ gl_PREREQ_SIGACTION
+ fi
gl_SIGNAL_MODULE_INDICATOR([sigaction])
- # Code from module signal:
gl_SIGNAL_H
- # Code from module signbit:
gl_SIGNBIT
+ if test $REPLACE_SIGNBIT = 1; then
+ AC_LIBOBJ([signbitf])
+ AC_LIBOBJ([signbitd])
+ AC_LIBOBJ([signbitl])
+ fi
gl_MATH_MODULE_INDICATOR([signbit])
- # Code from module sigprocmask:
+ gl_SIGNAL_SIGPIPE
+ dnl Define the C macro GNULIB_SIGPIPE to 1.
+ gl_MODULE_INDICATOR([sigpipe])
+ dnl Define the substituted variable GNULIB_SIGNAL_H_SIGPIPE to 1.
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+ GNULIB_SIGNAL_H_SIGPIPE=1
+ dnl Define the substituted variable GNULIB_STDIO_H_SIGPIPE to 1.
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
+ GNULIB_STDIO_H_SIGPIPE=1
+ dnl Define the substituted variable GNULIB_UNISTD_H_SIGPIPE to 1.
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ GNULIB_UNISTD_H_SIGPIPE=1
gl_SIGNALBLOCKING
+ if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+ AC_LIBOBJ([sigprocmask])
+ gl_PREREQ_SIGPROCMASK
+ fi
gl_SIGNAL_MODULE_INDICATOR([sigprocmask])
- # Code from module size_max:
gl_SIZE_MAX
- # Code from module snprintf:
gl_FUNC_SNPRINTF
gl_STDIO_MODULE_INDICATOR([snprintf])
gl_MODULE_INDICATOR([snprintf])
- # Code from module spawn:
gl_SPAWN_H
- # Code from module spawn-pipe:
gl_SPAWN_PIPE
- # Code from module ssize_t:
gt_TYPE_SSIZE_T
- # Code from module stat:
gl_FUNC_STAT
+ if test $REPLACE_STAT = 1; then
+ AC_LIBOBJ([stat])
+ gl_PREREQ_STAT
+ fi
gl_SYS_STAT_MODULE_INDICATOR([stat])
- # Code from module stdarg:
gl_STDARG_H
- # Code from module stdbool:
AM_STDBOOL_H
- # Code from module stddef:
gl_STDDEF_H
- # Code from module stdint:
gl_STDINT_H
- # Code from module stdio:
gl_STDIO_H
- # Code from module stdlib:
gl_STDLIB_H
- # Code from module stdlib-safer:
- gl_STDLIB_SAFER
- # Code from module strchrnul:
gl_FUNC_STRCHRNUL
+ if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
+ AC_LIBOBJ([strchrnul])
+ gl_PREREQ_STRCHRNUL
+ fi
gl_STRING_MODULE_INDICATOR([strchrnul])
- # Code from module streq:
- # Code from module strerror:
gl_FUNC_STRERROR
+ if test $REPLACE_STRERROR = 1; then
+ AC_LIBOBJ([strerror])
+ fi
+ gl_MODULE_INDICATOR([strerror])
gl_STRING_MODULE_INDICATOR([strerror])
- # Code from module string:
+ AC_REQUIRE([gl_HEADER_ERRNO_H])
+ AC_REQUIRE([gl_FUNC_STRERROR_0])
+ if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
+ AC_LIBOBJ([strerror-override])
+ gl_PREREQ_SYS_H_WINSOCK2
+ fi
gl_HEADER_STRING_H
- # Code from module strndup:
gl_FUNC_STRNDUP
+ if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then
+ AC_LIBOBJ([strndup])
+ fi
gl_STRING_MODULE_INDICATOR([strndup])
- # Code from module strnlen:
gl_FUNC_STRNLEN
+ if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
+ AC_LIBOBJ([strnlen])
+ gl_PREREQ_STRNLEN
+ fi
gl_STRING_MODULE_INDICATOR([strnlen])
- # Code from module strsignal:
gl_FUNC_STRSIGNAL
+ if test $HAVE_STRSIGNAL = 0 || test $REPLACE_STRSIGNAL = 1; then
+ AC_LIBOBJ([strsignal])
+ gl_PREREQ_STRSIGNAL
+ fi
gl_STRING_MODULE_INDICATOR([strsignal])
- # Code from module strstr:
gl_FUNC_STRSTR
- # Code from module strstr-simple:
+ if test $REPLACE_STRSTR = 1; then
+ AC_LIBOBJ([strstr])
+ fi
gl_FUNC_STRSTR_SIMPLE
+ if test $REPLACE_STRSTR = 1; then
+ AC_LIBOBJ([strstr])
+ fi
gl_STRING_MODULE_INDICATOR([strstr])
- # Code from module strtod:
gl_FUNC_STRTOD
+ if test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1; then
+ AC_LIBOBJ([strtod])
+ gl_PREREQ_STRTOD
+ fi
gl_STDLIB_MODULE_INDICATOR([strtod])
- # Code from module strtol:
- gl_FUNC_STRTOL
- # Code from module sys_stat:
gl_HEADER_SYS_STAT_H
AC_PROG_MKDIR_P
- # Code from module sys_time:
gl_HEADER_SYS_TIME_H
AC_PROG_MKDIR_P
- # Code from module sys_wait:
+ gl_SYS_TYPES_H
+ AC_PROG_MKDIR_P
gl_SYS_WAIT_H
AC_PROG_MKDIR_P
- # Code from module tempname:
gl_FUNC_GEN_TEMPNAME
- # Code from module threadlib:
gl_THREADLIB
- # Code from module time:
gl_HEADER_TIME_H
- # Code from module tls:
gl_TLS
- # Code from module tmpdir:
gt_TMPDIR
- # Code from module unistd:
gl_UNISTD_H
- # Code from module unistd-safer:
gl_UNISTD_SAFER
- # Code from module unlocked-io:
gl_FUNC_GLIBC_UNLOCKED_IO
- # Code from module update-copyright:
- # Code from module useless-if-before-free:
- # Code from module vasnprintf:
gl_FUNC_VASNPRINTF
- # Code from module vasprintf:
gl_FUNC_VASPRINTF
gl_STDIO_MODULE_INDICATOR([vasprintf])
m4_ifdef([AM_XGETTEXT_OPTION],
[AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format])
AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])])
- # Code from module vasprintf-posix:
gl_FUNC_VASPRINTF_POSIX
- # Code from module vc-list-files:
- # Code from module verify:
- # Code from module verror:
m4_ifdef([AM_XGETTEXT_OPTION],
[AM_][XGETTEXT_OPTION([--flag=verror:3:c-format])
AM_][XGETTEXT_OPTION([--flag=verror_at_line:5:c-format])])
- # Code from module version-etc:
gl_VERSION_ETC
- # Code from module version-etc-fsf:
- # Code from module wait-process:
gl_WAIT_PROCESS
- # Code from module waitpid:
gl_FUNC_WAITPID
+ if test $HAVE_WAITPID = 0; then
+ AC_LIBOBJ([waitpid])
+ fi
gl_SYS_WAIT_MODULE_INDICATOR([waitpid])
- # Code from module warn-on-use:
- # Code from module warnings:
- AC_SUBST([WARN_CFLAGS])
- # Code from module wchar:
gl_WCHAR_H
- # Code from module wcrtomb:
gl_FUNC_WCRTOMB
+ if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
+ AC_LIBOBJ([wcrtomb])
+ gl_PREREQ_WCRTOMB
+ fi
gl_WCHAR_MODULE_INDICATOR([wcrtomb])
- # Code from module wctype-h:
gl_WCTYPE_H
- # Code from module xalloc:
gl_XALLOC
- # Code from module xalloc-die:
- # Code from module xlist:
- gl_LIST
- # Code from module xmalloca:
- # Code from module xoset:
- gl_LIST
- # Code from module xprintf:
m4_ifdef([AM_XGETTEXT_OPTION],
[AM_][XGETTEXT_OPTION([--flag=xprintf:1:c-format])
AM_][XGETTEXT_OPTION([--flag=xvprintf:1:c-format])
AM_][XGETTEXT_OPTION([--flag=xfprintf:2:c-format])
AM_][XGETTEXT_OPTION([--flag=xvfprintf:2:c-format])])
- # Code from module xsize:
gl_XSIZE
- # Code from module xstrndup:
gl_XSTRNDUP
- # Code from module xvasprintf:
gl_XVASPRINTF
m4_ifdef([AM_XGETTEXT_OPTION],
[AM_][XGETTEXT_OPTION([--flag=xasprintf:1:c-format])])
- # Code from module xvasprintf-posix:
# End of code from modules
m4_ifval(M4_LIBSOURCES_LIST, [
m4_syscmd([test ! -d ]m4_defn([M4_LIBSOURCES_DIR])[ ||
@@ -925,19 +1067,49 @@ changequote([, ])dnl
gt_LOCALE_FR_UTF8
gt_LOCALE_FR
gt_LOCALE_TR_UTF8
+ gl_FUNC_CLOSEDIR
+ if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
+ AC_LIBOBJ([closedir])
+ fi
+ gl_DIRENT_MODULE_INDICATOR([closedir])
+ gl_DIRENT_H
+ gl_FUNC_DUP
+ if test $REPLACE_DUP = 1; then
+ AC_LIBOBJ([dup])
+ gl_PREREQ_DUP
+ fi
+ gl_UNISTD_MODULE_INDICATOR([dup])
+ gl_FUNC_FDOPEN
+ if test $REPLACE_FDOPEN = 1; then
+ AC_LIBOBJ([fdopen])
+ gl_PREREQ_FDOPEN
+ fi
+ gl_STDIO_MODULE_INDICATOR([fdopen])
gl_FUNC_UNGETC_WORKS
- gl_FUNC_FTELL
- gl_STDIO_MODULE_INDICATOR([ftell])
gl_FUNC_UNGETC_WORKS
gl_FUNC_UNGETC_WORKS
+ gl_FUNC_UNGETC_WORKS
+ gl_FUNC_GETCWD_LGPL
+ if test $REPLACE_GETCWD = 1; then
+ AC_LIBOBJ([getcwd-lgpl])
+ fi
+ gl_UNISTD_MODULE_INDICATOR([getcwd])
gl_FUNC_GETPAGESIZE
+ if test $REPLACE_GETPAGESIZE = 1; then
+ AC_LIBOBJ([getpagesize])
+ fi
gl_UNISTD_MODULE_INDICATOR([getpagesize])
+ gl_INTTYPES_H
+ gl_INTTYPES_INCOMPLETE
gl_DOUBLE_EXPONENT_LOCATION
gl_FLOAT_EXPONENT_LOCATION
gl_LONG_DOUBLE_EXPONENT_LOCATION
+ AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
gl_FUNC_LINK
+ if test $HAVE_LINK = 0 || test $REPLACE_LINK = 1; then
+ AC_LIBOBJ([link])
+ fi
gl_UNISTD_MODULE_INDICATOR([link])
- gl_LOCALE_H
AC_CHECK_FUNCS_ONCE([newlocale])
gl_LOCALENAME
AC_CHECK_FUNCS_ONCE([newlocale])
@@ -955,6 +1127,11 @@ changequote([, ])dnl
AC_CHECK_FUNCS_ONCE([mprotect])
gt_LOCALE_FR
gt_LOCALE_FR_UTF8
+ gl_FUNC_OPENDIR
+ if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
+ AC_LIBOBJ([opendir])
+ fi
+ gl_DIRENT_MODULE_INDICATOR([opendir])
AC_EGREP_CPP([notposix], [[
#if defined _MSC_VER || defined __MINGW32__
notposix
@@ -964,14 +1141,35 @@ changequote([, ])dnl
[posix_spawn_ported=yes])
AM_CONDITIONAL([POSIX_SPAWN_PORTED], [test $posix_spawn_ported = yes])
gl_FUNC_PUTENV
+ if test $REPLACE_PUTENV = 1; then
+ AC_LIBOBJ([putenv])
+ gl_PREREQ_PUTENV
+ fi
gl_STDLIB_MODULE_INDICATOR([putenv])
dnl Check for prerequisites for memory fence checks.
+ dnl FIXME: zerosize-ptr.h requires these: make a module for it
gl_FUNC_MMAP_ANON
AC_CHECK_HEADERS_ONCE([sys/mman.h])
AC_CHECK_FUNCS_ONCE([mprotect])
+ dnl Check for prerequisites for memory fence checks.
+ gl_FUNC_MMAP_ANON
+ AC_CHECK_HEADERS_ONCE([sys/mman.h])
+ AC_CHECK_FUNCS_ONCE([mprotect])
+ gl_FUNC_READDIR
+ if test $HAVE_READDIR = 0; then
+ AC_LIBOBJ([readdir])
+ fi
+ gl_DIRENT_MODULE_INDICATOR([readdir])
gl_FUNC_SETENV
+ if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
+ AC_LIBOBJ([setenv])
+ fi
gl_STDLIB_MODULE_INDICATOR([setenv])
gl_FUNC_SETLOCALE
+ if test $REPLACE_SETLOCALE = 1; then
+ AC_LIBOBJ([setlocale])
+ gl_PREREQ_SETLOCALE
+ fi
gl_LOCALE_MODULE_INDICATOR([setlocale])
gt_LOCALE_FR
gt_LOCALE_FR_UTF8
@@ -980,9 +1178,19 @@ changequote([, ])dnl
AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION])
AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
AC_REQUIRE([gl_LONG_DOUBLE_EXPONENT_LOCATION])
- gt_TYPE_WCHAR_T
- gt_TYPE_WINT_T
+ gl_FUNC_SLEEP
+ if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then
+ AC_LIBOBJ([sleep])
+ fi
+ gl_UNISTD_MODULE_INDICATOR([sleep])
+ AC_CHECK_DECLS_ONCE([alarm])
+ AC_REQUIRE([gt_TYPE_WCHAR_T])
+ AC_REQUIRE([gt_TYPE_WINT_T])
gl_FUNC_STRDUP_POSIX
+ if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
+ AC_LIBOBJ([strdup])
+ gl_PREREQ_STRDUP
+ fi
gl_STRING_MODULE_INDICATOR([strdup])
dnl Check for prerequisites for memory fence checks.
gl_FUNC_MMAP_ANON
@@ -993,11 +1201,19 @@ changequote([, ])dnl
AC_CHECK_HEADERS_ONCE([sys/mman.h])
AC_CHECK_FUNCS_ONCE([mprotect])
gl_FUNC_SYMLINK
+ if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
+ AC_LIBOBJ([symlink])
+ fi
gl_UNISTD_MODULE_INDICATOR([symlink])
gl_FUNC_UNSETENV
+ if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
+ AC_LIBOBJ([unsetenv])
+ gl_PREREQ_UNSETENV
+ fi
gl_STDLIB_MODULE_INDICATOR([unsetenv])
abs_aux_dir=`cd "$ac_aux_dir"; pwd`
AC_SUBST([abs_aux_dir])
+ AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
abs_aux_dir=`cd "$ac_aux_dir"; pwd`
AC_SUBST([abs_aux_dir])
gt_LOCALE_FR
@@ -1005,9 +1221,23 @@ changequote([, ])dnl
gt_LOCALE_JA
gt_LOCALE_ZH_CN
gl_FUNC_WCTOB
+ if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then
+ AC_LIBOBJ([wctob])
+ gl_PREREQ_WCTOB
+ fi
gl_WCHAR_MODULE_INDICATOR([wctob])
gl_FUNC_WCTOMB
+ if test $REPLACE_WCTOMB = 1; then
+ AC_LIBOBJ([wctomb])
+ gl_PREREQ_WCTOMB
+ fi
gl_STDLIB_MODULE_INDICATOR([wctomb])
+ gl_FUNC_WRITE
+ if test $REPLACE_WRITE = 1; then
+ AC_LIBOBJ([write])
+ gl_PREREQ_WRITE
+ fi
+ gl_UNISTD_MODULE_INDICATOR([write])
m4_popdef([gl_MODULE_INDICATOR_CONDITION])
m4_ifval(M4tests_LIBSOURCES_LIST, [
m4_syscmd([test ! -d ]m4_defn([M4tests_LIBSOURCES_DIR])[ ||
@@ -1105,17 +1335,19 @@ AC_DEFUN([M4tests_LIBSOURCES], [
# gnulib-tool and may be removed by future gnulib-tool invocations.
AC_DEFUN([M4_FILE_LIST], [
build-aux/announce-gen
- build-aux/arg-nonnull.h
- build-aux/c++defs.h
build-aux/config.rpath
build-aux/gendocs.sh
build-aux/git-version-gen
build-aux/gnu-web-doc-update
build-aux/gnupload
+ build-aux/snippet/_Noreturn.h
+ build-aux/snippet/arg-nonnull.h
+ build-aux/snippet/c++defs.h
+ build-aux/snippet/unused-parameter.h
+ build-aux/snippet/warn-on-use.h
build-aux/update-copyright
build-aux/useless-if-before-free
build-aux/vc-list-files
- build-aux/warn-on-use.h
doc/fdl-1.3.texi
doc/gendocs_template
doc/gpl-3.0.texi
@@ -1124,19 +1356,22 @@ AC_DEFUN([M4_FILE_LIST], [
lib/asprintf.c
lib/basename-lgpl.c
lib/basename.c
+ lib/binary-io.c
lib/binary-io.h
lib/btowc.c
lib/c-ctype.c
lib/c-ctype.h
lib/c-stack.c
lib/c-stack.h
+ lib/c-strcase.h
+ lib/c-strcasecmp.c
+ lib/c-strcaseeq.h
+ lib/c-strncasecmp.c
lib/canonicalize-lgpl.c
lib/clean-temp.c
lib/clean-temp.h
lib/cloexec.c
lib/cloexec.h
- lib/close-hook.c
- lib/close-hook.h
lib/close-stream.c
lib/close-stream.h
lib/close.c
@@ -1164,6 +1399,8 @@ AC_DEFUN([M4_FILE_LIST], [
lib/fclose.c
lib/fcntl.c
lib/fcntl.in.h
+ lib/fd-hook.c
+ lib/fd-hook.h
lib/fd-safer-flag.c
lib/fd-safer.c
lib/fflush.c
@@ -1171,6 +1408,7 @@ AC_DEFUN([M4_FILE_LIST], [
lib/filenamecat.c
lib/filenamecat.h
lib/float+.h
+ lib/float.c
lib/float.in.h
lib/fopen-safer.c
lib/fopen.c
@@ -1184,7 +1422,10 @@ AC_DEFUN([M4_FILE_LIST], [
lib/freading.h
lib/frexp.c
lib/frexpl.c
+ lib/fseek.c
lib/fseeko.c
+ lib/fstat.c
+ lib/ftell.c
lib/ftello.c
lib/getdtablesize.c
lib/getopt.c
@@ -1224,15 +1465,19 @@ AC_DEFUN([M4_FILE_LIST], [
lib/isnanf.c
lib/isnanl-nolibm.h
lib/isnanl.c
+ lib/itold.c
lib/langinfo.in.h
lib/localcharset.c
lib/localcharset.h
+ lib/locale.in.h
+ lib/localeconv.c
lib/lseek.c
lib/lstat.c
lib/malloc.c
lib/malloca.c
lib/malloca.h
lib/malloca.valgrind
+ lib/math.c
lib/math.in.h
lib/mbrtowc.c
lib/mbsinit.c
@@ -1246,6 +1491,10 @@ AC_DEFUN([M4_FILE_LIST], [
lib/mkdtemp.c
lib/mkstemp-safer.c
lib/mkstemp.c
+ lib/msvc-inval.c
+ lib/msvc-inval.h
+ lib/msvc-nothrow.c
+ lib/msvc-nothrow.h
lib/nl_langinfo.c
lib/obstack.c
lib/obstack.h
@@ -1264,8 +1513,10 @@ AC_DEFUN([M4_FILE_LIST], [
lib/printf-parse.h
lib/progname.c
lib/progname.h
+ lib/quote.h
lib/quotearg.c
lib/quotearg.h
+ lib/raise.c
lib/rawmemchr.c
lib/rawmemchr.valgrind
lib/readlink.c
@@ -1281,6 +1532,8 @@ AC_DEFUN([M4_FILE_LIST], [
lib/rmdir.c
lib/same-inode.h
lib/sched.in.h
+ lib/secure_getenv.c
+ lib/sig-handler.c
lib/sig-handler.h
lib/sigaction.c
lib/siglist.h
@@ -1314,6 +1567,7 @@ AC_DEFUN([M4_FILE_LIST], [
lib/stdio--.h
lib/stdio-impl.h
lib/stdio-safer.h
+ lib/stdio-write.c
lib/stdio.in.h
lib/stdlib--.h
lib/stdlib-safer.h
@@ -1322,6 +1576,8 @@ AC_DEFUN([M4_FILE_LIST], [
lib/strchrnul.c
lib/strchrnul.valgrind
lib/streq.h
+ lib/strerror-override.c
+ lib/strerror-override.h
lib/strerror.c
lib/string.in.h
lib/stripslash.c
@@ -1330,9 +1586,9 @@ AC_DEFUN([M4_FILE_LIST], [
lib/strsignal.c
lib/strstr.c
lib/strtod.c
- lib/strtol.c
lib/sys_stat.in.h
lib/sys_time.in.h
+ lib/sys_types.in.h
lib/sys_wait.in.h
lib/tempname.c
lib/tempname.h
@@ -1341,6 +1597,7 @@ AC_DEFUN([M4_FILE_LIST], [
lib/tmpdir.h
lib/unistd--.h
lib/unistd-safer.h
+ lib/unistd.c
lib/unistd.in.h
lib/unlocked-io.h
lib/vasnprintf.c
@@ -1358,8 +1615,10 @@ AC_DEFUN([M4_FILE_LIST], [
lib/waitpid.c
lib/wchar.in.h
lib/wcrtomb.c
+ lib/wctype-h.c
lib/wctype.in.h
lib/xalloc-die.c
+ lib/xalloc-oversized.h
lib/xalloc.h
lib/xasprintf.c
lib/xmalloc.c
@@ -1367,6 +1626,7 @@ AC_DEFUN([M4_FILE_LIST], [
lib/xmalloca.h
lib/xprintf.c
lib/xprintf.h
+ lib/xsize.c
lib/xsize.h
lib/xstrndup.c
lib/xstrndup.h
@@ -1375,21 +1635,24 @@ AC_DEFUN([M4_FILE_LIST], [
m4/00gnulib.m4
m4/alloca.m4
m4/ansi-c++.m4
+ m4/asm-underscore.m4
m4/assert.m4
m4/autobuild.m4
m4/btowc.m4
m4/c-stack.m4
m4/canonicalize.m4
- m4/cloexec.m4
m4/close-stream.m4
m4/close.m4
+ m4/closedir.m4
m4/closein.m4
m4/closeout.m4
m4/codeset.m4
m4/config-h.m4
m4/configmake.m4
+ m4/dirent_h.m4
m4/dirname.m4
m4/double-slash-root.m4
+ m4/dup.m4
m4/dup2.m4
m4/eealloc.m4
m4/environ.m4
@@ -1400,11 +1663,13 @@ AC_DEFUN([M4_FILE_LIST], [
m4/exponentf.m4
m4/exponentl.m4
m4/extensions.m4
+ m4/extern-inline.m4
m4/fatal-signal.m4
m4/fclose.m4
m4/fcntl-o.m4
m4/fcntl.m4
m4/fcntl_h.m4
+ m4/fdopen.m4
m4/fflush.m4
m4/filenamecat.m4
m4/float_h.m4
@@ -1412,28 +1677,33 @@ AC_DEFUN([M4_FILE_LIST], [
m4/fpending.m4
m4/fpieee.m4
m4/fpurge.m4
+ m4/freadahead.m4
m4/freading.m4
m4/frexp.m4
m4/frexpl.m4
+ m4/fseek.m4
m4/fseeko.m4
+ m4/fstat.m4
m4/ftell.m4
m4/ftello.m4
+ m4/getcwd.m4
m4/getdtablesize.m4
m4/getopt.m4
m4/getpagesize.m4
m4/gettimeofday.m4
- m4/gl_list.m4
m4/glibc21.m4
m4/gnulib-common.m4
m4/include_next.m4
- m4/inline.m4
m4/intlmacosx.m4
m4/intmax_t.m4
+ m4/inttypes-pri.m4
+ m4/inttypes.m4
m4/inttypes_h.m4
m4/isnand.m4
m4/isnanf.m4
m4/isnanl.m4
m4/langinfo_h.m4
+ m4/largefile.m4
m4/lcmessage.m4
m4/ldexp.m4
m4/ldexpl.m4
@@ -1448,6 +1718,7 @@ AC_DEFUN([M4_FILE_LIST], [
m4/locale-tr.m4
m4/locale-zh.m4
m4/locale_h.m4
+ m4/localeconv.m4
m4/localename.m4
m4/lock.m4
m4/longlong.m4
@@ -1466,10 +1737,14 @@ AC_DEFUN([M4_FILE_LIST], [
m4/mkstemp.m4
m4/mmap-anon.m4
m4/mode_t.m4
+ m4/msvc-inval.m4
+ m4/msvc-nothrow.m4
m4/multiarch.m4
m4/nl_langinfo.m4
m4/nocrash.m4
+ m4/off_t.m4
m4/open.m4
+ m4/opendir.m4
m4/pathmax.m4
m4/pipe2.m4
m4/posix_spawn.m4
@@ -1478,12 +1753,15 @@ AC_DEFUN([M4_FILE_LIST], [
m4/printf.m4
m4/putenv.m4
m4/quotearg.m4
+ m4/raise.m4
m4/rawmemchr.m4
+ m4/readdir.m4
m4/readlink.m4
m4/regex.m4
m4/rename.m4
m4/rmdir.m4
m4/sched_h.m4
+ m4/secure_getenv.m4
m4/setenv.m4
m4/setlocale.m4
m4/sig_atomic_t.m4
@@ -1491,7 +1769,9 @@ AC_DEFUN([M4_FILE_LIST], [
m4/signal_h.m4
m4/signalblocking.m4
m4/signbit.m4
+ m4/sigpipe.m4
m4/size_max.m4
+ m4/sleep.m4
m4/snprintf.m4
m4/spawn-pipe.m4
m4/spawn_h.m4
@@ -1502,9 +1782,7 @@ AC_DEFUN([M4_FILE_LIST], [
m4/stddef_h.m4
m4/stdint.m4
m4/stdint_h.m4
- m4/stdio-safer.m4
m4/stdio_h.m4
- m4/stdlib-safer.m4
m4/stdlib_h.m4
m4/strchrnul.m4
m4/strdup.m4
@@ -1515,10 +1793,11 @@ AC_DEFUN([M4_FILE_LIST], [
m4/strsignal.m4
m4/strstr.m4
m4/strtod.m4
- m4/strtol.m4
m4/symlink.m4
+ m4/sys_socket_h.m4
m4/sys_stat_h.m4
m4/sys_time_h.m4
+ m4/sys_types_h.m4
m4/sys_wait_h.m4
m4/tempname.m4
m4/threadlib.m4
@@ -1544,14 +1823,18 @@ AC_DEFUN([M4_FILE_LIST], [
m4/wctomb.m4
m4/wctype_h.m4
m4/wint_t.m4
+ m4/write.m4
m4/xalloc.m4
m4/xsize.m4
m4/xstrndup.m4
m4/xvasprintf.m4
+ tests/infinity.h
tests/init.sh
tests/macros.h
tests/minus-zero.h
tests/nan.h
+ tests/randomd.c
+ tests/randoml.c
tests/signature.h
tests/test-alloca-opt.c
tests/test-array_list.c
@@ -1570,35 +1853,55 @@ AC_DEFUN([M4_FILE_LIST], [
tests/test-c-strcasecmp.c
tests/test-c-strncasecmp.c
tests/test-canonicalize-lgpl.c
+ tests/test-chdir.c
tests/test-cloexec.c
+ tests/test-close.c
tests/test-closein.c
tests/test-closein.sh
+ tests/test-dirent-c++.cc
+ tests/test-dirent.c
tests/test-dirname.c
tests/test-dup-safer.c
+ tests/test-dup.c
tests/test-dup2.c
tests/test-environ.c
tests/test-errno.c
+ tests/test-fclose.c
tests/test-fcntl-h-c++.cc
tests/test-fcntl-h.c
tests/test-fcntl.c
+ tests/test-fdopen.c
tests/test-fflush.c
tests/test-fflush2.c
tests/test-fflush2.sh
+ tests/test-fgetc.c
tests/test-filenamecat.c
+ tests/test-float.c
tests/test-fopen-safer.c
tests/test-fopen.c
tests/test-fopen.h
tests/test-fpending.c
tests/test-fpending.sh
tests/test-fpurge.c
+ tests/test-fputc.c
+ tests/test-fread.c
tests/test-freadahead.c
tests/test-freadahead.sh
tests/test-freading.c
tests/test-frexp.c
+ tests/test-frexp.h
tests/test-frexpl.c
+ tests/test-fseek.c
+ tests/test-fseek.sh
+ tests/test-fseek2.sh
tests/test-fseeko.c
tests/test-fseeko.sh
tests/test-fseeko2.sh
+ tests/test-fseeko3.c
+ tests/test-fseeko3.sh
+ tests/test-fseeko4.c
+ tests/test-fseeko4.sh
+ tests/test-fstat.c
tests/test-ftell.c
tests/test-ftell.sh
tests/test-ftell2.sh
@@ -1607,12 +1910,19 @@ AC_DEFUN([M4_FILE_LIST], [
tests/test-ftello.sh
tests/test-ftello2.sh
tests/test-ftello3.c
+ tests/test-ftello4.c
+ tests/test-ftello4.sh
+ tests/test-fwrite.c
+ tests/test-getcwd-lgpl.c
tests/test-getdtablesize.c
tests/test-getopt.c
tests/test-getopt.h
tests/test-getopt_long.h
tests/test-gettimeofday.c
tests/test-ignore-value.c
+ tests/test-init.sh
+ tests/test-intprops.c
+ tests/test-inttypes.c
tests/test-isnand-nolibm.c
tests/test-isnand.h
tests/test-isnanf-nolibm.c
@@ -1627,6 +1937,7 @@ AC_DEFUN([M4_FILE_LIST], [
tests/test-locale-c++.cc
tests/test-locale-c++2.cc
tests/test-locale.c
+ tests/test-localeconv.c
tests/test-localename.c
tests/test-lseek.c
tests/test-lseek.sh
@@ -1656,18 +1967,24 @@ AC_DEFUN([M4_FILE_LIST], [
tests/test-nl_langinfo.sh
tests/test-open.c
tests/test-open.h
+ tests/test-pathmax.c
tests/test-pipe2.c
tests/test-posix_spawn1.c
tests/test-posix_spawn1.in.sh
tests/test-posix_spawn2.c
tests/test-posix_spawn2.in.sh
+ tests/test-posix_spawn_file_actions_addclose.c
+ tests/test-posix_spawn_file_actions_adddup2.c
+ tests/test-posix_spawn_file_actions_addopen.c
tests/test-printf-frexp.c
tests/test-printf-frexpl.c
tests/test-quotearg-simple.c
tests/test-quotearg.h
+ tests/test-raise.c
tests/test-rawmemchr.c
tests/test-readlink.c
tests/test-readlink.h
+ tests/test-regex.c
tests/test-rename.c
tests/test-rename.h
tests/test-rmdir.c
@@ -1679,13 +1996,18 @@ AC_DEFUN([M4_FILE_LIST], [
tests/test-setlocale2.c
tests/test-setlocale2.sh
tests/test-sigaction.c
- tests/test-signal-c++.cc
- tests/test-signal-c++2.cc
- tests/test-signal.c
+ tests/test-signal-h-c++.cc
+ tests/test-signal-h-c++2.cc
+ tests/test-signal-h.c
tests/test-signbit.c
+ tests/test-sigpipe.c
+ tests/test-sigpipe.sh
+ tests/test-sigprocmask.c
+ tests/test-sleep.c
tests/test-snprintf.c
tests/test-spawn-c++.cc
- tests/test-spawn-pipe.c
+ tests/test-spawn-pipe-child.c
+ tests/test-spawn-pipe-main.c
tests/test-spawn-pipe.sh
tests/test-spawn.c
tests/test-stat.c
@@ -1714,6 +2036,8 @@ AC_DEFUN([M4_FILE_LIST], [
tests/test-sys_stat.c
tests/test-sys_time-c++.cc
tests/test-sys_time.c
+ tests/test-sys_types-c++.cc
+ tests/test-sys_types.c
tests/test-sys_wait-c++.cc
tests/test-sys_wait.c
tests/test-sys_wait.h
@@ -1745,32 +2069,40 @@ AC_DEFUN([M4_FILE_LIST], [
tests/test-wcrtomb.sh
tests/test-wctype-h-c++.cc
tests/test-wctype-h.c
+ tests/test-write.c
tests/test-xalloc-die.c
tests/test-xalloc-die.sh
tests/test-xvasprintf.c
tests/zerosize-ptr.h
- tests=lib/c-strcase.h
- tests=lib/c-strcasecmp.c
- tests=lib/c-strncasecmp.c
- tests=lib/ftell.c
+ tests=lib/closedir.c
+ tests=lib/dirent-private.h
+ tests=lib/dirent.in.h
+ tests=lib/dup.c
+ tests=lib/fdopen.c
+ tests=lib/filename.h
+ tests=lib/getcwd-lgpl.c
tests=lib/getpagesize.c
tests=lib/gl_array_list.c
tests=lib/gl_array_list.h
tests=lib/gl_array_oset.c
tests=lib/gl_array_oset.h
+ tests=lib/inttypes.in.h
tests=lib/link.c
- tests=lib/locale.in.h
tests=lib/localename.c
tests=lib/localename.h
+ tests=lib/opendir.c
tests=lib/putenv.c
+ tests=lib/readdir.c
tests=lib/setenv.c
tests=lib/setlocale.c
+ tests=lib/sleep.c
tests=lib/strdup.c
tests=lib/symlink.c
tests=lib/unsetenv.c
tests=lib/wctob.c
tests=lib/wctomb-impl.h
tests=lib/wctomb.c
+ tests=lib/write.c
top/GNUmakefile
top/maint.mk
])
diff --git a/m4/include_next.m4 b/m4/include_next.m4
index b3c7849..108d945 100644
--- a/m4/include_next.m4
+++ b/m4/include_next.m4
@@ -1,5 +1,5 @@
-# include_next.m4 serial 18
-dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
+# include_next.m4 serial 23
+dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -143,7 +143,7 @@ choke me
# even if the compiler does not support include_next.
# The three "///" are to pacify Sun C 5.8, which otherwise would say
# "warning: #include of /usr/include/... may be non-portable".
-# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
+# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
# Note: This macro assumes that the header file is not empty after
# preprocessing, i.e. it does not only define preprocessor macros but also
# provides some type/enum definitions or function/variable declarations.
@@ -175,11 +175,13 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
[AC_CHECK_HEADERS_ONCE([$1])
])
+dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
+dnl until we can assume autoconf 2.64 or newer.
m4_foreach_w([gl_HEADER_NAME], [$1],
[AS_VAR_PUSHDEF([gl_next_header],
[gl_cv_next_]m4_defn([gl_HEADER_NAME]))
if test $gl_cv_have_include_next = yes; then
- AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+ AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
else
AC_CACHE_CHECK(
[absolute name of <]m4_defn([gl_HEADER_NAME])[>],
@@ -205,33 +207,57 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
aix*) gl_absname_cpp="$ac_cpp -C" ;;
*) gl_absname_cpp="$ac_cpp" ;;
esac
+changequote(,)
+ case "$host_os" in
+ mingw*)
+ dnl For the sake of native Windows compilers (excluding gcc),
+ dnl treat backslash as a directory separator, like /.
+ dnl Actually, these compilers use a double-backslash as
+ dnl directory separator, inside the
+ dnl # line "filename"
+ dnl directives.
+ gl_dirsep_regex='[/\\]'
+ ;;
+ *)
+ gl_dirsep_regex='\/'
+ ;;
+ esac
+ dnl A sed expression that turns a string into a basic regular
+ dnl expression, for use within "/.../".
+ gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+changequote([,])
+ gl_header_literal_regex=`echo ']m4_defn([gl_HEADER_NAME])[' \
+ | sed -e "$gl_make_literal_regex_sed"`
+ gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+ s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+changequote(,)dnl
+ s|^/[^/]|//&|
+changequote([,])dnl
+ p
+ q
+ }'
dnl eval is necessary to expand gl_absname_cpp.
dnl Ultrix and Pyramid sh refuse to redirect output of eval,
dnl so use subshell.
- AS_VAR_SET([gl_next_header],
+ AS_VAR_SET(gl_next_header,
['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
- sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
- s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
- s#^/[^/]#//&#
- p
- q
- }'`'"'])
+ sed -n "$gl_absolute_header_sed"`'"'])
m4_if([$2], [check],
[else
- AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+ AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
fi
])
])
fi
AC_SUBST(
AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
- [AS_VAR_GET([gl_next_header])])
+ [AS_VAR_GET(gl_next_header)])
if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
gl_next_as_first_directive='<'gl_HEADER_NAME'>'
else
# INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
- gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
+ gl_next_as_first_directive=AS_VAR_GET(gl_next_header)
fi
AC_SUBST(
AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
diff --git a/m4/inline.m4 b/m4/inline.m4
deleted file mode 100644
index a459080..0000000
--- a/m4/inline.m4
+++ /dev/null
@@ -1,40 +0,0 @@
-# inline.m4 serial 4
-dnl Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
-dnl This file is free software; the Free 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 Test for the 'inline' keyword or equivalent.
-dnl Define 'inline' to a supported equivalent, or to nothing if not supported,
-dnl like AC_C_INLINE does. Also, define HAVE_INLINE if 'inline' or an
-dnl equivalent is effectively supported, i.e. if the compiler is likely to
-dnl drop unused 'static inline' functions.
-AC_DEFUN([gl_INLINE],
-[
- AC_REQUIRE([AC_C_INLINE])
- AC_CACHE_CHECK([whether the compiler generally respects inline],
- [gl_cv_c_inline_effective],
- [if test $ac_cv_c_inline = no; then
- gl_cv_c_inline_effective=no
- else
- dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is
- dnl specified.
- dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result
- dnl depends on optimization flags, which can be in CFLAGS.
- dnl (AC_EGREP_CPP looks only at the CPPFLAGS.)
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[]],
- [[#ifdef __NO_INLINE__
- #error "inline is not effective"
- #endif]])],
- [gl_cv_c_inline_effective=yes],
- [gl_cv_c_inline_effective=no])
- fi
- ])
- if test $gl_cv_c_inline_effective = yes; then
- AC_DEFINE([HAVE_INLINE], [1],
- [Define to 1 if the compiler supports one of the keywords
- 'inline', '__inline__', '__inline' and effectively inlines
- functions marked as such.])
- fi
-])
diff --git a/m4/intlmacosx.m4 b/m4/intlmacosx.m4
index 51f8547..ab97d39 100644
--- a/m4/intlmacosx.m4
+++ b/m4/intlmacosx.m4
@@ -1,5 +1,5 @@
-# intlmacosx.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2004-2011 Free Software Foundation, Inc.
+# intlmacosx.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2004-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -13,11 +13,11 @@ dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
-dnl Checks for special options needed on MacOS X.
+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 MacOS X 10.2.
+ dnl Check for API introduced in Mac OS X 10.2.
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
[gt_cv_func_CFPreferencesCopyAppValue],
[gt_save_LIBS="$LIBS"
@@ -31,9 +31,9 @@ AC_DEFUN([gt_INTL_MACOSX],
LIBS="$gt_save_LIBS"])
if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
- [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
+ [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
fi
- dnl Check for API introduced in MacOS X 10.3.
+ dnl Check for API introduced in Mac OS X 10.3.
AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
[gt_save_LIBS="$LIBS"
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
@@ -46,7 +46,7 @@ AC_DEFUN([gt_INTL_MACOSX],
LIBS="$gt_save_LIBS"])
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
- [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
+ [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
fi
INTL_MACOSX_LIBS=
if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
diff --git a/m4/intmax_t.m4 b/m4/intmax_t.m4
index 7341054..6ea7053 100644
--- a/m4/intmax_t.m4
+++ b/m4/intmax_t.m4
@@ -1,5 +1,5 @@
# intmax_t.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2011 Free Software Foundation,
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2013 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
new file mode 100644
index 0000000..e5a1e05
--- /dev/null
+++ b/m4/inttypes-pri.m4
@@ -0,0 +1,42 @@
+# inttypes-pri.m4 serial 7 (gettext-0.18.2)
+dnl Copyright (C) 1997-2002, 2006, 2008-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.53])
+
+# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
+# macros to non-string values. This is the case on AIX 4.3.3.
+
+AC_DEFUN([gt_INTTYPES_PRI],
+[
+ AC_CHECK_HEADERS([inttypes.h])
+ if test $ac_cv_header_inttypes_h = yes; then
+ AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
+ [gt_cv_inttypes_pri_broken],
+ [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <inttypes.h>
+#ifdef PRId32
+char *p = PRId32;
+#endif
+ ]],
+ [[]])],
+ [gt_cv_inttypes_pri_broken=no],
+ [gt_cv_inttypes_pri_broken=yes])
+ ])
+ fi
+ if test "$gt_cv_inttypes_pri_broken" = yes; then
+ AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1],
+ [Define if <inttypes.h> exists and defines unusable PRI* macros.])
+ PRI_MACROS_BROKEN=1
+ else
+ PRI_MACROS_BROKEN=0
+ fi
+ AC_SUBST([PRI_MACROS_BROKEN])
+])
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
new file mode 100644
index 0000000..3b483d3
--- /dev/null
+++ b/m4/inttypes.m4
@@ -0,0 +1,157 @@
+# inttypes.m4 serial 26
+dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Derek Price, Bruno Haible.
+dnl Test whether <inttypes.h> is supported or must be substituted.
+
+AC_DEFUN([gl_INTTYPES_H],
+[
+ AC_REQUIRE([gl_INTTYPES_INCOMPLETE])
+ gl_INTTYPES_PRI_SCN
+])
+
+AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE],
+[
+ AC_REQUIRE([gl_STDINT_H])
+ AC_CHECK_HEADERS_ONCE([inttypes.h])
+
+ dnl Override <inttypes.h> always, so that the portability warnings work.
+ AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+ gl_CHECK_NEXT_HEADERS([inttypes.h])
+
+ AC_REQUIRE([gl_MULTIARCH])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[#include <inttypes.h>
+ ]], [imaxabs imaxdiv strtoimax strtoumax])
+])
+
+# Ensure that the PRI* and SCN* macros are defined appropriately.
+AC_DEFUN([gl_INTTYPES_PRI_SCN],
+[
+ AC_REQUIRE([gt_INTTYPES_PRI])
+
+ PRIPTR_PREFIX=
+ if test -n "$STDINT_H"; then
+ dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'.
+ PRIPTR_PREFIX='"l"'
+ else
+ dnl Using the system's <stdint.h>.
+ for glpfx in '' l ll I64; do
+ case $glpfx in
+ '') gltype1='int';;
+ l) gltype1='long int';;
+ ll) gltype1='long long int';;
+ I64) gltype1='__int64';;
+ esac
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <stdint.h>
+ extern intptr_t foo;
+ extern $gltype1 foo;]])],
+ [PRIPTR_PREFIX='"'$glpfx'"'])
+ test -n "$PRIPTR_PREFIX" && break
+ done
+ fi
+ AC_SUBST([PRIPTR_PREFIX])
+
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [INT32_MAX_LT_INTMAX_MAX],
+ [defined INT32_MAX && defined INTMAX_MAX],
+ [INT32_MAX < INTMAX_MAX],
+ [sizeof (int) < sizeof (long long int)])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [INT64_MAX_EQ_LONG_MAX],
+ [defined INT64_MAX],
+ [INT64_MAX == LONG_MAX],
+ [sizeof (long long int) == sizeof (long int)])
+ else
+ INT64_MAX_EQ_LONG_MAX=-1
+ fi
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [UINT32_MAX_LT_UINTMAX_MAX],
+ [defined UINT32_MAX && defined UINTMAX_MAX],
+ [UINT32_MAX < UINTMAX_MAX],
+ [sizeof (unsigned int) < sizeof (unsigned long long int)])
+ if test $APPLE_UNIVERSAL_BUILD = 0; then
+ gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
+ [UINT64_MAX_EQ_ULONG_MAX],
+ [defined UINT64_MAX],
+ [UINT64_MAX == ULONG_MAX],
+ [sizeof (unsigned long long int) == sizeof (unsigned long int)])
+ else
+ UINT64_MAX_EQ_ULONG_MAX=-1
+ fi
+])
+
+# Define the symbol $1 to be 1 if the condition is true, 0 otherwise.
+# If $2 is true, the condition is $3; otherwise if long long int is supported
+# approximate the condition with $4; otherwise, assume the condition is false.
+# The condition should work on all C99 platforms; the approximations should be
+# good enough to work on all practical pre-C99 platforms.
+# $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants.
+AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
+[
+ AC_CACHE_CHECK([whether $3],
+ [gl_cv_test_$1],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[/* Work also in C++ mode. */
+ #define __STDC_LIMIT_MACROS 1
+
+ /* Work if build is not clean. */
+ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+
+ #include <limits.h>
+ #if HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
+
+ #if $2
+ #define CONDITION ($3)
+ #elif HAVE_LONG_LONG_INT
+ #define CONDITION ($4)
+ #else
+ #define CONDITION 0
+ #endif
+ int test[CONDITION ? 1 : -1];]])],
+ [gl_cv_test_$1=yes],
+ [gl_cv_test_$1=no])])
+ if test $gl_cv_test_$1 = yes; then
+ $1=1;
+ else
+ $1=0;
+ fi
+ AC_SUBST([$1])
+])
+
+AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
+[
+ GNULIB_IMAXABS=0; AC_SUBST([GNULIB_IMAXABS])
+ GNULIB_IMAXDIV=0; AC_SUBST([GNULIB_IMAXDIV])
+ GNULIB_STRTOIMAX=0; AC_SUBST([GNULIB_STRTOIMAX])
+ GNULIB_STRTOUMAX=0; AC_SUBST([GNULIB_STRTOUMAX])
+ dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_DECL_IMAXABS=1; AC_SUBST([HAVE_DECL_IMAXABS])
+ HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV])
+ HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
+ HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
+ REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX])
+ INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
+ INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX])
+ PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN])
+ PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX])
+ UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX])
+ UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX])
+])
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4
index f10fd54..5f05ac5 100644
--- a/m4/inttypes_h.m4
+++ b/m4/inttypes_h.m4
@@ -1,5 +1,5 @@
# inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/isnand.m4 b/m4/isnand.m4
index fb2c0f9..ee05e0f 100644
--- a/m4/isnand.m4
+++ b/m4/isnand.m4
@@ -1,5 +1,5 @@
-# isnand.m4 serial 8
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# isnand.m4 serial 11
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -24,7 +24,6 @@ AC_DEFUN([gl_FUNC_ISNAND],
else
gl_func_isnand=no
HAVE_ISNAND=0
- gl_BUILD_ISNAND
fi
AC_SUBST([ISNAND_LIBM])
])
@@ -34,19 +33,17 @@ dnl Check how to get or define isnand() without linking with libm.
AC_DEFUN([gl_FUNC_ISNAND_NO_LIBM],
[
gl_HAVE_ISNAND_NO_LIBM
+ gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
if test $gl_cv_func_isnand_no_libm = yes; then
AC_DEFINE([HAVE_ISNAND_IN_LIBC], [1],
[Define if the isnan(double) function is available in libc.])
- else
- gl_BUILD_ISNAND
fi
])
-dnl Pull in replacement isnand definition. It does not need -lm.
-AC_DEFUN([gl_BUILD_ISNAND],
+dnl Prerequisites of replacement isnand definition. It does not need -lm.
+AC_DEFUN([gl_PREREQ_ISNAND],
[
- AC_LIBOBJ([isnand])
- gl_DOUBLE_EXPONENT_LOCATION
+ AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
])
dnl Test whether isnand() can be used with libm.
diff --git a/m4/isnanf.m4 b/m4/isnanf.m4
index 92024bb..f01886a 100644
--- a/m4/isnanf.m4
+++ b/m4/isnanf.m4
@@ -1,5 +1,5 @@
-# isnanf.m4 serial 12
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# isnanf.m4 serial 14
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -17,6 +17,7 @@ AC_DEFUN([gl_FUNC_ISNANF],
ISNANF_LIBM=-lm
fi
fi
+ dnl The variable gl_func_isnanf set here is used by isnan.m4.
if test $gl_cv_func_isnanf_no_libm = yes \
|| test $gl_cv_func_isnanf_in_libm = yes; then
save_LIBS="$LIBS"
@@ -32,7 +33,6 @@ AC_DEFUN([gl_FUNC_ISNANF],
fi
if test $gl_func_isnanf != yes; then
HAVE_ISNANF=0
- gl_BUILD_ISNANF
fi
AC_SUBST([ISNANF_LIBM])
])
@@ -51,17 +51,17 @@ AC_DEFUN([gl_FUNC_ISNANF_NO_LIBM],
*) false;;
esac
}; then
+ gl_func_isnanf_no_libm=yes
AC_DEFINE([HAVE_ISNANF_IN_LIBC], [1],
[Define if the isnan(float) function is available in libc.])
else
- gl_BUILD_ISNANF
+ gl_func_isnanf_no_libm=no
fi
])
-dnl Pull in replacement isnanf definition. It does not need -lm.
-AC_DEFUN([gl_BUILD_ISNANF],
+dnl Prerequisites of replacement isnanf definition. It does not need -lm.
+AC_DEFUN([gl_PREREQ_ISNANF],
[
- AC_LIBOBJ([isnanf])
gl_FLOAT_EXPONENT_LOCATION
])
diff --git a/m4/isnanl.m4 b/m4/isnanl.m4
index 5d73759..ed5bbf8 100644
--- a/m4/isnanl.m4
+++ b/m4/isnanl.m4
@@ -1,5 +1,5 @@
-# isnanl.m4 serial 14
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# isnanl.m4 serial 17
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -15,6 +15,7 @@ AC_DEFUN([gl_FUNC_ISNANL],
ISNANL_LIBM=-lm
fi
fi
+ dnl The variable gl_func_isnanl set here is used by isnan.m4.
if test $gl_cv_func_isnanl_no_libm = yes \
|| test $gl_cv_func_isnanl_in_libm = yes; then
save_LIBS="$LIBS"
@@ -30,7 +31,6 @@ AC_DEFUN([gl_FUNC_ISNANL],
fi
if test $gl_func_isnanl != yes; then
HAVE_ISNANL=0
- gl_BUILD_ISNANL
fi
AC_SUBST([ISNANL_LIBM])
])
@@ -49,16 +49,14 @@ AC_DEFUN([gl_FUNC_ISNANL_NO_LIBM],
if test $gl_func_isnanl_no_libm = yes; then
AC_DEFINE([HAVE_ISNANL_IN_LIBC], [1],
[Define if the isnan(long double) function is available in libc.])
- else
- gl_BUILD_ISNANL
fi
])
-dnl Pull in replacement isnanl definition. It does not need -lm.
-AC_DEFUN([gl_BUILD_ISNANL],
+dnl Prerequisites of replacement isnanl definition. It does not need -lm.
+AC_DEFUN([gl_PREREQ_ISNANL],
[
- AC_LIBOBJ([isnanl])
gl_LONG_DOUBLE_EXPONENT_LOCATION
+ AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
])
dnl Test whether isnanl() can be used without libm.
@@ -119,6 +117,7 @@ AC_DEFUN([gl_FUNC_ISNANL_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([gl_BIGENDIAN])
+ AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether isnanl works], [gl_cv_func_isnanl_works],
[
@@ -172,7 +171,7 @@ int main ()
result |= 1;
}
-#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
+#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
/* Representation of an 80-bit 'long double' as an initializer for a sequence
of 'unsigned int' words. */
# ifdef WORDS_BIGENDIAN
diff --git a/m4/langinfo_h.m4 b/m4/langinfo_h.m4
index 4cced8a..73bef8b 100644
--- a/m4/langinfo_h.m4
+++ b/m4/langinfo_h.m4
@@ -1,5 +1,5 @@
# langinfo_h.m4 serial 7
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/largefile.m4 b/m4/largefile.m4
new file mode 100644
index 0000000..1e605e3
--- /dev/null
+++ b/m4/largefile.m4
@@ -0,0 +1,146 @@
+# Enable large files on systems where this is not the default.
+
+# Copyright 1992-1996, 1998-2013 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# The following implementation works around a problem in autoconf <= 2.69;
+# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5,
+# or configures them incorrectly in some cases.
+m4_version_prereq([2.70], [] ,[
+
+# _AC_SYS_LARGEFILE_TEST_INCLUDES
+# -------------------------------
+m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
+[@%:@include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1]];[]dnl
+])
+
+
+# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
+# CACHE-VAR,
+# DESCRIPTION,
+# PROLOGUE, [FUNCTION-BODY])
+# --------------------------------------------------------
+m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
+[AC_CACHE_CHECK([for $1 value needed for large files], [$3],
+[while :; do
+ m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+ [AC_LANG_PROGRAM([$5], [$6])],
+ [$3=no; break])
+ m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+ [AC_LANG_PROGRAM([@%:@define $1 $2
+$5], [$6])],
+ [$3=$2; break])
+ $3=unknown
+ break
+done])
+case $$3 in #(
+ no | unknown) ;;
+ *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);;
+esac
+rm -rf conftest*[]dnl
+])# _AC_SYS_LARGEFILE_MACRO_VALUE
+
+
+# AC_SYS_LARGEFILE
+# ----------------
+# By default, many hosts won't let programs access large files;
+# one must use special compiler options to get large-file access to work.
+# For more details about this brain damage please see:
+# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html
+AC_DEFUN([AC_SYS_LARGEFILE],
+[AC_ARG_ENABLE(largefile,
+ [ --disable-largefile omit support for large files])
+if test "$enable_largefile" != no; then
+
+ AC_CACHE_CHECK([for special C compiler options needed for large files],
+ ac_cv_sys_largefile_CC,
+ [ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
+ AC_COMPILE_IFELSE([], [break])
+ CC="$CC -n32"
+ AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi])
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
+ ac_cv_sys_file_offset_bits,
+ [Number of bits in a file offset, on hosts where this is settable.],
+ [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+ if test $ac_cv_sys_file_offset_bits = unknown; then
+ _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
+ ac_cv_sys_large_files,
+ [Define for large files, on AIX-style hosts.],
+ [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+ fi
+
+ AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1],
+ [Enable large inode numbers on Mac OS X 10.5.])
+fi
+])# AC_SYS_LARGEFILE
+])# m4_version_prereq 2.70
+
+# Enable large files on systems where this is implemented by Gnulib, not by the
+# system headers.
+# Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib
+# overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively.
+AC_DEFUN([gl_LARGEFILE],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw*)
+ dnl Native Windows.
+ dnl mingw64 defines off_t to a 64-bit type already, if
+ dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE.
+ AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/types.h>
+ int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
+ ]],
+ [[]])],
+ [gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no])
+ ])
+ if test $gl_cv_type_off_t_64 = no; then
+ WINDOWS_64_BIT_OFF_T=1
+ else
+ WINDOWS_64_BIT_OFF_T=0
+ fi
+ dnl But all native Windows platforms (including mingw64) have a 32-bit
+ dnl st_size member in 'struct stat'.
+ WINDOWS_64_BIT_ST_SIZE=1
+ ;;
+ *)
+ dnl Nothing to do on gnulib's side.
+ dnl A 64-bit off_t is
+ dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX,
+ dnl OSF/1, Cygwin,
+ dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on
+ dnl glibc, HP-UX, Solaris,
+ dnl - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX,
+ dnl - impossible to achieve on Minix 3.1.8.
+ WINDOWS_64_BIT_OFF_T=0
+ WINDOWS_64_BIT_ST_SIZE=0
+ ;;
+ esac
+])
diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4
index baf41c5..d62a175 100644
--- a/m4/lcmessage.m4
+++ b/m4/lcmessage.m4
@@ -1,5 +1,5 @@
# lcmessage.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1995-2002, 2004-2005, 2008-2011 Free Software Foundation,
+dnl Copyright (C) 1995-2002, 2004-2005, 2008-2013 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/ldexp.m4 b/m4/ldexp.m4
index dd400d4..7a75b1b 100644
--- a/m4/ldexp.m4
+++ b/m4/ldexp.m4
@@ -1,5 +1,5 @@
# ldexp.m4 serial 1
-dnl Copyright (C) 2010-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/ldexpl.m4 b/m4/ldexpl.m4
index 37dc230..1223711 100644
--- a/m4/ldexpl.m4
+++ b/m4/ldexpl.m4
@@ -1,5 +1,5 @@
-# ldexpl.m4 serial 10
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# ldexpl.m4 serial 16
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,10 +7,16 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_LDEXPL],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
AC_REQUIRE([gl_FUNC_ISNANL]) dnl for ISNANL_LIBM
+
+ dnl Persuade glibc <math.h> to declare ldexpl().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
dnl Check whether it's declared.
- dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [#include <math.h>])
+ dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
+
LDEXPL_LIBM=
if test $HAVE_DECL_LDEXPL = 1; then
gl_CHECK_LDEXPL_NO_LIBM
@@ -52,8 +58,13 @@ AC_DEFUN([gl_FUNC_LDEXPL],
fi
fi
if test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; then
- AC_LIBOBJ([ldexpl])
- LDEXPL_LIBM="$ISNANL_LIBM"
+ dnl Find libraries needed to link lib/ldexpl.c.
+ if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
+ AC_REQUIRE([gl_FUNC_LDEXP])
+ LDEXPL_LIBM="$LDEXP_LIBM"
+ else
+ LDEXPL_LIBM="$ISNANL_LIBM"
+ fi
fi
AC_SUBST([LDEXPL_LIBM])
])
@@ -76,7 +87,7 @@ AC_DEFUN([gl_CHECK_LDEXPL_NO_LIBM],
])
dnl Test whether ldexpl() works on finite numbers (this fails on AIX 5.1
-dnl and MacOS X 10.4/PowerPC).
+dnl and Mac OS X 10.4/PowerPC).
AC_DEFUN([gl_FUNC_LDEXPL_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
@@ -86,7 +97,11 @@ AC_DEFUN([gl_FUNC_LDEXPL_WORKS],
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <math.h>
-extern long double ldexpl (long double, int);
+extern
+#ifdef __cplusplus
+"C"
+#endif
+long double ldexpl (long double, int);
int main()
{
int result = 0;
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
index ae003f7..c145e47 100644
--- a/m4/lib-ld.m4
+++ b/m4/lib-ld.m4
@@ -1,33 +1,39 @@
-# lib-ld.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 1996-2003, 2009-2011 Free Software Foundation, Inc.
+# lib-ld.m4 serial 6
+dnl Copyright (C) 1996-2003, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free 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 Subroutines of libtool.m4,
-dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
-dnl with libtool.m4.
+dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
+dnl collision with libtool.m4.
-dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
AC_DEFUN([AC_LIB_PROG_LD_GNU],
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
- acl_cv_prog_gnu_ld=yes ;;
+ acl_cv_prog_gnu_ld=yes
+ ;;
*)
- acl_cv_prog_gnu_ld=no ;;
+ acl_cv_prog_gnu_ld=no
+ ;;
esac])
with_gnu_ld=$acl_cv_prog_gnu_ld
])
-dnl From libtool-1.4. Sets the variable LD.
+dnl From libtool-2.4. Sets the variable LD.
AC_DEFUN([AC_LIB_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
-[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
+[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld [default=no]])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
# Prepare PATH_SEPARATOR.
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
@@ -40,10 +46,11 @@ if test "${PATH_SEPARATOR+set}" != set; then
|| PATH_SEPARATOR=';'
}
fi
+
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by GCC])
+ AC_MSG_CHECKING([for ld used by $CC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -53,11 +60,11 @@ if test "$GCC" = yes; then
esac
case $ac_prog in
# Accept absolute paths.
- [[\\/]* | [A-Za-z]:[\\/]*)]
- [re_direlt='/[^/][^/]*/\.\./']
- # Canonicalize the path of ld
- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
+ while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
@@ -78,23 +85,26 @@ else
fi
AC_CACHE_VAL([acl_cv_path_LD],
[if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
+ IFS="$acl_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
acl_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some GNU ld's only accept -v.
+ # but apparently some variants of GNU ld only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+ case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break ;;
+ test "$with_gnu_ld" != no && break
+ ;;
*)
- test "$with_gnu_ld" != yes && break ;;
+ test "$with_gnu_ld" != yes && break
+ ;;
esac
fi
done
- IFS="$ac_save_ifs"
+ IFS="$acl_save_ifs"
else
acl_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
index e7c9ba9..073f040 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -1,5 +1,5 @@
# lib-link.m4 serial 26 (gettext-0.18.2)
-dnl Copyright (C) 2001-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
index 7e5f0bd..60908e8 100644
--- a/m4/lib-prefix.m4
+++ b/m4/lib-prefix.m4
@@ -1,5 +1,5 @@
# lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2005, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/libsigsegv.m4 b/m4/libsigsegv.m4
index 4156400..3f3e7db 100644
--- a/m4/libsigsegv.m4
+++ b/m4/libsigsegv.m4
@@ -1,5 +1,5 @@
# libsigsegv.m4 serial 4
-dnl Copyright (C) 2002-2003, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/link.m4 b/m4/link.m4
index 479083c..7cc0ceb 100644
--- a/m4/link.m4
+++ b/m4/link.m4
@@ -1,5 +1,5 @@
-# link.m4 serial 5
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# link.m4 serial 8
+dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,12 +7,12 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_LINK],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_FUNCS_ONCE([link])
if test $ac_cv_func_link = no; then
HAVE_LINK=0
- AC_LIBOBJ([link])
else
- AC_CACHE_CHECK([whether link handles trailing slash correctly],
+ AC_CACHE_CHECK([whether link obeys POSIX],
[gl_cv_func_link_works],
[touch conftest.a
# Assume that if we have lstat, we can also check symlinks.
@@ -29,15 +29,27 @@ AC_DEFUN([gl_FUNC_LINK],
#if HAVE_LSTAT
if (!link ("conftest.lnk/", "conftest.b"))
result |= 2;
+ if (rename ("conftest.a", "conftest.b"))
+ result |= 4;
+ if (!link ("conftest.b", "conftest.lnk"))
+ result |= 8;
#endif
return result;
]])],
[gl_cv_func_link_works=yes], [gl_cv_func_link_works=no],
- [gl_cv_func_link_works="guessing no"])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_link_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_link_works="guessing no" ;;
+ esac
+ ])
rm -f conftest.a conftest.b conftest.lnk])
- if test "$gl_cv_func_link_works" != yes; then
- REPLACE_LINK=1
- AC_LIBOBJ([link])
- fi
+ case "$gl_cv_func_link_works" in
+ *yes) ;;
+ *)
+ REPLACE_LINK=1
+ ;;
+ esac
fi
])
diff --git a/m4/localcharset.m4 b/m4/localcharset.m4
index 6801ca9..2e93e58 100644
--- a/m4/localcharset.m4
+++ b/m4/localcharset.m4
@@ -1,5 +1,5 @@
# localcharset.m4 serial 7
-dnl Copyright (C) 2002, 2004, 2006, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004, 2006, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/locale-fr.m4 b/m4/locale-fr.m4
index 3f4f954..ef199e3 100644
--- a/m4/locale-fr.m4
+++ b/m4/locale-fr.m4
@@ -1,5 +1,5 @@
-# locale-fr.m4 serial 13
-dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
+# locale-fr.m4 serial 17
+dnl Copyright (C) 2003, 2005-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -26,9 +26,9 @@ char buf[16];
int main () {
/* Check whether the given locale name is recognized by the system. */
#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
- /* On native Win32, setlocale(category, "") looks at the system settings,
+ /* 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 speficied, it succeeds but sets the LC_CTYPE
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
category of the locale to "C". */
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
@@ -37,7 +37,7 @@ int main () {
if (setlocale (LC_ALL, "") == NULL) return 1;
#endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
- On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
succeeds but then nl_langinfo(CODESET) is "646". In this situation,
@@ -63,10 +63,12 @@ int main () {
one byte long. This excludes the UTF-8 encoding. */
t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
/* Check whether the decimal separator is a comma.
On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
are nl_langinfo(RADIXCHAR) are both ".". */
if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
return 0;
}
changequote([,])dnl
@@ -80,7 +82,7 @@ changequote([,])dnl
# "ja" as "Japanese" or "Japanese_Japan.932",
# and similar.
mingw*)
- # Test for the native Win32 locale name.
+ # Test for the native Windows locale name.
if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
gt_cv_locale_fr=French_France.1252
else
@@ -90,7 +92,7 @@ changequote([,])dnl
;;
*)
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
- # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
# configure script would override the LC_ALL setting. Likewise for
# LC_CTYPE, which is also set at the beginning of the configure script.
# Test for the usual locale name.
@@ -152,9 +154,9 @@ int main () {
#if !(defined __BEOS__ || defined __HAIKU__)
/* Check whether the given locale name is recognized by the system. */
# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
- /* On native Win32, setlocale(category, "") looks at the system settings,
+ /* 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 speficied, it succeeds but sets the LC_CTYPE
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
category of the locale to "C". */
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
@@ -163,7 +165,7 @@ int main () {
if (setlocale (LC_ALL, "") == NULL) return 1;
# endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
- On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
succeeds but then nl_langinfo(CODESET) is "646". In this situation,
@@ -189,10 +191,12 @@ int main () {
|| buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
return 1;
#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */
/* Check whether the decimal separator is a comma.
On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
are nl_langinfo(RADIXCHAR) are both ".". */
if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
return 0;
}
changequote([,])dnl
@@ -206,7 +210,7 @@ changequote([,])dnl
# "ja" as "Japanese" or "Japanese_Japan.932",
# and similar.
mingw*)
- # Test for the hypothetical native Win32 locale name.
+ # Test for the hypothetical native Windows locale name.
if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
gt_cv_locale_fr_utf8=French_France.65001
else
@@ -216,7 +220,7 @@ changequote([,])dnl
;;
*)
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
- # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
# configure script would override the LC_ALL setting. Likewise for
# LC_CTYPE, which is also set at the beginning of the configure script.
# Test for the usual locale name.
diff --git a/m4/locale-ja.m4 b/m4/locale-ja.m4
index d44c2c8..132a3e7 100644
--- a/m4/locale-ja.m4
+++ b/m4/locale-ja.m4
@@ -1,5 +1,5 @@
-# locale-ja.m4 serial 9
-dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
+# locale-ja.m4 serial 12
+dnl Copyright (C) 2003, 2005-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -28,9 +28,9 @@ int main ()
const char *p;
/* Check whether the given locale name is recognized by the system. */
#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
- /* On native Win32, setlocale(category, "") looks at the system settings,
+ /* 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 speficied, it succeeds but sets the LC_CTYPE
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
category of the locale to "C". */
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
@@ -39,7 +39,7 @@ int main ()
if (setlocale (LC_ALL, "") == NULL) return 1;
#endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
- On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
succeeds but then nl_langinfo(CODESET) is "646". In this situation,
@@ -84,13 +84,14 @@ changequote([,])dnl
# "ja" as "Japanese" or "Japanese_Japan.932",
# and similar.
mingw*)
- # Note that on native Win32, the Japanese locale is Japanese_Japan.932,
- # and CP932 is very different from EUC-JP, so we cannot use it here.
+ # Note that on native Windows, the Japanese locale is
+ # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
+ # cannot use it here.
gt_cv_locale_ja=none
;;
*)
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
- # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
# configure script would override the LC_ALL setting. Likewise for
# LC_CTYPE, which is also set at the beginning of the configure script.
# Test for the AIX locale name.
diff --git a/m4/locale-tr.m4 b/m4/locale-tr.m4
index 19ded1b..aeb5615 100644
--- a/m4/locale-tr.m4
+++ b/m4/locale-tr.m4
@@ -1,5 +1,5 @@
-# locale-tr.m4 serial 7
-dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
+# locale-tr.m4 serial 10
+dnl Copyright (C) 2003, 2005-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -31,9 +31,9 @@ int main () {
program return 1 on BeOS. */
/* Check whether the given locale name is recognized by the system. */
#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
- /* On native Win32, setlocale(category, "") looks at the system settings,
+ /* 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 speficied, it succeeds but sets the LC_CTYPE
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
category of the locale to "C". */
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
@@ -42,7 +42,7 @@ int main () {
if (setlocale (LC_ALL, "") == NULL) return 1;
#endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
- On MacOS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET)
+ On Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
succeeds but then nl_langinfo(CODESET) is "646". In this situation,
@@ -85,7 +85,7 @@ changequote([,])dnl
# "ja" as "Japanese" or "Japanese_Japan.932",
# and similar.
mingw*)
- # Test for the hypothetical native Win32 locale name.
+ # Test for the hypothetical native Windows locale name.
if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
gt_cv_locale_tr_utf8=Turkish_Turkey.65001
else
@@ -95,7 +95,7 @@ changequote([,])dnl
;;
*)
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
- # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
# configure script would override the LC_ALL setting. Likewise for
# LC_CTYPE, which is also set at the beginning of the configure script.
# Test for the usual locale name.
diff --git a/m4/locale-zh.m4 b/m4/locale-zh.m4
index e03f91f..4eed73f 100644
--- a/m4/locale-zh.m4
+++ b/m4/locale-zh.m4
@@ -1,5 +1,5 @@
-# locale-zh.m4 serial 8
-dnl Copyright (C) 2003, 2005-2011 Free Software Foundation, Inc.
+# locale-zh.m4 serial 12
+dnl Copyright (C) 2003, 2005-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -29,9 +29,9 @@ int main ()
const char *p;
/* Check whether the given locale name is recognized by the system. */
#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
- /* On native Win32, setlocale(category, "") looks at the system settings,
+ /* 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 speficied, it succeeds but sets the LC_CTYPE
+ as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
category of the locale to "C". */
if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
|| strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
@@ -40,7 +40,7 @@ int main ()
if (setlocale (LC_ALL, "") == NULL) return 1;
#endif
/* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
- On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
+ On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
succeeds but then nl_langinfo(CODESET) is "646". In this situation,
@@ -85,7 +85,7 @@ changequote([,])dnl
# "ja" as "Japanese" or "Japanese_Japan.932",
# and similar.
mingw*)
- # Test for the hypothetical native Win32 locale name.
+ # Test for the hypothetical native Windows locale name.
if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
gt_cv_locale_zh_CN=Chinese_China.54936
else
@@ -93,9 +93,15 @@ changequote([,])dnl
gt_cv_locale_zh_CN=none
fi
;;
+ solaris2.8)
+ # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+ # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+ # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
+ gt_cv_locale_zh_CN=none
+ ;;
*)
# Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
- # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+ # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
# configure script would override the LC_ALL setting. Likewise for
# LC_CTYPE, which is also set at the beginning of the configure script.
# Test for the locale name without encoding suffix.
diff --git a/m4/locale_h.m4 b/m4/locale_h.m4
index 4d0f894..8bd12e8 100644
--- a/m4/locale_h.m4
+++ b/m4/locale_h.m4
@@ -1,5 +1,5 @@
-# locale_h.m4 serial 13
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# locale_h.m4 serial 19
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,18 +10,29 @@ AC_DEFUN([gl_LOCALE_H],
dnl once only, before all statements that occur in other macros.
AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
- dnl Persuade glibc <locale.h> to define locale_t.
+ dnl Persuade glibc <locale.h> to define locale_t and the int_p_*, int_n_*
+ dnl members of 'struct lconv'.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
dnl If <stddef.h> is replaced, then <locale.h> must also be replaced.
AC_REQUIRE([gl_STDDEF_H])
+ dnl Solaris 11 2011-11 defines the int_p_*, int_n_* members of 'struct lconv'
+ dnl only if _LCONV_C99 is defined.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ solaris*)
+ AC_DEFINE([_LCONV_C99], [1], [Define to 1 on Solaris.])
+ ;;
+ esac
+
AC_CACHE_CHECK([whether locale.h conforms to POSIX:2001],
[gl_cv_header_locale_h_posix2001],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <locale.h>
- int x = LC_MESSAGES;]],
+ int x = LC_MESSAGES;
+ int y = sizeof (((struct lconv *) 0)->decimal_point);]],
[[]])],
[gl_cv_header_locale_h_posix2001=yes],
[gl_cv_header_locale_h_posix2001=no])])
@@ -31,7 +42,7 @@ AC_DEFUN([gl_LOCALE_H],
if test $ac_cv_header_xlocale_h = yes; then
HAVE_XLOCALE_H=1
dnl Check whether use of locale_t requires inclusion of <xlocale.h>,
- dnl e.g. on MacOS X 10.5. If <locale.h> does not define locale_t by
+ dnl e.g. on Mac OS X 10.5. If <locale.h> does not define locale_t by
dnl itself, we assume that <xlocale.h> will do so.
AC_CACHE_CHECK([whether locale.h defines locale_t],
[gl_cv_header_locale_has_locale_t],
@@ -54,15 +65,29 @@ AC_DEFUN([gl_LOCALE_H],
fi
AC_SUBST([HAVE_XLOCALE_H])
+ dnl Check whether 'struct lconv' is complete.
+ dnl Bionic libc's 'struct lconv' is just a dummy.
+ dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x,
+ dnl mingw, MSVC 9, it lacks the int_p_* and int_n_* members.
+ AC_CACHE_CHECK([whether struct lconv is properly defined],
+ [gl_cv_sys_struct_lconv_ok],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <locale.h>
+ struct lconv l;
+ int x = sizeof (l.decimal_point);
+ int y = sizeof (l.int_p_cs_precedes);]],
+ [[]])],
+ [gl_cv_sys_struct_lconv_ok=yes],
+ [gl_cv_sys_struct_lconv_ok=no])
+ ])
+ if test $gl_cv_sys_struct_lconv_ok = no; then
+ REPLACE_STRUCT_LCONV=1
+ fi
+
dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK.
gl_NEXT_HEADERS([locale.h])
- if test -n "$STDDEF_H" \
- || test $gl_cv_header_locale_h_posix2001 = no \
- || test $gl_cv_header_locale_h_needs_xlocale_h = yes; then
- gl_REPLACE_LOCALE_H
- fi
-
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[#include <locale.h>
@@ -74,13 +99,6 @@ AC_DEFUN([gl_LOCALE_H],
[setlocale duplocale])
])
-dnl Unconditionally enables the replacement of <locale.h>.
-AC_DEFUN([gl_REPLACE_LOCALE_H],
-[
- dnl This is a no-op, because <locale.h> is always overridden.
- :
-])
-
AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
@@ -92,10 +110,13 @@ AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
AC_DEFUN([gl_LOCALE_H_DEFAULTS],
[
+ GNULIB_LOCALECONV=0; AC_SUBST([GNULIB_LOCALECONV])
GNULIB_SETLOCALE=0; AC_SUBST([GNULIB_SETLOCALE])
GNULIB_DUPLOCALE=0; AC_SUBST([GNULIB_DUPLOCALE])
dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE])
- REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE])
- REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
+ HAVE_DUPLOCALE=1; AC_SUBST([HAVE_DUPLOCALE])
+ REPLACE_LOCALECONV=0; AC_SUBST([REPLACE_LOCALECONV])
+ REPLACE_SETLOCALE=0; AC_SUBST([REPLACE_SETLOCALE])
+ REPLACE_DUPLOCALE=0; AC_SUBST([REPLACE_DUPLOCALE])
+ REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV])
])
diff --git a/m4/localeconv.m4 b/m4/localeconv.m4
new file mode 100644
index 0000000..b8bb596
--- /dev/null
+++ b/m4/localeconv.m4
@@ -0,0 +1,22 @@
+# localeconv.m4 serial 1
+dnl Copyright (C) 2012-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_LOCALECONV],
+[
+ AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+ AC_REQUIRE([gl_LOCALE_H])
+
+ if test $REPLACE_STRUCT_LCONV = 1; then
+ REPLACE_LOCALECONV=1
+ fi
+])
+
+# Prerequisites of lib/localeconv.c.
+AC_DEFUN([gl_PREREQ_LOCALECONV],
+[
+ AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [],
+ [[#include <locale.h>]])
+])
diff --git a/m4/localename.m4 b/m4/localename.m4
index 926ada6..361ed73 100644
--- a/m4/localename.m4
+++ b/m4/localename.m4
@@ -1,5 +1,5 @@
# localename.m4 serial 2
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/lock.m4 b/m4/lock.m4
index 9686945..aae1701 100644
--- a/m4/lock.m4
+++ b/m4/lock.m4
@@ -1,5 +1,5 @@
-# lock.m4 serial 11 (gettext-0.18.2)
-dnl Copyright (C) 2005-2011 Free Software Foundation, Inc.
+# lock.m4 serial 13 (gettext-0.18.2)
+dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,7 +10,7 @@ AC_DEFUN([gl_LOCK],
[
AC_REQUIRE([gl_THREADLIB])
if test "$gl_threads_api" = posix; then
- # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
+ # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
# pthread_rwlock_* functions.
AC_CHECK_TYPE([pthread_rwlock_t],
[AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
@@ -24,6 +24,9 @@ AC_DEFUN([gl_LOCK],
[[
#if __FreeBSD__ == 4
error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
+ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
#else
int x = (int)PTHREAD_MUTEX_RECURSIVE;
return !x;
@@ -35,7 +38,5 @@ return !x;
gl_PREREQ_LOCK
])
-# Prerequisites of lib/lock.c.
-AC_DEFUN([gl_PREREQ_LOCK], [
- AC_REQUIRE([AC_C_INLINE])
-])
+# Prerequisites of lib/glthread/lock.c.
+AC_DEFUN([gl_PREREQ_LOCK], [:])
diff --git a/m4/longlong.m4 b/m4/longlong.m4
index aed816c..3af6ab5 100644
--- a/m4/longlong.m4
+++ b/m4/longlong.m4
@@ -1,5 +1,5 @@
-# longlong.m4 serial 16
-dnl Copyright (C) 1999-2007, 2009-2011 Free Software Foundation, Inc.
+# longlong.m4 serial 17
+dnl Copyright (C) 1999-2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -51,7 +51,7 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
fi])
if test $ac_cv_type_long_long_int = yes; then
AC_DEFINE([HAVE_LONG_LONG_INT], [1],
- [Define to 1 if the system has the type `long long int'.])
+ [Define to 1 if the system has the type 'long long int'.])
fi
])
@@ -77,7 +77,7 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
fi])
if test $ac_cv_type_unsigned_long_long_int = yes; then
AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
- [Define to 1 if the system has the type `unsigned long long int'.])
+ [Define to 1 if the system has the type 'unsigned long long int'.])
fi
])
diff --git a/m4/lseek.m4 b/m4/lseek.m4
index f6452f6..df9302a 100644
--- a/m4/lseek.m4
+++ b/m4/lseek.m4
@@ -1,5 +1,5 @@
-# lseek.m4 serial 6
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# lseek.m4 serial 10
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,43 +7,65 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_LSEEK],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_CC])
+ AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CACHE_CHECK([whether lseek detects pipes], [gl_cv_func_lseek_pipe],
- [if test $cross_compiling = no; then
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ [case "$host_os" in
+ mingw*)
+ dnl Native Windows.
+ dnl The result of lseek (fd, (off_t)0, SEEK_CUR) or
+ dnl SetFilePointer(handle, 0, NULL, FILE_CURRENT)
+ dnl for a pipe depends on the environment: In a Cygwin 1.5
+ dnl environment it succeeds (wrong); in a Cygwin 1.7 environment
+ dnl it fails with a wrong errno value.
+ gl_cv_func_lseek_pipe=no
+ ;;
+ *)
+ if test $cross_compiling = no; then
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h> /* for off_t */
#include <stdio.h> /* for SEEK_CUR */
-#include <unistd.h>]], [[
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
+]], [[
/* Exit with success only if stdin is seekable. */
return lseek (0, (off_t)0, SEEK_CUR) < 0;
]])],
- [if test -s conftest$ac_exeext \
- && ./conftest$ac_exeext < conftest.$ac_ext \
- && test 1 = "`echo hi \
- | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
- gl_cv_func_lseek_pipe=yes
- else
- gl_cv_func_lseek_pipe=no
- fi],
- [gl_cv_func_lseek_pipe=no])
- else
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined __BEOS__
-/* mingw and BeOS mistakenly return 0 when trying to seek on pipes. */
+ [if test -s conftest$ac_exeext \
+ && ./conftest$ac_exeext < conftest.$ac_ext \
+ && test 1 = "`echo hi \
+ | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
+ gl_cv_func_lseek_pipe=yes
+ else
+ gl_cv_func_lseek_pipe=no
+ fi
+ ],
+ [gl_cv_func_lseek_pipe=no])
+ else
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[
+#if defined __BEOS__
+/* BeOS mistakenly return 0 when trying to seek on pipes. */
Choke me.
#endif]])],
- [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
- fi])
+ [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
+ fi
+ ;;
+ esac
+ ])
if test $gl_cv_func_lseek_pipe = no; then
- gl_REPLACE_LSEEK
+ REPLACE_LSEEK=1
+ AC_DEFINE([LSEEK_PIPE_BROKEN], [1],
+ [Define to 1 if lseek does not detect pipes.])
fi
-])
-AC_DEFUN([gl_REPLACE_LSEEK],
-[
- AC_LIBOBJ([lseek])
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- REPLACE_LSEEK=1
- AC_DEFINE([LSEEK_PIPE_BROKEN], [1],
- [Define to 1 if lseek does not detect pipes.])
+ AC_REQUIRE([gl_SYS_TYPES_H])
+ if test $WINDOWS_64_BIT_OFF_T = 1; then
+ REPLACE_LSEEK=1
+ fi
])
diff --git a/m4/lstat.m4 b/m4/lstat.m4
index b9b22a6..5f4db64 100644
--- a/m4/lstat.m4
+++ b/m4/lstat.m4
@@ -1,6 +1,6 @@
-# serial 21
+# serial 26
-# Copyright (C) 1997-2001, 2003-2011 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -15,24 +15,26 @@ AC_DEFUN([gl_FUNC_LSTAT],
dnl "#define lstat stat", and lstat.c is a no-op.
AC_CHECK_FUNCS_ONCE([lstat])
if test $ac_cv_func_lstat = yes; then
- AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
- if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
- dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ([lstat]).
- REPLACE_LSTAT=1
- fi
- # Prerequisites of lib/lstat.c.
- AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+ case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+ *no)
+ REPLACE_LSTAT=1
+ ;;
+ esac
else
HAVE_LSTAT=0
fi
])
-# Redefine AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, because it is no longer
-# maintained in Autoconf.
-AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
+# Prerequisites of lib/lstat.c.
+AC_DEFUN([gl_PREREQ_LSTAT], [:])
+
+AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
[
+ dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it
+ dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ.
AC_CACHE_CHECK([whether lstat correctly handles trailing slash],
- [ac_cv_func_lstat_dereferences_slashed_symlink],
+ [gl_cv_func_lstat_dereferences_slashed_symlink],
[rm -f conftest.sym conftest.file
echo >conftest.file
if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
@@ -45,25 +47,27 @@ AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
have to compile and use the lstat wrapper. */
return lstat ("conftest.sym/", &sbuf) == 0;
]])],
- [ac_cv_func_lstat_dereferences_slashed_symlink=yes],
- [ac_cv_func_lstat_dereferences_slashed_symlink=no],
- [# When cross-compiling, be pessimistic so we will end up using the
- # replacement version of lstat that checks for trailing slashes and
- # calls lstat a second time when necessary.
- ac_cv_func_lstat_dereferences_slashed_symlink=no
+ [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
+ [gl_cv_func_lstat_dereferences_slashed_symlink=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
+ esac
])
else
# If the 'ln -s' command failed, then we probably don't even
# have an lstat function.
- ac_cv_func_lstat_dereferences_slashed_symlink=no
+ gl_cv_func_lstat_dereferences_slashed_symlink="guessing no"
fi
rm -f conftest.sym conftest.file
])
- test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
- AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
- [Define to 1 if `lstat' dereferences a symlink specified
- with a trailing slash.])
- if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
- AC_LIBOBJ([lstat])
- fi
+ case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+ *yes)
+ AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
+ [Define to 1 if 'lstat' dereferences a symlink specified
+ with a trailing slash.])
+ ;;
+ esac
])
diff --git a/m4/malloc.m4 b/m4/malloc.m4
index 8094444..4b24a0b 100644
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -1,9 +1,47 @@
-# malloc.m4 serial 12
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# malloc.m4 serial 14
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+m4_version_prereq([2.70], [] ,[
+
+# This is taken from the following Autoconf patch:
+# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9
+AC_DEFUN([_AC_FUNC_MALLOC_IF],
+[
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+ AC_CHECK_HEADERS([stdlib.h])
+ AC_CACHE_CHECK([for GNU libc compatible malloc],
+ [ac_cv_func_malloc_0_nonnull],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+ # include <stdlib.h>
+ #else
+ char *malloc ();
+ #endif
+ ]],
+ [[return ! malloc (0);]])
+ ],
+ [ac_cv_func_malloc_0_nonnull=yes],
+ [ac_cv_func_malloc_0_nonnull=no],
+ [case "$host_os" in
+ # Guess yes on platforms where we know the result.
+ *-gnu* | freebsd* | netbsd* | openbsd* \
+ | hpux* | solaris* | cygwin* | mingw*)
+ ac_cv_func_malloc_0_nonnull=yes ;;
+ # If we don't know, assume the worst.
+ *) ac_cv_func_malloc_0_nonnull=no ;;
+ esac
+ ])
+ ])
+ AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2])
+])# _AC_FUNC_MALLOC_IF
+
+])
+
# gl_FUNC_MALLOC_GNU
# ------------------
# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if
@@ -17,7 +55,7 @@ AC_DEFUN([gl_FUNC_MALLOC_GNU],
[Define to 1 if your system has a GNU libc compatible 'malloc'
function, and to 0 otherwise.])],
[AC_DEFINE([HAVE_MALLOC_GNU], [0])
- gl_REPLACE_MALLOC
+ REPLACE_MALLOC=1
])
])
@@ -33,7 +71,7 @@ AC_DEFUN([gl_FUNC_MALLOC_POSIX],
AC_DEFINE([HAVE_MALLOC_POSIX], [1],
[Define if the 'malloc' function is POSIX compliant.])
else
- gl_REPLACE_MALLOC
+ REPLACE_MALLOC=1
fi
])
@@ -58,9 +96,3 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
[gl_cv_func_malloc_posix=no])
])
])
-
-AC_DEFUN([gl_REPLACE_MALLOC],
-[
- AC_LIBOBJ([malloc])
- REPLACE_MALLOC=1
-])
diff --git a/m4/malloca.m4 b/m4/malloca.m4
index aec43f5..791ce10 100644
--- a/m4/malloca.m4
+++ b/m4/malloca.m4
@@ -1,5 +1,5 @@
# malloca.m4 serial 1
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2011 Free Software Foundation,
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2013 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index e928821..be6d4c9 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -1,5 +1,5 @@
-# manywarnings.m4 serial 1
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# manywarnings.m4 serial 5
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -30,79 +30,193 @@ AC_DEFUN([gl_MANYWARN_COMPLEMENT],
# gl_MANYWARN_ALL_GCC(VARIABLE)
# -----------------------------
-# Add all documented GCC (currently as per version 4.4) warning
-# parameters to variable VARIABLE. Note that you need to test them
-# using gl_WARN_ADD if you want to make sure your gcc understands it.
+# Add all documented GCC warning parameters to variable VARIABLE.
+# Note that you need to test them using gl_WARN_ADD if you want to
+# make sure your gcc understands it.
AC_DEFUN([gl_MANYWARN_ALL_GCC],
[
- gl_manywarn_set=
- for gl_manywarn_item in \
- -Wall \
- -W \
- -Wformat-y2k \
- -Wformat-nonliteral \
- -Wformat-security \
- -Winit-self \
- -Wmissing-include-dirs \
- -Wswitch-default \
- -Wswitch-enum \
- -Wunused \
- -Wunknown-pragmas \
- -Wstrict-aliasing \
- -Wstrict-overflow \
- -Wsystem-headers \
- -Wfloat-equal \
- -Wtraditional \
- -Wtraditional-conversion \
- -Wdeclaration-after-statement \
- -Wundef \
- -Wshadow \
- -Wunsafe-loop-optimizations \
- -Wpointer-arith \
- -Wbad-function-cast \
- -Wc++-compat \
- -Wcast-qual \
- -Wcast-align \
- -Wwrite-strings \
- -Wconversion \
- -Wsign-conversion \
- -Wlogical-op \
- -Waggregate-return \
- -Wstrict-prototypes \
- -Wold-style-definition \
- -Wmissing-prototypes \
- -Wmissing-declarations \
- -Wmissing-noreturn \
- -Wmissing-format-attribute \
- -Wpacked \
- -Wpadded \
- -Wredundant-decls \
- -Wnested-externs \
- -Wunreachable-code \
- -Winline \
- -Winvalid-pch \
- -Wlong-long \
- -Wvla \
- -Wvolatile-register-var \
- -Wdisabled-optimization \
- -Wstack-protector \
- -Woverlength-strings \
- -Wbuiltin-macro-redefined \
- -Wmudflap \
- -Wpacked-bitfield-compat \
- -Wsync-nand \
- ; do
- gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
- done
- # The following are not documented in the manual but are included in
- # output from gcc --help=warnings.
- for gl_manywarn_item in \
- -Wattributes \
- -Wcoverage-mismatch \
- -Wmultichar \
- -Wunused-macros \
- ; do
+ dnl First, check for some issues that only occur when combining multiple
+ dnl gcc warning categories.
+ AC_REQUIRE([AC_PROG_CC])
+ if test -n "$GCC"; then
+
+ 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])
+
+ 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(
+ [[void f (void)
+ {
+ typedef struct { int a; int b; } s_t;
+ s_t s1 = { 0, };
+ }
+ ]],
+ [[]])],
+ [gl_cv_cc_nomfi_needed=no],
+ [gl_cv_cc_nomfi_needed=yes])
+ CFLAGS="$gl_save_CFLAGS"
+ ])
+ AC_MSG_RESULT([$gl_cv_cc_nomfi_needed])
+ 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])
+
+ fi
+
+ # List all gcc warning categories.
+ gl_manywarn_set=
+ for gl_manywarn_item in \
+ -W \
+ -Wabi \
+ -Waddress \
+ -Waggressive-loop-optimizations \
+ -Wall \
+ -Warray-bounds \
+ -Wattributes \
+ -Wbad-function-cast \
+ -Wbuiltin-macro-redefined \
+ -Wcast-align \
+ -Wchar-subscripts \
+ -Wclobbered \
+ -Wcomment \
+ -Wcomments \
+ -Wcoverage-mismatch \
+ -Wcpp \
+ -Wdeprecated \
+ -Wdeprecated-declarations \
+ -Wdisabled-optimization \
+ -Wdiv-by-zero \
+ -Wdouble-promotion \
+ -Wempty-body \
+ -Wendif-labels \
+ -Wenum-compare \
+ -Wextra \
+ -Wformat-contains-nul \
+ -Wformat-extra-args \
+ -Wformat-nonliteral \
+ -Wformat-security \
+ -Wformat-y2k \
+ -Wformat-zero-length \
+ -Wfree-nonheap-object \
+ -Wignored-qualifiers \
+ -Wimplicit \
+ -Wimplicit-function-declaration \
+ -Wimplicit-int \
+ -Winit-self \
+ -Winline \
+ -Wint-to-pointer-cast \
+ -Winvalid-memory-model \
+ -Winvalid-pch \
+ -Wjump-misses-init \
+ -Wlogical-op \
+ -Wmain \
+ -Wmaybe-uninitialized \
+ -Wmissing-braces \
+ -Wmissing-declarations \
+ -Wmissing-field-initializers \
+ -Wmissing-include-dirs \
+ -Wmissing-parameter-type \
+ -Wmissing-prototypes \
+ -Wmudflap \
+ -Wmultichar \
+ -Wnarrowing \
+ -Wnested-externs \
+ -Wnonnull \
+ -Wnormalized=nfc \
+ -Wold-style-declaration \
+ -Wold-style-definition \
+ -Woverflow \
+ -Woverlength-strings \
+ -Woverride-init \
+ -Wpacked \
+ -Wpacked-bitfield-compat \
+ -Wparentheses \
+ -Wpointer-arith \
+ -Wpointer-sign \
+ -Wpointer-to-int-cast \
+ -Wpragmas \
+ -Wreturn-local-addr \
+ -Wreturn-type \
+ -Wsequence-point \
+ -Wshadow \
+ -Wsizeof-pointer-memaccess \
+ -Wstack-protector \
+ -Wstrict-aliasing \
+ -Wstrict-overflow \
+ -Wstrict-prototypes \
+ -Wsuggest-attribute=const \
+ -Wsuggest-attribute=format \
+ -Wsuggest-attribute=noreturn \
+ -Wsuggest-attribute=pure \
+ -Wswitch \
+ -Wswitch-default \
+ -Wsync-nand \
+ -Wsystem-headers \
+ -Wtrampolines \
+ -Wtrigraphs \
+ -Wtype-limits \
+ -Wuninitialized \
+ -Wunknown-pragmas \
+ -Wunsafe-loop-optimizations \
+ -Wunused \
+ -Wunused-but-set-parameter \
+ -Wunused-but-set-variable \
+ -Wunused-function \
+ -Wunused-label \
+ -Wunused-local-typedefs \
+ -Wunused-macros \
+ -Wunused-parameter \
+ -Wunused-result \
+ -Wunused-value \
+ -Wunused-variable \
+ -Wvarargs \
+ -Wvariadic-macros \
+ -Wvector-operation-performance \
+ -Wvla \
+ -Wvolatile-register-var \
+ -Wwrite-strings \
+ \
+ ; do
gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
done
+
+ # Disable specific options as needed.
+ if test "$gl_cv_cc_nomfi_needed" = yes; then
+ gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
+ fi
+
+ if test "$gl_cv_cc_uninitialized_supported" = no; then
+ gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized"
+ fi
+
$1=$gl_manywarn_set
])
diff --git a/m4/math_h.m4 b/m4/math_h.m4
index 7b46aee..bf0845f 100644
--- a/m4/math_h.m4
+++ b/m4/math_h.m4
@@ -1,5 +1,5 @@
-# math_h.m4 serial 25
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# math_h.m4 serial 114
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -8,7 +8,6 @@ AC_DEFUN([gl_MATH_H],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
gl_CHECK_NEXT_HEADERS([math.h])
- AC_REQUIRE([AC_C_INLINE])
AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]],
@@ -38,9 +37,20 @@ AC_DEFUN([gl_MATH_H],
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
- gl_WARN_ON_USE_PREPARE([[#include <math.h>
- ]], [acosl asinl atanl ceilf ceill cosl expl floorf floorl frexpl
- ldexpl logb logl round roundf roundl sinl sqrtl tanl trunc truncf truncl])
+ gl_WARN_ON_USE_PREPARE([[#include <math.h>]],
+ [acosf acosl asinf asinl atanf atanl
+ cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf
+ expf expl exp2 exp2f exp2l expm1 expm1f expm1l
+ fabsf fabsl floorf floorl fma fmaf fmal
+ fmod fmodf fmodl frexpf frexpl hypotf hypotl
+ ilogb ilogbf ilogbl
+ ldexpf ldexpl
+ log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
+ logb logbf logbl
+ modf modff modfl powf
+ remainder remainderf remainderl
+ rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl
+ tanf tanl tanhf trunc truncf truncl])
])
AC_DEFUN([gl_MATH_MODULE_INDICATOR],
@@ -54,64 +64,189 @@ AC_DEFUN([gl_MATH_MODULE_INDICATOR],
AC_DEFUN([gl_MATH_H_DEFAULTS],
[
- GNULIB_ACOSL=0; AC_SUBST([GNULIB_ACOSL])
- GNULIB_ASINL=0; AC_SUBST([GNULIB_ASINL])
- GNULIB_ATANL=0; AC_SUBST([GNULIB_ATANL])
- GNULIB_CEIL=0; AC_SUBST([GNULIB_CEIL])
- GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF])
- GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL])
- GNULIB_COSL=0; AC_SUBST([GNULIB_COSL])
- GNULIB_EXPL=0; AC_SUBST([GNULIB_EXPL])
- GNULIB_FLOOR=0; AC_SUBST([GNULIB_FLOOR])
- GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF])
- GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL])
- GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP])
- GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL])
- GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE])
- GNULIB_ISINF=0; AC_SUBST([GNULIB_ISINF])
- GNULIB_ISNAN=0; AC_SUBST([GNULIB_ISNAN])
- GNULIB_ISNANF=0; AC_SUBST([GNULIB_ISNANF])
- GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND])
- GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL])
- GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL])
- GNULIB_LOGB=0; AC_SUBST([GNULIB_LOGB])
- GNULIB_LOGL=0; AC_SUBST([GNULIB_LOGL])
- GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND])
- GNULIB_ROUNDF=0; AC_SUBST([GNULIB_ROUNDF])
- GNULIB_ROUNDL=0; AC_SUBST([GNULIB_ROUNDL])
- GNULIB_SIGNBIT=0; AC_SUBST([GNULIB_SIGNBIT])
- GNULIB_SINL=0; AC_SUBST([GNULIB_SINL])
- GNULIB_SQRTL=0; AC_SUBST([GNULIB_SQRTL])
- GNULIB_TANL=0; AC_SUBST([GNULIB_TANL])
- GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC])
- GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF])
- GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL])
+ GNULIB_ACOSF=0; AC_SUBST([GNULIB_ACOSF])
+ GNULIB_ACOSL=0; AC_SUBST([GNULIB_ACOSL])
+ GNULIB_ASINF=0; AC_SUBST([GNULIB_ASINF])
+ GNULIB_ASINL=0; AC_SUBST([GNULIB_ASINL])
+ GNULIB_ATANF=0; AC_SUBST([GNULIB_ATANF])
+ GNULIB_ATANL=0; AC_SUBST([GNULIB_ATANL])
+ GNULIB_ATAN2F=0; AC_SUBST([GNULIB_ATAN2F])
+ GNULIB_CBRT=0; AC_SUBST([GNULIB_CBRT])
+ GNULIB_CBRTF=0; AC_SUBST([GNULIB_CBRTF])
+ GNULIB_CBRTL=0; AC_SUBST([GNULIB_CBRTL])
+ GNULIB_CEIL=0; AC_SUBST([GNULIB_CEIL])
+ GNULIB_CEILF=0; AC_SUBST([GNULIB_CEILF])
+ GNULIB_CEILL=0; AC_SUBST([GNULIB_CEILL])
+ GNULIB_COPYSIGN=0; AC_SUBST([GNULIB_COPYSIGN])
+ GNULIB_COPYSIGNF=0; AC_SUBST([GNULIB_COPYSIGNF])
+ GNULIB_COPYSIGNL=0; AC_SUBST([GNULIB_COPYSIGNL])
+ GNULIB_COSF=0; AC_SUBST([GNULIB_COSF])
+ GNULIB_COSL=0; AC_SUBST([GNULIB_COSL])
+ GNULIB_COSHF=0; AC_SUBST([GNULIB_COSHF])
+ GNULIB_EXPF=0; AC_SUBST([GNULIB_EXPF])
+ GNULIB_EXPL=0; AC_SUBST([GNULIB_EXPL])
+ GNULIB_EXP2=0; AC_SUBST([GNULIB_EXP2])
+ GNULIB_EXP2F=0; AC_SUBST([GNULIB_EXP2F])
+ GNULIB_EXP2L=0; AC_SUBST([GNULIB_EXP2L])
+ GNULIB_EXPM1=0; AC_SUBST([GNULIB_EXPM1])
+ GNULIB_EXPM1F=0; AC_SUBST([GNULIB_EXPM1F])
+ GNULIB_EXPM1L=0; AC_SUBST([GNULIB_EXPM1L])
+ GNULIB_FABSF=0; AC_SUBST([GNULIB_FABSF])
+ GNULIB_FABSL=0; AC_SUBST([GNULIB_FABSL])
+ GNULIB_FLOOR=0; AC_SUBST([GNULIB_FLOOR])
+ GNULIB_FLOORF=0; AC_SUBST([GNULIB_FLOORF])
+ GNULIB_FLOORL=0; AC_SUBST([GNULIB_FLOORL])
+ GNULIB_FMA=0; AC_SUBST([GNULIB_FMA])
+ GNULIB_FMAF=0; AC_SUBST([GNULIB_FMAF])
+ GNULIB_FMAL=0; AC_SUBST([GNULIB_FMAL])
+ GNULIB_FMOD=0; AC_SUBST([GNULIB_FMOD])
+ GNULIB_FMODF=0; AC_SUBST([GNULIB_FMODF])
+ GNULIB_FMODL=0; AC_SUBST([GNULIB_FMODL])
+ GNULIB_FREXPF=0; AC_SUBST([GNULIB_FREXPF])
+ GNULIB_FREXP=0; AC_SUBST([GNULIB_FREXP])
+ GNULIB_FREXPL=0; AC_SUBST([GNULIB_FREXPL])
+ GNULIB_HYPOT=0; AC_SUBST([GNULIB_HYPOT])
+ GNULIB_HYPOTF=0; AC_SUBST([GNULIB_HYPOTF])
+ GNULIB_HYPOTL=0; AC_SUBST([GNULIB_HYPOTL])
+ GNULIB_ILOGB=0; AC_SUBST([GNULIB_ILOGB])
+ GNULIB_ILOGBF=0; AC_SUBST([GNULIB_ILOGBF])
+ GNULIB_ILOGBL=0; AC_SUBST([GNULIB_ILOGBL])
+ GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE])
+ GNULIB_ISINF=0; AC_SUBST([GNULIB_ISINF])
+ GNULIB_ISNAN=0; AC_SUBST([GNULIB_ISNAN])
+ GNULIB_ISNANF=0; AC_SUBST([GNULIB_ISNANF])
+ GNULIB_ISNAND=0; AC_SUBST([GNULIB_ISNAND])
+ GNULIB_ISNANL=0; AC_SUBST([GNULIB_ISNANL])
+ GNULIB_LDEXPF=0; AC_SUBST([GNULIB_LDEXPF])
+ GNULIB_LDEXPL=0; AC_SUBST([GNULIB_LDEXPL])
+ GNULIB_LOG=0; AC_SUBST([GNULIB_LOG])
+ GNULIB_LOGF=0; AC_SUBST([GNULIB_LOGF])
+ GNULIB_LOGL=0; AC_SUBST([GNULIB_LOGL])
+ GNULIB_LOG10=0; AC_SUBST([GNULIB_LOG10])
+ GNULIB_LOG10F=0; AC_SUBST([GNULIB_LOG10F])
+ GNULIB_LOG10L=0; AC_SUBST([GNULIB_LOG10L])
+ GNULIB_LOG1P=0; AC_SUBST([GNULIB_LOG1P])
+ GNULIB_LOG1PF=0; AC_SUBST([GNULIB_LOG1PF])
+ GNULIB_LOG1PL=0; AC_SUBST([GNULIB_LOG1PL])
+ GNULIB_LOG2=0; AC_SUBST([GNULIB_LOG2])
+ GNULIB_LOG2F=0; AC_SUBST([GNULIB_LOG2F])
+ GNULIB_LOG2L=0; AC_SUBST([GNULIB_LOG2L])
+ GNULIB_LOGB=0; AC_SUBST([GNULIB_LOGB])
+ GNULIB_LOGBF=0; AC_SUBST([GNULIB_LOGBF])
+ GNULIB_LOGBL=0; AC_SUBST([GNULIB_LOGBL])
+ GNULIB_MODF=0; AC_SUBST([GNULIB_MODF])
+ GNULIB_MODFF=0; AC_SUBST([GNULIB_MODFF])
+ GNULIB_MODFL=0; AC_SUBST([GNULIB_MODFL])
+ GNULIB_POWF=0; AC_SUBST([GNULIB_POWF])
+ GNULIB_REMAINDER=0; AC_SUBST([GNULIB_REMAINDER])
+ GNULIB_REMAINDERF=0; AC_SUBST([GNULIB_REMAINDERF])
+ GNULIB_REMAINDERL=0; AC_SUBST([GNULIB_REMAINDERL])
+ GNULIB_RINT=0; AC_SUBST([GNULIB_RINT])
+ GNULIB_RINTF=0; AC_SUBST([GNULIB_RINTF])
+ GNULIB_RINTL=0; AC_SUBST([GNULIB_RINTL])
+ GNULIB_ROUND=0; AC_SUBST([GNULIB_ROUND])
+ GNULIB_ROUNDF=0; AC_SUBST([GNULIB_ROUNDF])
+ GNULIB_ROUNDL=0; AC_SUBST([GNULIB_ROUNDL])
+ GNULIB_SIGNBIT=0; AC_SUBST([GNULIB_SIGNBIT])
+ GNULIB_SINF=0; AC_SUBST([GNULIB_SINF])
+ GNULIB_SINL=0; AC_SUBST([GNULIB_SINL])
+ GNULIB_SINHF=0; AC_SUBST([GNULIB_SINHF])
+ GNULIB_SQRTF=0; AC_SUBST([GNULIB_SQRTF])
+ GNULIB_SQRTL=0; AC_SUBST([GNULIB_SQRTL])
+ GNULIB_TANF=0; AC_SUBST([GNULIB_TANF])
+ GNULIB_TANL=0; AC_SUBST([GNULIB_TANL])
+ GNULIB_TANHF=0; AC_SUBST([GNULIB_TANHF])
+ GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC])
+ GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF])
+ GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL])
dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF])
HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL])
+ HAVE_ASINF=1; AC_SUBST([HAVE_ASINF])
HAVE_ASINL=1; AC_SUBST([HAVE_ASINL])
+ HAVE_ATANF=1; AC_SUBST([HAVE_ATANF])
HAVE_ATANL=1; AC_SUBST([HAVE_ATANL])
+ HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F])
+ HAVE_CBRT=1; AC_SUBST([HAVE_CBRT])
+ HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF])
+ HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL])
+ HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN])
+ HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL])
+ HAVE_COSF=1; AC_SUBST([HAVE_COSF])
HAVE_COSL=1; AC_SUBST([HAVE_COSL])
+ HAVE_COSHF=1; AC_SUBST([HAVE_COSHF])
+ HAVE_EXPF=1; AC_SUBST([HAVE_EXPF])
HAVE_EXPL=1; AC_SUBST([HAVE_EXPL])
+ HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1])
+ HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F])
+ HAVE_FABSF=1; AC_SUBST([HAVE_FABSF])
+ HAVE_FABSL=1; AC_SUBST([HAVE_FABSL])
+ HAVE_FMA=1; AC_SUBST([HAVE_FMA])
+ HAVE_FMAF=1; AC_SUBST([HAVE_FMAF])
+ HAVE_FMAL=1; AC_SUBST([HAVE_FMAL])
+ HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
+ HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
+ HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
+ HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
+ HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
+ HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
+ HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF])
+ HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL])
HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF])
HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND])
HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL])
+ HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF])
+ HAVE_LOGF=1; AC_SUBST([HAVE_LOGF])
HAVE_LOGL=1; AC_SUBST([HAVE_LOGL])
+ HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F])
+ HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L])
+ HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P])
+ HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF])
+ HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL])
+ HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF])
+ HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL])
+ HAVE_MODFF=1; AC_SUBST([HAVE_MODFF])
+ HAVE_MODFL=1; AC_SUBST([HAVE_MODFL])
+ HAVE_POWF=1; AC_SUBST([HAVE_POWF])
+ HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER])
+ HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
+ HAVE_RINT=1; AC_SUBST([HAVE_RINT])
+ HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
+ HAVE_SINF=1; AC_SUBST([HAVE_SINF])
HAVE_SINL=1; AC_SUBST([HAVE_SINL])
+ HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
+ HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF])
HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL])
+ HAVE_TANF=1; AC_SUBST([HAVE_TANF])
HAVE_TANL=1; AC_SUBST([HAVE_TANL])
+ HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
+ HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF])
+ HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL])
HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF])
HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL])
+ HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF])
HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL])
HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL])
+ HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2])
+ HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F])
+ HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L])
+ HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L])
HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
- HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL])
+ HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L])
+ HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2])
+ HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F])
+ HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L])
+ HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB])
+ HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER])
+ HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL])
+ HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF])
HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND])
HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
@@ -121,26 +256,98 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC])
HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
+ REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF])
+ REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL])
REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL])
REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF])
REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL])
+ REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1])
+ REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F])
+ REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2])
+ REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L])
+ REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL])
REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR])
REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF])
REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL])
+ REPLACE_FMA=0; AC_SUBST([REPLACE_FMA])
+ REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF])
+ REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL])
+ REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD])
+ REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF])
+ REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL])
+ REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
+ REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
+ REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
+ REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL])
+ REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB])
+ REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF])
REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
+ REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
+ REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
+ REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL])
+ REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10])
+ REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F])
+ REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L])
+ REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P])
+ REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF])
+ REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL])
+ REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2])
+ REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F])
+ REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L])
+ REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB])
+ REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF])
+ REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL])
+ REPLACE_MODF=0; AC_SUBST([REPLACE_MODF])
+ REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF])
+ REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL])
REPLACE_NAN=0; AC_SUBST([REPLACE_NAN])
+ REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER])
+ REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF])
+ REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL])
REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND])
REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF])
REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL])
REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT])
REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
+ REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
])
+
+# gl_LONG_DOUBLE_VS_DOUBLE
+# determines whether 'long double' and 'double' have the same representation.
+# Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
+# HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
+# The currently known platforms where this is the case are:
+# Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
+AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
+[
+ AC_CACHE_CHECK([whether long double and double are the same],
+ [gl_cv_long_double_equals_double],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <float.h>]],
+ [[typedef int check[sizeof (long double) == sizeof (double)
+ && LDBL_MANT_DIG == DBL_MANT_DIG
+ && LDBL_MAX_EXP == DBL_MAX_EXP
+ && LDBL_MIN_EXP == DBL_MIN_EXP
+ ? 1 : -1];
+ ]])],
+ [gl_cv_long_double_equals_double=yes],
+ [gl_cv_long_double_equals_double=no])
+ ])
+ if test $gl_cv_long_double_equals_double = yes; then
+ AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1],
+ [Define to 1 if 'long double' and 'double' have the same representation.])
+ HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
+ else
+ HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
+ fi
+ AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE])
+])
diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4
index c353862..4c9f388 100644
--- a/m4/mbrtowc.m4
+++ b/m4/mbrtowc.m4
@@ -1,5 +1,5 @@
-# mbrtowc.m4 serial 22
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2011 Free Software Foundation,
+# mbrtowc.m4 serial 25
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2013 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -15,6 +15,22 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
AC_CHECK_FUNCS_ONCE([mbrtowc])
if test $ac_cv_func_mbrtowc = no; then
HAVE_MBRTOWC=0
+ AC_CHECK_DECLS([mbrtowc],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+ if test $ac_cv_have_decl_mbrtowc = yes; then
+ dnl On Minix 3.1.8, the system's <wchar.h> declares mbrtowc() although
+ dnl it does not have the function. Avoid a collision with gnulib's
+ dnl replacement.
+ REPLACE_MBRTOWC=1
+ fi
else
if test $REPLACE_MBSTATE_T = 1; then
REPLACE_MBRTOWC=1
@@ -53,11 +69,6 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
esac
fi
fi
- if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
- gl_REPLACE_WCHAR_H
- AC_LIBOBJ([mbrtowc])
- gl_PREREQ_MBRTOWC
- fi
])
dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that
@@ -88,9 +99,6 @@ AC_DEFUN([gl_MBSTATE_T_BROKEN],
else
REPLACE_MBSTATE_T=1
fi
- if test $REPLACE_MBSTATE_T = 1; then
- gl_REPLACE_WCHAR_H
- fi
])
dnl Test whether mbrtowc puts the state into non-initial state when parsing an
diff --git a/m4/mbsinit.m4 b/m4/mbsinit.m4
index 47e2d14..2e6d092 100644
--- a/m4/mbsinit.m4
+++ b/m4/mbsinit.m4
@@ -1,5 +1,5 @@
-# mbsinit.m4 serial 5
-dnl Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc.
+# mbsinit.m4 serial 8
+dnl Copyright (C) 2008, 2010-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -15,6 +15,22 @@ AC_DEFUN([gl_FUNC_MBSINIT],
AC_CHECK_FUNCS_ONCE([mbsinit])
if test $ac_cv_func_mbsinit = no; then
HAVE_MBSINIT=0
+ AC_CHECK_DECLS([mbsinit],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+ if test $ac_cv_have_decl_mbsinit = yes; then
+ dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although
+ dnl it does not have the function. Avoid a collision with gnulib's
+ dnl replacement.
+ REPLACE_MBSINIT=1
+ fi
else
if test $REPLACE_MBSTATE_T = 1; then
REPLACE_MBSINIT=1
@@ -27,11 +43,6 @@ AC_DEFUN([gl_FUNC_MBSINIT],
esac
fi
fi
- if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
- gl_REPLACE_WCHAR_H
- AC_LIBOBJ([mbsinit])
- gl_PREREQ_MBSINIT
- fi
])
# Prerequisites of lib/mbsinit.c.
diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4
index f7c46b8..ed00117 100644
--- a/m4/mbstate_t.m4
+++ b/m4/mbstate_t.m4
@@ -1,5 +1,5 @@
# mbstate_t.m4 serial 13
-dnl Copyright (C) 2000-2002, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/mbtowc.m4 b/m4/mbtowc.m4
index 9215892..e479461 100644
--- a/m4/mbtowc.m4
+++ b/m4/mbtowc.m4
@@ -1,5 +1,5 @@
-# mbtowc.m4 serial 1
-dnl Copyright (C) 2011 Free Software Foundation, Inc.
+# mbtowc.m4 serial 2
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,10 +11,6 @@ AC_DEFUN([gl_FUNC_MBTOWC],
if false; then
REPLACE_MBTOWC=1
fi
- if test $REPLACE_MBTOWC = 1; then
- AC_LIBOBJ([mbtowc])
- gl_PREREQ_MBTOWC
- fi
])
# Prerequisites of lib/mbtowc.c.
diff --git a/m4/memchr.m4 b/m4/memchr.m4
index 3c2b313..2d8abe7 100644
--- a/m4/memchr.m4
+++ b/m4/memchr.m4
@@ -1,5 +1,5 @@
-# memchr.m4 serial 10
-dnl Copyright (C) 2002-2004, 2009-2011 Free Software Foundation, Inc.
+# memchr.m4 serial 12
+dnl Copyright (C) 2002-2004, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,10 +11,16 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
AC_CHECK_HEADERS_ONCE([sys/mman.h])
AC_CHECK_FUNCS_ONCE([mprotect])
- dnl These days, we assume memchr is present. But just in case...
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([memchr])
- if test $ac_cv_func_memchr = yes; then
+ m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [
+ dnl These days, we assume memchr is present. But if support for old
+ dnl platforms is desired:
+ AC_CHECK_FUNCS_ONCE([memchr])
+ if test $ac_cv_func_memchr = no; then
+ HAVE_MEMCHR=0
+ fi
+ ])
+ if test $HAVE_MEMCHR = 1; then
# Detect platform-specific bugs in some versions of glibc:
# memchr should not dereference anything with length 0
# http://bugzilla.redhat.com/499689
@@ -73,12 +79,6 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
if test "$gl_cv_func_memchr_works" != yes; then
REPLACE_MEMCHR=1
fi
- else
- HAVE_MEMCHR=0
- fi
- if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
- AC_LIBOBJ([memchr])
- gl_PREREQ_MEMCHR
fi
])
diff --git a/m4/mkdtemp.m4 b/m4/mkdtemp.m4
index 0ef7dfb..b7c0a61 100644
--- a/m4/mkdtemp.m4
+++ b/m4/mkdtemp.m4
@@ -1,17 +1,16 @@
-# mkdtemp.m4 serial 6
-dnl Copyright (C) 2001-2003, 2006-2007, 2009-2011 Free Software Foundation,
+# mkdtemp.m4 serial 8
+dnl Copyright (C) 2001-2003, 2006-2007, 2009-2013 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-AC_DEFUN([gt_FUNC_MKDTEMP],
+AC_DEFUN([gl_FUNC_MKDTEMP],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- AC_REPLACE_FUNCS([mkdtemp])
+ AC_CHECK_FUNCS([mkdtemp])
if test $ac_cv_func_mkdtemp = no; then
HAVE_MKDTEMP=0
- gl_PREREQ_MKDTEMP
fi
])
diff --git a/m4/mkstemp.m4 b/m4/mkstemp.m4
index c5cd282..ac6c7cd 100644
--- a/m4/mkstemp.m4
+++ b/m4/mkstemp.m4
@@ -1,6 +1,6 @@
-#serial 19
+#serial 23
-# Copyright (C) 2001, 2003-2007, 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003-2007, 2009-2013 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.
@@ -10,11 +10,13 @@
# Other systems lack mkstemp altogether.
# On OSF1/Tru64 V4.0F, the system-provided mkstemp function can create
# only 32 files per process.
+# On some hosts, mkstemp creates files with mode 0666, which is a security
+# problem and a violation of POSIX 2008.
# On systems like the above, arrange to use the replacement function.
AC_DEFUN([gl_FUNC_MKSTEMP],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- AC_REQUIRE([AC_SYS_LARGEFILE])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_FUNCS_ONCE([mkstemp])
if test $ac_cv_func_mkstemp = yes; then
@@ -30,6 +32,7 @@ AC_DEFUN([gl_FUNC_MKSTEMP],
off_t large = (off_t) 4294967295u;
if (large < 0)
large = 2147483647;
+ umask (0);
for (i = 0; i < 70; i++)
{
char templ[] = "conftest.mkstemp/coXXXXXX";
@@ -39,26 +42,37 @@ AC_DEFUN([gl_FUNC_MKSTEMP],
result |= 1;
else
{
+ struct stat st;
if (lseek (fd, large, SEEK_SET) != large)
result |= 2;
- close (fd);
+ if (fstat (fd, &st) < 0)
+ result |= 4;
+ else if (st.st_mode & 0077)
+ result |= 8;
+ if (close (fd))
+ result |= 16;
}
}
return result;]])],
[gl_cv_func_working_mkstemp=yes],
[gl_cv_func_working_mkstemp=no],
- [gl_cv_func_working_mkstemp=no])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_working_mkstemp="guessing no" ;;
+ esac
+ ])
rm -rf conftest.mkstemp
])
- if test $gl_cv_func_working_mkstemp != yes; then
- REPLACE_MKSTEMP=1
- AC_LIBOBJ([mkstemp])
- gl_PREREQ_MKSTEMP
- fi
+ case "$gl_cv_func_working_mkstemp" in
+ *yes) ;;
+ *)
+ REPLACE_MKSTEMP=1
+ ;;
+ esac
else
HAVE_MKSTEMP=0
- AC_LIBOBJ([mkstemp])
- gl_PREREQ_MKSTEMP
fi
])
diff --git a/m4/mmap-anon.m4 b/m4/mmap-anon.m4
index 7ba7fd2..9b60ddf 100644
--- a/m4/mmap-anon.m4
+++ b/m4/mmap-anon.m4
@@ -1,5 +1,5 @@
-# mmap-anon.m4 serial 9
-dnl Copyright (C) 2005, 2007, 2009-2011 Free Software Foundation, Inc.
+# mmap-anon.m4 serial 10
+dnl Copyright (C) 2005, 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,7 @@ dnl with or without modifications, as long as this notice is preserved.
# - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS
# and MAP_ANON exist and have the same value.
# - On HP-UX, only MAP_ANONYMOUS exists.
-# - On MacOS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
+# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
# - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be
# used.
@@ -27,18 +27,18 @@ AC_DEFUN([gl_FUNC_MMAP_ANON],
gl_have_mmap_anonymous=no
if test $gl_have_mmap = yes; then
AC_MSG_CHECKING([for MAP_ANONYMOUS])
- AC_EGREP_CPP([I cant identify this map.], [
+ AC_EGREP_CPP([I cannot identify this map], [
#include <sys/mman.h>
#ifdef MAP_ANONYMOUS
- I cant identify this map.
+ I cannot identify this map
#endif
],
[gl_have_mmap_anonymous=yes])
if test $gl_have_mmap_anonymous != yes; then
- AC_EGREP_CPP([I cant identify this map.], [
+ AC_EGREP_CPP([I cannot identify this map], [
#include <sys/mman.h>
#ifdef MAP_ANON
- I cant identify this map.
+ I cannot identify this map
#endif
],
[AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON],
diff --git a/m4/mode_t.m4 b/m4/mode_t.m4
index f9cf704..d5b66d4 100644
--- a/m4/mode_t.m4
+++ b/m4/mode_t.m4
@@ -1,5 +1,5 @@
# mode_t.m4 serial 2
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/msvc-inval.m4 b/m4/msvc-inval.m4
new file mode 100644
index 0000000..9a6a47a
--- /dev/null
+++ b/m4/msvc-inval.m4
@@ -0,0 +1,19 @@
+# msvc-inval.m4 serial 1
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free 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_MSVC_INVAL],
+[
+ AC_CHECK_FUNCS_ONCE([_set_invalid_parameter_handler])
+ if test $ac_cv_func__set_invalid_parameter_handler = yes; then
+ HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
+ AC_DEFINE([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [1],
+ [Define to 1 on MSVC platforms that have the "invalid parameter handler"
+ concept.])
+ else
+ HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
+ fi
+ AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER])
+])
diff --git a/m4/cloexec.m4 b/m4/msvc-nothrow.m4
index c936f43..a39618a 100644
--- a/m4/cloexec.m4
+++ b/m4/msvc-nothrow.m4
@@ -1,10 +1,10 @@
-#serial 6
-dnl Copyright (C) 2004-2006, 2009-2011 Free Software Foundation, Inc.
+# msvc-nothrow.m4 serial 1
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free 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_CLOEXEC],
+AC_DEFUN([gl_MSVC_NOTHROW],
[
- AC_LIBOBJ([cloexec])
+ AC_REQUIRE([gl_MSVC_INVAL])
])
diff --git a/m4/multiarch.m4 b/m4/multiarch.m4
index 691d892..552ec7e 100644
--- a/m4/multiarch.m4
+++ b/m4/multiarch.m4
@@ -1,12 +1,12 @@
-# multiarch.m4 serial 6
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# multiarch.m4 serial 7
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Determine whether the compiler is or may be producing universal binaries.
#
-# On MacOS X 10.5 and later systems, the user can create libraries and
+# On Mac OS X 10.5 and later systems, the user can create libraries and
# executables that work on multiple system types--known as "fat" or
# "universal" binaries--by specifying multiple '-arch' options to the
# compiler but only a single '-arch' option to the preprocessor. Like
diff --git a/m4/nl_langinfo.m4 b/m4/nl_langinfo.m4
index ca9d28d..25e2101 100644
--- a/m4/nl_langinfo.m4
+++ b/m4/nl_langinfo.m4
@@ -1,5 +1,5 @@
-# nl_langinfo.m4 serial 4
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# nl_langinfo.m4 serial 5
+dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -43,10 +43,8 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
REPLACE_NL_LANGINFO=1
AC_DEFINE([REPLACE_NL_LANGINFO], [1],
[Define if nl_langinfo exists but is overridden by gnulib.])
- AC_LIBOBJ([nl_langinfo])
fi
else
HAVE_NL_LANGINFO=0
- AC_LIBOBJ([nl_langinfo])
fi
])
diff --git a/m4/nocrash.m4 b/m4/nocrash.m4
index 0cc0d53..105b884 100644
--- a/m4/nocrash.m4
+++ b/m4/nocrash.m4
@@ -1,5 +1,5 @@
-# nocrash.m4 serial 2
-dnl Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc.
+# nocrash.m4 serial 4
+dnl Copyright (C) 2005, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -18,7 +18,7 @@ dnl int main() { nocrash_init(); ... }
AC_DEFUN([GL_NOCRASH],[[
#include <stdlib.h>
#if defined __MACH__ && defined __APPLE__
-/* Avoid a crash on MacOS X. */
+/* Avoid a crash on Mac OS X. */
#include <mach/mach.h>
#include <mach/mach_error.h>
#include <mach/thread_status.h>
@@ -79,6 +79,34 @@ nocrash_init (void)
}
}
}
+#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Avoid a crash on native Windows. */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winerror.h>
+static LONG WINAPI
+exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+{
+ switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
+ {
+ case EXCEPTION_ACCESS_VIOLATION:
+ case EXCEPTION_IN_PAGE_ERROR:
+ case EXCEPTION_STACK_OVERFLOW:
+ case EXCEPTION_GUARD_PAGE:
+ case EXCEPTION_PRIV_INSTRUCTION:
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ case EXCEPTION_DATATYPE_MISALIGNMENT:
+ case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+ case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+ exit (1);
+ }
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+static void
+nocrash_init (void)
+{
+ SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+}
#else
/* Avoid a crash on POSIX systems. */
#include <signal.h>
diff --git a/m4/off_t.m4 b/m4/off_t.m4
new file mode 100644
index 0000000..d355d01
--- /dev/null
+++ b/m4/off_t.m4
@@ -0,0 +1,18 @@
+# off_t.m4 serial 1
+dnl Copyright (C) 2012-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free 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 Check whether to override the 'off_t' type.
+dnl Set WINDOWS_64_BIT_OFF_T.
+
+AC_DEFUN([gl_TYPE_OFF_T],
+[
+ m4_ifdef([gl_LARGEFILE], [
+ AC_REQUIRE([gl_LARGEFILE])
+ ], [
+ WINDOWS_64_BIT_OFF_T=0
+ ])
+ AC_SUBST([WINDOWS_64_BIT_OFF_T])
+])
diff --git a/m4/open.m4 b/m4/open.m4
index bfebdab..a6cb101 100644
--- a/m4/open.m4
+++ b/m4/open.m4
@@ -1,5 +1,5 @@
-# open.m4 serial 11
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# open.m4 serial 14
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_OPEN],
AC_REQUIRE([AC_CANONICAL_HOST])
case "$host_os" in
mingw* | pw*)
- gl_REPLACE_OPEN
+ REPLACE_OPEN=1
;;
*)
dnl open("foo/") should not create a file when the file name has a
@@ -57,25 +57,35 @@ changequote([,])dnl
*no)
AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
[Define to 1 if open() fails to recognize a trailing slash.])
- gl_REPLACE_OPEN
+ REPLACE_OPEN=1
;;
esac
;;
esac
-])
-
-AC_DEFUN([gl_REPLACE_OPEN],
-[
- AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
- REPLACE_OPEN=1
- AC_LIBOBJ([open])
- gl_PREREQ_OPEN
+ dnl Replace open() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ if test $REPLACE_OPEN = 0; then
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ REPLACE_OPEN=1
+ fi
+ fi
+ ])
+ dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag.
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ if test $REPLACE_OPEN = 0; then
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_open_O_NONBLOCK != yes; then
+ REPLACE_OPEN=1
+ fi
+ fi
+ ])
])
# Prerequisites of lib/open.c.
AC_DEFUN([gl_PREREQ_OPEN],
[
- AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T])
:
])
diff --git a/m4/opendir.m4 b/m4/opendir.m4
new file mode 100644
index 0000000..d411680
--- /dev/null
+++ b/m4/opendir.m4
@@ -0,0 +1,25 @@
+# opendir.m4 serial 2
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_OPENDIR],
+[
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+ AC_CHECK_FUNCS([opendir])
+ if test $ac_cv_func_opendir = no; then
+ HAVE_OPENDIR=0
+ fi
+ dnl Replace opendir() for supporting the gnulib-defined fchdir() function,
+ dnl to keep fchdir's bookkeeping up-to-date.
+ m4_ifdef([gl_FUNC_FCHDIR], [
+ gl_TEST_FCHDIR
+ if test $HAVE_FCHDIR = 0; then
+ if test $HAVE_OPENDIR = 1; then
+ REPLACE_OPENDIR=1
+ fi
+ fi
+ ])
+])
diff --git a/m4/pathmax.m4 b/m4/pathmax.m4
index 17b3d64..e11bf57 100644
--- a/m4/pathmax.m4
+++ b/m4/pathmax.m4
@@ -1,5 +1,5 @@
-# pathmax.m4 serial 8
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
+# pathmax.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2013 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,6 +8,35 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_PATHMAX],
[
dnl Prerequisites of lib/pathmax.h.
- AC_CHECK_FUNCS_ONCE([pathconf])
AC_CHECK_HEADERS_ONCE([sys/param.h])
])
+
+# Expands to a piece of C program that defines PATH_MAX in the same way as
+# "pathmax.h" will do.
+AC_DEFUN([gl_PATHMAX_SNIPPET], [[
+/* Arrange to define PATH_MAX, like "pathmax.h" does. */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <limits.h>
+#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+#endif
+#if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+#endif
+#ifdef __hpux
+# undef PATH_MAX
+# define PATH_MAX 1024
+#endif
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# undef PATH_MAX
+# define PATH_MAX 260
+#endif
+]])
+
+# Prerequisites of gl_PATHMAX_SNIPPET.
+AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ],
+[
+ AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h])
+])
diff --git a/m4/pipe2.m4 b/m4/pipe2.m4
index 10f1e14..6ccee10 100644
--- a/m4/pipe2.m4
+++ b/m4/pipe2.m4
@@ -1,5 +1,5 @@
# pipe2.m4 serial 2
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/posix_spawn.m4 b/m4/posix_spawn.m4
index 63e9473..69eaf63 100644
--- a/m4/posix_spawn.m4
+++ b/m4/posix_spawn.m4
@@ -1,5 +1,5 @@
-# posix_spawn.m4 serial 8
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# posix_spawn.m4 serial 11
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -36,6 +36,9 @@ AC_DEFUN([gl_POSIX_SPAWN_BODY],
gl_POSIX_SPAWN_WORKS
case "$gl_cv_func_posix_spawn_works" in
*yes)
+ AC_DEFINE([HAVE_WORKING_POSIX_SPAWN], [1],
+ [Define if you have the posix_spawn and posix_spawnp functions and
+ they work.])
dnl Assume that these functions are available if POSIX_SPAWN_SETSCHEDULER
dnl evaluates to nonzero.
dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getschedpolicy])
@@ -391,10 +394,134 @@ main (int argc, char *argv[])
])
])
-AC_DEFUN([gl_POSIX_SPAWN_INTERNAL],
+# Prerequisites of lib/spawni.c.
+AC_DEFUN([gl_PREREQ_POSIX_SPAWN_INTERNAL],
[
- AC_LIBOBJ([spawni])
- dnl Prerequisites of lib/spawni.c.
AC_CHECK_HEADERS([paths.h])
AC_CHECK_FUNCS([confstr sched_setparam sched_setscheduler setegid seteuid vfork])
])
+
+AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE],
+[
+ AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ gl_POSIX_SPAWN
+ if test $REPLACE_POSIX_SPAWN = 1; then
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1
+ else
+ dnl On Solaris 11 2011-11, posix_spawn_file_actions_addclose succeeds even
+ dnl if the fd argument is out of range.
+ AC_CACHE_CHECK([whether posix_spawn_file_actions_addclose works],
+ [gl_cv_func_posix_spawn_file_actions_addclose_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <spawn.h>
+int main ()
+{
+ posix_spawn_file_actions_t actions;
+ if (posix_spawn_file_actions_init (&actions) != 0)
+ return 1;
+ if (posix_spawn_file_actions_addclose (&actions, 10000000) == 0)
+ return 2;
+ return 0;
+}]])],
+ [gl_cv_func_posix_spawn_file_actions_addclose_works=yes],
+ [gl_cv_func_posix_spawn_file_actions_addclose_works=no],
+ [# Guess no on Solaris, yes otherwise.
+ case "$host_os" in
+ solaris*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no";;
+ *) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_posix_spawn_file_actions_addclose_works" in
+ *yes) ;;
+ *) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1 ;;
+ esac
+ fi
+])
+
+AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2],
+[
+ AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ gl_POSIX_SPAWN
+ if test $REPLACE_POSIX_SPAWN = 1; then
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1
+ else
+ dnl On Solaris 11 2011-11, posix_spawn_file_actions_adddup2 succeeds even
+ dnl if the fd argument is out of range.
+ AC_CACHE_CHECK([whether posix_spawn_file_actions_adddup2 works],
+ [gl_cv_func_posix_spawn_file_actions_adddup2_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <spawn.h>
+int main ()
+{
+ posix_spawn_file_actions_t actions;
+ if (posix_spawn_file_actions_init (&actions) != 0)
+ return 1;
+ if (posix_spawn_file_actions_adddup2 (&actions, 10000000, 2) == 0)
+ return 2;
+ return 0;
+}]])],
+ [gl_cv_func_posix_spawn_file_actions_adddup2_works=yes],
+ [gl_cv_func_posix_spawn_file_actions_adddup2_works=no],
+ [# Guess no on Solaris, yes otherwise.
+ case "$host_os" in
+ solaris*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";;
+ *) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_posix_spawn_file_actions_adddup2_works" in
+ *yes) ;;
+ *) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1 ;;
+ esac
+ fi
+])
+
+AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN],
+[
+ AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ gl_POSIX_SPAWN
+ if test $REPLACE_POSIX_SPAWN = 1; then
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1
+ else
+ dnl On Solaris 11 2011-11, posix_spawn_file_actions_addopen succeeds even
+ dnl if the fd argument is out of range.
+ AC_CACHE_CHECK([whether posix_spawn_file_actions_addopen works],
+ [gl_cv_func_posix_spawn_file_actions_addopen_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <spawn.h>
+#include <fcntl.h>
+int main ()
+{
+ posix_spawn_file_actions_t actions;
+ if (posix_spawn_file_actions_init (&actions) != 0)
+ return 1;
+ if (posix_spawn_file_actions_addopen (&actions, 10000000, "foo", 0, O_RDONLY)
+ == 0)
+ return 2;
+ return 0;
+}]])],
+ [gl_cv_func_posix_spawn_file_actions_addopen_works=yes],
+ [gl_cv_func_posix_spawn_file_actions_addopen_works=no],
+ [# Guess no on Solaris, yes otherwise.
+ case "$host_os" in
+ solaris*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";;
+ *) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_posix_spawn_file_actions_addopen_works" in
+ *yes) ;;
+ *) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1 ;;
+ esac
+ fi
+])
diff --git a/m4/printf-frexp.m4 b/m4/printf-frexp.m4
index 83ff9ce..8b373b1 100644
--- a/m4/printf-frexp.m4
+++ b/m4/printf-frexp.m4
@@ -1,5 +1,5 @@
# printf-frexp.m4 serial 5
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/printf-frexpl.m4 b/m4/printf-frexpl.m4
index 9c13d4e..f1ce4c8 100644
--- a/m4/printf-frexpl.m4
+++ b/m4/printf-frexpl.m4
@@ -1,5 +1,5 @@
-# printf-frexpl.m4 serial 7
-dnl Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# printf-frexpl.m4 serial 10
+dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,6 +9,8 @@ dnl Check how to define printf_frexpl() without linking with libm.
AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
+
dnl Subset of gl_FUNC_FREXPL_NO_LIBM.
gl_CHECK_FREXPL_NO_LIBM
if test $gl_cv_func_frexpl_no_libm = yes; then
@@ -26,8 +28,8 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1],
[Define if the frexpl function is available in libc.])
dnl Also check whether it's declared.
- dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>])
+ dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
fi
gl_CHECK_LDEXPL_NO_LIBM
@@ -38,8 +40,8 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
AC_DEFINE([HAVE_LDEXPL_IN_LIBC], [1],
[Define if the ldexpl function is available in libc.])
dnl Also check whether it's declared.
- dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [#include <math.h>])
+ dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
+ AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
;;
esac
fi
diff --git a/m4/printf.m4 b/m4/printf.m4
index 9c2ed1e..ef44f78 100644
--- a/m4/printf.m4
+++ b/m4/printf.m4
@@ -1,5 +1,5 @@
-# printf.m4 serial 42
-dnl Copyright (C) 2003, 2007-2011 Free Software Foundation, Inc.
+# printf.m4 serial 50
+dnl Copyright (C) 2003, 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -63,7 +63,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 5.
freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";;
darwin*) gl_cv_func_printf_sizes_c99="guessing yes";;
# Guess yes on OpenBSD >= 3.9.
@@ -178,28 +178,28 @@ static double zero = 0.0;
int main ()
{
int result = 0;
- if (sprintf (buf, "%f", 1.0 / 0.0) < 0
+ if (sprintf (buf, "%f", 1.0 / zero) < 0
|| (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
result |= 1;
- if (sprintf (buf, "%f", -1.0 / 0.0) < 0
+ if (sprintf (buf, "%f", -1.0 / zero) < 0
|| (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
result |= 1;
if (sprintf (buf, "%f", zero / zero) < 0
|| !strisnan (buf, 0, strlen (buf)))
result |= 2;
- if (sprintf (buf, "%e", 1.0 / 0.0) < 0
+ if (sprintf (buf, "%e", 1.0 / zero) < 0
|| (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
result |= 4;
- if (sprintf (buf, "%e", -1.0 / 0.0) < 0
+ if (sprintf (buf, "%e", -1.0 / zero) < 0
|| (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
result |= 4;
if (sprintf (buf, "%e", zero / zero) < 0
|| !strisnan (buf, 0, strlen (buf)))
result |= 8;
- if (sprintf (buf, "%g", 1.0 / 0.0) < 0
+ if (sprintf (buf, "%g", 1.0 / zero) < 0
|| (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
result |= 16;
- if (sprintf (buf, "%g", -1.0 / 0.0) < 0
+ if (sprintf (buf, "%g", -1.0 / zero) < 0
|| (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
result |= 16;
if (sprintf (buf, "%g", zero / zero) < 0
@@ -222,7 +222,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 6.
freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
darwin*) gl_cv_func_printf_infinite="guessing yes";;
# Guess yes on HP-UX >= 11.
@@ -251,6 +251,7 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([gl_BIGENDIAN])
+ AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
dnl The user can set or unset the variable gl_printf_safe to indicate
dnl that he wishes a safe handling of non-IEEE-754 'long double' values.
@@ -294,34 +295,34 @@ int main ()
{
int result = 0;
nocrash_init();
- if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0
+ if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0
|| (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
result |= 1;
- if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0
+ if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0
|| (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
result |= 1;
if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
|| !strisnan (buf, 0, strlen (buf)))
result |= 1;
- if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0
+ if (sprintf (buf, "%Le", 1.0L / zeroL) < 0
|| (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
result |= 1;
- if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0
+ if (sprintf (buf, "%Le", -1.0L / zeroL) < 0
|| (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
result |= 1;
if (sprintf (buf, "%Le", zeroL / zeroL) < 0
|| !strisnan (buf, 0, strlen (buf)))
result |= 1;
- if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0
+ if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0
|| (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
result |= 1;
- if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0
+ if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0
|| (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
result |= 1;
if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
|| !strisnan (buf, 0, strlen (buf)))
result |= 1;
-#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
+#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
/* Representation of an 80-bit 'long double' as an initializer for a sequence
of 'unsigned int' words. */
# ifdef WORDS_BIGENDIAN
@@ -478,6 +479,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
#include <stdio.h>
#include <string.h>
static char buf[100];
+static double zero = 0.0;
int main ()
{
int result = 0;
@@ -502,17 +504,17 @@ int main ()
result |= 4;
/* This catches a FreeBSD 6.1 bug. See
<http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
- if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0
+ if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
|| buf[0] == '0')
result |= 8;
- /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug. */
+ /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */
if (sprintf (buf, "%.1a", 1.999) < 0
|| (strcmp (buf, "0x1.0p+1") != 0
&& strcmp (buf, "0x2.0p+0") != 0
&& strcmp (buf, "0x4.0p-1") != 0
&& strcmp (buf, "0x8.0p-2") != 0))
result |= 16;
- /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
+ /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
if (sprintf (buf, "%.1La", 1.999L) < 0
|| (strcmp (buf, "0x1.0p+1") != 0
@@ -562,13 +564,14 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
#include <stdio.h>
#include <string.h>
static char buf[100];
+static double zero = 0.0;
int main ()
{
int result = 0;
if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
|| strcmp (buf, "1234567.000000 33") != 0)
result |= 1;
- if (sprintf (buf, "%F", 1.0 / 0.0) < 0
+ if (sprintf (buf, "%F", 1.0 / zero) < 0
|| (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
result |= 2;
/* This catches a Cygwin 1.5.x bug. */
@@ -587,7 +590,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 6.
freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
darwin*) gl_cv_func_printf_directive_f="guessing yes";;
# Guess yes on Solaris >= 2.10.
@@ -615,12 +618,27 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#ifdef _MSC_VER
+/* See page about "Parameter Validation" on msdn.microsoft.com. */
+static void cdecl
+invalid_parameter_handler (const wchar_t *expression,
+ const wchar_t *function,
+ const wchar_t *file, unsigned int line,
+ uintptr_t dummy)
+{
+ exit (1);
+}
+#endif
static char fmtstring[10];
static char buf[100];
int main ()
{
int count = -1;
+#ifdef _MSC_VER
+ _set_invalid_parameter_handler (invalid_parameter_handler);
+#endif
/* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
support %n in format strings in read-only memory but not in writable
memory. */
@@ -636,7 +654,8 @@ int main ()
[
changequote(,)dnl
case "$host_os" in
- *) gl_cv_func_printf_directive_n="guessing yes";;
+ mingw*) gl_cv_func_printf_directive_n="guessing no";;
+ *) gl_cv_func_printf_directive_n="guessing yes";;
esac
changequote([,])dnl
])
@@ -862,9 +881,10 @@ AC_DEFUN([gl_PRINTF_FLAG_ZERO],
#include <stdio.h>
#include <string.h>
static char buf[100];
+static double zero = 0.0;
int main ()
{
- if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0
+ if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0
|| (strcmp (buf, " inf") != 0
&& strcmp (buf, " infinity") != 0))
return 1;
@@ -892,7 +912,8 @@ dnl On mingw, precisions larger than 512 are treated like 512, in integer,
dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC,
dnl precisions larger than 510 in floating-point output yield wrong results.
-dnl On BeOS, precisions larger than 1044 crash the program.
+dnl On AIX 7.1, precisions larger than 998 in floating-point output yield
+dnl wrong results. On BeOS, precisions larger than 1044 crash the program.
dnl Result is gl_cv_func_printf_precision.
AC_DEFUN([gl_PRINTF_PRECISION],
@@ -921,6 +942,9 @@ int main ()
if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5
|| buf[0] != '1')
result |= 4;
+ if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5
+ || buf[0] != '1')
+ result |= 4;
return result;
}]])],
[gl_cv_func_printf_precision=yes],
@@ -928,7 +952,7 @@ int main ()
[
changequote(,)dnl
case "$host_os" in
- # Guess no only on Solaris, native Win32, and BeOS systems.
+ # Guess no only on Solaris, native Windows, and BeOS systems.
solaris*) gl_cv_func_printf_precision="guessing no" ;;
mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
beos*) gl_cv_func_printf_precision="guessing no" ;;
@@ -1004,8 +1028,9 @@ int main()
changequote([,])dnl
])])
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
- (./conftest
+ (./conftest 2>&AS_MESSAGE_LOG_FD
result=$?
+ _AS_ECHO_LOG([\$? = $result])
if test $result != 0 && test $result != 77; then result=1; fi
exit $result
) >/dev/null 2>/dev/null
@@ -1019,7 +1044,7 @@ changequote([,])dnl
fi
rm -fr conftest*
else
- dnl A universal build on Apple MacOS X platforms.
+ dnl A universal build on Apple Mac OS X platforms.
dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode.
dnl But we need a configuration result that is valid in both modes.
gl_cv_func_printf_enomem="guessing no"
@@ -1072,6 +1097,7 @@ AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_SNPRINTF_PRESENCE])
AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
[gl_cv_func_snprintf_truncation_c99],
[
@@ -1079,11 +1105,25 @@ AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
[AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
static char buf[100];
int main ()
{
strcpy (buf, "ABCDEF");
- snprintf (buf, 3, "%d %d", 4567, 89);
+ my_snprintf (buf, 3, "%d %d", 4567, 89);
if (memcmp (buf, "45\0DEF", 6) != 0)
return 1;
return 0;
@@ -1098,7 +1138,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 5.
freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess yes on OpenBSD >= 3.9.
@@ -1153,6 +1193,7 @@ AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_SNPRINTF_PRESENCE])
AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
[gl_cv_func_snprintf_retval_c99],
[
@@ -1160,15 +1201,29 @@ AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99],
[AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
static char buf[100];
int main ()
{
strcpy (buf, "ABCDEF");
- if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
+ if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7)
return 1;
- if (snprintf (buf, 0, "%d %d", 4567, 89) != 7)
+ if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7)
return 2;
- if (snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
+ if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
return 3;
return 0;
}]])],
@@ -1182,7 +1237,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 5.
freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";;
# Guess yes on OpenBSD >= 3.9.
@@ -1217,6 +1272,7 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_SNPRINTF_PRESENCE])
AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
[gl_cv_func_snprintf_directive_n],
[
@@ -1224,6 +1280,20 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
[AC_LANG_SOURCE([[
#include <stdio.h>
#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
static char fmtstring[10];
static char buf[100];
int main ()
@@ -1233,7 +1303,7 @@ int main ()
support %n in format strings in read-only memory but not in writable
memory. */
strcpy (fmtstring, "%d %n");
- snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
+ my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
if (count != 6)
return 1;
return 0;
@@ -1248,7 +1318,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 5.
freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
darwin*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on Solaris >= 2.6.
@@ -1285,16 +1355,31 @@ dnl Result is gl_cv_func_snprintf_size1.
AC_DEFUN([gl_SNPRINTF_SIZE1],
[
AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_SNPRINTF_PRESENCE])
AC_CACHE_CHECK([whether snprintf respects a size of 1],
[gl_cv_func_snprintf_size1],
[
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
#include <stdio.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+ va_list args;
+ int ret;
+ va_start (args, format);
+ ret = vsnprintf (buf, size, format, args);
+ va_end (args);
+ return ret;
+}
+#endif
int main()
{
static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
- snprintf (buf, 1, "%d", 12345);
+ my_snprintf (buf, 1, "%d", 12345);
return buf[1] != 'E';
}]])],
[gl_cv_func_snprintf_size1=yes],
@@ -1375,7 +1460,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 5.
freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on Cygwin.
@@ -1455,17 +1540,18 @@ dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . .
dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . .
dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . .
-dnl MacOS X 10.5.8 . . . # # . . . . . . # . . . . . . . .
-dnl MacOS X 10.3.9 . . . . # . . . . . . # . # . . . . . .
+dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . .
+dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . .
dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . .
dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . .
dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . .
dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . .
-dnl Solaris 11 2010-11 . . # # # . . # . . . # . . . . . . . .
+dnl Solaris 11 2011-11 . . # # # . . # . . . # . . . . . . . .
dnl Solaris 10 . . # # # . . # . . . # # . . . . . . .
dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . .
dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # #
-dnl AIX 5.2, 7.1 . . # # # . . . . . . # . . . . . . . .
+dnl AIX 7.1 . . # # # . . . . . . # # . . . . . . .
+dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . .
dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . # . . .
dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . .
dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . #
@@ -1478,4 +1564,7 @@ dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? .
dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . .
dnl Haiku . . . # # # . # . . . . . ? . . ? . . .
dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . .
-dnl mingw # # # # # # . . # # . # # ? . # # # . .
+dnl old mingw / msvcrt # # # # # # . . # # . # # ? . # # # . .
+dnl MSVC 9 # # # # # # # . # # . # # ? # # # # . .
+dnl mingw 2009-2011 . # . # . . . . # # . . . ? . . . . . .
+dnl mingw-w64 2011 # # # # # # . . # # . # # ? . # # # . .
diff --git a/m4/putenv.m4 b/m4/putenv.m4
index de3900b..c33b5b5 100644
--- a/m4/putenv.m4
+++ b/m4/putenv.m4
@@ -1,5 +1,5 @@
-# putenv.m4 serial 17
-dnl Copyright (C) 2002-2011 Free Software Foundation, Inc.
+# putenv.m4 serial 20
+dnl Copyright (C) 2002-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,6 +12,7 @@ dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
AC_DEFUN([gl_FUNC_PUTENV],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([for putenv compatible with GNU and SVID],
[gl_cv_func_svid_putenv],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[
@@ -32,10 +33,24 @@ AC_DEFUN([gl_FUNC_PUTENV],
gl_cv_func_svid_putenv=yes,
gl_cv_func_svid_putenv=no,
dnl When crosscompiling, assume putenv is broken.
- gl_cv_func_svid_putenv=no)
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_svid_putenv="guessing no" ;;
+ esac
+ ])
])
- if test $gl_cv_func_svid_putenv = no; then
- REPLACE_PUTENV=1
- AC_LIBOBJ([putenv])
- fi
+ case "$gl_cv_func_svid_putenv" in
+ *yes) ;;
+ *)
+ REPLACE_PUTENV=1
+ ;;
+ esac
+])
+
+# Prerequisites of lib/putenv.c.
+AC_DEFUN([gl_PREREQ_PUTENV],
+[
+ AC_CHECK_DECLS([_putenv])
])
diff --git a/m4/quotearg.m4 b/m4/quotearg.m4
index ff4a2fa..bc0ef0c 100644
--- a/m4/quotearg.m4
+++ b/m4/quotearg.m4
@@ -1,10 +1,10 @@
-# quotearg.m4 serial 8
-dnl Copyright (C) 2002, 2004-2011 Free Software Foundation, Inc.
+# quotearg.m4 serial 9
+dnl Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free 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_QUOTEARG],
[
- AC_LIBOBJ([quotearg])
+ :
])
diff --git a/m4/raise.m4 b/m4/raise.m4
new file mode 100644
index 0000000..7df3317
--- /dev/null
+++ b/m4/raise.m4
@@ -0,0 +1,34 @@
+# raise.m4 serial 3
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_RAISE],
+[
+ AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_MSVC_INVAL])
+ AC_CHECK_FUNCS([raise])
+ if test $ac_cv_func_raise = no; then
+ HAVE_RAISE=0
+ else
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_RAISE=1
+ fi
+ m4_ifdef([gl_SIGNALBLOCKING], [
+ gl_SIGNALBLOCKING
+ if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+ m4_ifdef([gl_SIGNAL_SIGPIPE], [
+ gl_SIGNAL_SIGPIPE
+ if test $gl_cv_header_signal_h_SIGPIPE != yes; then
+ REPLACE_RAISE=1
+ fi
+ ], [:])
+ fi
+ ])
+ fi
+])
+
+# Prerequisites of lib/raise.c.
+AC_DEFUN([gl_PREREQ_RAISE], [:])
diff --git a/m4/rawmemchr.m4 b/m4/rawmemchr.m4
index 542cba1..8c50054 100644
--- a/m4/rawmemchr.m4
+++ b/m4/rawmemchr.m4
@@ -1,5 +1,5 @@
-# rawmemchr.m4 serial 1
-dnl Copyright (C) 2003, 2007-2011 Free Software Foundation, Inc.
+# rawmemchr.m4 serial 2
+dnl Copyright (C) 2003, 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,10 +10,9 @@ AC_DEFUN([gl_FUNC_RAWMEMCHR],
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- AC_REPLACE_FUNCS([rawmemchr])
+ AC_CHECK_FUNCS([rawmemchr])
if test $ac_cv_func_rawmemchr = no; then
HAVE_RAWMEMCHR=0
- gl_PREREQ_RAWMEMCHR
fi
])
diff --git a/m4/readdir.m4 b/m4/readdir.m4
new file mode 100644
index 0000000..4269bb4
--- /dev/null
+++ b/m4/readdir.m4
@@ -0,0 +1,15 @@
+# readdir.m4 serial 1
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_READDIR],
+[
+ AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+ AC_CHECK_FUNCS([readdir])
+ if test $ac_cv_func_readdir = no; then
+ HAVE_READDIR=0
+ fi
+])
diff --git a/m4/readlink.m4 b/m4/readlink.m4
index a502ca5..96e5042 100644
--- a/m4/readlink.m4
+++ b/m4/readlink.m4
@@ -1,5 +1,5 @@
-# readlink.m4 serial 9
-dnl Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc.
+# readlink.m4 serial 12
+dnl Copyright (C) 2003, 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,11 +7,10 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_READLINK],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_FUNCS_ONCE([readlink])
if test $ac_cv_func_readlink = no; then
HAVE_READLINK=0
- AC_LIBOBJ([readlink])
- gl_PREREQ_READLINK
else
AC_CACHE_CHECK([whether readlink signature is correct],
[gl_cv_decl_readlink_works],
@@ -34,21 +33,31 @@ AC_DEFUN([gl_FUNC_READLINK],
]], [[char buf[20];
return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])],
[gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no],
- [gl_cv_func_readlink_works="guessing no"])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_readlink_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_readlink_works="guessing no" ;;
+ esac
+ ])
rm -f conftest.link conftest.lnk2])
- if test "$gl_cv_func_readlink_works" != yes; then
- AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink
- fails to recognize a trailing slash.])
- REPLACE_READLINK=1
- AC_LIBOBJ([readlink])
- elif test "$gl_cv_decl_readlink_works" != yes; then
- REPLACE_READLINK=1
- AC_LIBOBJ([readlink])
- fi
+ case "$gl_cv_func_readlink_works" in
+ *yes)
+ if test "$gl_cv_decl_readlink_works" != yes; then
+ REPLACE_READLINK=1
+ fi
+ ;;
+ *)
+ AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink
+ fails to recognize a trailing slash.])
+ REPLACE_READLINK=1
+ ;;
+ esac
fi
])
-# Like gl_FUNC_READLINK, except prepare for separate compilation (no AC_LIBOBJ).
+# Like gl_FUNC_READLINK, except prepare for separate compilation
+# (no REPLACE_READLINK, no AC_LIBOBJ).
AC_DEFUN([gl_FUNC_READLINK_SEPARATE],
[
AC_CHECK_FUNCS_ONCE([readlink])
diff --git a/m4/regex.m4 b/m4/regex.m4
index 24198b5..0945c11 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,6 +1,6 @@
-# serial 58
+# serial 64
-# Copyright (C) 1996-2001, 2003-2011 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -27,15 +27,21 @@ AC_DEFUN([gl_REGEX],
# following run test, then default to *not* using the included regex.c.
# If cross compiling, assume the test would fail and use the included
# regex.c.
+ AC_CHECK_DECLS_ONCE([alarm])
AC_CACHE_CHECK([for working re_compile_pattern],
[gl_cv_func_re_compile_pattern_working],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
- [AC_INCLUDES_DEFAULT[
- #include <locale.h>
- #include <limits.h>
- #include <regex.h>
- ]],
+ [[#include <regex.h>
+
+ #include <locale.h>
+ #include <limits.h>
+ #include <string.h>
+ #if HAVE_DECL_ALARM
+ # include <unistd.h>
+ # include <signal.h>
+ #endif
+ ]],
[[int result = 0;
static struct re_pattern_buffer regex;
unsigned char folded_chars[UCHAR_MAX + 1];
@@ -43,26 +49,65 @@ AC_DEFUN([gl_REGEX],
const char *s;
struct re_registers regs;
- /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
- This test needs valgrind to catch the bug on Debian
- GNU/Linux 3.1 x86, but it might catch the bug better
- on other platforms and it shouldn't hurt to try the
- test here. */
+#if HAVE_DECL_ALARM
+ /* Some builds of glibc go into an infinite loop on this test. */
+ signal (SIGALRM, SIG_DFL);
+ alarm (2);
+#endif
if (setlocale (LC_ALL, "en_US.UTF-8"))
{
- static char const pat[] = "insert into";
- static char const data[] =
- "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
- re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE
- | RE_ICASE);
- memset (&regex, 0, sizeof regex);
- s = re_compile_pattern (pat, sizeof pat - 1, &regex);
- if (s)
- result |= 1;
- else if (re_search (&regex, data, sizeof data - 1,
- 0, sizeof data - 1, &regs)
- != -1)
- result |= 1;
+ {
+ /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
+ This test needs valgrind to catch the bug on Debian
+ GNU/Linux 3.1 x86, but it might catch the bug better
+ on other platforms and it shouldn't hurt to try the
+ test here. */
+ static char const pat[] = "insert into";
+ static char const data[] =
+ "\xFF\0\x12\xA2\xAA\xC4\xB1,K\x12\xC4\xB1*\xACK";
+ re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE
+ | RE_ICASE);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+ if (s)
+ result |= 1;
+ else if (re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, &regs)
+ != -1)
+ result |= 1;
+ }
+
+ {
+ /* This test is from glibc bug 15078.
+ The test case is from Andreas Schwab in
+ <http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
+ */
+ static char const pat[] = "[^x]x";
+ static char const data[] =
+ /* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */
+ "\xe1\x80\x80"
+ "\xe1\x80\xbb"
+ "\xe1\x80\xbd"
+ "\xe1\x80\x94"
+ "\xe1\x80\xba"
+ "\xe1\x80\xaf"
+ "\xe1\x80\x95"
+ "\xe1\x80\xba"
+ "x";
+ re_set_syntax (0);
+ memset (&regex, 0, sizeof regex);
+ s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+ if (s)
+ result |= 1;
+ else
+ {
+ i = re_search (&regex, data, sizeof data - 1,
+ 0, sizeof data - 1, 0);
+ if (i != 0 && i != 21)
+ result |= 1;
+ }
+ }
+
if (! setlocale (LC_ALL, "C"))
return 1;
}
@@ -175,6 +220,9 @@ AC_DEFUN([gl_REGEX],
esac
if test $ac_use_included_regex = yes; then
+ AC_DEFINE([_REGEX_INCLUDE_LIMITS_H], [1],
+ [Define if you want <regex.h> to include <limits.h>, so that it
+ consistently overrides <limits.h>'s RE_DUP_MAX.])
AC_DEFINE([_REGEX_LARGE_OFFSETS], [1],
[Define if you want regoff_t to be at least as wide POSIX requires.])
AC_DEFINE([re_syntax_options], [rpl_re_syntax_options],
@@ -207,8 +255,6 @@ AC_DEFUN([gl_REGEX],
[Define to rpl_regerror if the replacement should be used.])
AC_DEFINE([regfree], [rpl_regfree],
[Define to rpl_regfree if the replacement should be used.])
- AC_LIBOBJ([regex])
- gl_PREREQ_REGEX
fi
])
@@ -219,7 +265,9 @@ AC_DEFUN([gl_PREREQ_REGEX],
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([AC_TYPE_MBSTATE_T])
+ AC_REQUIRE([gl_EEMALLOC])
+ AC_REQUIRE([gl_GLIBC21])
AC_CHECK_HEADERS([libintl.h])
AC_CHECK_FUNCS_ONCE([isblank iswctype wcscoll])
- AC_CHECK_DECLS([isblank], [], [], [#include <ctype.h>])
+ AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
])
diff --git a/m4/rename.m4 b/m4/rename.m4
index 6648542..66430aa 100644
--- a/m4/rename.m4
+++ b/m4/rename.m4
@@ -1,6 +1,6 @@
-# serial 23
+# serial 26
-# Copyright (C) 2001, 2003, 2005-2006, 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005-2006, 2009-2013 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.
@@ -54,16 +54,24 @@ AC_DEFUN([gl_FUNC_RENAME],
[gl_cv_func_rename_slash_dst_works=yes],
[gl_cv_func_rename_slash_dst_works=no],
dnl When crosscompiling, assume rename is broken.
- [gl_cv_func_rename_slash_dst_works="guessing no"])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_rename_slash_dst_works="guessing no" ;;
+ esac
+ ])
rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
])
- if test "x$gl_cv_func_rename_slash_dst_works" != xyes; then
- AC_LIBOBJ([rename])
- REPLACE_RENAME=1
- AC_DEFINE([RENAME_TRAILING_SLASH_DEST_BUG], [1],
- [Define if rename does not correctly handle slashes on the destination
- argument, such as on Solaris 10 or NetBSD 1.6.])
- fi
+ case "$gl_cv_func_rename_slash_dst_works" in
+ *yes) ;;
+ *)
+ REPLACE_RENAME=1
+ AC_DEFINE([RENAME_TRAILING_SLASH_DEST_BUG], [1],
+ [Define if rename does not correctly handle slashes on the destination
+ argument, such as on Solaris 10 or NetBSD 1.6.])
+ ;;
+ esac
dnl SunOS 4.1.1_U1 mistakenly forbids rename("dir/","name").
dnl Solaris 9 mistakenly allows rename("file/","name").
@@ -98,58 +106,79 @@ AC_DEFUN([gl_FUNC_RENAME],
[gl_cv_func_rename_slash_src_works=yes],
[gl_cv_func_rename_slash_src_works=no],
dnl When crosscompiling, assume rename is broken.
- [gl_cv_func_rename_slash_src_works="guessing no"])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_rename_slash_src_works="guessing no" ;;
+ esac
+ ])
rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
])
- if test "x$gl_cv_func_rename_slash_src_works" != xyes; then
- AC_LIBOBJ([rename])
- REPLACE_RENAME=1
- AC_DEFINE([RENAME_TRAILING_SLASH_SOURCE_BUG], [1],
- [Define if rename does not correctly handle slashes on the source
- argument, such as on Solaris 9 or cygwin 1.5.])
- fi
+ case "$gl_cv_func_rename_slash_src_works" in
+ *yes) ;;
+ *)
+ REPLACE_RENAME=1
+ AC_DEFINE([RENAME_TRAILING_SLASH_SOURCE_BUG], [1],
+ [Define if rename does not correctly handle slashes on the source
+ argument, such as on Solaris 9 or cygwin 1.5.])
+ ;;
+ esac
dnl NetBSD 1.6 and cygwin 1.5.x mistakenly reduce hard link count
dnl on rename("h1","h2").
dnl This bug requires stat'ting targets prior to attempting rename.
+ AC_CHECK_FUNCS_ONCE([link])
AC_CACHE_CHECK([whether rename manages hard links correctly],
[gl_cv_func_rename_link_works],
- [rm -rf conftest.f conftest.f1
- if touch conftest.f && ln conftest.f conftest.f1 &&
- set x `ls -i conftest.f conftest.f1` && test "$2" = "$4"; then
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM([[
-# include <stdio.h>
-# include <stdlib.h>
-# include <unistd.h>
- ]],
- [[int result = 0;
- if (rename ("conftest.f", "conftest.f1"))
- result |= 1;
- if (unlink ("conftest.f1"))
- result |= 2;
- if (rename ("conftest.f", "conftest.f"))
- result |= 4;
- if (rename ("conftest.f1", "conftest.f1") == 0)
- result |= 8;
- return result;
- ]])],
- [gl_cv_func_rename_link_works=yes],
- [gl_cv_func_rename_link_works=no],
- dnl When crosscompiling, assume rename is broken.
- [gl_cv_func_rename_link_works="guessing no"])
- else
- gl_cv_func_rename_link_works="guessing no"
- fi
- rm -rf conftest.f conftest.f1
- ])
- if test "x$gl_cv_func_rename_link_works" != xyes; then
- AC_LIBOBJ([rename])
- REPLACE_RENAME=1
- AC_DEFINE([RENAME_HARD_LINK_BUG], [1],
- [Define if rename fails to leave hard links alone, as on NetBSD 1.6
- or Cygwin 1.5.])
- fi
+ [if test $ac_cv_func_link = yes; then
+ rm -rf conftest.f conftest.f1
+ if touch conftest.f && ln conftest.f conftest.f1 &&
+ set x `ls -i conftest.f conftest.f1` && test "$2" = "$4"; then
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+# include <stdio.h>
+# include <stdlib.h>
+# include <unistd.h>
+ ]],
+ [[int result = 0;
+ if (rename ("conftest.f", "conftest.f1"))
+ result |= 1;
+ if (unlink ("conftest.f1"))
+ result |= 2;
+ if (rename ("conftest.f", "conftest.f"))
+ result |= 4;
+ if (rename ("conftest.f1", "conftest.f1") == 0)
+ result |= 8;
+ return result;
+ ]])],
+ [gl_cv_func_rename_link_works=yes],
+ [gl_cv_func_rename_link_works=no],
+ dnl When crosscompiling, assume rename is broken.
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_rename_link_works="guessing no" ;;
+ esac
+ ])
+ else
+ gl_cv_func_rename_link_works="guessing no"
+ fi
+ rm -rf conftest.f conftest.f1
+ else
+ gl_cv_func_rename_link_works=yes
+ fi
+ ])
+ case "$gl_cv_func_rename_link_works" in
+ *yes) ;;
+ *)
+ REPLACE_RENAME=1
+ AC_DEFINE([RENAME_HARD_LINK_BUG], [1],
+ [Define if rename fails to leave hard links alone, as on NetBSD 1.6
+ or Cygwin 1.5.])
+ ;;
+ esac
dnl Cygwin 1.5.x mistakenly allows rename("dir","file").
dnl mingw mistakenly forbids rename("dir1","dir2").
@@ -175,14 +204,22 @@ AC_DEFUN([gl_FUNC_RENAME],
[gl_cv_func_rename_dest_works=yes],
[gl_cv_func_rename_dest_works=no],
dnl When crosscompiling, assume rename is broken.
- [gl_cv_func_rename_dest_works="guessing no"])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_rename_dest_works="guessing no" ;;
+ esac
+ ])
rm -rf conftest.f conftest.d1 conftest.d2
])
- if test "x$gl_cv_func_rename_dest_works" != xyes; then
- AC_LIBOBJ([rename])
- REPLACE_RENAME=1
- AC_DEFINE([RENAME_DEST_EXISTS_BUG], [1],
- [Define if rename does not work when the destination file exists,
- as on Cygwin 1.5 or Windows.])
- fi
+ case "$gl_cv_func_rename_dest_works" in
+ *yes) ;;
+ *)
+ REPLACE_RENAME=1
+ AC_DEFINE([RENAME_DEST_EXISTS_BUG], [1],
+ [Define if rename does not work when the destination file exists,
+ as on Cygwin 1.5 or Windows.])
+ ;;
+ esac
])
diff --git a/m4/rmdir.m4 b/m4/rmdir.m4
index 41705a1..f6a02dd 100644
--- a/m4/rmdir.m4
+++ b/m4/rmdir.m4
@@ -1,5 +1,5 @@
-# rmdir.m4 serial 10
-dnl Copyright (C) 2002, 2005, 2009-2011 Free Software Foundation, Inc.
+# rmdir.m4 serial 13
+dnl Copyright (C) 2002, 2005, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +7,9 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_RMDIR],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
dnl Detect cygwin 1.5.x bug.
+ AC_CHECK_HEADERS_ONCE([unistd.h])
AC_CACHE_CHECK([whether rmdir works], [gl_cv_func_rmdir_works],
[mkdir conftest.dir
touch conftest.file
@@ -15,7 +17,11 @@ AC_DEFUN([gl_FUNC_RMDIR],
[AC_LANG_PROGRAM(
[[#include <stdio.h>
#include <errno.h>
- #include <unistd.h>
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #else /* on Windows with MSVC */
+ # include <direct.h>
+ #endif
]], [[int result = 0;
if (!rmdir ("conftest.file/"))
result |= 1;
@@ -26,10 +32,18 @@ AC_DEFUN([gl_FUNC_RMDIR],
return result;
]])],
[gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
- [gl_cv_func_rmdir_works="guessing no"])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_rmdir_works="guessing no" ;;
+ esac
+ ])
rm -rf conftest.dir conftest.file])
- if test x"$gl_cv_func_rmdir_works" != xyes; then
- REPLACE_RMDIR=1
- AC_LIBOBJ([rmdir])
- fi
+ case "$gl_cv_func_rmdir_works" in
+ *yes) ;;
+ *)
+ REPLACE_RMDIR=1
+ ;;
+ esac
])
diff --git a/m4/sched_h.m4 b/m4/sched_h.m4
index 6a46e47..931358f 100644
--- a/m4/sched_h.m4
+++ b/m4/sched_h.m4
@@ -1,5 +1,5 @@
-# sched_h.m4 serial 3
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# sched_h.m4 serial 6
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -13,6 +13,7 @@ AC_DEFUN([gl_SCHED_H],
#include <sched.h>
struct sched_param a;
int b[] = { SCHED_FIFO, SCHED_RR, SCHED_OTHER };
+ pid_t t1;
]])],
[SCHED_H=''],
[SCHED_H='sched.h'
@@ -30,6 +31,10 @@ AC_DEFUN([gl_SCHED_H],
[HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
[#include <sched.h>])
AC_SUBST([HAVE_STRUCT_SCHED_PARAM])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
])
AC_SUBST([SCHED_H])
+ AM_CONDITIONAL([GL_GENERATE_SCHED_H], [test -n "$SCHED_H"])
])
diff --git a/m4/secure_getenv.m4 b/m4/secure_getenv.m4
new file mode 100644
index 0000000..5da5298
--- /dev/null
+++ b/m4/secure_getenv.m4
@@ -0,0 +1,25 @@
+# Look up an environment variable more securely.
+dnl Copyright 2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SECURE_GETENV],
+[
+ dnl Persuade glibc <stdlib.h> to declare secure_getenv().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([secure_getenv])
+ if test $ac_cv_func_secure_getenv = no; then
+ HAVE_SECURE_GETENV=0
+ fi
+])
+
+# Prerequisites of lib/secure_getenv.c.
+AC_DEFUN([gl_PREREQ_SECURE_GETENV], [
+ AC_CHECK_FUNCS([__secure_getenv])
+ if test $ac_cv_func___secure_getenv = no; then
+ AC_CHECK_FUNCS([issetugid])
+ fi
+])
diff --git a/m4/setenv.m4 b/m4/setenv.m4
index ba619b0..cb5351a 100644
--- a/m4/setenv.m4
+++ b/m4/setenv.m4
@@ -1,5 +1,5 @@
-# setenv.m4 serial 21
-dnl Copyright (C) 2001-2004, 2006-2011 Free Software Foundation, Inc.
+# setenv.m4 serial 26
+dnl Copyright (C) 2001-2004, 2006-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,20 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_SETENV],
[
AC_REQUIRE([gl_FUNC_SETENV_SEPARATE])
- if test $HAVE_SETENV$REPLACE_SETENV != 10; then
- AC_LIBOBJ([setenv])
- fi
-])
-
-# Like gl_FUNC_SETENV, except prepare for separate compilation (no AC_LIBOBJ).
-AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
-[
- AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- AC_CHECK_DECLS_ONCE([setenv])
- if test $ac_cv_have_decl_setenv = no; then
- HAVE_DECL_SETENV=0
- fi
- AC_CHECK_FUNCS_ONCE([setenv])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
if test $ac_cv_func_setenv = no; then
HAVE_SETENV=0
else
@@ -47,27 +34,48 @@ AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
return result;
]])],
[gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
- [gl_cv_func_setenv_works="guessing no"])])
- if test "$gl_cv_func_setenv_works" != yes; then
- REPLACE_SETENV=1
- AC_LIBOBJ([setenv])
- fi
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_setenv_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_setenv_works="guessing no" ;;
+ esac
+ ])])
+ case "$gl_cv_func_setenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_SETENV=1
+ ;;
+ esac
fi
+])
+
+# Like gl_FUNC_SETENV, except prepare for separate compilation
+# (no REPLACE_SETENV, no AC_LIBOBJ).
+AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
+[
+ AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_CHECK_DECLS_ONCE([setenv])
+ if test $ac_cv_have_decl_setenv = no; then
+ HAVE_DECL_SETENV=0
+ fi
+ AC_CHECK_FUNCS_ONCE([setenv])
gl_PREREQ_SETENV
])
AC_DEFUN([gl_FUNC_UNSETENV],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_DECLS_ONCE([unsetenv])
if test $ac_cv_have_decl_unsetenv = no; then
HAVE_DECL_UNSETENV=0
fi
AC_CHECK_FUNCS([unsetenv])
if test $ac_cv_func_unsetenv = no; then
- AC_LIBOBJ([unsetenv])
- gl_PREREQ_UNSETENV
+ HAVE_UNSETENV=0
else
+ HAVE_UNSETENV=1
dnl Some BSDs return void, failing to do error checking.
AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
[AC_COMPILE_IFELSE(
@@ -80,11 +88,7 @@ extern
#ifdef __cplusplus
"C"
#endif
-#if defined(__STDC__) || defined(__cplusplus)
int unsetenv (const char *name);
-#else
-int unsetenv();
-#endif
]],
[[]])],
[gt_cv_func_unsetenv_ret='int'],
@@ -93,7 +97,6 @@ int unsetenv();
AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void
instead of int.])
REPLACE_UNSETENV=1
- AC_LIBOBJ([unsetenv])
fi
dnl Solaris 10 unsetenv does not remove all copies of a name.
@@ -123,11 +126,19 @@ int unsetenv();
if (getenv ("a")) return 6;
]])],
[gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no],
- [gl_cv_func_unsetenv_works="guessing no"])])
- if test "$gl_cv_func_unsetenv_works" != yes; then
- REPLACE_UNSETENV=1
- AC_LIBOBJ([unsetenv])
- fi
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_unsetenv_works="guessing no" ;;
+ esac
+ ])])
+ case "$gl_cv_func_unsetenv_works" in
+ *yes) ;;
+ *)
+ REPLACE_UNSETENV=1
+ ;;
+ esac
fi
])
diff --git a/m4/setlocale.m4 b/m4/setlocale.m4
index 6672c34..1133e65 100644
--- a/m4/setlocale.m4
+++ b/m4/setlocale.m4
@@ -1,5 +1,5 @@
-# setlocale.m4 serial 1
-dnl Copyright (C) 2011 Free Software Foundation, Inc.
+# setlocale.m4 serial 4
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,12 +12,14 @@ AC_DEFUN([gl_FUNC_SETLOCALE],
dnl On native Windows systems, setlocale(category,NULL) does not look at
dnl the environment variables LC_ALL, category, and LANG.
mingw*) REPLACE_SETLOCALE=1 ;;
+ dnl On Cygwin 1.5.x, setlocale always succeeds but setlocale(LC_CTYPE,NULL)
+ dnl is then still "C".
+ cygwin*)
+ case `uname -r` in
+ 1.5.*) REPLACE_SETLOCALE=1 ;;
+ esac
+ ;;
esac
- if test $REPLACE_SETLOCALE = 1; then
- gl_REPLACE_LOCALE_H
- AC_LIBOBJ([setlocale])
- gl_PREREQ_SETLOCALE
- fi
])
# Prerequisites of lib/setlocale.c.
diff --git a/m4/sig_atomic_t.m4 b/m4/sig_atomic_t.m4
index 4ffbfeb..f2dfd59 100644
--- a/m4/sig_atomic_t.m4
+++ b/m4/sig_atomic_t.m4
@@ -1,5 +1,5 @@
-# sig_atomic_t.m4 serial 2
-dnl Copyright (C) 2003, 2009-2011 Free Software Foundation, Inc.
+# sig_atomic_t.m4 serial 3
+dnl Copyright (C) 2003, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,6 +9,6 @@ AC_DEFUN([gt_TYPE_SIG_ATOMIC_T],
AC_CHECK_TYPES([sig_atomic_t], ,
[AC_DEFINE([sig_atomic_t], [int],
[Define as an integer type suitable for memory locations that can be
- accessed atomically even in the presence of asynchnonous signals.])],
+ accessed atomically even in the presence of asynchronous signals.])],
[#include <signal.h>])
])
diff --git a/m4/sigaction.m4 b/m4/sigaction.m4
index ce82232..116b068 100644
--- a/m4/sigaction.m4
+++ b/m4/sigaction.m4
@@ -1,5 +1,5 @@
-# sigaction.m4 serial 5
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# sigaction.m4 serial 7
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -17,8 +17,6 @@ AC_DEFUN([gl_SIGACTION],
fi
else
HAVE_SIGACTION=0
- AC_LIBOBJ([sigaction])
- gl_PREREQ_SIGACTION
fi
])
@@ -39,7 +37,4 @@ AC_DEFUN([gl_PREREQ_SIGACTION],
])
# Prerequisites of lib/sig-handler.h.
-AC_DEFUN([gl_PREREQ_SIG_HANDLER_H],
-[
- AC_REQUIRE([AC_C_INLINE])
-])
+AC_DEFUN([gl_PREREQ_SIG_HANDLER_H], [:])
diff --git a/m4/signal_h.m4 b/m4/signal_h.m4
index 77eb125..3de9f27 100644
--- a/m4/signal_h.m4
+++ b/m4/signal_h.m4
@@ -1,5 +1,5 @@
-# signal_h.m4 serial 11
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# signal_h.m4 serial 18
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,22 +7,49 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_SIGNAL_H],
[
AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+ AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
gl_NEXT_HEADERS([signal.h])
+
# AIX declares sig_atomic_t to already include volatile, and C89 compilers
# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
AC_CHECK_TYPE([volatile sig_atomic_t], [],
[HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0], [[
#include <signal.h>
]])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
AC_REQUIRE([AC_TYPE_UID_T])
+ dnl Persuade glibc <signal.h> to define sighandler_t.
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ AC_CHECK_TYPE([sighandler_t], [], [HAVE_SIGHANDLER_T=0], [[
+#include <signal.h>
+ ]])
+
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[#include <signal.h>
- ]], [sigaction sigaddset sigdelset sigemptyset sigfillset sigismember
+ ]], [pthread_sigmask sigaction
+ sigaddset sigdelset sigemptyset sigfillset sigismember
sigpending sigprocmask])
])
+AC_DEFUN([gl_CHECK_TYPE_SIGSET_T],
+[
+ AC_CHECK_TYPES([sigset_t],
+ [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no],
+ [[
+ #include <signal.h>
+ /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
+ #include <sys/types.h>
+ ]])
+ if test $gl_cv_type_sigset_t != yes; then
+ HAVE_SIGSET_T=0
+ fi
+])
+
AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
@@ -34,11 +61,15 @@ AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
[
+ GNULIB_PTHREAD_SIGMASK=0; AC_SUBST([GNULIB_PTHREAD_SIGMASK])
+ GNULIB_RAISE=0; AC_SUBST([GNULIB_RAISE])
GNULIB_SIGNAL_H_SIGPIPE=0; AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE])
GNULIB_SIGPROCMASK=0; AC_SUBST([GNULIB_SIGPROCMASK])
GNULIB_SIGACTION=0; AC_SUBST([GNULIB_SIGACTION])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING])
+ HAVE_PTHREAD_SIGMASK=1; AC_SUBST([HAVE_PTHREAD_SIGMASK])
+ HAVE_RAISE=1; AC_SUBST([HAVE_RAISE])
HAVE_SIGSET_T=1; AC_SUBST([HAVE_SIGSET_T])
HAVE_SIGINFO_T=1; AC_SUBST([HAVE_SIGINFO_T])
HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION])
@@ -46,4 +77,7 @@ AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION])
HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T])
+ HAVE_SIGHANDLER_T=1; AC_SUBST([HAVE_SIGHANDLER_T])
+ REPLACE_PTHREAD_SIGMASK=0; AC_SUBST([REPLACE_PTHREAD_SIGMASK])
+ REPLACE_RAISE=0; AC_SUBST([REPLACE_RAISE])
])
diff --git a/m4/signalblocking.m4 b/m4/signalblocking.m4
index 5ad8dbf..a00e704 100644
--- a/m4/signalblocking.m4
+++ b/m4/signalblocking.m4
@@ -1,5 +1,5 @@
-# signalblocking.m4 serial 10
-dnl Copyright (C) 2001-2002, 2006-2011 Free Software Foundation, Inc.
+# signalblocking.m4 serial 14
+dnl Copyright (C) 2001-2002, 2006-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -12,31 +12,14 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_SIGNALBLOCKING],
[
AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
- signals_not_posix=
- AC_EGREP_HEADER([sigset_t], [signal.h], , [signals_not_posix=1])
- if test -z "$signals_not_posix"; then
+ AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
+ if test $gl_cv_type_sigset_t = yes; then
AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1])
fi
if test -z "$gl_cv_func_sigprocmask"; then
HAVE_POSIX_SIGNALBLOCKING=0
- AC_LIBOBJ([sigprocmask])
- gl_PREREQ_SIGPROCMASK
fi
])
-# Prerequisites of the part of lib/signal.in.h and of lib/sigprocmask.c.
-AC_DEFUN([gl_PREREQ_SIGPROCMASK],
-[
- AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
- AC_CHECK_TYPES([sigset_t],
- [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no],
- [#include <signal.h>
-/* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
-#include <sys/types.h>])
- if test $gl_cv_type_sigset_t != yes; then
- HAVE_SIGSET_T=0
- fi
- dnl HAVE_SIGSET_T is 1 if the system lacks the sigprocmask function but has
- dnl the sigset_t type.
- AC_SUBST([HAVE_SIGSET_T])
-])
+# Prerequisites of lib/sigprocmask.c.
+AC_DEFUN([gl_PREREQ_SIGPROCMASK], [:])
diff --git a/m4/signbit.m4 b/m4/signbit.m4
index 6973a71..d58caaf 100644
--- a/m4/signbit.m4
+++ b/m4/signbit.m4
@@ -1,5 +1,5 @@
-# signbit.m4 serial 9
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# signbit.m4 serial 13
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_SIGNBIT],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([for signbit macro], [gl_cv_func_signbit],
[
AC_RUN_IFELSE(
@@ -27,7 +28,13 @@ AC_DEFUN([gl_SIGNBIT],
])],
[gl_cv_func_signbit=yes],
[gl_cv_func_signbit=no],
- [gl_cv_func_signbit="guessing no"])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_signbit="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_signbit="guessing no" ;;
+ esac
+ ])
])
dnl GCC 4.0 and newer provides three built-ins for signbit.
dnl They can be used without warnings, also in C++, regardless of <math.h>.
@@ -50,89 +57,99 @@ AC_DEFUN([gl_SIGNBIT],
])],
[gl_cv_func_signbit_gcc=yes],
[gl_cv_func_signbit_gcc=no],
- [gl_cv_func_signbit_gcc="guessing no"])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_signbit_gcc="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_signbit_gcc="guessing no" ;;
+ esac
+ ])
])
dnl Use the compiler built-ins whenever possible, because they are more
dnl efficient than the system library functions (if they exist).
- if test "$gl_cv_func_signbit_gcc" = yes; then
- REPLACE_SIGNBIT_USING_GCC=1
- else
- if test "$gl_cv_func_signbit" != yes; then
- REPLACE_SIGNBIT=1
- AC_LIBOBJ([signbitf])
- AC_LIBOBJ([signbitd])
- AC_LIBOBJ([signbitl])
- gl_FLOAT_SIGN_LOCATION
- gl_DOUBLE_SIGN_LOCATION
- gl_LONG_DOUBLE_SIGN_LOCATION
- if test "$gl_cv_cc_float_signbit" = unknown; then
- dnl Test whether copysignf() is declared.
- AC_CHECK_DECLS([copysignf], , , [#include <math.h>])
- if test "$ac_cv_have_decl_copysignf" = yes; then
- dnl Test whether copysignf() can be used without libm.
- AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
- [gl_cv_func_copysignf_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- float x, y;]],
- [[return copysignf (x, y) < 0;]])],
- [gl_cv_func_copysignf_no_libm=yes],
- [gl_cv_func_copysignf_no_libm=no])
- ])
- if test $gl_cv_func_copysignf_no_libm = yes; then
- AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1],
- [Define if the copysignf function is declared in <math.h> and available in libc.])
+ case "$gl_cv_func_signbit_gcc" in
+ *yes)
+ REPLACE_SIGNBIT_USING_GCC=1
+ ;;
+ *)
+ case "$gl_cv_func_signbit" in
+ *yes) ;;
+ *)
+ dnl REPLACE_SIGNBIT=1 makes sure the signbit[fdl] functions get built.
+ REPLACE_SIGNBIT=1
+ gl_FLOAT_SIGN_LOCATION
+ gl_DOUBLE_SIGN_LOCATION
+ gl_LONG_DOUBLE_SIGN_LOCATION
+ if test "$gl_cv_cc_float_signbit" = unknown; then
+ dnl Test whether copysignf() is declared.
+ AC_CHECK_DECLS([copysignf], , , [[#include <math.h>]])
+ if test "$ac_cv_have_decl_copysignf" = yes; then
+ dnl Test whether copysignf() can be used without libm.
+ AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
+ [gl_cv_func_copysignf_no_libm],
+ [
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <math.h>
+ float x, y;]],
+ [[return copysignf (x, y) < 0;]])],
+ [gl_cv_func_copysignf_no_libm=yes],
+ [gl_cv_func_copysignf_no_libm=no])
+ ])
+ if test $gl_cv_func_copysignf_no_libm = yes; then
+ AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1],
+ [Define if the copysignf function is declared in <math.h> and available in libc.])
+ fi
+ fi
fi
- fi
- fi
- if test "$gl_cv_cc_double_signbit" = unknown; then
- dnl Test whether copysign() is declared.
- AC_CHECK_DECLS([copysign], , , [#include <math.h>])
- if test "$ac_cv_have_decl_copysign" = yes; then
- dnl Test whether copysign() can be used without libm.
- AC_CACHE_CHECK([whether copysign can be used without linking with libm],
- [gl_cv_func_copysign_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- double x, y;]],
- [[return copysign (x, y) < 0;]])],
- [gl_cv_func_copysign_no_libm=yes],
- [gl_cv_func_copysign_no_libm=no])
- ])
- if test $gl_cv_func_copysign_no_libm = yes; then
- AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1],
- [Define if the copysign function is declared in <math.h> and available in libc.])
+ if test "$gl_cv_cc_double_signbit" = unknown; then
+ dnl Test whether copysign() is declared.
+ AC_CHECK_DECLS([copysign], , , [[#include <math.h>]])
+ if test "$ac_cv_have_decl_copysign" = yes; then
+ dnl Test whether copysign() can be used without libm.
+ AC_CACHE_CHECK([whether copysign can be used without linking with libm],
+ [gl_cv_func_copysign_no_libm],
+ [
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <math.h>
+ double x, y;]],
+ [[return copysign (x, y) < 0;]])],
+ [gl_cv_func_copysign_no_libm=yes],
+ [gl_cv_func_copysign_no_libm=no])
+ ])
+ if test $gl_cv_func_copysign_no_libm = yes; then
+ AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1],
+ [Define if the copysign function is declared in <math.h> and available in libc.])
+ fi
+ fi
fi
- fi
- fi
- if test "$gl_cv_cc_long_double_signbit" = unknown; then
- dnl Test whether copysignl() is declared.
- AC_CHECK_DECLS([copysignl], , , [#include <math.h>])
- if test "$ac_cv_have_decl_copysignl" = yes; then
- dnl Test whether copysignl() can be used without libm.
- AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
- [gl_cv_func_copysignl_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- long double x, y;]],
- [[return copysignl (x, y) < 0;]])],
- [gl_cv_func_copysignl_no_libm=yes],
- [gl_cv_func_copysignl_no_libm=no])
- ])
- if test $gl_cv_func_copysignl_no_libm = yes; then
- AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1],
- [Define if the copysignl function is declared in <math.h> and available in libc.])
+ if test "$gl_cv_cc_long_double_signbit" = unknown; then
+ dnl Test whether copysignl() is declared.
+ AC_CHECK_DECLS([copysignl], , , [[#include <math.h>]])
+ if test "$ac_cv_have_decl_copysignl" = yes; then
+ dnl Test whether copysignl() can be used without libm.
+ AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
+ [gl_cv_func_copysignl_no_libm],
+ [
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <math.h>
+ long double x, y;]],
+ [[return copysignl (x, y) < 0;]])],
+ [gl_cv_func_copysignl_no_libm=yes],
+ [gl_cv_func_copysignl_no_libm=no])
+ ])
+ if test $gl_cv_func_copysignl_no_libm = yes; then
+ AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1],
+ [Define if the copysignl function is declared in <math.h> and available in libc.])
+ fi
+ fi
fi
- fi
- fi
- fi
- fi
+ ;;
+ esac
+ ;;
+ esac
])
AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [[
@@ -153,7 +170,7 @@ double m0d = -p0d;
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
So we use another constant expression instead.
But that expression does not work on other platforms, such as when
- cross-compiling to PowerPC on MacOS X 10.5. */
+ cross-compiling to PowerPC on Mac OS X 10.5. */
long double p0l = 0.0L;
#if defined __hpux || defined __sgi
long double m0l = -LDBL_MIN * LDBL_MIN;
diff --git a/m4/sigpipe.m4 b/m4/sigpipe.m4
new file mode 100644
index 0000000..169889d
--- /dev/null
+++ b/m4/sigpipe.m4
@@ -0,0 +1,29 @@
+# sigpipe.m4 serial 2
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Tests whether SIGPIPE is provided by <signal.h>.
+dnl Sets gl_cv_header_signal_h_SIGPIPE.
+AC_DEFUN([gl_SIGNAL_SIGPIPE],
+[
+ dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+ dnl once only, before all statements that occur in other macros.
+ AC_REQUIRE([gl_SIGNAL_SIGPIPE_BODY])
+])
+
+AC_DEFUN([gl_SIGNAL_SIGPIPE_BODY],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([for SIGPIPE], [gl_cv_header_signal_h_SIGPIPE], [
+ AC_EGREP_CPP([booboo],[
+#include <signal.h>
+#if !defined SIGPIPE
+booboo
+#endif
+ ],
+ [gl_cv_header_signal_h_SIGPIPE=no],
+ [gl_cv_header_signal_h_SIGPIPE=yes])
+ ])
+])
diff --git a/m4/size_max.m4 b/m4/size_max.m4
index e807098..4b247ab 100644
--- a/m4/size_max.m4
+++ b/m4/size_max.m4
@@ -1,5 +1,5 @@
# size_max.m4 serial 10
-dnl Copyright (C) 2003, 2005-2006, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2006, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sleep.m4 b/m4/sleep.m4
new file mode 100644
index 0000000..a27baa6
--- /dev/null
+++ b/m4/sleep.m4
@@ -0,0 +1,62 @@
+# sleep.m4 serial 7
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SLEEP],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ dnl We expect to see the declaration of sleep() in a header file.
+ dnl Older versions of mingw have a sleep() function that is an alias to
+ dnl _sleep() in MSVCRT. It has a different signature than POSIX sleep():
+ dnl it takes the number of milliseconds as argument and returns void.
+ dnl mingw does not declare this function.
+ AC_CHECK_DECLS([sleep], , , [[#include <unistd.h>]])
+ AC_CHECK_FUNCS_ONCE([sleep])
+ if test $ac_cv_have_decl_sleep != yes; then
+ HAVE_SLEEP=0
+ else
+ dnl Cygwin 1.5.x has a bug where sleep can't exceed 49.7 days.
+ AC_CACHE_CHECK([for working sleep], [gl_cv_func_sleep_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <errno.h>
+#include <unistd.h>
+#include <signal.h>
+static void
+handle_alarm (int sig)
+{
+ if (sig != SIGALRM)
+ _exit (2);
+}
+]], [[
+ /* Failure to compile this test due to missing alarm is okay,
+ since all such platforms (mingw) also lack sleep. */
+ unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */
+ unsigned int remaining;
+ signal (SIGALRM, handle_alarm);
+ alarm (1);
+ remaining = sleep (pentecost);
+ if (remaining > pentecost)
+ return 3;
+ if (remaining <= pentecost - 10)
+ return 4;
+ return 0;
+ ]])],
+ [gl_cv_func_sleep_works=yes], [gl_cv_func_sleep_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_sleep_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_sleep_works="guessing no" ;;
+ esac
+ ])])
+ case "$gl_cv_func_sleep_works" in
+ *yes) ;;
+ *)
+ REPLACE_SLEEP=1
+ ;;
+ esac
+ fi
+])
diff --git a/m4/snprintf.m4 b/m4/snprintf.m4
index 8aa5dbe..3698e84 100644
--- a/m4/snprintf.m4
+++ b/m4/snprintf.m4
@@ -1,9 +1,13 @@
-# snprintf.m4 serial 5
-dnl Copyright (C) 2002-2004, 2007-2011 Free Software Foundation, Inc.
+# snprintf.m4 serial 6
+dnl Copyright (C) 2002-2004, 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free 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 Libintl 0.17 will replace snprintf only if it does not support %1$s,
+dnl but defers to any gnulib snprintf replacements. Therefore, gnulib
+dnl must guarantee that the decision for replacing snprintf is a superset
+dnl of the reasons checked by libintl.
AC_DEFUN([gl_FUNC_SNPRINTF],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
@@ -16,7 +20,12 @@ AC_DEFUN([gl_FUNC_SNPRINTF],
gl_SNPRINTF_RETVAL_C99
case "$gl_cv_func_snprintf_retval_c99" in
*yes)
- gl_cv_func_snprintf_usable=yes
+ gl_PRINTF_POSITIONS
+ case "$gl_cv_func_printf_positions" in
+ *yes)
+ gl_cv_func_snprintf_usable=yes
+ ;;
+ esac
;;
esac
;;
diff --git a/m4/spawn-pipe.m4 b/m4/spawn-pipe.m4
index 05df507..d272935 100644
--- a/m4/spawn-pipe.m4
+++ b/m4/spawn-pipe.m4
@@ -1,5 +1,5 @@
-# spawn-pipe.m4 serial 1
-dnl Copyright (C) 2004, 2008-2011 Free Software Foundation, Inc.
+# spawn-pipe.m4 serial 2
+dnl Copyright (C) 2004, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,5 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_SPAWN_PIPE],
[
dnl Prerequisites of lib/spawn-pipe.c.
- AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([AC_TYPE_MODE_T])
])
diff --git a/m4/spawn_h.m4 b/m4/spawn_h.m4
index a044e37..ba08c5d 100644
--- a/m4/spawn_h.m4
+++ b/m4/spawn_h.m4
@@ -1,5 +1,5 @@
-# spawn_h.m4 serial 12
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# spawn_h.m4 serial 16
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -28,10 +28,15 @@ AC_DEFUN([gl_SPAWN_H],
HAVE_SPAWN_H=0
HAVE_POSIX_SPAWNATTR_T=0
HAVE_POSIX_SPAWN_FILE_ACTIONS_T=0
- gl_REPLACE_SPAWN_H
fi
AC_SUBST([HAVE_SPAWN_H])
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Ensure the type mode_t gets defined.
+ AC_REQUIRE([AC_TYPE_MODE_T])
+
AC_REQUIRE([gl_HAVE_POSIX_SPAWN])
AC_REQUIRE([AC_C_RESTRICT])
@@ -65,13 +70,6 @@ AC_DEFUN([gl_HAVE_POSIX_SPAWN],
fi
])
-dnl Unconditionally enables the replacement of <spawn.h>.
-AC_DEFUN([gl_REPLACE_SPAWN_H],
-[
- dnl This is a no-op, because <spawn.h> is always overridden.
- :
-])
-
AC_DEFUN([gl_SPAWN_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
@@ -110,4 +108,10 @@ AC_DEFUN([gl_SPAWN_H_DEFAULTS],
HAVE_POSIX_SPAWN_FILE_ACTIONS_T=1;
AC_SUBST([HAVE_POSIX_SPAWN_FILE_ACTIONS_T])
REPLACE_POSIX_SPAWN=0; AC_SUBST([REPLACE_POSIX_SPAWN])
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0;
+ AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE])
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0;
+ AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2])
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0;
+ AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN])
])
diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4
index d712752..6338134 100644
--- a/m4/ssize_t.m4
+++ b/m4/ssize_t.m4
@@ -1,5 +1,5 @@
# ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/stat.m4 b/m4/stat.m4
index 27f82d5..2456297 100644
--- a/m4/stat.m4
+++ b/m4/stat.m4
@@ -1,6 +1,6 @@
-# serial 7
+# serial 11
-# Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -23,8 +23,9 @@ AC_DEFUN([gl_FUNC_STAT],
mingw*) gl_cv_func_stat_dir_slash="guessing no";;
*) gl_cv_func_stat_dir_slash="guessing yes";;
esac])])
- dnl AIX 7.1, Solaris 9 mistakenly succeed on stat("file/")
- dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/")
+ dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
+ dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
+ dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
AC_CACHE_CHECK([whether stat handles trailing slashes on files],
[gl_cv_func_stat_file_slash],
[touch conftest.tmp
@@ -46,7 +47,13 @@ AC_DEFUN([gl_FUNC_STAT],
return result;
]])],
[gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
- [gl_cv_func_stat_file_slash="guessing no"])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_stat_file_slash="guessing no" ;;
+ esac
+ ])
rm -f conftest.tmp conftest.lnk])
case $gl_cv_func_stat_dir_slash in
*no) REPLACE_STAT=1
@@ -58,9 +65,7 @@ AC_DEFUN([gl_FUNC_STAT],
AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
help when passed a file name with a trailing slash]);;
esac
- if test $REPLACE_STAT = 1; then
- AC_LIBOBJ([stat])
- dnl Prerequisites of lib/stat.c.
- AC_REQUIRE([AC_C_INLINE])
- fi
])
+
+# Prerequisites of lib/stat.c.
+AC_DEFUN([gl_PREREQ_STAT], [:])
diff --git a/m4/stdarg.m4 b/m4/stdarg.m4
index a1ef178..c087f61 100644
--- a/m4/stdarg.m4
+++ b/m4/stdarg.m4
@@ -1,5 +1,5 @@
-# stdarg.m4 serial 5
-dnl Copyright (C) 2006, 2008-2011 Free Software Foundation, Inc.
+# stdarg.m4 serial 6
+dnl Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,8 +9,8 @@ dnl Provide a working va_copy in combination with <stdarg.h>.
AC_DEFUN([gl_STDARG_H],
[
- STDARG_H=''; AC_SUBST([STDARG_H])
- NEXT_STDARG_H='<stdarg.h>'; AC_SUBST([NEXT_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(
@@ -72,4 +72,7 @@ error, bail out
fi
fi
fi
+ AC_SUBST([STDARG_H])
+ AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"])
+ AC_SUBST([NEXT_STDARG_H])
])
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
index 838cf0f..80d5559 100644
--- a/m4/stdbool.m4
+++ b/m4/stdbool.m4
@@ -1,11 +1,11 @@
# Check for stdbool.h that conforms to C99.
-dnl Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-#serial 4
+#serial 5
# Prepare for substituting <stdbool.h> if it is not supported.
@@ -21,6 +21,7 @@ AC_DEFUN([AM_STDBOOL_H],
STDBOOL_H='stdbool.h'
fi
AC_SUBST([STDBOOL_H])
+ AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"])
if test "$ac_cv_type__Bool" = yes; then
HAVE__BOOL=1
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
index 1942b6a..5da8ab1 100644
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -1,6 +1,6 @@
dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
-# stddef_h.m4 serial 3
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# stddef_h.m4 serial 4
+dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -9,6 +9,7 @@ AC_DEFUN([gl_STDDEF_H],
[
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
AC_REQUIRE([gt_TYPE_WCHAR_T])
+ STDDEF_H=
if test $gt_cv_c_wchar_t = no; then
HAVE_WCHAR_T=0
STDDEF_H=stddef.h
@@ -24,6 +25,8 @@ 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
gl_NEXT_HEADERS([stddef.h])
fi
@@ -41,5 +44,4 @@ AC_DEFUN([gl_STDDEF_H_DEFAULTS],
dnl Assume proper GNU behavior unless another module says otherwise.
REPLACE_NULL=0; AC_SUBST([REPLACE_NULL])
HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T])
- STDDEF_H=''; AC_SUBST([STDDEF_H])
])
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index e7d0d07..27cdcdb 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,5 +1,5 @@
-# stdint.m4 serial 39
-dnl Copyright (C) 2001-2011 Free Software Foundation, Inc.
+# stdint.m4 serial 43
+dnl Copyright (C) 2001-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl From Paul Eggert and Bruno Haible.
dnl Test whether <stdint.h> is supported or must be substituted.
-AC_DEFUN([gl_STDINT_H],
+AC_DEFUN_ONCE([gl_STDINT_H],
[
AC_PREREQ([2.59])dnl
@@ -69,8 +69,6 @@ AC_DEFUN([gl_STDINT_H],
[gl_cv_header_working_stdint_h=no
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
-#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
#include <stdint.h>
/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
@@ -219,8 +217,6 @@ struct s {
dnl This detects a bug on HP-UX 11.23/ia64.
AC_RUN_IFELSE([
AC_LANG_PROGRAM([[
-#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
#include <stdint.h>
]
@@ -305,6 +301,7 @@ static const char *macro_values[] =
STDINT_H=stdint.h
fi
AC_SUBST([STDINT_H])
+ AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"])
])
dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
@@ -465,6 +462,14 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
fi
gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
[gl_STDINT_INCLUDES])
+
+ dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99
+ dnl requirement that wint_t is "unchanged by default argument promotions".
+ dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t.
+ dnl Set the variable BITSIZEOF_WINT_T accordingly.
+ if test $BITSIZEOF_WINT_T -lt 32; then
+ BITSIZEOF_WINT_T=32
+ fi
])
dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4
index 356b14e..511ab4e 100644
--- a/m4/stdint_h.m4
+++ b/m4/stdint_h.m4
@@ -1,5 +1,5 @@
# stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/stdio-safer.m4 b/m4/stdio-safer.m4
deleted file mode 100644
index 0cf08c2..0000000
--- a/m4/stdio-safer.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-#serial 12
-dnl Copyright (C) 2002, 2005-2007, 2009-2011 Free Software Foundation, Inc.
-dnl This file is free software; the Free 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_FOPEN_SAFER],
-[
- AC_LIBOBJ([fopen-safer])
-])
-
-AC_DEFUN([gl_FREOPEN_SAFER],
-[
- AC_LIBOBJ([freopen-safer])
-])
-
-AC_DEFUN([gl_POPEN_SAFER],
-[
- AC_LIBOBJ([popen-safer])
-])
-
-AC_DEFUN([gl_TMPFILE_SAFER],
-[
- AC_LIBOBJ([tmpfile-safer])
-])
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 7f3ae56..ebade06 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 33
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# stdio_h.m4 serial 43
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,8 +7,32 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_STDIO_H],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- AC_REQUIRE([AC_C_INLINE])
gl_NEXT_HEADERS([stdio.h])
+
+ dnl No need to create extra modules for these functions. Everyone who uses
+ dnl <stdio.h> likely needs them.
+ GNULIB_FSCANF=1
+ gl_MODULE_INDICATOR([fscanf])
+ GNULIB_SCANF=1
+ gl_MODULE_INDICATOR([scanf])
+ GNULIB_FGETC=1
+ GNULIB_GETC=1
+ GNULIB_GETCHAR=1
+ GNULIB_FGETS=1
+ GNULIB_FREAD=1
+ dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c"
+ dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+ dnl also an optimization, to avoid performing a configure check whose result
+ dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
+ dnl or GNULIB_NONBLOCKING redundant.
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_nonblocking != yes; then
+ REPLACE_STDIO_READ_FUNCS=1
+ AC_LIBOBJ([stdio-read])
+ fi
+ ])
+
dnl No need to create extra modules for these functions. Everyone who uses
dnl <stdio.h> likely needs them.
GNULIB_FPRINTF=1
@@ -21,9 +45,11 @@ AC_DEFUN([gl_STDIO_H],
GNULIB_FPUTS=1
GNULIB_PUTS=1
GNULIB_FWRITE=1
- dnl This ifdef is just an optimization, to avoid performing a configure
- dnl check whose result is not used. It does not make the test of
- dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant.
+ dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
+ dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+ dnl also an optimization, to avoid performing a configure check whose result
+ dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or
+ dnl GNULIB_SIGPIPE redundant.
m4_ifdef([gl_SIGNAL_SIGPIPE], [
gl_SIGNAL_SIGPIPE
if test $gl_cv_header_signal_h_SIGPIPE != yes; then
@@ -31,13 +57,25 @@ AC_DEFUN([gl_STDIO_H],
AC_LIBOBJ([stdio-write])
fi
])
+ dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
+ dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+ dnl also an optimization, to avoid performing a configure check whose result
+ dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
+ dnl or GNULIB_NONBLOCKING redundant.
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_nonblocking != yes; then
+ REPLACE_STDIO_WRITE_FUNCS=1
+ AC_LIBOBJ([stdio-write])
+ fi
+ ])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
- dnl guaranteed by C89.
+ dnl guaranteed by both C89 and C11.
gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
- ]], [dprintf fpurge fseeko ftello getdelim getline popen renameat
- snprintf tmpfile vdprintf vsnprintf])
+ ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen
+ renameat snprintf tmpfile vdprintf vsnprintf])
])
AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
@@ -53,23 +91,31 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
[
GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF])
GNULIB_FCLOSE=0; AC_SUBST([GNULIB_FCLOSE])
+ GNULIB_FDOPEN=0; AC_SUBST([GNULIB_FDOPEN])
GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
+ GNULIB_FGETC=0; AC_SUBST([GNULIB_FGETC])
+ GNULIB_FGETS=0; AC_SUBST([GNULIB_FGETS])
GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN])
GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF])
GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX])
GNULIB_FPURGE=0; AC_SUBST([GNULIB_FPURGE])
GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC])
GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS])
+ GNULIB_FREAD=0; AC_SUBST([GNULIB_FREAD])
GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN])
+ GNULIB_FSCANF=0; AC_SUBST([GNULIB_FSCANF])
GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK])
GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO])
GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL])
GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO])
GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE])
+ GNULIB_GETC=0; AC_SUBST([GNULIB_GETC])
+ GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR])
GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF])
GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
+ GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE])
GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR])
GNULIB_POPEN=0; AC_SUBST([GNULIB_POPEN])
GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF])
@@ -80,11 +126,15 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
GNULIB_REMOVE=0; AC_SUBST([GNULIB_REMOVE])
GNULIB_RENAME=0; AC_SUBST([GNULIB_RENAME])
GNULIB_RENAMEAT=0; AC_SUBST([GNULIB_RENAMEAT])
+ GNULIB_SCANF=0; AC_SUBST([GNULIB_SCANF])
GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF])
GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX])
+ GNULIB_STDIO_H_NONBLOCKING=0; AC_SUBST([GNULIB_STDIO_H_NONBLOCKING])
GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
GNULIB_TMPFILE=0; AC_SUBST([GNULIB_TMPFILE])
GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
+ GNULIB_VFSCANF=0; AC_SUBST([GNULIB_VFSCANF])
+ GNULIB_VSCANF=0; AC_SUBST([GNULIB_VSCANF])
GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF])
GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF])
GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
@@ -104,11 +154,14 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF])
HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO])
HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO])
+ HAVE_PCLOSE=1; AC_SUBST([HAVE_PCLOSE])
+ HAVE_POPEN=1; AC_SUBST([HAVE_POPEN])
HAVE_RENAMEAT=1; AC_SUBST([HAVE_RENAMEAT])
HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF])
REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF])
REPLACE_FCLOSE=0; AC_SUBST([REPLACE_FCLOSE])
+ REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN])
REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN])
REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
@@ -129,6 +182,7 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
REPLACE_RENAMEAT=0; AC_SUBST([REPLACE_RENAMEAT])
REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF])
REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF])
+ REPLACE_STDIO_READ_FUNCS=0; AC_SUBST([REPLACE_STDIO_READ_FUNCS])
REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
REPLACE_TMPFILE=0; AC_SUBST([REPLACE_TMPFILE])
REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
diff --git a/m4/stdlib-safer.m4 b/m4/stdlib-safer.m4
deleted file mode 100644
index 692624c..0000000
--- a/m4/stdlib-safer.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-# stdlib-safer.m4 serial 2
-dnl Copyright (C) 2005-2006, 2009-2011 Free Software Foundation, Inc.
-dnl This file is free software; the Free 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_STDLIB_SAFER],
-[
- AC_LIBOBJ([mkstemp-safer])
-])
diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4
index 25fdada..2027ab3 100644
--- a/m4/stdlib_h.m4
+++ b/m4/stdlib_h.m4
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 37
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 42
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -19,10 +19,11 @@ AC_DEFUN([gl_STDLIB_H],
#if HAVE_RANDOM_H
# include <random.h>
#endif
- ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt mkdtemp
- mkostemp mkostemps mkstemp mkstemps ptsname random_r initstat_r srandom_r
- setstate_r realpath rpmatch setenv strtod strtoll strtoull unlockpt
- unsetenv])
+ ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
+ initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
+ posix_openpt ptsname ptsname_r random random_r realpath rpmatch
+ secure_getenv setenv setstate setstate_r srandom srandom_r
+ strtod strtoll strtoull unlockpt unsetenv])
])
AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
@@ -50,12 +51,16 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS])
GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP])
GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS])
+ GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT])
GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME])
+ GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R])
GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV])
+ GNULIB_RANDOM=0; AC_SUBST([GNULIB_RANDOM])
GNULIB_RANDOM_R=0; AC_SUBST([GNULIB_RANDOM_R])
GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
GNULIB_REALPATH=0; AC_SUBST([GNULIB_REALPATH])
GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH])
+ GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV])
GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV])
GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD])
GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL])
@@ -76,11 +81,15 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS])
HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP])
HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS])
+ HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT])
HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME])
+ HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R])
+ HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM])
HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H])
HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R])
HAVE_REALPATH=1; AC_SUBST([HAVE_REALPATH])
HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
+ HAVE_SECURE_GETENV=1; AC_SUBST([HAVE_SECURE_GETENV])
HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
HAVE_DECL_SETENV=1; AC_SUBST([HAVE_DECL_SETENV])
HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
@@ -95,7 +104,10 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC])
REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC])
REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
+ REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME])
+ REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
+ REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R])
REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC])
REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH])
REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV])
diff --git a/m4/strchrnul.m4 b/m4/strchrnul.m4
index a64e805..b59eda9 100644
--- a/m4/strchrnul.m4
+++ b/m4/strchrnul.m4
@@ -1,5 +1,5 @@
-# strchrnul.m4 serial 7
-dnl Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc.
+# strchrnul.m4 serial 9
+dnl Copyright (C) 2003, 2007, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,10 +10,39 @@ AC_DEFUN([gl_FUNC_STRCHRNUL],
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- AC_REPLACE_FUNCS([strchrnul])
+ AC_CHECK_FUNCS([strchrnul])
if test $ac_cv_func_strchrnul = no; then
HAVE_STRCHRNUL=0
- gl_PREREQ_STRCHRNUL
+ else
+ AC_CACHE_CHECK([whether strchrnul works],
+ [gl_cv_func_strchrnul_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <string.h> /* for strchrnul */
+]], [[const char *buf = "a";
+ return strchrnul (buf, 'b') != buf + 1;
+ ]])],
+ [gl_cv_func_strchrnul_works=yes],
+ [gl_cv_func_strchrnul_works=no],
+ [dnl Cygwin 1.7.9 introduced strchrnul, but it was broken until 1.7.10
+ AC_EGREP_CPP([Lucky user],
+ [
+#if defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
+ Lucky user
+ #endif
+#else
+ Lucky user
+#endif
+ ],
+ [gl_cv_func_strchrnul_works="guessing yes"],
+ [gl_cv_func_strchrnul_works="guessing no"])
+ ])
+ ])
+ case "$gl_cv_func_strchrnul_works" in
+ *yes) ;;
+ *) REPLACE_STRCHRNUL=1 ;;
+ esac
fi
])
diff --git a/m4/strdup.m4 b/m4/strdup.m4
index 3fb36dd..efe2d57 100644
--- a/m4/strdup.m4
+++ b/m4/strdup.m4
@@ -1,6 +1,6 @@
-# strdup.m4 serial 12
+# strdup.m4 serial 13
-dnl Copyright (C) 2002-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2013 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,10 +10,6 @@ AC_DEFUN([gl_FUNC_STRDUP],
[
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
AC_CHECK_FUNCS_ONCE([strdup])
- if test $ac_cv_func_strdup != yes; then
- AC_LIBOBJ([strdup])
- gl_PREREQ_STRDUP
- fi
AC_CHECK_DECLS_ONCE([strdup])
if test $ac_cv_have_decl_strdup = no; then
HAVE_DECL_STRDUP=0
@@ -28,12 +24,7 @@ AC_DEFUN([gl_FUNC_STRDUP_POSIX],
if test $ac_cv_func_strdup = yes; then
if test $gl_cv_func_malloc_posix != yes; then
REPLACE_STRDUP=1
- AC_LIBOBJ([strdup])
- gl_PREREQ_STRDUP
fi
- else
- AC_LIBOBJ([strdup])
- gl_PREREQ_STRDUP
fi
AC_CHECK_DECLS_ONCE([strdup])
if test $ac_cv_have_decl_strdup = no; then
diff --git a/m4/strerror.m4 b/m4/strerror.m4
index 73d1d54..3989844 100644
--- a/m4/strerror.m4
+++ b/m4/strerror.m4
@@ -1,68 +1,96 @@
-# strerror.m4 serial 9
-dnl Copyright (C) 2002, 2007-2011 Free Software Foundation, Inc.
+# strerror.m4 serial 17
+dnl Copyright (C) 2002, 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STRERROR],
[
- AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE])
- if test $REPLACE_STRERROR = 1; then
- AC_LIBOBJ([strerror])
- AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR],
- [Define this to 1 if strerror is broken.])
- fi
-])
-
-# Like gl_FUNC_STRERROR, except prepare for separate compilation (no AC_LIBOBJ).
-AC_DEFUN([gl_FUNC_STRERROR_SEPARATE],
-[
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
AC_REQUIRE([gl_HEADER_ERRNO_H])
- if test -z "$ERRNO_H"; then
+ AC_REQUIRE([gl_FUNC_STRERROR_0])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
+ AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
+ ])
+ if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
AC_CACHE_CHECK([for working strerror function],
[gl_cv_func_working_strerror],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[#include <string.h>
]],
- [[return !*strerror (-2);]])],
+ [[if (!*strerror (-2)) return 1;]])],
[gl_cv_func_working_strerror=yes],
[gl_cv_func_working_strerror=no],
- [dnl Assume crossbuild works if it compiles.
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <string.h>
- ]],
- [[return !*strerror (-2);]])],
- [gl_cv_func_working_strerror=yes],
- [gl_cv_func_working_strerror=no])
- ])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_working_strerror="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_working_strerror="guessing no" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_working_strerror" in
+ *yes) ;;
+ *)
+ dnl The system's strerror() fails to return a string for out-of-range
+ dnl integers. Replace it.
+ REPLACE_STRERROR=1
+ ;;
+ esac
+ m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
+ dnl If the system's strerror_r or __xpg_strerror_r clobbers strerror's
+ dnl buffer, we must replace strerror.
+ case "$gl_cv_func_strerror_r_works" in
+ *no) REPLACE_STRERROR=1 ;;
+ esac
])
- if test $gl_cv_func_working_strerror = no; then
- dnl The system's strerror() fails to return a string for out-of-range
- dnl integers. Replace it.
- REPLACE_STRERROR=1
- fi
else
dnl The system's strerror() cannot know about the new errno values we add
- dnl to <errno.h>. Replace it.
+ dnl to <errno.h>, or any fix for strerror(0). Replace it.
REPLACE_STRERROR=1
fi
- if test $REPLACE_STRERROR = 1; then
- gl_PREREQ_STRERROR
- fi
])
-# Prerequisites of lib/strerror.c.
-AC_DEFUN([gl_PREREQ_STRERROR], [
- AC_CHECK_DECLS([strerror])
- AC_CHECK_HEADERS_ONCE([sys/socket.h])
- if test $ac_cv_header_sys_socket_h != yes; then
- dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
- dnl the check for those headers unconditional; yet cygwin reports
- dnl that the headers are present but cannot be compiled (since on
- dnl cygwin, all socket information should come from sys/socket.h).
- AC_CHECK_HEADERS([winsock2.h])
- fi
+dnl Detect if strerror(0) passes (that is, does not set errno, and does not
+dnl return a string that matches strerror(-1)).
+AC_DEFUN([gl_FUNC_STRERROR_0],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ REPLACE_STRERROR_0=0
+ AC_CACHE_CHECK([whether strerror(0) succeeds],
+ [gl_cv_func_strerror_0_works],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <string.h>
+ #include <errno.h>
+ ]],
+ [[int result = 0;
+ char *str;
+ errno = 0;
+ str = strerror (0);
+ if (!*str) result |= 1;
+ if (errno) result |= 2;
+ if (strstr (str, "nknown") || strstr (str, "ndefined"))
+ result |= 4;
+ return result;]])],
+ [gl_cv_func_strerror_0_works=yes],
+ [gl_cv_func_strerror_0_works=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_strerror_0_works="guessing no" ;;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_strerror_0_works" in
+ *yes) ;;
+ *)
+ REPLACE_STRERROR_0=1
+ AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0)
+ does not return a message implying success.])
+ ;;
+ esac
])
diff --git a/m4/string_h.m4 b/m4/string_h.m4
index 30ddfbc..cc5fbbb 100644
--- a/m4/string_h.m4
+++ b/m4/string_h.m4
@@ -1,11 +1,11 @@
# Configure a GNU-like replacement for <string.h>.
-# Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# Copyright (C) 2007-2013 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 19
+# serial 21
# Written by Paul Eggert.
@@ -27,9 +27,9 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
dnl guaranteed by C89.
gl_WARN_ON_USE_PREPARE([[#include <string.h>
]],
- [memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup
- strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r
- strsignal strverscmp])
+ [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
+ strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
+ strerror_r strsignal strverscmp])
])
AC_DEFUN([gl_STRING_MODULE_INDICATOR],
@@ -43,6 +43,8 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR],
AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
[
+ GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL])
+ GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL])
GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR])
GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM])
GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY])
@@ -80,6 +82,8 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP])
HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN])
dnl Assume proper GNU behavior unless another module says otherwise.
+ HAVE_FFSL=1; AC_SUBST([HAVE_FFSL])
+ HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL])
HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR])
HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM])
HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY])
@@ -104,6 +108,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
+ REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R])
REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
diff --git a/m4/strndup.m4 b/m4/strndup.m4
index d8f00ca..a1f8274 100644
--- a/m4/strndup.m4
+++ b/m4/strndup.m4
@@ -1,5 +1,5 @@
-# strndup.m4 serial 18
-dnl Copyright (C) 2002-2003, 2005-2011 Free Software Foundation, Inc.
+# strndup.m4 serial 21
+dnl Copyright (C) 2002-2003, 2005-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -18,13 +18,18 @@ AC_DEFUN([gl_FUNC_STRNDUP],
fi
if test $ac_cv_func_strndup = yes; then
+ HAVE_STRNDUP=1
# AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'.
AC_CACHE_CHECK([for working strndup], [gl_cv_func_strndup_works],
[AC_RUN_IFELSE([
AC_LANG_PROGRAM([[#include <string.h>
#include <stdlib.h>]], [[
-#ifndef HAVE_DECL_STRNDUP
- extern char *strndup (const char *, size_t);
+#if !HAVE_DECL_STRNDUP
+ extern
+ #ifdef __cplusplus
+ "C"
+ #endif
+ char *strndup (const char *, size_t);
#endif
char *s;
s = strndup ("some longer string", 15);
@@ -42,12 +47,9 @@ changequote(,)dnl
changequote([,])dnl
])])
case $gl_cv_func_strndup_works in
- *no)
- REPLACE_STRNDUP=1
- AC_LIBOBJ([strndup])
- ;;
+ *no) REPLACE_STRNDUP=1 ;;
esac
else
- AC_LIBOBJ([strndup])
+ HAVE_STRNDUP=0
fi
])
diff --git a/m4/strnlen.m4 b/m4/strnlen.m4
index a1c59ac..eae82b7 100644
--- a/m4/strnlen.m4
+++ b/m4/strnlen.m4
@@ -1,5 +1,5 @@
-# strnlen.m4 serial 12
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2011 Free Software Foundation,
+# strnlen.m4 serial 13
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2013 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -16,16 +16,14 @@ AC_DEFUN([gl_FUNC_STRNLEN],
if test $ac_cv_have_decl_strnlen = no; then
HAVE_DECL_STRNLEN=0
else
- AC_FUNC_STRNLEN
+ m4_pushdef([AC_LIBOBJ], [:])
dnl Note: AC_FUNC_STRNLEN does AC_LIBOBJ([strnlen]).
+ AC_FUNC_STRNLEN
+ m4_popdef([AC_LIBOBJ])
if test $ac_cv_func_strnlen_working = no; then
REPLACE_STRNLEN=1
fi
fi
- if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
- AC_LIBOBJ([strnlen])
- gl_PREREQ_STRNLEN
- fi
])
# Prerequisites of lib/strnlen.c.
diff --git a/m4/strsignal.m4 b/m4/strsignal.m4
index 856f8af..8f6ea2e 100644
--- a/m4/strsignal.m4
+++ b/m4/strsignal.m4
@@ -1,5 +1,5 @@
-# strsignal.m4 serial 5
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# strsignal.m4 serial 8
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -19,6 +19,7 @@ AC_DEFUN([gl_FUNC_STRSIGNAL],
AC_CHECK_FUNCS([strsignal])
if test $ac_cv_func_strsignal = yes; then
+ HAVE_STRSIGNAL=1
dnl Check if strsignal behaves reasonably for out-of-range signal numbers.
dnl On Solaris it returns NULL; on AIX 5.1 it returns (char *) -1.
AC_CACHE_CHECK([whether strsignal always returns a string],
@@ -42,21 +43,17 @@ AC_DEFUN([gl_FUNC_STRSIGNAL],
solaris* | aix*) gl_cv_func_working_strsignal=no;;
*) gl_cv_func_working_strsignal="guessing yes";;
esac])])
- else
- gl_cv_func_working_strsignal=no
- fi
-
- if test "$gl_cv_func_working_strsignal" = no; then
- if test $ac_cv_func_strsignal = yes; then
+ if test "$gl_cv_func_working_strsignal" = no; then
REPLACE_STRSIGNAL=1
fi
- AC_LIBOBJ([strsignal])
- gl_PREREQ_STRSIGNAL
+ else
+ HAVE_STRSIGNAL=0
fi
])
# Prerequisites of lib/strsignal.c.
AC_DEFUN([gl_PREREQ_STRSIGNAL], [
+ AC_CHECK_HEADERS_ONCE([unistd.h])
AC_REQUIRE([AC_DECL_SYS_SIGLIST])
- AC_CHECK_DECLS([_sys_siglist], [], [], [#include <signal.h>])
+ AC_CHECK_DECLS([_sys_siglist], [], [], [[#include <signal.h>]])
])
diff --git a/m4/strstr.m4 b/m4/strstr.m4
index a42a1db..c486bdb 100644
--- a/m4/strstr.m4
+++ b/m4/strstr.m4
@@ -1,5 +1,5 @@
-# strstr.m4 serial 13
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# strstr.m4 serial 16
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,7 +11,6 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE],
AC_REQUIRE([gl_FUNC_MEMCHR])
if test "$gl_cv_func_memchr_works" != yes; then
REPLACE_STRSTR=1
- AC_LIBOBJ([strstr])
else
dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092.
AC_CACHE_CHECK([whether strstr works],
@@ -47,14 +46,16 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE],
Lucky user
#endif
],
- [gl_cv_func_strstr_works_always=yes],
+ [gl_cv_func_strstr_works_always="guessing yes"],
[gl_cv_func_strstr_works_always="guessing no"])
])
])
- if test "$gl_cv_func_strstr_works_always" != yes; then
- REPLACE_STRSTR=1
- AC_LIBOBJ([strstr])
- fi
+ case "$gl_cv_func_strstr_works_always" in
+ *yes) ;;
+ *)
+ REPLACE_STRSTR=1
+ ;;
+ esac
fi
]) # gl_FUNC_STRSTR_SIMPLE
@@ -95,13 +96,15 @@ static void quit (int sig) { exit (sig + 128); }
return result;
]])],
[gl_cv_func_strstr_linear=yes], [gl_cv_func_strstr_linear=no],
- [dnl Only glibc > 2.12 and cygwin > 1.7.7 are known to have a
- dnl bug-free strstr that works in linear time.
+ [dnl Only glibc > 2.12 on processors without SSE 4.2 instructions and
+ dnl cygwin > 1.7.7 are known to have a bug-free strstr that works in
+ dnl linear time.
AC_EGREP_CPP([Lucky user],
[
#include <features.h>
#ifdef __GNU_LIBRARY__
#if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+ && !(defined __i386__ || defined __x86_64__) \
&& !defined __UCLIBC__
Lucky user
#endif
@@ -113,15 +116,15 @@ static void quit (int sig) { exit (sig + 128); }
#endif
#endif
],
- [gl_cv_func_strstr_linear=yes],
+ [gl_cv_func_strstr_linear="guessing yes"],
[gl_cv_func_strstr_linear="guessing no"])
])
])
- if test "$gl_cv_func_strstr_linear" != yes; then
- REPLACE_STRSTR=1
- fi
- fi
- if test $REPLACE_STRSTR = 1; then
- AC_LIBOBJ([strstr])
+ case "$gl_cv_func_strstr_linear" in
+ *yes) ;;
+ *)
+ REPLACE_STRSTR=1
+ ;;
+ esac
fi
]) # gl_FUNC_STRSTR
diff --git a/m4/strtod.m4 b/m4/strtod.m4
index 4619c33..06ba60f 100644
--- a/m4/strtod.m4
+++ b/m4/strtod.m4
@@ -1,5 +1,5 @@
-# strtod.m4 serial 19
-dnl Copyright (C) 2002-2003, 2006-2011 Free Software Foundation, Inc.
+# strtod.m4 serial 22
+dnl Copyright (C) 2002-2003, 2006-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,15 +7,18 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STRTOD],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- dnl Test whether strtod is declared.
- dnl Don't call AC_FUNC_STRTOD, because it does not have the right guess
- dnl when cross-compiling.
- dnl Don't call AC_CHECK_FUNCS([strtod]) because it would collide with the
- dnl ac_cv_func_strtod variable set by the AC_FUNC_STRTOD macro.
- AC_CHECK_DECLS_ONCE([strtod])
- if test $ac_cv_have_decl_strtod != yes; then
- HAVE_STRTOD=0
- else
+ m4_ifdef([gl_FUNC_STRTOD_OBSOLETE], [
+ dnl Test whether strtod is declared.
+ dnl Don't call AC_FUNC_STRTOD, because it does not have the right guess
+ dnl when cross-compiling.
+ dnl Don't call AC_CHECK_FUNCS([strtod]) because it would collide with the
+ dnl ac_cv_func_strtod variable set by the AC_FUNC_STRTOD macro.
+ AC_CHECK_DECLS_ONCE([strtod])
+ if test $ac_cv_have_decl_strtod != yes; then
+ HAVE_STRTOD=0
+ fi
+ ])
+ if test $HAVE_STRTOD = 1; then
AC_CACHE_CHECK([whether strtod obeys C99], [gl_cv_func_strtod_works],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <stdlib.h>
@@ -98,7 +101,7 @@ numeric_equal (double x, double y)
[gl_cv_func_strtod_works=yes],
[gl_cv_func_strtod_works=no],
[dnl The last known bugs in glibc strtod(), as of this writing,
- dnl were fixed in version 2.8
+ dnl were fixed in version 2.8
AC_EGREP_CPP([Lucky user],
[
#include <features.h>
@@ -109,15 +112,14 @@ numeric_equal (double x, double y)
#endif
#endif
],
- [gl_cv_func_strtod_works=yes],
+ [gl_cv_func_strtod_works="guessing yes"],
[gl_cv_func_strtod_works="guessing no"])])])
- if test "$gl_cv_func_strtod_works" != yes; then
- REPLACE_STRTOD=1
- fi
- fi
- if test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1; then
- AC_LIBOBJ([strtod])
- gl_PREREQ_STRTOD
+ case "$gl_cv_func_strtod_works" in
+ *yes) ;;
+ *)
+ REPLACE_STRTOD=1
+ ;;
+ esac
fi
])
diff --git a/m4/strtol.m4 b/m4/strtol.m4
deleted file mode 100644
index 10f0284..0000000
--- a/m4/strtol.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-# strtol.m4 serial 5
-dnl Copyright (C) 2002-2003, 2006, 2009-2011 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_STRTOL],
-[
- AC_REPLACE_FUNCS([strtol])
-])
diff --git a/m4/symlink.m4 b/m4/symlink.m4
index 917d5f0..82ede2a 100644
--- a/m4/symlink.m4
+++ b/m4/symlink.m4
@@ -1,7 +1,7 @@
-# serial 4
+# serial 6
# See if we need to provide symlink replacement.
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,13 +11,13 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_SYMLINK],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CHECK_FUNCS_ONCE([symlink])
dnl The best we can do on mingw is provide a dummy that always fails, so
dnl that compilation can proceed with fewer ifdefs. On FreeBSD 7.2, AIX 7.1,
dnl and Solaris 9, we want to fix a bug with trailing slash handling.
if test $ac_cv_func_symlink = no; then
HAVE_SYMLINK=0
- AC_LIBOBJ([symlink])
else
AC_CACHE_CHECK([whether symlink handles trailing slash correctly],
[gl_cv_func_symlink_works],
@@ -35,11 +35,19 @@ AC_DEFUN([gl_FUNC_SYMLINK],
return result;
]])],
[gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no],
- [gl_cv_func_symlink_works="guessing no"])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-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])
- if test "$gl_cv_func_symlink_works" != yes; then
- REPLACE_SYMLINK=1
- AC_LIBOBJ([symlink])
- fi
+ case "$gl_cv_func_symlink_works" in
+ *yes) ;;
+ *)
+ REPLACE_SYMLINK=1
+ ;;
+ esac
fi
])
diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4
new file mode 100644
index 0000000..9486377
--- /dev/null
+++ b/m4/sys_socket_h.m4
@@ -0,0 +1,176 @@
+# sys_socket_h.m4 serial 23
+dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free 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 Simon Josefsson.
+
+AC_DEFUN([gl_HEADER_SYS_SOCKET],
+[
+ AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have
+ dnl old-style declarations (with return type 'int' instead of 'ssize_t')
+ dnl unless _POSIX_PII_SOCKET is defined.
+ case "$host_os" in
+ osf*)
+ AC_DEFINE([_POSIX_PII_SOCKET], [1],
+ [Define to 1 in order to get the POSIX compatible declarations
+ of socket functions.])
+ ;;
+ esac
+
+ AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
+ [gl_cv_header_sys_socket_h_selfcontained],
+ [
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])],
+ [gl_cv_header_sys_socket_h_selfcontained=yes],
+ [gl_cv_header_sys_socket_h_selfcontained=no])
+ ])
+ if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+ dnl If the shutdown function exists, <sys/socket.h> should define
+ dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
+ AC_CHECK_FUNCS([shutdown])
+ if test $ac_cv_func_shutdown = yes; then
+ AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros],
+ [gl_cv_header_sys_socket_h_shut],
+ [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <sys/socket.h>]],
+ [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])],
+ [gl_cv_header_sys_socket_h_shut=yes],
+ [gl_cv_header_sys_socket_h_shut=no])
+ ])
+ if test $gl_cv_header_sys_socket_h_shut = no; then
+ SYS_SOCKET_H='sys/socket.h'
+ fi
+ fi
+ fi
+ # We need to check for ws2tcpip.h now.
+ gl_PREREQ_SYS_H_SOCKET
+ AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[
+ /* sys/types.h is not needed according to POSIX, but the
+ sys/socket.h in i386-unknown-freebsd4.10 and
+ powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
+ if test $ac_cv_type_struct_sockaddr_storage = no; then
+ HAVE_STRUCT_SOCKADDR_STORAGE=0
+ fi
+ if test $ac_cv_type_sa_family_t = no; then
+ HAVE_SA_FAMILY_T=0
+ fi
+ if test $ac_cv_type_struct_sockaddr_storage != no; then
+ AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
+ [],
+ [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0],
+ [#include <sys/types.h>
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
+ #ifdef HAVE_WS2TCPIP_H
+ #include <ws2tcpip.h>
+ #endif
+ ])
+ fi
+ if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
+ || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
+ SYS_SOCKET_H='sys/socket.h'
+ fi
+ gl_PREREQ_SYS_H_WINSOCK2
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use.
+ gl_WARN_ON_USE_PREPARE([[
+/* Some systems require prerequisite headers. */
+#include <sys/types.h>
+#include <sys/socket.h>
+ ]], [socket connect accept bind getpeername getsockname getsockopt
+ listen recv send recvfrom sendto setsockopt shutdown accept4])
+])
+
+AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
+[
+ dnl Check prerequisites of the <sys/socket.h> replacement.
+ AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+ gl_CHECK_NEXT_HEADERS([sys/socket.h])
+ if test $ac_cv_header_sys_socket_h = yes; then
+ HAVE_SYS_SOCKET_H=1
+ HAVE_WS2TCPIP_H=0
+ else
+ HAVE_SYS_SOCKET_H=0
+ if test $ac_cv_header_ws2tcpip_h = yes; then
+ HAVE_WS2TCPIP_H=1
+ else
+ HAVE_WS2TCPIP_H=0
+ fi
+ fi
+ AC_SUBST([HAVE_SYS_SOCKET_H])
+ AC_SUBST([HAVE_WS2TCPIP_H])
+])
+
+# Common prerequisites of the <sys/socket.h> replacement and of the
+# <sys/select.h> replacement.
+# Sets and substitutes HAVE_WINSOCK2_H.
+AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
+[
+ m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+ m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])])
+ AC_CHECK_HEADERS_ONCE([sys/socket.h])
+ if test $ac_cv_header_sys_socket_h != yes; then
+ dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+ dnl the check for those headers unconditional; yet cygwin reports
+ dnl that the headers are present but cannot be compiled (since on
+ dnl cygwin, all socket information should come from sys/socket.h).
+ AC_CHECK_HEADERS([winsock2.h])
+ fi
+ if test "$ac_cv_header_winsock2_h" = yes; then
+ HAVE_WINSOCK2_H=1
+ UNISTD_H_HAVE_WINSOCK2_H=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+ else
+ HAVE_WINSOCK2_H=0
+ fi
+ AC_SUBST([HAVE_WINSOCK2_H])
+])
+
+AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+ gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+ dnl Define it also as a C macro, for the benefit of the unit tests.
+ gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
+[
+ GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET])
+ GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT])
+ GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT])
+ GNULIB_BIND=0; AC_SUBST([GNULIB_BIND])
+ GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME])
+ GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME])
+ GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT])
+ GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN])
+ GNULIB_RECV=0; AC_SUBST([GNULIB_RECV])
+ GNULIB_SEND=0; AC_SUBST([GNULIB_SEND])
+ GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM])
+ GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO])
+ GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT])
+ GNULIB_SHUTDOWN=0; AC_SUBST([GNULIB_SHUTDOWN])
+ GNULIB_ACCEPT4=0; AC_SUBST([GNULIB_ACCEPT4])
+ HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE])
+ HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
+ AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY])
+ HAVE_SA_FAMILY_T=1; AC_SUBST([HAVE_SA_FAMILY_T])
+ HAVE_ACCEPT4=1; AC_SUBST([HAVE_ACCEPT4])
+])
diff --git a/m4/sys_stat_h.m4 b/m4/sys_stat_h.m4
index fc41912..6dd3d99 100644
--- a/m4/sys_stat_h.m4
+++ b/m4/sys_stat_h.m4
@@ -1,5 +1,5 @@
-# sys_stat_h.m4 serial 24 -*- Autoconf -*-
-dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 28 -*- Autoconf -*-
+dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,14 +11,27 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
[
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
- dnl For the mkdir substitute.
- AC_REQUIRE([AC_C_INLINE])
-
dnl Check for broken stat macros.
AC_REQUIRE([AC_HEADER_STAT])
gl_CHECK_NEXT_HEADERS([sys/stat.h])
+ dnl Ensure the type mode_t gets defined.
+ AC_REQUIRE([AC_TYPE_MODE_T])
+
+ dnl Whether to override 'struct stat'.
+ m4_ifdef([gl_LARGEFILE], [
+ AC_REQUIRE([gl_LARGEFILE])
+ ], [
+ WINDOWS_64_BIT_ST_SIZE=0
+ ])
+ AC_SUBST([WINDOWS_64_BIT_ST_SIZE])
+ if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+ AC_DEFINE([_GL_WINDOWS_64_BIT_ST_SIZE], [1],
+ [Define to 1 if Gnulib overrides 'struct stat' on Windows so that
+ struct stat.st_size becomes 64-bit.])
+ fi
+
dnl Define types that are supposed to be defined in <sys/types.h> or
dnl <sys/stat.h>.
AC_CHECK_TYPE([nlink_t], [],
@@ -30,7 +43,7 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h>
- ]], [fchmodat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
+ ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
mknod mknodat stat utimensat])
]) # gl_HEADER_SYS_STAT_H
@@ -47,6 +60,7 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
[
AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
GNULIB_FCHMODAT=0; AC_SUBST([GNULIB_FCHMODAT])
+ GNULIB_FSTAT=0; AC_SUBST([GNULIB_FSTAT])
GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT])
GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS])
GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD])
diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4
index 3a3adc8..0ac71ac 100644
--- a/m4/sys_time_h.m4
+++ b/m4/sys_time_h.m4
@@ -1,7 +1,7 @@
# Configure a replacement for <sys/time.h>.
-# serial 6
+# serial 8
-# Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2013 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.
@@ -27,6 +27,9 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
HAVE_SYS_TIME_H=0
fi
+ dnl On native Windows with MSVC, 'struct timeval' is defined in <winsock2.h>
+ dnl only. So include that header in the list.
+ gl_PREREQ_SYS_H_WINSOCK2
AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
@@ -34,12 +37,46 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
#include <sys/time.h>
#endif
#include <time.h>
+ #if HAVE_WINSOCK2_H
+ # include <winsock2.h>
+ #endif
]],
[[static struct timeval x; x.tv_sec = x.tv_usec;]])],
[gl_cv_sys_struct_timeval=yes],
- [gl_cv_sys_struct_timeval=no])])
+ [gl_cv_sys_struct_timeval=no])
+ ])
if test $gl_cv_sys_struct_timeval != yes; then
HAVE_STRUCT_TIMEVAL=0
+ else
+ dnl On native Windows with a 64-bit 'time_t', 'struct timeval' is defined
+ dnl (in <sys/time.h> and <winsock2.h> for mingw64, in <winsock2.h> only
+ dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is
+ dnl smaller than the 'time_t' type mandated by POSIX.
+ dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but
+ dnl that is good enough.
+ AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member],
+ [gl_cv_sys_struct_timeval_tv_sec],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#if HAVE_SYS_TIME_H
+ #include <sys/time.h>
+ #endif
+ #include <time.h>
+ #if HAVE_WINSOCK2_H
+ # include <winsock2.h>
+ #endif
+ ]],
+ [[static struct timeval x;
+ typedef int verify_tv_sec_type[
+ sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
+ ];
+ ]])],
+ [gl_cv_sys_struct_timeval_tv_sec=yes],
+ [gl_cv_sys_struct_timeval_tv_sec=no])
+ ])
+ if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
+ REPLACE_STRUCT_TIMEVAL=1
+ fi
fi
dnl Check for declarations of anything we want to poison if the
@@ -69,4 +106,5 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS],
HAVE_STRUCT_TIMEVAL=1; AC_SUBST([HAVE_STRUCT_TIMEVAL])
HAVE_SYS_TIME_H=1; AC_SUBST([HAVE_SYS_TIME_H])
REPLACE_GETTIMEOFDAY=0; AC_SUBST([REPLACE_GETTIMEOFDAY])
+ REPLACE_STRUCT_TIMEVAL=0; AC_SUBST([REPLACE_STRUCT_TIMEVAL])
])
diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4
new file mode 100644
index 0000000..d15c1b3
--- /dev/null
+++ b/m4/sys_types_h.m4
@@ -0,0 +1,24 @@
+# sys_types_h.m4 serial 5
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_SYS_TYPES_H],
+[
+ AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
+ gl_NEXT_HEADERS([sys/types.h])
+
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Ensure the type mode_t gets defined.
+ AC_REQUIRE([AC_TYPE_MODE_T])
+
+ dnl Whether to override the 'off_t' type.
+ AC_REQUIRE([gl_TYPE_OFF_T])
+])
+
+AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
+[
+])
diff --git a/m4/sys_wait_h.m4 b/m4/sys_wait_h.m4
index e3b147c..a6c59d6 100644
--- a/m4/sys_wait_h.m4
+++ b/m4/sys_wait_h.m4
@@ -1,5 +1,5 @@
-# sys_wait_h.m4 serial 5
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# sys_wait_h.m4 serial 6
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,6 +11,9 @@ AC_DEFUN([gl_SYS_WAIT_H],
dnl <sys/wait.h> is always overridden, because of GNULIB_POSIXCHECK.
gl_CHECK_NEXT_HEADERS([sys/wait.h])
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
gl_WARN_ON_USE_PREPARE([[#include <sys/wait.h>]],
diff --git a/m4/tempname.m4 b/m4/tempname.m4
index 6bd74ab..a6e42dc 100644
--- a/m4/tempname.m4
+++ b/m4/tempname.m4
@@ -1,6 +1,6 @@
-#serial 3
+#serial 5
-# Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007, 2009-2013 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.
@@ -9,9 +9,6 @@
# it as a public API, and provide it on systems that are lacking.
AC_DEFUN([gl_FUNC_GEN_TEMPNAME],
[
- AC_REQUIRE([AC_SYS_LARGEFILE])
-
- AC_LIBOBJ([tempname])
gl_PREREQ_TEMPNAME
])
diff --git a/m4/threadlib.m4 b/m4/threadlib.m4
index 8a621fd..26bdeb5 100644
--- a/m4/threadlib.m4
+++ b/m4/threadlib.m4
@@ -1,5 +1,5 @@
-# threadlib.m4 serial 8 (gettext-0.18.2)
-dnl Copyright (C) 2005-2011 Free Software Foundation, Inc.
+# threadlib.m4 serial 10 (gettext-0.18.2)
+dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -15,7 +15,7 @@ dnl default is 'no', otherwise it is system dependent. In both cases, the user
dnl can change the choice through the options --enable-threads=choice or
dnl --disable-threads.
dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
-dnl USE_PTH_THREADS, USE_WIN32_THREADS
+dnl USE_PTH_THREADS, USE_WINDOWS_THREADS
dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
dnl libtool).
@@ -53,7 +53,7 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY],
[m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
[m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
AC_ARG_ENABLE([threads],
-AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
[gl_use_threads=$enableval],
[if test -n "$gl_use_threads_default"; then
@@ -276,17 +276,19 @@ int main ()
fi
fi
if test -z "$gl_have_pthread"; then
- if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
- if { case "$host_os" in
- mingw*) true;;
- *) false;;
- esac
- }; then
- gl_threads_api=win32
- AC_DEFINE([USE_WIN32_THREADS], [1],
- [Define if the Win32 multithreading API can be used.])
- fi
- fi
+ case "$gl_use_threads" in
+ yes | windows | win32) # The 'win32' is for backward compatibility.
+ if { case "$host_os" in
+ mingw*) true;;
+ *) false;;
+ esac
+ }; then
+ gl_threads_api=windows
+ AC_DEFINE([USE_WINDOWS_THREADS], [1],
+ [Define if the native Windows multithreading API can be used.])
+ fi
+ ;;
+ esac
fi
fi
AC_MSG_CHECKING([for multithread API to use])
@@ -317,50 +319,50 @@ AC_DEFUN([gl_DISABLE_THREADS], [
dnl Survey of platforms:
dnl
-dnl Platform Available Compiler Supports test-lock
-dnl flavours option weak result
-dnl --------------- --------- --------- -------- ---------
-dnl Linux 2.4/glibc posix -lpthread Y OK
+dnl Platform Available Compiler Supports test-lock
+dnl flavours option weak result
+dnl --------------- --------- --------- -------- ---------
+dnl Linux 2.4/glibc posix -lpthread Y OK
dnl
-dnl GNU Hurd/glibc posix
+dnl GNU Hurd/glibc posix
dnl
-dnl FreeBSD 5.3 posix -lc_r Y
-dnl posix -lkse ? Y
-dnl posix -lpthread ? Y
-dnl posix -lthr Y
+dnl FreeBSD 5.3 posix -lc_r Y
+dnl posix -lkse ? Y
+dnl posix -lpthread ? Y
+dnl posix -lthr Y
dnl
-dnl FreeBSD 5.2 posix -lc_r Y
-dnl posix -lkse Y
-dnl posix -lthr Y
+dnl FreeBSD 5.2 posix -lc_r Y
+dnl posix -lkse Y
+dnl posix -lthr Y
dnl
-dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
+dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
dnl
-dnl NetBSD 1.6 --
+dnl NetBSD 1.6 --
dnl
-dnl OpenBSD 3.4 posix -lpthread Y OK
+dnl OpenBSD 3.4 posix -lpthread Y OK
dnl
-dnl MacOS X 10.[123] posix -lpthread Y OK
+dnl Mac OS X 10.[123] posix -lpthread Y OK
dnl
-dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
-dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
+dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
+dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
dnl
-dnl HP-UX 11 posix -lpthread N (cc) OK
+dnl HP-UX 11 posix -lpthread N (cc) OK
dnl Y (gcc)
dnl
-dnl IRIX 6.5 posix -lpthread Y 0.5
+dnl IRIX 6.5 posix -lpthread Y 0.5
dnl
-dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
+dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
dnl
-dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
+dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
dnl -lpthread (gcc) Y
dnl
-dnl Cygwin posix -lpthread Y OK
+dnl Cygwin posix -lpthread Y OK
dnl
-dnl Any of the above pth -lpth 0.0
+dnl Any of the above pth -lpth 0.0
dnl
-dnl Mingw win32 N OK
+dnl Mingw windows N OK
dnl
-dnl BeOS 5 --
+dnl BeOS 5 --
dnl
dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
dnl turned off:
diff --git a/m4/time_h.m4 b/m4/time_h.m4
index 615da1c..3b83900 100644
--- a/m4/time_h.m4
+++ b/m4/time_h.m4
@@ -1,8 +1,8 @@
# Configure a more-standard replacement for <time.h>.
-# Copyright (C) 2000-2001, 2003-2007, 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2013 Free Software Foundation, Inc.
-# serial 4
+# serial 7
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -25,7 +25,7 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY],
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
])
-dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
+dnl Check whether 'struct timespec' is declared
dnl in time.h, sys/time.h, or pthread.h.
AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
diff --git a/m4/tls.m4 b/m4/tls.m4
index bb318b3..8ef1913 100644
--- a/m4/tls.m4
+++ b/m4/tls.m4
@@ -1,5 +1,5 @@
# tls.m4 serial 2 (gettext-0.18)
-dnl Copyright (C) 2005, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/tmpdir.m4 b/m4/tmpdir.m4
index 9d4b170..6dd5f70 100644
--- a/m4/tmpdir.m4
+++ b/m4/tmpdir.m4
@@ -1,12 +1,9 @@
-# tmpdir.m4 serial 3
-dnl Copyright (C) 2001-2002, 2006, 2009-2011 Free Software Foundation, Inc.
+# tmpdir.m4 serial 4
+dnl Copyright (C) 2001-2002, 2006, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Prerequisites for lib/tmpdir.c
-AC_DEFUN([gt_TMPDIR],
-[
- AC_CHECK_FUNCS([__secure_getenv])
-])
+AC_DEFUN([gt_TMPDIR], [:])
diff --git a/m4/ungetc.m4 b/m4/ungetc.m4
index 749f6bd..4e3577a 100644
--- a/m4/ungetc.m4
+++ b/m4/ungetc.m4
@@ -1,5 +1,5 @@
-# ungetc.m4 serial 2
-dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# ungetc.m4 serial 3
+dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_CACHE_CHECK([whether ungetc works on arbitrary bytes],
[gl_cv_func_ungetc_works],
@@ -27,10 +28,19 @@ AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS],
if (fgetc (f) != 'c') return 11;
fclose (f); remove ("conftest.tmp");])],
[gl_cv_func_ungetc_works=yes], [gl_cv_func_ungetc_works=no],
- [gl_cv_func_ungetc_works='guessing no'])
+ [case "$host_os" in
+ # Guess yes on glibc systems.
+ *-gnu*) gl_cv_func_ungetc_works="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_ungetc_works="guessing no" ;;
+ esac
+ ])
])
- if test "$gl_cv_func_ungetc_works" != yes; then
- AC_DEFINE([FUNC_UNGETC_BROKEN], [1],
- [Define to 1 if ungetc is broken when used on arbitrary bytes.])
- fi
+ case "$gl_cv_func_ungetc_works" in
+ *yes) ;;
+ *)
+ AC_DEFINE([FUNC_UNGETC_BROKEN], [1],
+ [Define to 1 if ungetc is broken when used on arbitrary bytes.])
+ ;;
+ esac
])
diff --git a/m4/unistd-safer.m4 b/m4/unistd-safer.m4
index 00ff1bd..e65c3c9 100644
--- a/m4/unistd-safer.m4
+++ b/m4/unistd-safer.m4
@@ -1,5 +1,5 @@
-#serial 8
-dnl Copyright (C) 2002, 2005-2006, 2009-2011 Free Software Foundation, Inc.
+#serial 9
+dnl Copyright (C) 2002, 2005-2006, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +7,4 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_UNISTD_SAFER],
[
AC_CHECK_FUNCS_ONCE([pipe])
- AC_LIBOBJ([dup-safer])
- AC_LIBOBJ([fd-safer])
- AC_LIBOBJ([pipe-safer])
])
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index c81a113..32dcfa5 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 53
-dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
+# unistd_h.m4 serial 66
+dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,7 +11,6 @@ AC_DEFUN([gl_UNISTD_H],
dnl Use AC_REQUIRE here, so that the default behavior below is expanded
dnl once only, before all statements that occur in other macros.
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([AC_C_INLINE])
gl_CHECK_NEXT_HEADERS([unistd.h])
if test $ac_cv_header_unistd_h = yes; then
@@ -21,9 +20,18 @@ AC_DEFUN([gl_UNISTD_H],
fi
AC_SUBST([HAVE_UNISTD_H])
+ dnl Ensure the type pid_t gets defined.
+ AC_REQUIRE([AC_TYPE_PID_T])
+
+ dnl Determine WINDOWS_64_BIT_OFF_T.
+ AC_REQUIRE([gl_TYPE_OFF_T])
+
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
- gl_WARN_ON_USE_PREPARE([[#include <unistd.h>
+ gl_WARN_ON_USE_PREPARE([[
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
/* Some systems declare various items in the wrong headers. */
#if !(defined __GLIBC__ && !defined __UCLIBC__)
# include <fcntl.h>
@@ -33,12 +41,13 @@ AC_DEFUN([gl_UNISTD_H],
# include <io.h>
# endif
#endif
- ]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
- fsync ftruncate getcwd getdomainname getdtablesize getgroups
- gethostname getlogin getlogin_r getpagesize getusershell setusershell
- endusershell lchown link linkat lseek pipe pipe2 pread pwrite readlink
- readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
- usleep])
+ ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat
+ fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups
+ gethostname getlogin getlogin_r getpagesize
+ getusershell setusershell endusershell
+ group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
+ readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r
+ unlink unlinkat usleep])
])
AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -52,47 +61,54 @@ AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
AC_DEFUN([gl_UNISTD_H_DEFAULTS],
[
- GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN])
- GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE])
- GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2])
- GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3])
- GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON])
- GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS])
- GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT])
- GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR])
- GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT])
- GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC])
- GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE])
- GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD])
- GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME])
- GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE])
- GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS])
- GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME])
- GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN])
- GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R])
- GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
- GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL])
- GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
- GNULIB_LINK=0; AC_SUBST([GNULIB_LINK])
- GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT])
- GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
- GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE])
- GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2])
- GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD])
- GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE])
- GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK])
- GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT])
- GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR])
- GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP])
- GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK])
- GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT])
- GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R])
- GNULIB_UNISTD_H_GETOPT=0; AC_SUBST([GNULIB_UNISTD_H_GETOPT])
- GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
- GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK])
- GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT])
- GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP])
- GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE])
+ GNULIB_CHDIR=0; AC_SUBST([GNULIB_CHDIR])
+ GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN])
+ GNULIB_CLOSE=0; AC_SUBST([GNULIB_CLOSE])
+ GNULIB_DUP=0; AC_SUBST([GNULIB_DUP])
+ GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2])
+ GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3])
+ GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON])
+ GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS])
+ GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT])
+ GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR])
+ GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT])
+ GNULIB_FDATASYNC=0; AC_SUBST([GNULIB_FDATASYNC])
+ GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC])
+ GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE])
+ GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD])
+ GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME])
+ GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE])
+ GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS])
+ GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME])
+ GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN])
+ GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R])
+ GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
+ GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL])
+ GNULIB_GROUP_MEMBER=0; AC_SUBST([GNULIB_GROUP_MEMBER])
+ GNULIB_ISATTY=0; AC_SUBST([GNULIB_ISATTY])
+ GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
+ GNULIB_LINK=0; AC_SUBST([GNULIB_LINK])
+ GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT])
+ GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
+ GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE])
+ GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2])
+ GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD])
+ GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE])
+ GNULIB_READ=0; AC_SUBST([GNULIB_READ])
+ GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK])
+ GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT])
+ GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR])
+ GNULIB_SETHOSTNAME=0; AC_SUBST([GNULIB_SETHOSTNAME])
+ GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP])
+ GNULIB_SYMLINK=0; AC_SUBST([GNULIB_SYMLINK])
+ GNULIB_SYMLINKAT=0; AC_SUBST([GNULIB_SYMLINKAT])
+ GNULIB_TTYNAME_R=0; AC_SUBST([GNULIB_TTYNAME_R])
+ GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING])
+ GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
+ GNULIB_UNLINK=0; AC_SUBST([GNULIB_UNLINK])
+ GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT])
+ GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP])
+ GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN])
HAVE_DUP2=1; AC_SUBST([HAVE_DUP2])
@@ -101,6 +117,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT])
HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR])
HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT])
+ HAVE_FDATASYNC=1; AC_SUBST([HAVE_FDATASYNC])
HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC])
HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE])
HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE])
@@ -108,6 +125,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_GROUP_MEMBER=1; AC_SUBST([HAVE_GROUP_MEMBER])
HAVE_LCHOWN=1; AC_SUBST([HAVE_LCHOWN])
HAVE_LINK=1; AC_SUBST([HAVE_LINK])
HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT])
@@ -117,6 +135,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE])
HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT])
+ HAVE_SETHOSTNAME=1; AC_SUBST([HAVE_SETHOSTNAME])
HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
HAVE_SYMLINK=1; AC_SUBST([HAVE_SYMLINK])
HAVE_SYMLINKAT=1; AC_SUBST([HAVE_SYMLINKAT])
@@ -124,10 +143,12 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP])
HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR])
+ HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC])
HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
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_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])
@@ -136,17 +157,20 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_DUP=0; AC_SUBST([REPLACE_DUP])
REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2])
REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT])
+ REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE])
REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R])
REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS])
REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
+ REPLACE_ISATTY=0; AC_SUBST([REPLACE_ISATTY])
REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
REPLACE_LINK=0; AC_SUBST([REPLACE_LINK])
REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT])
REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD])
REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE])
+ REPLACE_READ=0; AC_SUBST([REPLACE_READ])
REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK])
REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR])
REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP])
diff --git a/m4/unlocked-io.m4 b/m4/unlocked-io.m4
index be4323c..f146206 100644
--- a/m4/unlocked-io.m4
+++ b/m4/unlocked-io.m4
@@ -1,6 +1,6 @@
# unlocked-io.m4 serial 15
-# Copyright (C) 1998-2006, 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 1998-2006, 2009-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4
index 32ea985..d730e43 100644
--- a/m4/vasnprintf.m4
+++ b/m4/vasnprintf.m4
@@ -1,5 +1,5 @@
-# vasnprintf.m4 serial 32
-dnl Copyright (C) 2002-2004, 2006-2011 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 36
+dnl Copyright (C) 2002-2004, 2006-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -29,7 +29,7 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
gl_PREREQ_ASNPRINTF
])
-# Prequisites of lib/printf-args.h, lib/printf-args.c.
+# Prerequisites of lib/printf-args.h, lib/printf-args.c.
AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
[
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
@@ -37,7 +37,7 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
AC_REQUIRE([gt_TYPE_WINT_T])
])
-# Prequisites of lib/printf-parse.h, lib/printf-parse.c.
+# Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
[
AC_REQUIRE([gl_FEATURES_H])
@@ -55,7 +55,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
# Prerequisites of lib/vasnprintf.c.
AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
[
- AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([AC_FUNC_ALLOCA])
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
AC_REQUIRE([gt_TYPE_WCHAR_T])
@@ -63,7 +62,10 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
dnl Use the _snprintf function only if it is declared (because on NetBSD it
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
- AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>])
+ AC_CHECK_DECLS([_snprintf], , , [[#include <stdio.h>]])
+ dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
+ dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE.
+ AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
dnl We can avoid a lot of code by assuming that snprintf's return value
dnl conforms to ISO C99. So check that.
AC_REQUIRE([gl_SNPRINTF_RETVAL_C99])
diff --git a/m4/vasprintf-posix.m4 b/m4/vasprintf-posix.m4
index 06390a8..c2b0901 100644
--- a/m4/vasprintf-posix.m4
+++ b/m4/vasprintf-posix.m4
@@ -1,5 +1,5 @@
# vasprintf-posix.m4 serial 13
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/vasprintf.m4 b/m4/vasprintf.m4
index 6db52b1..c214ff1 100644
--- a/m4/vasprintf.m4
+++ b/m4/vasprintf.m4
@@ -1,5 +1,5 @@
# vasprintf.m4 serial 6
-dnl Copyright (C) 2002-2003, 2006-2007, 2009-2011 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2013 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/version-etc.m4 b/m4/version-etc.m4
index 5032bf8..5dbef8e 100644
--- a/m4/version-etc.m4
+++ b/m4/version-etc.m4
@@ -1,5 +1,5 @@
# version-etc.m4 serial 1
-# Copyright (C) 2009-2011 Free Software Foundation, Inc.
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/m4/wait-process.m4 b/m4/wait-process.m4
index 078d094..693bebf 100644
--- a/m4/wait-process.m4
+++ b/m4/wait-process.m4
@@ -1,5 +1,5 @@
-# wait-process.m4 serial 5
-dnl Copyright (C) 2003, 2008-2011 Free Software Foundation, Inc.
+# wait-process.m4 serial 6
+dnl Copyright (C) 2003, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_WAIT_PROCESS],
[
dnl Prerequisites of lib/wait-process.c.
- AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([gt_TYPE_SIG_ATOMIC_T])
AC_CHECK_FUNCS([waitid])
])
diff --git a/m4/waitpid.m4 b/m4/waitpid.m4
index ccc25e4..26ce890 100644
--- a/m4/waitpid.m4
+++ b/m4/waitpid.m4
@@ -1,5 +1,5 @@
-# waitpid.m4 serial 1
-dnl Copyright (C) 2010-2011 Free Software Foundation, Inc.
+# waitpid.m4 serial 2
+dnl Copyright (C) 2010-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -7,9 +7,8 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_WAITPID],
[
AC_REQUIRE([AC_CANONICAL_HOST])
+ HAVE_WAITPID=1
case $host_os in
- mingw*)
- AC_LIBOBJ([waitpid])
- ;;
+ mingw*) HAVE_WAITPID=0 ;;
esac
])
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index a8f3466..5f5da51 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -1,5 +1,5 @@
-# warnings.m4 serial 2
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# warnings.m4 serial 10
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -14,23 +14,66 @@ m4_ifdef([AS_VAR_APPEND],
[m4_define([gl_AS_VAR_APPEND],
[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])])
-# gl_WARN_ADD(PARAMETER, [VARIABLE = WARN_CFLAGS])
-# ------------------------------------------------
-# Adds parameter to WARN_CFLAGS if the compiler supports it. For example,
-# gl_WARN_ADD([-Wparentheses]).
-AC_DEFUN([gl_WARN_ADD],
-[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_$1])dnl
-AC_CACHE_CHECK([whether compiler handles $1], [gl_Warn], [
- save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="${CPPFLAGS} $1"
- AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
- [AS_VAR_SET([gl_Warn], [yes])],
- [AS_VAR_SET([gl_Warn], [no])])
- CPPFLAGS="$save_CPPFLAGS"
+
+# gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED],
+# [PROGRAM = AC_LANG_PROGRAM()])
+# -----------------------------------------------------------------
+# Check if the compiler supports OPTION when compiling PROGRAM.
+#
+# FIXME: gl_Warn must be used unquoted until we can assume Autoconf
+# 2.64 or newer.
+AC_DEFUN([gl_COMPILER_OPTION_IF],
+[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
+AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
+AS_LITERAL_IF([$1],
+ [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))],
+ [gl_positive="$1"
+case $gl_positive in
+ -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
+esac
+m4_pushdef([gl_Positive], [$gl_positive])])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
+ gl_save_compiler_FLAGS="$gl_Flags"
+ gl_AS_VAR_APPEND(m4_defn([gl_Flags]),
+ [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["])
+ AC_COMPILE_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
+ [AS_VAR_SET(gl_Warn, [yes])],
+ [AS_VAR_SET(gl_Warn, [no])])
+ gl_Flags="$gl_save_compiler_FLAGS"
])
-AS_VAR_PUSHDEF([gl_Flags], m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]))dnl
-AS_VAR_IF([gl_Warn], [yes], [gl_AS_VAR_APPEND([gl_Flags], [" $1"])])
+AS_VAR_IF(gl_Warn, [yes], [$2], [$3])
+m4_popdef([gl_Positive])dnl
AS_VAR_POPDEF([gl_Flags])dnl
AS_VAR_POPDEF([gl_Warn])dnl
-m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl
])
+
+# gl_UNKNOWN_WARNINGS_ARE_ERRORS
+# ------------------------------
+# Clang doesn't complain about unknown warning options unless one also
+# specifies -Wunknown-warning-option -Werror. Detect this.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS],
+[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option],
+ [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'],
+ [gl_unknown_warnings_are_errors=])])
+
+# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS],
+# [PROGRAM = AC_LANG_PROGRAM()])
+# ---------------------------------------------
+# Adds parameter to WARN_CFLAGS if the compiler supports it when
+# compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]).
+#
+# If VARIABLE is a variable name, AC_SUBST it.
+AC_DEFUN([gl_WARN_ADD],
+[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+gl_COMPILER_OPTION_IF([$1],
+ [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])],
+ [],
+ [$3])
+m4_ifval([$2],
+ [AS_LITERAL_IF([$2], [AC_SUBST([$2])])],
+ [AC_SUBST([WARN_CFLAGS])])dnl
+])
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4
index 6255ff3..bedb15a 100644
--- a/m4/wchar_h.m4
+++ b/m4/wchar_h.m4
@@ -1,13 +1,13 @@
dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
-dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl Written by Eric Blake.
-# wchar_h.m4 serial 38
+# wchar_h.m4 serial 39
AC_DEFUN([gl_WCHAR_H],
[
@@ -119,13 +119,6 @@ Configuration aborted.])
fi
])
-dnl Unconditionally enables the replacement of <wchar.h>.
-AC_DEFUN([gl_REPLACE_WCHAR_H],
-[
- dnl This is a no-op, because <wchar.h> is always overridden.
- :
-])
-
AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4
index d2c03c4..e1e1e69 100644
--- a/m4/wchar_t.m4
+++ b/m4/wchar_t.m4
@@ -1,5 +1,5 @@
# wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/wcrtomb.m4 b/m4/wcrtomb.m4
index 2905d9b..f56b5ba 100644
--- a/m4/wcrtomb.m4
+++ b/m4/wcrtomb.m4
@@ -1,5 +1,5 @@
-# wcrtomb.m4 serial 8
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# wcrtomb.m4 serial 11
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -14,6 +14,22 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
AC_CHECK_FUNCS_ONCE([wcrtomb])
if test $ac_cv_func_wcrtomb = no; then
HAVE_WCRTOMB=0
+ AC_CHECK_DECLS([wcrtomb],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+ included before <wchar.h>. */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+ if test $ac_cv_have_decl_wcrtomb = yes; then
+ dnl On Minix 3.1.8, the system's <wchar.h> declares wcrtomb() although
+ dnl it does not have the function. Avoid a collision with gnulib's
+ dnl replacement.
+ REPLACE_WCRTOMB=1
+ fi
else
if test $REPLACE_MBSTATE_T = 1; then
REPLACE_WCRTOMB=1
@@ -88,11 +104,6 @@ int main ()
esac
fi
fi
- if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
- gl_REPLACE_WCHAR_H
- AC_LIBOBJ([wcrtomb])
- gl_PREREQ_WCRTOMB
- fi
])
# Prerequisites of lib/wcrtomb.c.
diff --git a/m4/wctob.m4 b/m4/wctob.m4
index 3b4633c..edc0d79 100644
--- a/m4/wctob.m4
+++ b/m4/wctob.m4
@@ -1,5 +1,5 @@
-# wctob.m4 serial 7
-dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
+# wctob.m4 serial 10
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -10,11 +10,10 @@ AC_DEFUN([gl_FUNC_WCTOB],
AC_CHECK_FUNCS_ONCE([wctob])
if test $ac_cv_func_wctob = no; then
+ HAVE_WCTOB=0
HAVE_DECL_WCTOB=0
- gl_REPLACE_WCHAR_H
- AC_LIBOBJ([wctob])
- gl_PREREQ_WCTOB
else
+ HAVE_WCTOB=1
dnl Solaris 9 has the wctob() function but it does not work.
dnl Cygwin 1.7.2 has the wctob() function but it clobbers caller-owned
@@ -102,14 +101,10 @@ int main ()
*yes) ;;
*) REPLACE_WCTOB=1 ;;
esac
- if test $REPLACE_WCTOB = 1; then
- gl_REPLACE_WCHAR_H
- AC_LIBOBJ([wctob])
- gl_PREREQ_WCTOB
- else
+ if test $REPLACE_WCTOB = 0; then
dnl IRIX 6.5 has the wctob() function but does not declare it.
- AC_CHECK_DECLS([wctob], [], [], [
+ AC_CHECK_DECLS([wctob], [], [], [[
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
<wchar.h>.
BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
@@ -118,10 +113,9 @@ int main ()
#include <stdio.h>
#include <time.h>
#include <wchar.h>
-])
+]])
if test $ac_cv_have_decl_wctob != yes; then
HAVE_DECL_WCTOB=0
- gl_REPLACE_WCHAR_H
fi
fi
fi
diff --git a/m4/wctomb.m4 b/m4/wctomb.m4
index bc21b5b..7deba92 100644
--- a/m4/wctomb.m4
+++ b/m4/wctomb.m4
@@ -1,5 +1,5 @@
-# wctomb.m4 serial 1
-dnl Copyright (C) 2011 Free Software Foundation, Inc.
+# wctomb.m4 serial 2
+dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -11,10 +11,6 @@ AC_DEFUN([gl_FUNC_WCTOMB],
if false; then
REPLACE_WCTOMB=1
fi
- if test $REPLACE_WCTOMB = 1; then
- AC_LIBOBJ([wctomb])
- gl_PREREQ_WCTOMB
- fi
])
# Prerequisites of lib/wctomb.c.
diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4
index ef9fb04..82ada0e 100644
--- a/m4/wctype_h.m4
+++ b/m4/wctype_h.m4
@@ -1,8 +1,8 @@
-# wctype_h.m4 serial 14
+# wctype_h.m4 serial 18
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
-dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -22,8 +22,6 @@ AC_DEFUN([gl_WCTYPE_H],
fi
AC_SUBST([HAVE_ISWCNTRL])
- AC_REQUIRE([AC_C_INLINE])
-
AC_REQUIRE([gt_TYPE_WINT_T])
if test $gt_cv_c_wint_t = yes; then
HAVE_WINT_T=1
@@ -57,7 +55,8 @@ AC_DEFUN([gl_WCTYPE_H],
#if __GNU_LIBRARY__ == 1
Linux libc5 i18n is broken.
#endif]], [])],
- [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
+ [gl_cv_func_iswcntrl_works="guessing yes"],
+ [gl_cv_func_iswcntrl_works="guessing no"])
])
])
fi
@@ -67,15 +66,51 @@ AC_DEFUN([gl_WCTYPE_H],
fi
AC_SUBST([HAVE_WCTYPE_H])
- if test "$gl_cv_func_iswcntrl_works" = no; then
- REPLACE_ISWCNTRL=1
- else
- REPLACE_ISWCNTRL=0
- fi
+ case "$gl_cv_func_iswcntrl_works" in
+ *yes) REPLACE_ISWCNTRL=0 ;;
+ *) REPLACE_ISWCNTRL=1 ;;
+ esac
AC_SUBST([REPLACE_ISWCNTRL])
if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
- dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>.
+ dnl Redefine all of iswcntrl, ..., iswxdigit in <wctype.h>.
+ :
+ fi
+
+ if test $REPLACE_ISWCNTRL = 1; then
+ REPLACE_TOWLOWER=1
+ else
+ AC_CHECK_FUNCS([towlower])
+ if test $ac_cv_func_towlower = yes; then
+ REPLACE_TOWLOWER=0
+ else
+ AC_CHECK_DECLS([towlower],,,
+ [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+ included before <wchar.h>.
+ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+ must be included before <wchar.h>. */
+ #include <stddef.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <wchar.h>
+ #if HAVE_WCTYPE_H
+ # include <wctype.h>
+ #endif
+ ]])
+ if test $ac_cv_have_decl_towlower = yes; then
+ dnl On Minix 3.1.8, the system's <wctype.h> declares towlower() and
+ dnl towupper() although it does not have the functions. Avoid a
+ dnl collision with gnulib's replacement.
+ REPLACE_TOWLOWER=1
+ else
+ REPLACE_TOWLOWER=0
+ fi
+ fi
+ fi
+ AC_SUBST([REPLACE_TOWLOWER])
+
+ if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
+ dnl Redefine towlower, towupper in <wctype.h>.
:
fi
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
index da1ce3d..d7cd3db 100644
--- a/m4/wint_t.m4
+++ b/m4/wint_t.m4
@@ -1,5 +1,5 @@
# wint_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/write.m4 b/m4/write.m4
new file mode 100644
index 0000000..a79b2cc
--- /dev/null
+++ b/m4/write.m4
@@ -0,0 +1,32 @@
+# write.m4 serial 5
+dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WRITE],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_MSVC_INVAL])
+ if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+ REPLACE_WRITE=1
+ fi
+ dnl This ifdef is just an optimization, to avoid performing a configure
+ dnl check whose result is not used. It does not make the test of
+ dnl GNULIB_UNISTD_H_SIGPIPE or GNULIB_SIGPIPE redundant.
+ m4_ifdef([gl_SIGNAL_SIGPIPE], [
+ gl_SIGNAL_SIGPIPE
+ if test $gl_cv_header_signal_h_SIGPIPE != yes; then
+ REPLACE_WRITE=1
+ fi
+ ])
+ m4_ifdef([gl_NONBLOCKING_IO], [
+ gl_NONBLOCKING_IO
+ if test $gl_cv_have_nonblocking != yes; then
+ REPLACE_WRITE=1
+ fi
+ ])
+])
+
+# Prerequisites of lib/write.c.
+AC_DEFUN([gl_PREREQ_WRITE], [:])
diff --git a/m4/xalloc.m4 b/m4/xalloc.m4
index 4900820..64ca701 100644
--- a/m4/xalloc.m4
+++ b/m4/xalloc.m4
@@ -1,24 +1,7 @@
-# xalloc.m4 serial 16
-dnl Copyright (C) 2002-2006, 2009-2011 Free Software Foundation, Inc.
+# xalloc.m4 serial 18
+dnl Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free 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_XALLOC],
-[
- AC_LIBOBJ([xmalloc])
-
- gl_PREREQ_XALLOC
- gl_PREREQ_XMALLOC
-])
-
-# Prerequisites of lib/xalloc.h.
-AC_DEFUN([gl_PREREQ_XALLOC], [
- AC_REQUIRE([gl_INLINE])
- :
-])
-
-# Prerequisites of lib/xmalloc.c.
-AC_DEFUN([gl_PREREQ_XMALLOC], [
- :
-])
+AC_DEFUN([gl_XALLOC], [:])
diff --git a/m4/xsize.m4 b/m4/xsize.m4
index 8c693bc..8ea9f2c 100644
--- a/m4/xsize.m4
+++ b/m4/xsize.m4
@@ -1,5 +1,5 @@
-# xsize.m4 serial 4
-dnl Copyright (C) 2003-2004, 2008-2011 Free Software Foundation, Inc.
+# xsize.m4 serial 5
+dnl Copyright (C) 2003-2004, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -8,6 +8,5 @@ AC_DEFUN([gl_XSIZE],
[
dnl Prerequisites of lib/xsize.h.
AC_REQUIRE([gl_SIZE_MAX])
- AC_REQUIRE([AC_C_INLINE])
AC_CHECK_HEADERS([stdint.h])
])
diff --git a/m4/xstrndup.m4 b/m4/xstrndup.m4
index 1400b0f..4a9330b 100644
--- a/m4/xstrndup.m4
+++ b/m4/xstrndup.m4
@@ -1,5 +1,5 @@
# xstrndup.m4 serial 2
-dnl Copyright (C) 2003, 2009-2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/xvasprintf.m4 b/m4/xvasprintf.m4
index 7abfaef..772dcc8 100644
--- a/m4/xvasprintf.m4
+++ b/m4/xvasprintf.m4
@@ -1,11 +1,8 @@
-# xvasprintf.m4 serial 1
-dnl Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
+# xvasprintf.m4 serial 2
+dnl Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free 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_XVASPRINTF],
-[
- dnl Prerequisites of lib/xvasprintf.c.
- AC_REQUIRE([AC_C_INLINE])
-])
+dnl Prerequisites of lib/xvasprintf.c.
+AC_DEFUN([gl_XVASPRINTF], [:])