summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-06-16 18:22:50 +0200
committerAndy Wingo <wingo@pobox.com>2011-06-16 19:47:25 +0200
commit3d458a81c64e4696157b23c7c4c4c150aa4a93b8 (patch)
tree1478fb3a9faaf203f517a8776f54d00884efdef6 /m4
parent0b77014f0c7d53b8bdbc7059c92f526560e1cacd (diff)
gnulib update
Added pipe2 and open modules, to get O_CLOEXEC. * libguile/Makefile.am (guile_filter_doc_snarfage$(EXEEXT)): Add gnulib here, in the native build case, for rpl_fflush if needed. foo
Diffstat (limited to 'm4')
-rw-r--r--m4/arpa_inet_h.m49
-rw-r--r--m4/canonicalize.m421
-rw-r--r--m4/ceil.m44
-rw-r--r--m4/duplocale.m47
-rw-r--r--m4/fclose.m46
-rw-r--r--m4/fcntl-o.m4112
-rw-r--r--m4/fcntl_h.m444
-rw-r--r--m4/fflush.m481
-rw-r--r--m4/flock.m44
-rw-r--r--m4/floor.m44
-rw-r--r--m4/fpurge.m445
-rw-r--r--m4/freading.m410
-rw-r--r--m4/frexp.m46
-rw-r--r--m4/fseek.m415
-rw-r--r--m4/fseeko.m461
-rw-r--r--m4/ftell.m415
-rw-r--r--m4/ftello.m4127
-rw-r--r--m4/getaddrinfo.m439
-rw-r--r--m4/gnulib-cache.m45
-rw-r--r--m4/gnulib-common.m457
-rw-r--r--m4/gnulib-comp.m4798
-rw-r--r--m4/iconv_open-utf.m4231
-rw-r--r--m4/iconv_open.m4243
-rw-r--r--m4/inet_ntop.m423
-rw-r--r--m4/inet_pton.m423
-rw-r--r--m4/isinf.m44
-rw-r--r--m4/isnan.m47
-rw-r--r--m4/isnand.m411
-rw-r--r--m4/isnanf.m412
-rw-r--r--m4/isnanl.m411
-rw-r--r--m4/locale_h.m415
-rw-r--r--m4/lseek.m442
-rw-r--r--m4/lstat.m435
-rw-r--r--m4/malloc.m412
-rw-r--r--m4/memchr.m46
-rw-r--r--m4/mode_t.m426
-rw-r--r--m4/netdb_h.m45
-rw-r--r--m4/nocrash.m4102
-rw-r--r--m4/open.m490
-rw-r--r--m4/pipe2.m418
-rw-r--r--m4/putenv.m43
-rw-r--r--m4/read.m43
-rw-r--r--m4/readlink.m49
-rw-r--r--m4/safe-read.m49
-rw-r--r--m4/safe-write.m49
-rw-r--r--m4/stat.m414
-rw-r--r--m4/stdint.m44
-rw-r--r--m4/stdio_h.m44
-rw-r--r--m4/strftime.m44
-rw-r--r--m4/time_r.m44
-rw-r--r--m4/trunc.m44
-rw-r--r--m4/unistd_h.m48
-rw-r--r--m4/warnings.m46
-rw-r--r--m4/wchar_h.m49
-rw-r--r--m4/write.m45
55 files changed, 1672 insertions, 809 deletions
diff --git a/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4
index d21b162fc..6dc0fdb58 100644
--- a/m4/arpa_inet_h.m4
+++ b/m4/arpa_inet_h.m4
@@ -1,4 +1,4 @@
-# arpa_inet_h.m4 serial 11
+# arpa_inet_h.m4 serial 12
dnl Copyright (C) 2006, 2008-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,
@@ -38,13 +38,6 @@ AC_DEFUN([gl_HEADER_ARPA_INET],
]], [inet_ntop inet_pton])
])
-dnl Unconditionally enables the replacement of <arpa/inet.h>.
-AC_DEFUN([gl_REPLACE_ARPA_INET_H],
-[
- dnl This is a no-op, because <arpa/inet.h> is always overridden.
- :
-])
-
AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
[
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4
index dcc6039ed..ba7a38bb9 100644
--- a/m4/canonicalize.m4
+++ b/m4/canonicalize.m4
@@ -1,4 +1,4 @@
-# canonicalize.m4 serial 17
+# canonicalize.m4 serial 23
dnl Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc.
@@ -10,8 +10,6 @@ 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])
@@ -26,24 +24,23 @@ AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
# 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
fi
elif test "$gl_cv_func_realpath_works" != yes; then
- AC_LIBOBJ([canonicalize-lgpl])
- REPLACE_REALPATH=1
REPLACE_CANONICALIZE_FILE_NAME=1
+ REPLACE_REALPATH=1
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])
@@ -61,9 +58,12 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
AC_CHECK_FUNCS_ONCE([realpath])
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,10 +81,17 @@ 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"])
+ 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()
diff --git a/m4/ceil.m4 b/m4/ceil.m4
index 21d04b468..157407745 100644
--- a/m4/ceil.m4
+++ b/m4/ceil.m4
@@ -1,4 +1,4 @@
-# ceil.m4 serial 5
+# ceil.m4 serial 6
dnl Copyright (C) 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,
@@ -48,7 +48,7 @@ int main()
fi
])
if test $REPLACE_CEIL = 1; then
- AC_LIBOBJ([ceil])
+ dnl No libraries are needed to link lib/ceil.c.
CEIL_LIBM=
fi
AC_SUBST([CEIL_LIBM])
diff --git a/m4/duplocale.m4 b/m4/duplocale.m4
index 4393d82df..cfb7f4b53 100644
--- a/m4/duplocale.m4
+++ b/m4/duplocale.m4
@@ -1,4 +1,4 @@
-# duplocale.m4 serial 5
+# duplocale.m4 serial 7
dnl Copyright (C) 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,
@@ -59,11 +59,6 @@ int main ()
else
HAVE_DUPLOCALE=0
fi
- if test $REPLACE_DUPLOCALE = 1; then
- gl_REPLACE_LOCALE_H
- AC_LIBOBJ([duplocale])
- gl_PREREQ_DUPLOCALE
- fi
])
# Prerequisites of lib/duplocale.c.
diff --git a/m4/fclose.m4 b/m4/fclose.m4
index 278859c6c..349b5f14c 100644
--- a/m4/fclose.m4
+++ b/m4/fclose.m4
@@ -1,4 +1,4 @@
-# fclose.m4 serial 2
+# fclose.m4 serial 4
dnl Copyright (C) 2008-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,
@@ -6,6 +6,10 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FCLOSE],
[
+ gl_FUNC_FFLUSH_STDIN
+ if test $gl_cv_func_fflush_stdin = no; then
+ gl_REPLACE_FCLOSE
+ fi
])
AC_DEFUN([gl_REPLACE_FCLOSE],
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4
new file mode 100644
index 000000000..88db07ec7
--- /dev/null
+++ b/m4/fcntl-o.m4
@@ -0,0 +1,112 @@
+# fcntl-o.m4 serial 3
+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 Written by Paul Eggert.
+
+# Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
+# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
+# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
+AC_DEFUN([gl_FCNTL_O_FLAGS],
+[
+ dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
+ dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
+ dnl AC_GNU_SOURCE.
+ m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+ [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
+ [AC_REQUIRE([AC_GNU_SOURCE])])
+ AC_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>
+ #include <fcntl.h>
+ #ifndef O_NOATIME
+ #define O_NOATIME 0
+ #endif
+ #ifndef O_NOFOLLOW
+ #define O_NOFOLLOW 0
+ #endif
+ static int const constants[] =
+ {
+ O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
+ O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
+ };
+ ]],
+ [[
+ int result = !constants;
+ {
+ static char const sym[] = "conftest.sym";
+ if (symlink (".", sym) != 0)
+ result |= 2;
+ else
+ {
+ int fd = open (sym, O_RDONLY | O_NOFOLLOW);
+ if (fd >= 0)
+ {
+ close (fd);
+ result |= 4;
+ }
+ }
+ unlink (sym);
+ }
+ {
+ static char const file[] = "confdefs.h";
+ int fd = open (file, O_RDONLY | O_NOATIME);
+ if (fd < 0)
+ result |= 8;
+ else
+ {
+ struct stat st0;
+ if (fstat (fd, &st0) != 0)
+ result |= 16;
+ else
+ {
+ char c;
+ sleep (1);
+ if (read (fd, &c, 1) != 1)
+ result |= 24;
+ else
+ {
+ if (close (fd) != 0)
+ result |= 32;
+ else
+ {
+ struct stat st1;
+ if (stat (file, &st1) != 0)
+ result |= 40;
+ else
+ if (st0.st_atime != st1.st_atime)
+ result |= 64;
+ }
+ }
+ }
+ }
+ }
+ return result;]])],
+ [gl_cv_header_working_fcntl_h=yes],
+ [case $? in #(
+ 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+ 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
+ 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+ *) gl_cv_header_working_fcntl_h='no';;
+ esac],
+ [gl_cv_header_working_fcntl_h=cross-compiling])])
+
+ case $gl_cv_header_working_fcntl_h in #(
+ *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
+ *) ac_val=1;;
+ esac
+ AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val],
+ [Define to 1 if O_NOATIME works.])
+
+ case $gl_cv_header_working_fcntl_h in #(
+ *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
+ *) ac_val=1;;
+ esac
+ AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val],
+ [Define to 1 if O_NOFOLLOW works.])
+])
diff --git a/m4/fcntl_h.m4 b/m4/fcntl_h.m4
new file mode 100644
index 000000000..c466da4df
--- /dev/null
+++ b/m4/fcntl_h.m4
@@ -0,0 +1,44 @@
+# serial 13
+# Configure fcntl.h.
+dnl Copyright (C) 2006-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.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl_FCNTL_H],
+[
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_REQUIRE([gl_FCNTL_O_FLAGS])
+ gl_NEXT_HEADERS([fcntl.h])
+
+ dnl Check for declarations of anything we want to poison if the
+ dnl corresponding gnulib module is not in use, if it is not common
+ dnl enough to be declared everywhere.
+ gl_WARN_ON_USE_PREPARE([[#include <fcntl.h>
+ ]], [fcntl openat])
+])
+
+AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
+[
+ dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+ AC_REQUIRE([gl_FCNTL_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_FCNTL_H_DEFAULTS],
+[
+ 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])
+])
diff --git a/m4/fflush.m4 b/m4/fflush.m4
new file mode 100644
index 000000000..a91ee0bea
--- /dev/null
+++ b/m4/fflush.m4
@@ -0,0 +1,81 @@
+# fflush.m4 serial 12
+
+# Copyright (C) 2007-2011 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Eric Blake
+
+dnl Find out how to obey POSIX semantics of fflush(stdin) discarding
+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 = no; 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_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>
+ ]], [[FILE *f = fopen ("conftest.txt", "r");
+ char buffer[10];
+ int fd;
+ int c;
+ if (f == NULL)
+ return 1;
+ fd = fileno (f);
+ if (fd < 0 || fread (buffer, 1, 5, f) != 5)
+ return 2;
+ /* For deterministic results, ensure f read a bigger buffer. */
+ if (lseek (fd, 0, SEEK_CUR) == 5)
+ return 3;
+ /* POSIX requires fflush-fseek to set file offset of fd. This fails
+ on BSD systems and on mingw. */
+ if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
+ return 4;
+ if (lseek (fd, 0, SEEK_CUR) != 5)
+ return 5;
+ /* Verify behaviour of fflush after ungetc. See
+ <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> */
+ /* Verify behaviour of fflush after a backup ungetc. This fails on
+ mingw. */
+ c = fgetc (f);
+ ungetc (c, f);
+ fflush (f);
+ if (fgetc (f) != c)
+ return 6;
+ /* Verify behaviour of fflush after a non-backup ungetc. This fails
+ on glibc 2.8 and on BSD systems. */
+ c = fgetc (f);
+ ungetc ('@', f);
+ fflush (f);
+ if (fgetc (f) != c)
+ 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])
+ rm conftest.txt
+ ])
+])
+
+# Prerequisites of lib/fflush.c.
+AC_DEFUN([gl_PREREQ_FFLUSH],
+[
+ AC_REQUIRE([AC_C_INLINE])
+ :
+])
diff --git a/m4/flock.m4 b/m4/flock.m4
index 7d8c7030d..c1b64c807 100644
--- a/m4/flock.m4
+++ b/m4/flock.m4
@@ -1,4 +1,4 @@
-# flock.m4 serial 2
+# flock.m4 serial 3
dnl Copyright (C) 2008-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,
@@ -10,8 +10,6 @@ AC_DEFUN([gl_FUNC_FLOCK],
AC_CHECK_FUNCS_ONCE([flock])
if test $ac_cv_func_flock = no; then
HAVE_FLOCK=0
- AC_LIBOBJ([flock])
- gl_PREREQ_FLOCK
fi
])
diff --git a/m4/floor.m4 b/m4/floor.m4
index 568310785..62d19fed7 100644
--- a/m4/floor.m4
+++ b/m4/floor.m4
@@ -1,4 +1,4 @@
-# floor.m4 serial 5
+# floor.m4 serial 6
dnl Copyright (C) 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,
@@ -48,7 +48,7 @@ int main()
fi
])
if test $REPLACE_FLOOR = 1; then
- AC_LIBOBJ([floor])
+ dnl No libraries are needed to link lib/floor.c.
FLOOR_LIBM=
fi
AC_SUBST([FLOOR_LIBM])
diff --git a/m4/fpurge.m4 b/m4/fpurge.m4
new file mode 100644
index 000000000..234f563f8
--- /dev/null
+++ b/m4/fpurge.m4
@@ -0,0 +1,45 @@
+# fpurge.m4 serial 7
+dnl Copyright (C) 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_FUNC_FPURGE],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_CHECK_FUNCS_ONCE([fpurge])
+ AC_CHECK_FUNCS_ONCE([__fpurge])
+ AC_CHECK_DECLS([fpurge], , , [[#include <stdio.h>]])
+ if test "x$ac_cv_func_fpurge" = xyes; then
+ HAVE_FPURGE=1
+ # Detect BSD bug. Only cygwin 1.7 is known to be immune.
+ AC_CACHE_CHECK([whether fpurge works], [gl_cv_func_fpurge_works],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
+]], [FILE *f = fopen ("conftest.txt", "w+");
+ if (!f) return 1;
+ if (fputc ('a', f) != 'a') return 2;
+ rewind (f);
+ if (fgetc (f) != 'a') return 3;
+ if (fgetc (f) != EOF) return 4;
+ if (fpurge (f) != 0) return 5;
+ if (putc ('b', f) != 'b') return 6;
+ if (fclose (f) != 0) return 7;
+ if ((f = fopen ("conftest.txt", "r")) == NULL) return 8;
+ if (fgetc (f) != 'a') return 9;
+ if (fgetc (f) != 'b') return 10;
+ if (fgetc (f) != EOF) return 11;
+ if (fclose (f) != 0) return 12;
+ if (remove ("conftest.txt") != 0) return 13;
+ return 0;])],
+ [gl_cv_func_fpurge_works=yes], [gl_cv_func_fpurge_works=no],
+ [gl_cv_func_fpurge_works='guessing no'])])
+ if test "x$gl_cv_func_fpurge_works" != xyes; then
+ REPLACE_FPURGE=1
+ fi
+ else
+ HAVE_FPURGE=0
+ fi
+ if test "x$ac_cv_have_decl_fpurge" = xno; then
+ HAVE_DECL_FPURGE=0
+ fi
+])
diff --git a/m4/freading.m4 b/m4/freading.m4
new file mode 100644
index 000000000..59d502efd
--- /dev/null
+++ b/m4/freading.m4
@@ -0,0 +1,10 @@
+# freading.m4 serial 1
+dnl Copyright (C) 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_FUNC_FREADING],
+[
+ AC_CHECK_FUNCS_ONCE([__freading])
+])
diff --git a/m4/frexp.m4 b/m4/frexp.m4
index 2e0fb3b47..0021ed2b9 100644
--- a/m4/frexp.m4
+++ b/m4/frexp.m4
@@ -1,4 +1,4 @@
-# frexp.m4 serial 10
+# frexp.m4 serial 11
dnl Copyright (C) 2007-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,
@@ -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
])
diff --git a/m4/fseek.m4 b/m4/fseek.m4
new file mode 100644
index 000000000..135a22bdc
--- /dev/null
+++ b/m4/fseek.m4
@@ -0,0 +1,15 @@
+# fseek.m4 serial 4
+dnl Copyright (C) 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_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
new file mode 100644
index 000000000..391948d4e
--- /dev/null
+++ b/m4/fseeko.m4
@@ -0,0 +1,61 @@
+# fseeko.m4 serial 15
+dnl Copyright (C) 2007-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_FSEEKO],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
+ AC_REQUIRE([AC_PROG_CC])
+
+ dnl Persuade glibc <stdio.h> to declare fseeko().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko],
+ [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
+]], [fseeko (stdin, 0, 0);])],
+ [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
+ ])
+
+ 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 $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 = no; then
+ REPLACE_FSEEKO=1
+ fi
+ ])
+ fi
+])
+
+dnl Code shared by fseeko and ftello. Determine if large files are supported,
+dnl but stdin does not start as a large file by default.
+AC_DEFUN([gl_STDIN_LARGE_OFFSET],
+ [
+ AC_CACHE_CHECK([whether stdin defaults to large file offsets],
+ [gl_cv_var_stdin_large_offset],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
+[[#if defined __SL64 && defined __SCLE /* cygwin */
+ /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
+ fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and
+ it is easier to do a version check than building a runtime test. */
+# include <cygwin/version.h>
+# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
+ choke me
+# endif
+#endif]])],
+ [gl_cv_var_stdin_large_offset=yes],
+ [gl_cv_var_stdin_large_offset=no])])
+])
diff --git a/m4/ftell.m4 b/m4/ftell.m4
new file mode 100644
index 000000000..c529c5030
--- /dev/null
+++ b/m4/ftell.m4
@@ -0,0 +1,15 @@
+# ftell.m4 serial 3
+dnl Copyright (C) 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_FUNC_FTELL],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_FTELLO])
+ dnl When ftello needs fixes, ftell needs them too.
+ if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
+ REPLACE_FTELL=1
+ fi
+])
diff --git a/m4/ftello.m4 b/m4/ftello.m4
new file mode 100644
index 000000000..10cf4291b
--- /dev/null
+++ b/m4/ftello.m4
@@ -0,0 +1,127 @@
+# ftello.m4 serial 10
+dnl Copyright (C) 2007-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_FTELLO],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
+
+ dnl Persuade glibc <stdio.h> to declare ftello().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_DECLS_ONCE([ftello])
+ if test $ac_cv_have_decl_ftello = no; then
+ HAVE_DECL_FTELLO=0
+ fi
+
+ AC_CACHE_CHECK([for ftello], [gl_cv_func_ftello],
+ [
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <stdio.h>]],
+ [[ftello (stdin);]])],
+ [gl_cv_func_ftello=yes],
+ [gl_cv_func_ftello=no])
+ ])
+ if test $gl_cv_func_ftello = no; then
+ HAVE_FTELLO=0
+ else
+ if test $gl_cv_var_stdin_large_offset = no; then
+ REPLACE_FTELLO=1
+ else
+ 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
+ dnl flag does not get cleared in this case, even though _IOWRT gets set,
+ dnl and ftell and ftello look whether the _IOREAD flag is set.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([whether ftello works],
+ [gl_cv_func_ftello_works],
+ [
+ dnl Initial guess, used when cross-compiling or when /dev/tty cannot
+ dnl be opened.
+changequote(,)dnl
+ case "$host_os" in
+ # Guess no on Solaris.
+ solaris*) gl_cv_func_ftello_works="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_ftello_works="guessing yes" ;;
+ esac
+changequote([,])dnl
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define TESTFILE "conftest.tmp"
+int
+main (void)
+{
+ FILE *fp;
+
+ /* Create a file with some contents. */
+ fp = fopen (TESTFILE, "w");
+ if (fp == NULL)
+ return 70;
+ if (fwrite ("foogarsh", 1, 8, fp) < 8)
+ return 71;
+ if (fclose (fp))
+ return 72;
+
+ /* The file's contents is now "foogarsh". */
+
+ /* Try writing after reading to EOF. */
+ fp = fopen (TESTFILE, "r+");
+ if (fp == NULL)
+ return 73;
+ if (fseek (fp, -1, SEEK_END))
+ return 74;
+ if (!(getc (fp) == 'h'))
+ return 1;
+ if (!(getc (fp) == EOF))
+ return 2;
+ if (!(ftell (fp) == 8))
+ return 3;
+ if (!(ftell (fp) == 8))
+ return 4;
+ if (!(putc ('!', fp) == '!'))
+ return 5;
+ if (!(ftell (fp) == 9))
+ return 6;
+ if (!(fclose (fp) == 0))
+ return 7;
+ fp = fopen (TESTFILE, "r");
+ if (fp == NULL)
+ return 75;
+ {
+ char buf[10];
+ if (!(fread (buf, 1, 10, fp) == 9))
+ return 10;
+ if (!(memcmp (buf, "foogarsh!", 9) == 0))
+ return 11;
+ }
+ if (!(fclose (fp) == 0))
+ return 12;
+
+ /* The file's contents is now "foogarsh!". */
+
+ return 0;
+}]])],
+ [gl_cv_func_ftello_works=yes],
+ [gl_cv_func_ftello_works=no], [:])
+ ])
+ case "$gl_cv_func_ftello_works" in
+ *yes) ;;
+ *)
+ REPLACE_FTELLO=1
+ AC_DEFINE([FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE], [1],
+ [Define to 1 if the system's ftello function has the Solaris bug.])
+ ;;
+ esac
+ fi
+ fi
+])
diff --git a/m4/getaddrinfo.m4 b/m4/getaddrinfo.m4
index e57623694..20a622611 100644
--- a/m4/getaddrinfo.m4
+++ b/m4/getaddrinfo.m4
@@ -1,4 +1,4 @@
-# getaddrinfo.m4 serial 24
+# getaddrinfo.m4 serial 26
dnl Copyright (C) 2004-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,
@@ -24,6 +24,7 @@ AC_DEFUN([gl_GETADDRINFO],
fi])
LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
+ HAVE_GETADDRINFO=1
AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
@@ -55,16 +56,14 @@ AC_DEFUN([gl_GETADDRINFO],
GETADDRINFO_LIB="-lws2_32"
LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
else
- AC_LIBOBJ([getaddrinfo])
+ HAVE_GETADDRINFO=0
fi
fi
# We can't use AC_REPLACE_FUNCS here because gai_strerror may be an
# inline function declared in ws2tcpip.h, so we need to get that
# header included somehow.
- AC_CACHE_CHECK([for gai_strerror (possibly via ws2tcpip.h)],
- gl_cv_func_gai_strerror, [
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ AC_CHECK_DECLS([gai_strerror, gai_strerrorA], [], [break], [[
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
@@ -76,11 +75,29 @@ AC_DEFUN([gl_GETADDRINFO],
#include <ws2tcpip.h>
#endif
#include <stddef.h>
-]], [[gai_strerror (NULL);]])],
- [gl_cv_func_gai_strerror=yes],
- [gl_cv_func_gai_strerror=no])])
- if test $gl_cv_func_gai_strerror = no; then
- AC_LIBOBJ([gai_strerror])
+]])
+ if test $ac_cv_have_decl_gai_strerror = yes; then
+ dnl check for correct signature
+ AC_CACHE_CHECK([for gai_strerror with POSIX signature],
+ [gl_cv_func_gai_strerror_posix_signature], [
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+#include <stddef.h>
+extern const char *gai_strerror(int);]])],
+ [gl_cv_func_gai_strerror_posix_signature=yes],
+ [gl_cv_func_gai_strerror_posix_signature=no])])
+ if test $gl_cv_func_gai_strerror_posix_signature = no; then
+ REPLACE_GAI_STRERROR=1
+ fi
fi
LIBS="$gai_saved_LIBS"
@@ -112,7 +129,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [
AC_CHECK_HEADERS_ONCE([netinet/in.h])
- AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[
+ AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, getnameinfo],,,[
/* 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. */
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
index 70f8b9ae5..64dfef04b 100644
--- a/m4/gnulib-cache.m4
+++ b/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap canonicalize-lgpl ceil close connect duplocale environ extensions flock floor fpieee frexp full-read full-write func gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring listen locale log1p maintainer-makefile malloc-gnu malloca nproc putenv recv recvfrom send sendto setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat trunc verify vsnprintf warnings wchar
+# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap canonicalize-lgpl ceil close connect duplocale environ extensions flock floor fpieee frexp full-read full-write func gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring listen locale log1p maintainer-makefile malloc-gnu malloca nproc open pipe2 putenv recv recvfrom send sendto setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat trunc verify vsnprintf warnings wchar
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
@@ -67,6 +67,8 @@ gl_MODULES([
malloc-gnu
malloca
nproc
+ open
+ pipe2
putenv
recv
recvfrom
@@ -99,4 +101,5 @@ gl_MAKEFILE_NAME([])
gl_LIBTOOL
gl_MACRO_PREFIX([gl])
gl_PO_DOMAIN([])
+gl_WITNESS_C_DOMAIN([])
gl_VC_FILES([false])
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index c4d7a20ea..843efe051 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 24
+# gnulib-common.m4 serial 26
dnl Copyright (C) 2007-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,
@@ -34,6 +34,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 +61,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])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 257258734..79f61fb3d 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -35,6 +35,7 @@ AC_DEFUN([gl_EARLY],
# Code from module arpa_inet:
# Code from module autobuild:
AB_INIT
+ # Code from module binary-io:
# Code from module bind:
# Code from module byteswap:
# Code from module c++defs:
@@ -52,13 +53,24 @@ AC_DEFUN([gl_EARLY],
# Code from module extensions:
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
# Code from module fclose:
+ # Code from module fcntl-h:
# Code from module fd-hook:
+ # Code from module fflush:
+ AC_REQUIRE([AC_FUNC_FSEEKO])
# Code from module float:
# Code from module flock:
# Code from module floor:
# Code from module fpieee:
AC_REQUIRE([gl_FP_IEEE])
+ # Code from module fpurge:
+ # Code from module freading:
# Code from module frexp:
+ # Code from module fseek:
+ # Code from module fseeko:
+ AC_REQUIRE([AC_FUNC_FSEEKO])
+ # Code from module ftell:
+ # Code from module ftello:
+ AC_REQUIRE([AC_FUNC_FSEEKO])
# Code from module full-read:
# Code from module full-write:
# Code from module func:
@@ -97,6 +109,7 @@ AC_DEFUN([gl_EARLY],
# Code from module listen:
# Code from module locale:
# Code from module log1p:
+ # Code from module lseek:
# Code from module lstat:
# Code from module maintainer-makefile:
# Code from module malloc-gnu:
@@ -107,8 +120,11 @@ AC_DEFUN([gl_EARLY],
# Code from module multiarch:
# Code from module netdb:
# Code from module netinet_in:
+ # Code from module nocrash:
# Code from module nproc:
+ # Code from module open:
# Code from module pathmax:
+ # Code from module pipe2:
# Code from module putenv:
# Code from module read:
# Code from module readlink:
@@ -181,375 +197,390 @@ AC_DEFUN([gl_INIT],
m4_pushdef([gl_LIBSOURCES_DIR], [])
gl_COMMON
gl_source_base='lib'
- # Code from module accept:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([accept])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([accept])
- # Code from module alignof:
- # Code from module alloca-opt:
- gl_FUNC_ALLOCA
- # Code from module announce-gen:
- # Code from module arg-nonnull:
- # Code from module arpa_inet:
- gl_HEADER_ARPA_INET
- AC_PROG_MKDIR_P
- # Code from module autobuild:
- # Code from module bind:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([bind])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([bind])
- # Code from module byteswap:
- gl_BYTESWAP
- # Code from module c++defs:
- # Code from module c-ctype:
- # Code from module c-strcase:
- # Code from module c-strcaseeq:
- # Code from module canonicalize-lgpl:
- gl_CANONICALIZE_LGPL
- gl_MODULE_INDICATOR([canonicalize-lgpl])
- gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
- gl_STDLIB_MODULE_INDICATOR([realpath])
- # Code from module ceil:
- gl_FUNC_CEIL
- gl_MATH_MODULE_INDICATOR([ceil])
- # Code from module close:
- gl_FUNC_CLOSE
- gl_UNISTD_MODULE_INDICATOR([close])
- # Code from module connect:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([connect])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([connect])
- # Code from module dosname:
- # Code from module duplocale:
- gl_FUNC_DUPLOCALE
- gl_LOCALE_MODULE_INDICATOR([duplocale])
- # Code from module environ:
- gl_ENVIRON
- gl_UNISTD_MODULE_INDICATOR([environ])
- # Code from module errno:
- gl_HEADER_ERRNO_H
- # Code from module extensions:
- # Code from module fclose:
- gl_FUNC_FCLOSE
- gl_STDIO_MODULE_INDICATOR([fclose])
- # Code from module fd-hook:
- # Code from module float:
- gl_FLOAT_H
- # Code from module flock:
- gl_FUNC_FLOCK
- gl_HEADER_SYS_FILE_MODULE_INDICATOR([flock])
- # Code from module floor:
- gl_FUNC_FLOOR
- gl_MATH_MODULE_INDICATOR([floor])
- # Code from module fpieee:
- # Code from module frexp:
- gl_FUNC_FREXP
- gl_MATH_MODULE_INDICATOR([frexp])
- # Code from module full-read:
- # Code from module full-write:
- # Code from module func:
- gl_FUNC
- # Code from module gendocs:
- # Code from module getaddrinfo:
- gl_GETADDRINFO
- gl_NETDB_MODULE_INDICATOR([getaddrinfo])
- # Code from module getpeername:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([getpeername])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([getpeername])
- # Code from module getsockname:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([getsockname])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([getsockname])
- # Code from module getsockopt:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([getsockopt])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([getsockopt])
- # Code from module gettext-h:
- AC_SUBST([LIBINTL])
- AC_SUBST([LTLIBINTL])
- # Code from module git-version-gen:
- # Code from module gitlog-to-changelog:
- # 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.
- # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
- # 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], [],
- [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
- [GNUmakefile=$GNUmakefile])])
- # Code from module gnupload:
- # Code from module gperf:
- # Code from module havelib:
- # Code from module hostent:
- gl_HOSTENT
- # Code from module iconv:
- AM_ICONV
- m4_ifdef([gl_ICONV_MODULE_INDICATOR],
- [gl_ICONV_MODULE_INDICATOR([iconv])])
- # Code from module iconv-h:
- gl_ICONV_H
- # Code from module iconv_open:
- gl_FUNC_ICONV_OPEN
- # Code from module iconv_open-utf:
- gl_FUNC_ICONV_OPEN_UTF
- # Code from module include_next:
- # Code from module inet_ntop:
- gl_FUNC_INET_NTOP
- gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
- # Code from module inet_pton:
- gl_FUNC_INET_PTON
- gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
- # Code from module inline:
- gl_INLINE
- # Code from module isinf:
- gl_ISINF
- gl_MATH_MODULE_INDICATOR([isinf])
- # Code from module isnan:
- gl_ISNAN
- gl_MATH_MODULE_INDICATOR([isnan])
- # Code from module isnand:
- gl_FUNC_ISNAND
- gl_MATH_MODULE_INDICATOR([isnand])
- # Code from module isnand-nolibm:
- gl_FUNC_ISNAND_NO_LIBM
- # Code from module isnanf:
- gl_FUNC_ISNANF
- gl_MATH_MODULE_INDICATOR([isnanf])
- # Code from module isnanl:
- gl_FUNC_ISNANL
- gl_MATH_MODULE_INDICATOR([isnanl])
- # Code from module ldexp:
- gl_FUNC_LDEXP
- # Code from module lib-symbol-versions:
- gl_LD_VERSION_SCRIPT
- # Code from module lib-symbol-visibility:
- gl_VISIBILITY
- # Code from module libunistring:
- gl_LIBUNISTRING
- # Code from module listen:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([listen])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([listen])
- # Code from module locale:
- gl_LOCALE_H
- # Code from module log1p:
- gl_COMMON_DOUBLE_MATHFUNC([log1p])
- # Code from module lstat:
- gl_FUNC_LSTAT
- 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
- gl_MODULE_INDICATOR([malloc-gnu])
- # Code from module malloc-posix:
- gl_FUNC_MALLOC_POSIX
- gl_STDLIB_MODULE_INDICATOR([malloc-posix])
- # Code from module malloca:
- gl_MALLOCA
- # Code from module math:
- gl_MATH_H
- # Code from module memchr:
- gl_FUNC_MEMCHR
- gl_STRING_MODULE_INDICATOR([memchr])
- # Code from module multiarch:
- gl_MULTIARCH
- # Code from module netdb:
- gl_HEADER_NETDB
- # Code from module netinet_in:
- gl_HEADER_NETINET_IN
- AC_PROG_MKDIR_P
- # Code from module nproc:
- gl_NPROC
- # Code from module pathmax:
- gl_PATHMAX
- # Code from module putenv:
- gl_FUNC_PUTENV
- gl_STDLIB_MODULE_INDICATOR([putenv])
- # Code from module read:
- gl_FUNC_READ
- gl_UNISTD_MODULE_INDICATOR([read])
- # Code from module readlink:
- gl_FUNC_READLINK
- gl_UNISTD_MODULE_INDICATOR([readlink])
- # Code from module recv:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([recv])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([recv])
- # Code from module recvfrom:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([recvfrom])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([recvfrom])
- # Code from module safe-read:
- gl_SAFE_READ
- # Code from module safe-write:
- gl_SAFE_WRITE
- # Code from module send:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([send])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([send])
- # Code from module sendto:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([sendto])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([sendto])
- # Code from module servent:
- gl_SERVENT
- # Code from module setsockopt:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([setsockopt])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt])
- # Code from module shutdown:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([shutdown])
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([shutdown])
- # 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 socket:
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- if test "$ac_cv_header_winsock2_h" = yes; then
- AC_LIBOBJ([socket])
- fi
- # When this module is used, sockets may actually occur as file descriptors,
- # hence it is worth warning if the modules 'close' and 'ioctl' are not used.
- 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_REQUIRE([gl_PREREQ_SYS_H_WINSOCK2])
- if test "$ac_cv_header_winsock2_h" = yes; then
- UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
- SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
- fi
- gl_SYS_SOCKET_MODULE_INDICATOR([socket])
- # Code from module socketlib:
- gl_SOCKETLIB
- # Code from module sockets:
- gl_SOCKETS
- # Code from module socklen:
- gl_TYPE_SOCKLEN_T
- # Code from module ssize_t:
- gt_TYPE_SSIZE_T
- # Code from module stat:
- gl_FUNC_STAT
- gl_SYS_STAT_MODULE_INDICATOR([stat])
- # Code from module stat-time:
- gl_STAT_TIME
- gl_STAT_BIRTHTIME
- # 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 strftime:
- gl_FUNC_GNU_STRFTIME
- # Code from module striconveh:
- if test $gl_cond_libtool = false; then
- gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV"
- gl_libdeps="$gl_libdeps $LIBICONV"
- fi
- # Code from module string:
- gl_HEADER_STRING_H
- # Code from module sys_file:
- gl_HEADER_SYS_FILE_H
- AC_PROG_MKDIR_P
- # Code from module sys_socket:
- gl_HEADER_SYS_SOCKET
- AC_PROG_MKDIR_P
- # 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_uio:
- gl_HEADER_SYS_UIO
- AC_PROG_MKDIR_P
- # Code from module time:
- gl_HEADER_TIME_H
- # Code from module time_r:
- gl_TIME_R
- gl_TIME_MODULE_INDICATOR([time_r])
- # Code from module trunc:
- gl_FUNC_TRUNC
- gl_MATH_MODULE_INDICATOR([trunc])
- # Code from module unistd:
- gl_UNISTD_H
- # Code from module unistr/base:
- gl_LIBUNISTRING_LIBHEADER([0.9.2], [unistr.h])
- # Code from module unistr/u8-mbtouc:
- gl_MODULE_INDICATOR([unistr/u8-mbtouc])
- gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u8-mbtouc])
- # Code from module unistr/u8-mbtouc-unsafe:
- gl_MODULE_INDICATOR([unistr/u8-mbtouc-unsafe])
- gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u8-mbtouc-unsafe])
- # Code from module unistr/u8-mbtoucr:
- gl_MODULE_INDICATOR([unistr/u8-mbtoucr])
- gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-mbtoucr])
- # Code from module unistr/u8-prev:
- gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-prev])
- # Code from module unistr/u8-uctomb:
- gl_MODULE_INDICATOR([unistr/u8-uctomb])
- gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-uctomb])
- # Code from module unitypes:
- gl_LIBUNISTRING_LIBHEADER([0.9], [unitypes.h])
- # Code from module unused-parameter:
- # Code from module useless-if-before-free:
- # Code from module vasnprintf:
- gl_FUNC_VASNPRINTF
- # Code from module vc-list-files:
- # Code from module verify:
- # Code from module vsnprintf:
- gl_FUNC_VSNPRINTF
- gl_STDIO_MODULE_INDICATOR([vsnprintf])
- # Code from module warn-on-use:
- # Code from module warnings:
- AC_SUBST([WARN_CFLAGS])
- # Code from module wchar:
- gl_WCHAR_H
- # Code from module write:
- gl_FUNC_WRITE
- gl_UNISTD_MODULE_INDICATOR([write])
- # Code from module xsize:
- gl_XSIZE
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([accept])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([accept])
+gl_FUNC_ALLOCA
+gl_HEADER_ARPA_INET
+AC_PROG_MKDIR_P
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([bind])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([bind])
+gl_BYTESWAP
+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])
+gl_FUNC_CEIL
+if test $REPLACE_CEIL = 1; then
+ AC_LIBOBJ([ceil])
+fi
+gl_MATH_MODULE_INDICATOR([ceil])
+gl_FUNC_CLOSE
+gl_UNISTD_MODULE_INDICATOR([close])
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([connect])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([connect])
+gl_FUNC_DUPLOCALE
+if test $REPLACE_DUPLOCALE = 1; then
+ AC_LIBOBJ([duplocale])
+ gl_PREREQ_DUPLOCALE
+fi
+gl_LOCALE_MODULE_INDICATOR([duplocale])
+gl_ENVIRON
+gl_UNISTD_MODULE_INDICATOR([environ])
+gl_HEADER_ERRNO_H
+gl_FUNC_FCLOSE
+gl_STDIO_MODULE_INDICATOR([fclose])
+gl_FCNTL_H
+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])
+gl_FLOAT_H
+gl_FUNC_FLOCK
+if test $HAVE_FLOCK = 0; then
+ AC_LIBOBJ([flock])
+ gl_PREREQ_FLOCK
+fi
+gl_HEADER_SYS_FILE_MODULE_INDICATOR([flock])
+gl_FUNC_FLOOR
+if test $REPLACE_FLOOR = 1; then
+ AC_LIBOBJ([floor])
+fi
+gl_MATH_MODULE_INDICATOR([floor])
+gl_FUNC_FPURGE
+if test $HAVE_FPURGE = 0 || test $REPLACE_FPURGE = 1; then
+ AC_LIBOBJ([fpurge])
+fi
+gl_STDIO_MODULE_INDICATOR([fpurge])
+gl_FUNC_FREADING
+gl_FUNC_FREXP
+if test $gl_func_frexp != yes; then
+ AC_LIBOBJ([frexp])
+fi
+gl_MATH_MODULE_INDICATOR([frexp])
+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])
+fi
+gl_STDIO_MODULE_INDICATOR([fseeko])
+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])
+fi
+gl_STDIO_MODULE_INDICATOR([ftello])
+gl_FUNC
+gl_GETADDRINFO
+if test $HAVE_GETADDRINFO = 0; then
+ AC_LIBOBJ([getaddrinfo])
+fi
+if test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then
+ AC_LIBOBJ([gai_strerror])
+fi
+gl_NETDB_MODULE_INDICATOR([getaddrinfo])
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([getpeername])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([getpeername])
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([getsockname])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([getsockname])
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([getsockopt])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([getsockopt])
+AC_SUBST([LIBINTL])
+AC_SUBST([LTLIBINTL])
+# 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.
+# Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
+# 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], [],
+ [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
+ [GNUmakefile=$GNUmakefile])])
+gl_HOSTENT
+AM_ICONV
+m4_ifdef([gl_ICONV_MODULE_INDICATOR],
+ [gl_ICONV_MODULE_INDICATOR([iconv])])
+gl_ICONV_H
+gl_FUNC_ICONV_OPEN
+if test $REPLACE_ICONV_OPEN = 1; then
+ AC_LIBOBJ([iconv_open])
+fi
+if test $REPLACE_ICONV = 1; then
+ AC_LIBOBJ([iconv])
+ AC_LIBOBJ([iconv_close])
+fi
+gl_FUNC_ICONV_OPEN_UTF
+gl_FUNC_INET_NTOP
+if test $HAVE_INET_NTOP = 0; then
+ AC_LIBOBJ([inet_ntop])
+ gl_PREREQ_INET_NTOP
+fi
+gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
+gl_FUNC_INET_PTON
+if test $HAVE_INET_PTON = 0; then
+ AC_LIBOBJ([inet_pton])
+ gl_PREREQ_INET_PTON
+fi
+gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
+gl_INLINE
+gl_ISINF
+if test $REPLACE_ISINF = 1; then
+ AC_LIBOBJ([isinf])
+fi
+gl_MATH_MODULE_INDICATOR([isinf])
+gl_ISNAN
+gl_MATH_MODULE_INDICATOR([isnan])
+gl_FUNC_ISNAND
+m4_ifdef([gl_ISNAN], [
+ AC_REQUIRE([gl_ISNAN])
+])
+if test $HAVE_ISNAND = 0 || test $REPLACE_ISNAN = 1; then
+ AC_LIBOBJ([isnand])
+ gl_PREREQ_ISNAND
+fi
+gl_MATH_MODULE_INDICATOR([isnand])
+gl_FUNC_ISNAND_NO_LIBM
+if test $gl_func_isnand_no_libm != yes; then
+ AC_LIBOBJ([isnand])
+ gl_PREREQ_ISNAND
+fi
+gl_FUNC_ISNANF
+m4_ifdef([gl_ISNAN], [
+ AC_REQUIRE([gl_ISNAN])
+])
+if test $HAVE_ISNANF = 0 || test $REPLACE_ISNAN = 1; then
+ AC_LIBOBJ([isnanf])
+ gl_PREREQ_ISNANF
+fi
+gl_MATH_MODULE_INDICATOR([isnanf])
+gl_FUNC_ISNANL
+m4_ifdef([gl_ISNAN], [
+ AC_REQUIRE([gl_ISNAN])
+])
+if test $HAVE_ISNANL = 0 || test $REPLACE_ISNAN = 1; then
+ AC_LIBOBJ([isnanl])
+ gl_PREREQ_ISNANL
+fi
+gl_MATH_MODULE_INDICATOR([isnanl])
+gl_FUNC_LDEXP
+gl_LD_VERSION_SCRIPT
+gl_VISIBILITY
+gl_LIBUNISTRING
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([listen])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([listen])
+gl_LOCALE_H
+gl_COMMON_DOUBLE_MATHFUNC([log1p])
+gl_FUNC_LSEEK
+if test $REPLACE_LSEEK = 1; then
+ AC_LIBOBJ([lseek])
+fi
+gl_UNISTD_MODULE_INDICATOR([lseek])
+gl_FUNC_LSTAT
+if test $REPLACE_LSTAT = 1; then
+ AC_LIBOBJ([lstat])
+ gl_PREREQ_LSTAT
+fi
+gl_SYS_STAT_MODULE_INDICATOR([lstat])
+AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
+ [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
+gl_FUNC_MALLOC_GNU
+if test $REPLACE_MALLOC = 1; then
+ AC_LIBOBJ([malloc])
+fi
+gl_MODULE_INDICATOR([malloc-gnu])
+gl_FUNC_MALLOC_POSIX
+if test $REPLACE_MALLOC = 1; then
+ AC_LIBOBJ([malloc])
+fi
+gl_STDLIB_MODULE_INDICATOR([malloc-posix])
+gl_MALLOCA
+gl_MATH_H
+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])
+gl_MULTIARCH
+gl_HEADER_NETDB
+gl_HEADER_NETINET_IN
+AC_PROG_MKDIR_P
+gl_NPROC
+gl_FUNC_OPEN
+gl_FCNTL_MODULE_INDICATOR([open])
+gl_PATHMAX
+gl_FUNC_PIPE2
+gl_UNISTD_MODULE_INDICATOR([pipe2])
+gl_FUNC_PUTENV
+if test $REPLACE_PUTENV = 1; then
+ AC_LIBOBJ([putenv])
+fi
+gl_STDLIB_MODULE_INDICATOR([putenv])
+gl_FUNC_READ
+if test $REPLACE_READ = 1; then
+ AC_LIBOBJ([read])
+fi
+gl_UNISTD_MODULE_INDICATOR([read])
+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])
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([recv])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([recv])
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([recvfrom])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([recvfrom])
+gl_PREREQ_SAFE_READ
+gl_PREREQ_SAFE_WRITE
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([send])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([send])
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([sendto])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([sendto])
+gl_SERVENT
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([setsockopt])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt])
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([shutdown])
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([shutdown])
+gl_SIZE_MAX
+gl_FUNC_SNPRINTF
+gl_STDIO_MODULE_INDICATOR([snprintf])
+gl_MODULE_INDICATOR([snprintf])
+AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ AC_LIBOBJ([socket])
+fi
+# When this module is used, sockets may actually occur as file descriptors,
+# hence it is worth warning if the modules 'close' and 'ioctl' are not used.
+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_REQUIRE([gl_PREREQ_SYS_H_WINSOCK2])
+if test "$ac_cv_header_winsock2_h" = yes; then
+ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
+ SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
+fi
+gl_SYS_SOCKET_MODULE_INDICATOR([socket])
+gl_SOCKETLIB
+gl_SOCKETS
+gl_TYPE_SOCKLEN_T
+gt_TYPE_SSIZE_T
+gl_FUNC_STAT
+if test $REPLACE_STAT = 1; then
+ AC_LIBOBJ([stat])
+ gl_PREREQ_STAT
+fi
+gl_SYS_STAT_MODULE_INDICATOR([stat])
+gl_STAT_TIME
+gl_STAT_BIRTHTIME
+AM_STDBOOL_H
+gl_STDDEF_H
+gl_STDINT_H
+gl_STDIO_H
+gl_STDLIB_H
+gl_FUNC_GNU_STRFTIME
+if test $gl_cond_libtool = false; then
+ gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV"
+ gl_libdeps="$gl_libdeps $LIBICONV"
+fi
+gl_HEADER_STRING_H
+gl_HEADER_SYS_FILE_H
+AC_PROG_MKDIR_P
+gl_HEADER_SYS_SOCKET
+AC_PROG_MKDIR_P
+gl_HEADER_SYS_STAT_H
+AC_PROG_MKDIR_P
+gl_HEADER_SYS_TIME_H
+AC_PROG_MKDIR_P
+gl_HEADER_SYS_UIO
+AC_PROG_MKDIR_P
+gl_HEADER_TIME_H
+gl_TIME_R
+if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
+ AC_LIBOBJ([time_r])
+ gl_PREREQ_TIME_R
+fi
+gl_TIME_MODULE_INDICATOR([time_r])
+gl_FUNC_TRUNC
+if test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1; then
+ AC_LIBOBJ([trunc])
+fi
+gl_MATH_MODULE_INDICATOR([trunc])
+gl_UNISTD_H
+gl_LIBUNISTRING_LIBHEADER([0.9.2], [unistr.h])
+gl_MODULE_INDICATOR([unistr/u8-mbtouc])
+gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u8-mbtouc])
+gl_MODULE_INDICATOR([unistr/u8-mbtouc-unsafe])
+gl_LIBUNISTRING_MODULE([0.9.4], [unistr/u8-mbtouc-unsafe])
+gl_MODULE_INDICATOR([unistr/u8-mbtoucr])
+gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-mbtoucr])
+gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-prev])
+gl_MODULE_INDICATOR([unistr/u8-uctomb])
+gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-uctomb])
+gl_LIBUNISTRING_LIBHEADER([0.9], [unitypes.h])
+gl_FUNC_VASNPRINTF
+gl_FUNC_VSNPRINTF
+gl_STDIO_MODULE_INDICATOR([vsnprintf])
+AC_SUBST([WARN_CFLAGS])
+gl_WCHAR_H
+gl_FUNC_WRITE
+if test $REPLACE_WRITE = 1; then
+ AC_LIBOBJ([write])
+fi
+gl_UNISTD_MODULE_INDICATOR([write])
+gl_XSIZE
# End of code from modules
m4_ifval(gl_LIBSOURCES_LIST, [
m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
@@ -705,6 +736,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/alloca.in.h
lib/arpa_inet.in.h
lib/asnprintf.c
+ lib/binary-io.h
lib/bind.c
lib/byteswap.in.h
lib/c-ctype.c
@@ -721,13 +753,22 @@ AC_DEFUN([gl_FILE_LIST], [
lib/duplocale.c
lib/errno.in.h
lib/fclose.c
+ lib/fcntl.in.h
lib/fd-hook.c
lib/fd-hook.h
+ lib/fflush.c
lib/float+.h
lib/float.in.h
lib/flock.c
lib/floor.c
+ lib/fpurge.c
+ lib/freading.c
+ lib/freading.h
lib/frexp.c
+ lib/fseek.c
+ lib/fseeko.c
+ lib/ftell.c
+ lib/ftello.c
lib/full-read.c
lib/full-read.h
lib/full-write.c
@@ -759,6 +800,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/libunistring.valgrind
lib/listen.c
lib/locale.in.h
+ lib/lseek.c
lib/lstat.c
lib/malloc.c
lib/malloca.c
@@ -771,7 +813,9 @@ AC_DEFUN([gl_FILE_LIST], [
lib/netinet_in.in.h
lib/nproc.c
lib/nproc.h
+ lib/open.c
lib/pathmax.h
+ lib/pipe2.c
lib/printf-args.c
lib/printf-args.h
lib/printf-parse.c
@@ -799,6 +843,7 @@ AC_DEFUN([gl_FILE_LIST], [
lib/stdbool.in.h
lib/stddef.in.h
lib/stdint.in.h
+ lib/stdio-impl.h
lib/stdio.in.h
lib/stdlib.in.h
lib/strftime.c
@@ -853,17 +898,27 @@ AC_DEFUN([gl_FILE_LIST], [
m4/exponentl.m4
m4/extensions.m4
m4/fclose.m4
+ m4/fcntl-o.m4
+ m4/fcntl_h.m4
+ m4/fflush.m4
m4/float_h.m4
m4/flock.m4
m4/floor.m4
m4/fpieee.m4
+ m4/fpurge.m4
+ m4/freading.m4
m4/frexp.m4
+ m4/fseek.m4
+ m4/fseeko.m4
+ m4/ftell.m4
+ m4/ftello.m4
m4/func.m4
m4/getaddrinfo.m4
m4/gnulib-common.m4
m4/hostent.m4
m4/iconv.m4
m4/iconv_h.m4
+ m4/iconv_open-utf.m4
m4/iconv_open.m4
m4/include_next.m4
m4/inet_ntop.m4
@@ -885,6 +940,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/libunistring.m4
m4/locale_h.m4
m4/longlong.m4
+ m4/lseek.m4
m4/lstat.m4
m4/malloc.m4
m4/malloca.m4
@@ -892,11 +948,15 @@ AC_DEFUN([gl_FILE_LIST], [
m4/mathfunc.m4
m4/memchr.m4
m4/mmap-anon.m4
+ m4/mode_t.m4
m4/multiarch.m4
m4/netdb_h.m4
m4/netinet_in_h.m4
+ m4/nocrash.m4
m4/nproc.m4
+ m4/open.m4
m4/pathmax.m4
+ m4/pipe2.m4
m4/printf.m4
m4/putenv.m4
m4/read.m4
diff --git a/m4/iconv_open-utf.m4 b/m4/iconv_open-utf.m4
new file mode 100644
index 000000000..dd035301a
--- /dev/null
+++ b/m4/iconv_open-utf.m4
@@ -0,0 +1,231 @@
+# iconv_open-utf.m4 serial 1
+dnl Copyright (C) 2007-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.
+
+# A placeholder to ensure that this m4 file gets included by aclocal.
+AC_DEFUN([gl_FUNC_ICONV_OPEN_UTF], [])
+
+AC_DEFUN([gl_FUNC_ICONV_OPEN_UTF_SUPPORT],
+[
+ dnl This macro relies on am_cv_func_iconv and gl_func_iconv_gnu from
+ dnl gl_FUNC_ICONV_OPEN, but is called from within gl_FUNC_ICONV_OPEN.
+ dnl *Not* AC_REQUIRE([gl_FUNC_ICONV_OPEN]).
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+ if test "$am_cv_func_iconv" = yes; then
+ AC_CACHE_CHECK([whether iconv supports conversion between UTF-8 and UTF-{16,32}{BE,LE}],
+ [gl_cv_func_iconv_supports_utf],
+ [
+ save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBICONV"
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <iconv.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+int main ()
+{
+ int result = 0;
+ /* Test conversion from UTF-8 to UTF-16BE with no errors. */
+ {
+ static const char input[] =
+ "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]";
+ static const char expected[] =
+ "\000J\000a\000p\000a\000n\000e\000s\000e\000 \000(\145\345\147\054\212\236\000)\000 \000[\330\065\335\015\330\065\335\036\330\065\335\055\000]";
+ iconv_t cd;
+ cd = iconv_open ("UTF-16BE", "UTF-8");
+ if (cd == (iconv_t)(-1))
+ result |= 1;
+ else
+ {
+ char buf[100];
+ const char *inptr;
+ size_t inbytesleft;
+ char *outptr;
+ size_t outbytesleft;
+ size_t res;
+ inptr = input;
+ inbytesleft = sizeof (input) - 1;
+ outptr = buf;
+ outbytesleft = sizeof (buf);
+ res = iconv (cd,
+ (ICONV_CONST char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (!(res == 0 && inbytesleft == 0))
+ result |= 1;
+ else if (!(outptr == buf + (sizeof (expected) - 1)))
+ result |= 1;
+ else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
+ result |= 1;
+ else if (!(iconv_close (cd) == 0))
+ result |= 1;
+ }
+ }
+ /* Test conversion from UTF-8 to UTF-16LE with no errors. */
+ {
+ static const char input[] =
+ "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]";
+ static const char expected[] =
+ "J\000a\000p\000a\000n\000e\000s\000e\000 \000(\000\345\145\054\147\236\212)\000 \000[\000\065\330\015\335\065\330\036\335\065\330\055\335]\000";
+ iconv_t cd;
+ cd = iconv_open ("UTF-16LE", "UTF-8");
+ if (cd == (iconv_t)(-1))
+ result |= 2;
+ else
+ {
+ char buf[100];
+ const char *inptr;
+ size_t inbytesleft;
+ char *outptr;
+ size_t outbytesleft;
+ size_t res;
+ inptr = input;
+ inbytesleft = sizeof (input) - 1;
+ outptr = buf;
+ outbytesleft = sizeof (buf);
+ res = iconv (cd,
+ (ICONV_CONST char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (!(res == 0 && inbytesleft == 0))
+ result |= 2;
+ else if (!(outptr == buf + (sizeof (expected) - 1)))
+ result |= 2;
+ else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
+ result |= 2;
+ else if (!(iconv_close (cd) == 0))
+ result |= 2;
+ }
+ }
+ /* Test conversion from UTF-8 to UTF-32BE with no errors. */
+ {
+ static const char input[] =
+ "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]";
+ static const char expected[] =
+ "\000\000\000J\000\000\000a\000\000\000p\000\000\000a\000\000\000n\000\000\000e\000\000\000s\000\000\000e\000\000\000 \000\000\000(\000\000\145\345\000\000\147\054\000\000\212\236\000\000\000)\000\000\000 \000\000\000[\000\001\325\015\000\001\325\036\000\001\325\055\000\000\000]";
+ iconv_t cd;
+ cd = iconv_open ("UTF-32BE", "UTF-8");
+ if (cd == (iconv_t)(-1))
+ result |= 4;
+ else
+ {
+ char buf[100];
+ const char *inptr;
+ size_t inbytesleft;
+ char *outptr;
+ size_t outbytesleft;
+ size_t res;
+ inptr = input;
+ inbytesleft = sizeof (input) - 1;
+ outptr = buf;
+ outbytesleft = sizeof (buf);
+ res = iconv (cd,
+ (ICONV_CONST char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (!(res == 0 && inbytesleft == 0))
+ result |= 4;
+ else if (!(outptr == buf + (sizeof (expected) - 1)))
+ result |= 4;
+ else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
+ result |= 4;
+ else if (!(iconv_close (cd) == 0))
+ result |= 4;
+ }
+ }
+ /* Test conversion from UTF-8 to UTF-32LE with no errors. */
+ {
+ static const char input[] =
+ "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]";
+ static const char expected[] =
+ "J\000\000\000a\000\000\000p\000\000\000a\000\000\000n\000\000\000e\000\000\000s\000\000\000e\000\000\000 \000\000\000(\000\000\000\345\145\000\000\054\147\000\000\236\212\000\000)\000\000\000 \000\000\000[\000\000\000\015\325\001\000\036\325\001\000\055\325\001\000]\000\000\000";
+ iconv_t cd;
+ cd = iconv_open ("UTF-32LE", "UTF-8");
+ if (cd == (iconv_t)(-1))
+ result |= 8;
+ else
+ {
+ char buf[100];
+ const char *inptr;
+ size_t inbytesleft;
+ char *outptr;
+ size_t outbytesleft;
+ size_t res;
+ inptr = input;
+ inbytesleft = sizeof (input) - 1;
+ outptr = buf;
+ outbytesleft = sizeof (buf);
+ res = iconv (cd,
+ (ICONV_CONST char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (!(res == 0 && inbytesleft == 0))
+ result |= 8;
+ else if (!(outptr == buf + (sizeof (expected) - 1)))
+ result |= 8;
+ else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
+ result |= 8;
+ else if (!(iconv_close (cd) == 0))
+ result |= 8;
+ }
+ }
+ /* Test conversion from UTF-16BE to UTF-8 with no errors.
+ This test fails on NetBSD 3.0. */
+ {
+ static const char input[] =
+ "\000J\000a\000p\000a\000n\000e\000s\000e\000 \000(\145\345\147\054\212\236\000)\000 \000[\330\065\335\015\330\065\335\036\330\065\335\055\000]";
+ static const char expected[] =
+ "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]";
+ iconv_t cd;
+ cd = iconv_open ("UTF-8", "UTF-16BE");
+ if (cd == (iconv_t)(-1))
+ result |= 16;
+ else
+ {
+ char buf[100];
+ const char *inptr;
+ size_t inbytesleft;
+ char *outptr;
+ size_t outbytesleft;
+ size_t res;
+ inptr = input;
+ inbytesleft = sizeof (input) - 1;
+ outptr = buf;
+ outbytesleft = sizeof (buf);
+ res = iconv (cd,
+ (ICONV_CONST char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (!(res == 0 && inbytesleft == 0))
+ result |= 16;
+ else if (!(outptr == buf + (sizeof (expected) - 1)))
+ result |= 16;
+ else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
+ result |= 16;
+ else if (!(iconv_close (cd) == 0))
+ result |= 16;
+ }
+ }
+ return result;
+}]])],
+ [gl_cv_func_iconv_supports_utf=yes],
+ [gl_cv_func_iconv_supports_utf=no],
+ [
+ dnl We know that GNU libiconv, GNU libc, and Solaris >= 9 do.
+ dnl OSF/1 5.1 has these encodings, but inserts a BOM in the "to"
+ dnl direction.
+ gl_cv_func_iconv_supports_utf=no
+ if test $gl_func_iconv_gnu = yes; then
+ gl_cv_func_iconv_supports_utf=yes
+ else
+changequote(,)dnl
+ case "$host_os" in
+ solaris2.9 | solaris2.1[0-9]) gl_cv_func_iconv_supports_utf=yes ;;
+ esac
+changequote([,])dnl
+ fi
+ ])
+ LIBS="$save_LIBS"
+ ])
+ fi
+])
diff --git a/m4/iconv_open.m4 b/m4/iconv_open.m4
index b062e73b2..accdecc22 100644
--- a/m4/iconv_open.m4
+++ b/m4/iconv_open.m4
@@ -1,4 +1,4 @@
-# iconv_open.m4 serial 12
+# iconv_open.m4 serial 14
dnl Copyright (C) 2007-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,
@@ -36,6 +36,16 @@ AC_DEFUN([gl_FUNC_ICONV_OPEN],
gl_REPLACE_ICONV_OPEN
fi
fi
+ m4_ifdef([gl_FUNC_ICONV_OPEN_UTF_SUPPORT], [
+ gl_FUNC_ICONV_OPEN_UTF_SUPPORT
+ if test $gl_cv_func_iconv_supports_utf = no; then
+ REPLACE_ICONV_UTF=1
+ AC_DEFINE([REPLACE_ICONV_UTF], [1],
+ [Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.])
+ REPLACE_ICONV=1
+ gl_REPLACE_ICONV_OPEN
+ fi
+ ])
fi
])
@@ -43,235 +53,4 @@ AC_DEFUN([gl_REPLACE_ICONV_OPEN],
[
gl_REPLACE_ICONV_H
REPLACE_ICONV_OPEN=1
- AC_LIBOBJ([iconv_open])
-])
-
-AC_DEFUN([gl_FUNC_ICONV_OPEN_UTF],
-[
- AC_REQUIRE([gl_FUNC_ICONV_OPEN])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([gl_ICONV_H_DEFAULTS])
- if test "$am_cv_func_iconv" = yes; then
- AC_CACHE_CHECK([whether iconv supports conversion between UTF-8 and UTF-{16,32}{BE,LE}],
- [gl_cv_func_iconv_supports_utf],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS $LIBICONV"
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <iconv.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-int main ()
-{
- int result = 0;
- /* Test conversion from UTF-8 to UTF-16BE with no errors. */
- {
- static const char input[] =
- "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]";
- static const char expected[] =
- "\000J\000a\000p\000a\000n\000e\000s\000e\000 \000(\145\345\147\054\212\236\000)\000 \000[\330\065\335\015\330\065\335\036\330\065\335\055\000]";
- iconv_t cd;
- cd = iconv_open ("UTF-16BE", "UTF-8");
- if (cd == (iconv_t)(-1))
- result |= 1;
- else
- {
- char buf[100];
- const char *inptr;
- size_t inbytesleft;
- char *outptr;
- size_t outbytesleft;
- size_t res;
- inptr = input;
- inbytesleft = sizeof (input) - 1;
- outptr = buf;
- outbytesleft = sizeof (buf);
- res = iconv (cd,
- (ICONV_CONST char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if (!(res == 0 && inbytesleft == 0))
- result |= 1;
- else if (!(outptr == buf + (sizeof (expected) - 1)))
- result |= 1;
- else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
- result |= 1;
- else if (!(iconv_close (cd) == 0))
- result |= 1;
- }
- }
- /* Test conversion from UTF-8 to UTF-16LE with no errors. */
- {
- static const char input[] =
- "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]";
- static const char expected[] =
- "J\000a\000p\000a\000n\000e\000s\000e\000 \000(\000\345\145\054\147\236\212)\000 \000[\000\065\330\015\335\065\330\036\335\065\330\055\335]\000";
- iconv_t cd;
- cd = iconv_open ("UTF-16LE", "UTF-8");
- if (cd == (iconv_t)(-1))
- result |= 2;
- else
- {
- char buf[100];
- const char *inptr;
- size_t inbytesleft;
- char *outptr;
- size_t outbytesleft;
- size_t res;
- inptr = input;
- inbytesleft = sizeof (input) - 1;
- outptr = buf;
- outbytesleft = sizeof (buf);
- res = iconv (cd,
- (ICONV_CONST char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if (!(res == 0 && inbytesleft == 0))
- result |= 2;
- else if (!(outptr == buf + (sizeof (expected) - 1)))
- result |= 2;
- else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
- result |= 2;
- else if (!(iconv_close (cd) == 0))
- result |= 2;
- }
- }
- /* Test conversion from UTF-8 to UTF-32BE with no errors. */
- {
- static const char input[] =
- "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]";
- static const char expected[] =
- "\000\000\000J\000\000\000a\000\000\000p\000\000\000a\000\000\000n\000\000\000e\000\000\000s\000\000\000e\000\000\000 \000\000\000(\000\000\145\345\000\000\147\054\000\000\212\236\000\000\000)\000\000\000 \000\000\000[\000\001\325\015\000\001\325\036\000\001\325\055\000\000\000]";
- iconv_t cd;
- cd = iconv_open ("UTF-32BE", "UTF-8");
- if (cd == (iconv_t)(-1))
- result |= 4;
- else
- {
- char buf[100];
- const char *inptr;
- size_t inbytesleft;
- char *outptr;
- size_t outbytesleft;
- size_t res;
- inptr = input;
- inbytesleft = sizeof (input) - 1;
- outptr = buf;
- outbytesleft = sizeof (buf);
- res = iconv (cd,
- (ICONV_CONST char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if (!(res == 0 && inbytesleft == 0))
- result |= 4;
- else if (!(outptr == buf + (sizeof (expected) - 1)))
- result |= 4;
- else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
- result |= 4;
- else if (!(iconv_close (cd) == 0))
- result |= 4;
- }
- }
- /* Test conversion from UTF-8 to UTF-32LE with no errors. */
- {
- static const char input[] =
- "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]";
- static const char expected[] =
- "J\000\000\000a\000\000\000p\000\000\000a\000\000\000n\000\000\000e\000\000\000s\000\000\000e\000\000\000 \000\000\000(\000\000\000\345\145\000\000\054\147\000\000\236\212\000\000)\000\000\000 \000\000\000[\000\000\000\015\325\001\000\036\325\001\000\055\325\001\000]\000\000\000";
- iconv_t cd;
- cd = iconv_open ("UTF-32LE", "UTF-8");
- if (cd == (iconv_t)(-1))
- result |= 8;
- else
- {
- char buf[100];
- const char *inptr;
- size_t inbytesleft;
- char *outptr;
- size_t outbytesleft;
- size_t res;
- inptr = input;
- inbytesleft = sizeof (input) - 1;
- outptr = buf;
- outbytesleft = sizeof (buf);
- res = iconv (cd,
- (ICONV_CONST char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if (!(res == 0 && inbytesleft == 0))
- result |= 8;
- else if (!(outptr == buf + (sizeof (expected) - 1)))
- result |= 8;
- else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
- result |= 8;
- else if (!(iconv_close (cd) == 0))
- result |= 8;
- }
- }
- /* Test conversion from UTF-16BE to UTF-8 with no errors.
- This test fails on NetBSD 3.0. */
- {
- static const char input[] =
- "\000J\000a\000p\000a\000n\000e\000s\000e\000 \000(\145\345\147\054\212\236\000)\000 \000[\330\065\335\015\330\065\335\036\330\065\335\055\000]";
- static const char expected[] =
- "Japanese (\346\227\245\346\234\254\350\252\236) [\360\235\224\215\360\235\224\236\360\235\224\255]";
- iconv_t cd;
- cd = iconv_open ("UTF-8", "UTF-16BE");
- if (cd == (iconv_t)(-1))
- result |= 16;
- else
- {
- char buf[100];
- const char *inptr;
- size_t inbytesleft;
- char *outptr;
- size_t outbytesleft;
- size_t res;
- inptr = input;
- inbytesleft = sizeof (input) - 1;
- outptr = buf;
- outbytesleft = sizeof (buf);
- res = iconv (cd,
- (ICONV_CONST char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if (!(res == 0 && inbytesleft == 0))
- result |= 16;
- else if (!(outptr == buf + (sizeof (expected) - 1)))
- result |= 16;
- else if (!(memcmp (buf, expected, sizeof (expected) - 1) == 0))
- result |= 16;
- else if (!(iconv_close (cd) == 0))
- result |= 16;
- }
- }
- return result;
-}]])],
- [gl_cv_func_iconv_supports_utf=yes],
- [gl_cv_func_iconv_supports_utf=no],
- [
- dnl We know that GNU libiconv, GNU libc, and Solaris >= 9 do.
- dnl OSF/1 5.1 has these encodings, but inserts a BOM in the "to"
- dnl direction.
- gl_cv_func_iconv_supports_utf=no
- if test $gl_func_iconv_gnu = yes; then
- gl_cv_func_iconv_supports_utf=yes
- else
-changequote(,)dnl
- case "$host_os" in
- solaris2.9 | solaris2.1[0-9]) gl_cv_func_iconv_supports_utf=yes ;;
- esac
-changequote([,])dnl
- fi
- ])
- LIBS="$save_LIBS"
- ])
- if test $gl_cv_func_iconv_supports_utf = no; then
- REPLACE_ICONV_UTF=1
- AC_DEFINE([REPLACE_ICONV_UTF], [1],
- [Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.])
- REPLACE_ICONV=1
- gl_REPLACE_ICONV_OPEN
- AC_LIBOBJ([iconv])
- AC_LIBOBJ([iconv_close])
- fi
- fi
])
diff --git a/m4/inet_ntop.m4 b/m4/inet_ntop.m4
index 57580b8a4..45be497be 100644
--- a/m4/inet_ntop.m4
+++ b/m4/inet_ntop.m4
@@ -1,4 +1,4 @@
-# inet_ntop.m4 serial 13
+# inet_ntop.m4 serial 15
dnl Copyright (C) 2005-2006, 2008-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,
@@ -9,14 +9,18 @@ AC_DEFUN([gl_FUNC_INET_NTOP],
dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- gl_REPLACE_ARPA_INET_H
-
dnl Most platforms that provide inet_ntop define it in libc.
dnl Solaris 8..10 provide inet_ntop in libnsl instead.
+ HAVE_INET_NTOP=1
gl_save_LIBS=$LIBS
AC_SEARCH_LIBS([inet_ntop], [nsl], [],
- [AC_REPLACE_FUNCS([inet_ntop])])
+ [AC_CHECK_FUNCS([inet_ntop])
+ if test $ac_cv_func_inet_ntop = no; then
+ HAVE_INET_NTOP=0
+ fi
+ ])
LIBS=$gl_save_LIBS
+
INET_NTOP_LIB=
if test "$ac_cv_search_inet_ntop" != "no" &&
test "$ac_cv_search_inet_ntop" != "none required"; then
@@ -24,11 +28,6 @@ AC_DEFUN([gl_FUNC_INET_NTOP],
fi
AC_SUBST([INET_NTOP_LIB])
- gl_PREREQ_INET_NTOP
-])
-
-# Prerequisites of lib/inet_ntop.c.
-AC_DEFUN([gl_PREREQ_INET_NTOP], [
AC_CHECK_HEADERS_ONCE([netdb.h])
AC_CHECK_DECLS([inet_ntop],,,
[#include <arpa/inet.h>
@@ -38,7 +37,11 @@ AC_DEFUN([gl_PREREQ_INET_NTOP], [
])
if test $ac_cv_have_decl_inet_ntop = no; then
HAVE_DECL_INET_NTOP=0
+ AC_REQUIRE([AC_C_RESTRICT])
fi
+])
+
+# Prerequisites of lib/inet_ntop.c.
+AC_DEFUN([gl_PREREQ_INET_NTOP], [
AC_REQUIRE([gl_SOCKET_FAMILIES])
- AC_REQUIRE([AC_C_RESTRICT])
])
diff --git a/m4/inet_pton.m4 b/m4/inet_pton.m4
index 9a7ad3b38..9fc64df4e 100644
--- a/m4/inet_pton.m4
+++ b/m4/inet_pton.m4
@@ -1,4 +1,4 @@
-# inet_pton.m4 serial 11
+# inet_pton.m4 serial 13
dnl Copyright (C) 2006, 2008-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,
@@ -9,14 +9,18 @@ AC_DEFUN([gl_FUNC_INET_PTON],
dnl Persuade Solaris <arpa/inet.h> to declare inet_pton.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- gl_REPLACE_ARPA_INET_H
-
dnl Most platforms that provide inet_pton define it in libc.
dnl Solaris 8..10 provide inet_pton in libnsl instead.
+ HAVE_INET_PTON=1
gl_save_LIBS=$LIBS
AC_SEARCH_LIBS([inet_pton], [nsl], [],
- [AC_REPLACE_FUNCS([inet_pton])])
+ [AC_CHECK_FUNCS([inet_pton])
+ if test $ac_cv_func_inet_pton = no; then
+ HAVE_INET_PTON=0
+ fi
+ ])
LIBS=$gl_save_LIBS
+
INET_PTON_LIB=
if test "$ac_cv_search_inet_pton" != "no" &&
test "$ac_cv_search_inet_pton" != "none required"; then
@@ -24,11 +28,6 @@ AC_DEFUN([gl_FUNC_INET_PTON],
fi
AC_SUBST([INET_PTON_LIB])
- gl_PREREQ_INET_PTON
-])
-
-# Prerequisites of lib/inet_pton.c.
-AC_DEFUN([gl_PREREQ_INET_PTON], [
AC_CHECK_HEADERS_ONCE([netdb.h])
AC_CHECK_DECLS([inet_pton],,,
[#include <arpa/inet.h>
@@ -38,7 +37,11 @@ AC_DEFUN([gl_PREREQ_INET_PTON], [
])
if test $ac_cv_have_decl_inet_pton = no; then
HAVE_DECL_INET_PTON=0
+ AC_REQUIRE([AC_C_RESTRICT])
fi
+])
+
+# Prerequisites of lib/inet_pton.c.
+AC_DEFUN([gl_PREREQ_INET_PTON], [
AC_REQUIRE([gl_SOCKET_FAMILIES])
- AC_REQUIRE([AC_C_RESTRICT])
])
diff --git a/m4/isinf.m4 b/m4/isinf.m4
index ab3cf9e6f..f6056e610 100644
--- a/m4/isinf.m4
+++ b/m4/isinf.m4
@@ -1,4 +1,4 @@
-# isinf.m4 serial 3
+# isinf.m4 serial 4
dnl Copyright (C) 2007-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,
@@ -24,7 +24,7 @@ AC_DEFUN([gl_ISINF],
if test "$ac_cv_have_decl_isinf" != yes ||
test "$ISINF_LIBM" = missing; then
REPLACE_ISINF=1
- AC_LIBOBJ([isinf])
+ dnl No libraries are needed to link lib/isinf.c.
ISINF_LIBM=
fi
AC_SUBST([ISINF_LIBM])
diff --git a/m4/isnan.m4 b/m4/isnan.m4
index dc3e290cd..a99cbb3b9 100644
--- a/m4/isnan.m4
+++ b/m4/isnan.m4
@@ -1,4 +1,4 @@
-# isnan.m4 serial 3
+# isnan.m4 serial 5
dnl Copyright (C) 2007-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,
@@ -36,11 +36,8 @@ AC_DEFUN([gl_ISNAN],
esac
else
AC_MSG_RESULT([no])
+ dnl REPLACE_ISNAN=1 also makes sure the rpl_isnan[fdl] functions get built.
REPLACE_ISNAN=1
- # Make sure the rpl_isnan[fdl] functions get built.
- gl_BUILD_ISNANF
- gl_BUILD_ISNAND
- gl_BUILD_ISNANL
ISNAN_LIBM=
fi
AC_SUBST([ISNAN_LIBM])
diff --git a/m4/isnand.m4 b/m4/isnand.m4
index fb2c0f9be..2b18b0ac6 100644
--- a/m4/isnand.m4
+++ b/m4/isnand.m4
@@ -1,4 +1,4 @@
-# isnand.m4 serial 8
+# isnand.m4 serial 10
dnl Copyright (C) 2007-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,
@@ -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,18 +33,16 @@ 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
])
diff --git a/m4/isnanf.m4 b/m4/isnanf.m4
index 92024bb10..66ed954be 100644
--- a/m4/isnanf.m4
+++ b/m4/isnanf.m4
@@ -1,4 +1,4 @@
-# isnanf.m4 serial 12
+# isnanf.m4 serial 14
dnl Copyright (C) 2007-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,
@@ -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 5d7375992..c79308b03 100644
--- a/m4/isnanl.m4
+++ b/m4/isnanl.m4
@@ -1,4 +1,4 @@
-# isnanl.m4 serial 14
+# isnanl.m4 serial 16
dnl Copyright (C) 2007-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,
@@ -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,15 +49,12 @@ 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
])
diff --git a/m4/locale_h.m4 b/m4/locale_h.m4
index 4d0f89426..e77a3032e 100644
--- a/m4/locale_h.m4
+++ b/m4/locale_h.m4
@@ -1,4 +1,4 @@
-# locale_h.m4 serial 13
+# locale_h.m4 serial 14
dnl Copyright (C) 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,
@@ -57,12 +57,6 @@ AC_DEFUN([gl_LOCALE_H],
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 +68,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.
diff --git a/m4/lseek.m4 b/m4/lseek.m4
new file mode 100644
index 000000000..b45488445
--- /dev/null
+++ b/m4/lseek.m4
@@ -0,0 +1,42 @@
+# lseek.m4 serial 7
+dnl Copyright (C) 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_FUNC_LSEEK],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([whether lseek detects pipes], [gl_cv_func_lseek_pipe],
+ [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>]], [[
+ /* 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. */
+ Choke me.
+#endif]])],
+ [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
+ fi])
+ if test $gl_cv_func_lseek_pipe = no; then
+ REPLACE_LSEEK=1
+ AC_DEFINE([LSEEK_PIPE_BROKEN], [1],
+ [Define to 1 if lseek does not detect pipes.])
+ fi
+])
diff --git a/m4/lstat.m4 b/m4/lstat.m4
index b9b22a6b2..72c76c6cf 100644
--- a/m4/lstat.m4
+++ b/m4/lstat.m4
@@ -1,4 +1,4 @@
-# serial 21
+# serial 22
# Copyright (C) 1997-2001, 2003-2011 Free Software Foundation, Inc.
#
@@ -16,23 +16,27 @@ AC_DEFUN([gl_FUNC_LSTAT],
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]).
+ if test $gl_cv_func_lstat_dereferences_slashed_symlink = no; then
REPLACE_LSTAT=1
fi
- # Prerequisites of lib/lstat.c.
- AC_REQUIRE([AC_C_INLINE])
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_REQUIRE([AC_C_INLINE])
+ :
+])
+
+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 +49,22 @@ 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],
+ [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
+ [gl_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=no
])
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=no
fi
rm -f conftest.sym conftest.file
])
- test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+ test $gl_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
])
diff --git a/m4/malloc.m4 b/m4/malloc.m4
index 809444450..87018ec87 100644
--- a/m4/malloc.m4
+++ b/m4/malloc.m4
@@ -1,4 +1,4 @@
-# malloc.m4 serial 12
+# malloc.m4 serial 13
dnl Copyright (C) 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,
@@ -17,7 +17,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 +33,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 +58,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/memchr.m4 b/m4/memchr.m4
index a544e2b4e..f6dc3e712 100644
--- a/m4/memchr.m4
+++ b/m4/memchr.m4
@@ -1,4 +1,4 @@
-# memchr.m4 serial 11
+# memchr.m4 serial 12
dnl Copyright (C) 2002-2004, 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,
@@ -80,10 +80,6 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
REPLACE_MEMCHR=1
fi
fi
- if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
- AC_LIBOBJ([memchr])
- gl_PREREQ_MEMCHR
- fi
])
# Prerequisites of lib/memchr.c.
diff --git a/m4/mode_t.m4 b/m4/mode_t.m4
new file mode 100644
index 000000000..f9cf70472
--- /dev/null
+++ b/m4/mode_t.m4
@@ -0,0 +1,26 @@
+# mode_t.m4 serial 2
+dnl Copyright (C) 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.
+
+# For using mode_t, it's sufficient to use AC_TYPE_MODE_T and
+# include <sys/types.h>.
+
+# Define PROMOTED_MODE_T to the type that is the result of "default argument
+# promotion" (ISO C 6.5.2.2.(6)) of the type mode_t.
+AC_DEFUN([gl_PROMOTED_TYPE_MODE_T],
+[
+ AC_REQUIRE([AC_TYPE_MODE_T])
+ AC_CACHE_CHECK([for promoted mode_t type], [gl_cv_promoted_mode_t], [
+ dnl Assume mode_t promotes to 'int' if and only if it is smaller than 'int',
+ dnl and to itself otherwise. This assumption is not guaranteed by the ISO C
+ dnl standard, but we don't know of any real-world counterexamples.
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]],
+ [[typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];]])],
+ [gl_cv_promoted_mode_t='int'],
+ [gl_cv_promoted_mode_t='mode_t'])
+ ])
+ AC_DEFINE_UNQUOTED([PROMOTED_MODE_T], [$gl_cv_promoted_mode_t],
+ [Define to the type that is the result of default argument promotions of type mode_t.])
+])
diff --git a/m4/netdb_h.m4 b/m4/netdb_h.m4
index 9a01cd6a7..a54d6701b 100644
--- a/m4/netdb_h.m4
+++ b/m4/netdb_h.m4
@@ -1,4 +1,4 @@
-# netdb_h.m4 serial 10
+# netdb_h.m4 serial 11
dnl Copyright (C) 2008-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,
@@ -26,6 +26,8 @@ AC_DEFUN([gl_NETDB_MODULE_INDICATOR],
dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
AC_REQUIRE([gl_NETDB_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_NETDB_H_DEFAULTS],
@@ -37,4 +39,5 @@ AC_DEFUN([gl_NETDB_H_DEFAULTS],
HAVE_DECL_GAI_STRERROR=1; AC_SUBST([HAVE_DECL_GAI_STRERROR])
HAVE_DECL_GETADDRINFO=1; AC_SUBST([HAVE_DECL_GETADDRINFO])
HAVE_DECL_GETNAMEINFO=1; AC_SUBST([HAVE_DECL_GETNAMEINFO])
+ REPLACE_GAI_STRERROR=0; AC_SUBST([REPLACE_GAI_STRERROR])
])
diff --git a/m4/nocrash.m4 b/m4/nocrash.m4
new file mode 100644
index 000000000..0cc0d53eb
--- /dev/null
+++ b/m4/nocrash.m4
@@ -0,0 +1,102 @@
+# nocrash.m4 serial 2
+dnl Copyright (C) 2005, 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 Based on libsigsegv, from Bruno Haible and Paolo Bonzini.
+
+AC_PREREQ([2.13])
+
+dnl Expands to some code for use in .c programs that will cause the configure
+dnl test to exit instead of crashing. This is useful to avoid triggering
+dnl action from a background debugger and to avoid core dumps.
+dnl Usage: ...
+dnl ]GL_NOCRASH[
+dnl ...
+dnl int main() { nocrash_init(); ... }
+AC_DEFUN([GL_NOCRASH],[[
+#include <stdlib.h>
+#if defined __MACH__ && defined __APPLE__
+/* Avoid a crash on MacOS X. */
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <mach/thread_status.h>
+#include <mach/exception.h>
+#include <mach/task.h>
+#include <pthread.h>
+/* The exception port on which our thread listens. */
+static mach_port_t our_exception_port;
+/* The main function of the thread listening for exceptions of type
+ EXC_BAD_ACCESS. */
+static void *
+mach_exception_thread (void *arg)
+{
+ /* Buffer for a message to be received. */
+ struct {
+ mach_msg_header_t head;
+ mach_msg_body_t msgh_body;
+ char data[1024];
+ } msg;
+ mach_msg_return_t retval;
+ /* Wait for a message on the exception port. */
+ retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
+ our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+ if (retval != MACH_MSG_SUCCESS)
+ abort ();
+ exit (1);
+}
+static void
+nocrash_init (void)
+{
+ mach_port_t self = mach_task_self ();
+ /* Allocate a port on which the thread shall listen for exceptions. */
+ if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
+ == KERN_SUCCESS) {
+ /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
+ if (mach_port_insert_right (self, our_exception_port, our_exception_port,
+ MACH_MSG_TYPE_MAKE_SEND)
+ == KERN_SUCCESS) {
+ /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
+ for us. */
+ exception_mask_t mask = EXC_MASK_BAD_ACCESS;
+ /* Create the thread listening on the exception port. */
+ pthread_attr_t attr;
+ pthread_t thread;
+ if (pthread_attr_init (&attr) == 0
+ && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
+ && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
+ pthread_attr_destroy (&attr);
+ /* Replace the exception port info for these exceptions with our own.
+ Note that we replace the exception port for the entire task, not only
+ for a particular thread. This has the effect that when our exception
+ port gets the message, the thread specific exception port has already
+ been asked, and we don't need to bother about it.
+ See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
+ task_set_exception_ports (self, mask, our_exception_port,
+ EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
+ }
+ }
+ }
+}
+#else
+/* Avoid a crash on POSIX systems. */
+#include <signal.h>
+/* A POSIX signal handler. */
+static void
+exception_handler (int sig)
+{
+ exit (1);
+}
+static void
+nocrash_init (void)
+{
+#ifdef SIGSEGV
+ signal (SIGSEGV, exception_handler);
+#endif
+#ifdef SIGBUS
+ signal (SIGBUS, exception_handler);
+#endif
+}
+#endif
+]])
diff --git a/m4/open.m4 b/m4/open.m4
new file mode 100644
index 000000000..690cc648d
--- /dev/null
+++ b/m4/open.m4
@@ -0,0 +1,90 @@
+# open.m4 serial 12
+dnl Copyright (C) 2007-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_OPEN],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ case "$host_os" in
+ mingw* | pw*)
+ gl_REPLACE_OPEN
+ ;;
+ *)
+ dnl open("foo/") should not create a file when the file name has a
+ dnl trailing slash. FreeBSD only has the problem on symlinks.
+ AC_CHECK_FUNCS_ONCE([lstat])
+ AC_CACHE_CHECK([whether open recognizes a trailing slash],
+ [gl_cv_func_open_slash],
+ [# Assume that if we have lstat, we can also check symlinks.
+ if test $ac_cv_func_lstat = yes; then
+ touch conftest.tmp
+ ln -s conftest.tmp conftest.lnk
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <fcntl.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+int main ()
+{
+ int result = 0;
+#if HAVE_LSTAT
+ if (open ("conftest.lnk/", O_RDONLY) != -1)
+ result |= 1;
+#endif
+ if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
+ result |= 2;
+ return result;
+}]])],
+ [gl_cv_func_open_slash=yes],
+ [gl_cv_func_open_slash=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+ gl_cv_func_open_slash="guessing no" ;;
+ *)
+ gl_cv_func_open_slash="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ rm -f conftest.sl conftest.tmp conftest.lnk
+ ])
+ case "$gl_cv_func_open_slash" in
+ *no)
+ AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
+ [Define to 1 if open() fails to recognize a trailing slash.])
+ gl_REPLACE_OPEN
+ ;;
+ esac
+ ;;
+ esac
+ 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
+ gl_REPLACE_OPEN
+ fi
+ fi
+ ])
+])
+
+AC_DEFUN([gl_REPLACE_OPEN],
+[
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ REPLACE_OPEN=1
+ AC_LIBOBJ([open])
+ gl_PREREQ_OPEN
+])
+
+# 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/pipe2.m4 b/m4/pipe2.m4
new file mode 100644
index 000000000..10f1e1489
--- /dev/null
+++ b/m4/pipe2.m4
@@ -0,0 +1,18 @@
+# pipe2.m4 serial 2
+dnl Copyright (C) 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_PIPE2],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+ dnl Persuade glibc <unistd.h> to declare pipe2().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_FUNCS_ONCE([pipe2])
+ if test $ac_cv_func_pipe2 != yes; then
+ HAVE_PIPE2=0
+ fi
+])
diff --git a/m4/putenv.m4 b/m4/putenv.m4
index de3900bf2..1497b4a79 100644
--- a/m4/putenv.m4
+++ b/m4/putenv.m4
@@ -1,4 +1,4 @@
-# putenv.m4 serial 17
+# putenv.m4 serial 18
dnl Copyright (C) 2002-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,
@@ -36,6 +36,5 @@ AC_DEFUN([gl_FUNC_PUTENV],
])
if test $gl_cv_func_svid_putenv = no; then
REPLACE_PUTENV=1
- AC_LIBOBJ([putenv])
fi
])
diff --git a/m4/read.m4 b/m4/read.m4
index 032761f1b..310e5ebcf 100644
--- a/m4/read.m4
+++ b/m4/read.m4
@@ -1,4 +1,4 @@
-# read.m4 serial 1
+# read.m4 serial 2
dnl Copyright (C) 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,
@@ -14,7 +14,6 @@ AC_DEFUN([gl_FUNC_READ],
gl_NONBLOCKING_IO
if test $gl_cv_have_nonblocking != yes; then
REPLACE_READ=1
- AC_LIBOBJ([read])
fi
])
])
diff --git a/m4/readlink.m4 b/m4/readlink.m4
index a502ca560..91d7df3c9 100644
--- a/m4/readlink.m4
+++ b/m4/readlink.m4
@@ -1,4 +1,4 @@
-# readlink.m4 serial 9
+# readlink.m4 serial 11
dnl Copyright (C) 2003, 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,
@@ -10,8 +10,6 @@ AC_DEFUN([gl_FUNC_READLINK],
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],
@@ -40,15 +38,14 @@ AC_DEFUN([gl_FUNC_READLINK],
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
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/safe-read.m4 b/m4/safe-read.m4
index ea8eedbfc..791624205 100644
--- a/m4/safe-read.m4
+++ b/m4/safe-read.m4
@@ -1,17 +1,10 @@
-# safe-read.m4 serial 5
+# safe-read.m4 serial 6
dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-AC_DEFUN([gl_SAFE_READ],
-[
- AC_LIBOBJ([safe-read])
-
- gl_PREREQ_SAFE_READ
-])
-
# Prerequisites of lib/safe-read.c.
AC_DEFUN([gl_PREREQ_SAFE_READ],
[
diff --git a/m4/safe-write.m4 b/m4/safe-write.m4
index 7f6b9f81a..6631ab658 100644
--- a/m4/safe-write.m4
+++ b/m4/safe-write.m4
@@ -1,16 +1,9 @@
-# safe-write.m4 serial 3
+# safe-write.m4 serial 4
dnl Copyright (C) 2002, 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_SAFE_WRITE],
-[
- AC_LIBOBJ([safe-write])
-
- gl_PREREQ_SAFE_WRITE
-])
-
# Prerequisites of lib/safe-write.c.
AC_DEFUN([gl_PREREQ_SAFE_WRITE],
[
diff --git a/m4/stat.m4 b/m4/stat.m4
index 27f82d5a9..c63f59fd5 100644
--- a/m4/stat.m4
+++ b/m4/stat.m4
@@ -1,4 +1,4 @@
-# serial 7
+# serial 8
# Copyright (C) 2009-2011 Free Software Foundation, Inc.
#
@@ -58,9 +58,11 @@ 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],
+[
+ AC_REQUIRE([AC_C_INLINE])
+ :
])
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index dff37fe1b..c75e95722 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 40
+# stdint.m4 serial 41
dnl Copyright (C) 2001-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,
@@ -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
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 8b013c2f3..a8326f3c3 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 36
+# stdio_h.m4 serial 37
dnl Copyright (C) 2007-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,
@@ -14,8 +14,6 @@ AC_DEFUN([gl_STDIO_H],
dnl <stdio.h> likely needs them.
GNULIB_FSCANF=1
GNULIB_SCANF=1
- GNULIB_VFSCANF=1
- GNULIB_VSCANF=1
GNULIB_FGETC=1
GNULIB_GETC=1
GNULIB_GETCHAR=1
diff --git a/m4/strftime.m4 b/m4/strftime.m4
index d9de341bf..dd30ccfc0 100644
--- a/m4/strftime.m4
+++ b/m4/strftime.m4
@@ -1,4 +1,4 @@
-# serial 32
+# serial 33
# Copyright (C) 1996-1997, 1999-2007, 2009-2011 Free Software Foundation, Inc.
#
@@ -16,8 +16,6 @@ AC_DEFUN([gl_FUNC_GNU_STRFTIME],
# These are the prerequisite macros for GNU's strftime.c replacement.
AC_DEFUN([gl_FUNC_STRFTIME],
[
- AC_LIBOBJ([strftime])
-
# This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
AC_REQUIRE([AC_STRUCT_TIMEZONE])
diff --git a/m4/time_r.m4 b/m4/time_r.m4
index 9bb28005f..d646edc2d 100644
--- a/m4/time_r.m4
+++ b/m4/time_r.m4
@@ -50,10 +50,6 @@ AC_DEFUN([gl_TIME_R],
else
HAVE_LOCALTIME_R=0
fi
- if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
- AC_LIBOBJ([time_r])
- gl_PREREQ_TIME_R
- fi
])
# Prerequisites of lib/time_r.c.
diff --git a/m4/trunc.m4 b/m4/trunc.m4
index e1069115c..953f5b131 100644
--- a/m4/trunc.m4
+++ b/m4/trunc.m4
@@ -1,4 +1,4 @@
-# trunc.m4 serial 5
+# trunc.m4 serial 6
dnl Copyright (C) 2007, 2010-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,
@@ -79,7 +79,7 @@ int main()
HAVE_DECL_TRUNC=0
fi
if test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1; then
- AC_LIBOBJ([trunc])
+ dnl No libraries are needed to link lib/trunc.c.
TRUNC_LIBM=
fi
AC_SUBST([TRUNC_LIBM])
diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4
index eeb3360b0..fb6fe0772 100644
--- a/m4/unistd_h.m4
+++ b/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 55
+# unistd_h.m4 serial 56
dnl Copyright (C) 2006-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,
@@ -36,8 +36,8 @@ AC_DEFUN([gl_UNISTD_H],
]], [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
+ endusershell group_member lchown link linkat lseek pipe pipe2 pread pwrite
+ readlink readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
usleep])
])
@@ -72,6 +72,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
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_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
GNULIB_LINK=0; AC_SUBST([GNULIB_LINK])
GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT])
@@ -110,6 +111,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])
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index a8f346632..b2d1a29e2 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -1,4 +1,4 @@
-# warnings.m4 serial 2
+# warnings.m4 serial 3
dnl Copyright (C) 2008-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,
@@ -21,12 +21,12 @@ m4_ifdef([AS_VAR_APPEND],
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"
+ gl_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"
+ CPPFLAGS="$gl_save_CPPFLAGS"
])
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"])])
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4
index 6255ff352..977491fe8 100644
--- a/m4/wchar_h.m4
+++ b/m4/wchar_h.m4
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl Written by Eric Blake.
-# wchar_h.m4 serial 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/write.m4 b/m4/write.m4
index 63ab5e4c0..c39d3d07a 100644
--- a/m4/write.m4
+++ b/m4/write.m4
@@ -1,4 +1,4 @@
-# write.m4 serial 2
+# write.m4 serial 3
dnl Copyright (C) 2008-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,
@@ -22,7 +22,4 @@ AC_DEFUN([gl_FUNC_WRITE],
REPLACE_WRITE=1
fi
])
- if test $REPLACE_WRITE = 1; then
- AC_LIBOBJ([write])
- fi
])