summaryrefslogtreecommitdiff
path: root/gl/m4
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-03-04 12:00:56 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-03-04 12:10:00 +0100
commit77d2dca98d17f86fedefdca54b1175019f8f8ffa (patch)
tree1369fa31e2f7a7c1acca17cad470cd5d81fbf4a3 /gl/m4
parenta64ee8b7888ba1d0784991008fb1aa4bbcb3d1a3 (diff)
downloadgnutls-77d2dca98d17f86fedefdca54b1175019f8f8ffa.tar.gz
removed unused gnulib crap
Diffstat (limited to 'gl/m4')
-rw-r--r--gl/m4/close.m433
-rw-r--r--gl/m4/dup2.m487
-rw-r--r--gl/m4/ftruncate.m440
-rw-r--r--gl/m4/getaddrinfo.m4209
-rw-r--r--gl/m4/getcwd.m4155
-rw-r--r--gl/m4/getdtablesize.m444
-rw-r--r--gl/m4/gnulib-cache.m420
-rw-r--r--gl/m4/gnulib-comp.m4383
-rw-r--r--gl/m4/hostent.m449
-rw-r--r--gl/m4/inet_ntop.m468
-rw-r--r--gl/m4/ioctl.m441
-rw-r--r--gl/m4/lstat.m473
-rw-r--r--gl/m4/mode_t.m426
-rw-r--r--gl/m4/open.m491
-rw-r--r--gl/m4/pathmax.m442
-rw-r--r--gl/m4/perror.m463
-rw-r--r--gl/m4/pipe.m415
-rw-r--r--gl/m4/select.m4113
-rw-r--r--gl/m4/servent.m451
-rw-r--r--gl/m4/signal_h.m483
-rw-r--r--gl/m4/stat.m471
-rw-r--r--gl/m4/strerror.m496
-rw-r--r--gl/m4/strerror_r.m4173
-rw-r--r--gl/m4/symlink.m453
-rw-r--r--gl/m4/sys_ioctl_h.m464
-rw-r--r--gl/m4/sys_select_h.m495
26 files changed, 16 insertions, 2222 deletions
diff --git a/gl/m4/close.m4 b/gl/m4/close.m4
deleted file mode 100644
index 68510c5c52..0000000000
--- a/gl/m4/close.m4
+++ /dev/null
@@ -1,33 +0,0 @@
-# close.m4 serial 8
-dnl Copyright (C) 2008-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_CLOSE],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([gl_MSVC_INVAL])
- if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
- REPLACE_CLOSE=1
- fi
- m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [
- gl_PREREQ_SYS_H_WINSOCK2
- if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
- dnl Even if the 'socket' module is not used here, another part of the
- dnl application may use it and pass file descriptors that refer to
- dnl sockets to the close() function. So enable the support for sockets.
- REPLACE_CLOSE=1
- fi
- ])
- dnl Replace close() for supporting the gnulib-defined fchdir() function,
- dnl to keep fchdir's bookkeeping up-to-date.
- m4_ifdef([gl_FUNC_FCHDIR], [
- if test $REPLACE_CLOSE = 0; then
- gl_TEST_FCHDIR
- if test $HAVE_FCHDIR = 0; then
- REPLACE_CLOSE=1
- fi
- fi
- ])
-])
diff --git a/gl/m4/dup2.m4 b/gl/m4/dup2.m4
deleted file mode 100644
index 89638a0bfe..0000000000
--- a/gl/m4/dup2.m4
+++ /dev/null
@@ -1,87 +0,0 @@
-#serial 20
-dnl Copyright (C) 2002, 2005, 2007, 2009-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_DUP2],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([AC_CANONICAL_HOST])
- m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [
- AC_CHECK_FUNCS_ONCE([dup2])
- if test $ac_cv_func_dup2 = no; then
- HAVE_DUP2=0
- fi
- ], [
- AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.])
- ])
- if test $HAVE_DUP2 = 1; then
- AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
- [AC_RUN_IFELSE([
- AC_LANG_PROGRAM([[#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>]],
- [int result = 0;
-#ifdef FD_CLOEXEC
- if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
- result |= 1;
-#endif
- if (dup2 (1, 1) == 0)
- result |= 2;
-#ifdef FD_CLOEXEC
- if (fcntl (1, F_GETFD) != FD_CLOEXEC)
- result |= 4;
-#endif
- close (0);
- if (dup2 (0, 0) != -1)
- result |= 8;
- /* Many gnulib modules require POSIX conformance of EBADF. */
- if (dup2 (2, 1000000) == -1 && errno != EBADF)
- result |= 16;
- /* Flush out some cygwin core dumps. */
- if (dup2 (2, -1) != -1 || errno != EBADF)
- result |= 32;
- dup2 (2, 255);
- dup2 (2, 256);
- return result;
- ])
- ],
- [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
- [case "$host_os" in
- mingw*) # on this platform, dup2 always returns 0 for success
- gl_cv_func_dup2_works="guessing no" ;;
- cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
- gl_cv_func_dup2_works="guessing no" ;;
- linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
- # closed fd may yield -EBADF instead of -1 / errno=EBADF.
- gl_cv_func_dup2_works="guessing no" ;;
- freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
- gl_cv_func_dup2_works="guessing no" ;;
- haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
- gl_cv_func_dup2_works="guessing no" ;;
- *) gl_cv_func_dup2_works="guessing yes" ;;
- esac])
- ])
- case "$gl_cv_func_dup2_works" in
- *yes) ;;
- *)
- REPLACE_DUP2=1
- AC_CHECK_FUNCS([setdtablesize])
- ;;
- esac
- fi
- dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
- dnl to keep fchdir's bookkeeping up-to-date.
- m4_ifdef([gl_FUNC_FCHDIR], [
- gl_TEST_FCHDIR
- if test $HAVE_FCHDIR = 0; then
- if test $HAVE_DUP2 = 1; then
- REPLACE_DUP2=1
- fi
- fi
- ])
-])
-
-# Prerequisites of lib/dup2.c.
-AC_DEFUN([gl_PREREQ_DUP2], [])
diff --git a/gl/m4/ftruncate.m4 b/gl/m4/ftruncate.m4
deleted file mode 100644
index 29c76ccfca..0000000000
--- a/gl/m4/ftruncate.m4
+++ /dev/null
@@ -1,40 +0,0 @@
-# serial 20
-
-# See if we need to emulate a missing ftruncate function using chsize.
-
-# Copyright (C) 2000-2001, 2003-2007, 2009-2014 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_FTRUNCATE],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([ftruncate])
- if test $ac_cv_func_ftruncate = yes; then
- m4_ifdef([gl_LARGEFILE], [
- AC_REQUIRE([AC_CANONICAL_HOST])
- case "$host_os" in
- mingw*)
- dnl Native Windows, and Large File Support is requested.
- dnl The MSVCRT _chsize() function only accepts a 32-bit file size,
- dnl and the mingw64 ftruncate64() function is unreliable (it may
- dnl delete the file, see
- dnl <http://mingw-w64.sourcearchive.com/documentation/2.0-1/ftruncate64_8c_source.html>).
- dnl Use gnulib's ftruncate() implementation instead.
- REPLACE_FTRUNCATE=1
- ;;
- esac
- ], [
- :
- ])
- else
- HAVE_FTRUNCATE=0
- fi
-])
-
-# Prerequisites of lib/ftruncate.c.
-AC_DEFUN([gl_PREREQ_FTRUNCATE],
-[
- AC_CHECK_FUNCS([chsize])
-])
diff --git a/gl/m4/getaddrinfo.m4 b/gl/m4/getaddrinfo.m4
deleted file mode 100644
index 2e66584865..0000000000
--- a/gl/m4/getaddrinfo.m4
+++ /dev/null
@@ -1,209 +0,0 @@
-# getaddrinfo.m4 serial 30
-dnl Copyright (C) 2004-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_GETADDRINFO],
-[
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
- AC_REQUIRE([gl_HEADER_NETDB])dnl for HAVE_NETDB_H
- AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo])
- GETADDRINFO_LIB=
- gai_saved_LIBS="$LIBS"
-
- dnl Where is getaddrinfo()?
- dnl - On Solaris, it is in libsocket.
- dnl - On Haiku, it is in libnetwork.
- dnl - On BeOS, it is in libnet.
- dnl - On native Windows, it is in ws2_32.dll.
- dnl - Otherwise it is in libc.
- AC_SEARCH_LIBS([getaddrinfo], [socket network net],
- [if test "$ac_cv_search_getaddrinfo" != "none required"; then
- GETADDRINFO_LIB="$ac_cv_search_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>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#include <stddef.h>
-]], [[getaddrinfo("", "", NULL, NULL);]])],
- [gl_cv_func_getaddrinfo=yes],
- [gl_cv_func_getaddrinfo=no])])
- if test $gl_cv_func_getaddrinfo = no; then
- AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32],
- gl_cv_w32_getaddrinfo, [
- gl_cv_w32_getaddrinfo=no
- am_save_LIBS="$LIBS"
- LIBS="$LIBS -lws2_32"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#ifdef HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
-#endif
-#include <stddef.h>
-]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], [gl_cv_w32_getaddrinfo=yes])
- LIBS="$am_save_LIBS"
- ])
- if test "$gl_cv_w32_getaddrinfo" = "yes"; then
- GETADDRINFO_LIB="-lws2_32"
- LIBS="$gai_saved_LIBS $GETADDRINFO_LIB"
- else
- 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_CHECK_DECLS([gai_strerror], [], [], [[
-#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>
-]])
- if test $ac_cv_have_decl_gai_strerror = yes; then
- AC_CHECK_DECLS([gai_strerrorA], [], [], [[
-#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>
-]])
- 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
-#ifdef __cplusplus
-"C"
-#endif
-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"
-
- gl_PREREQ_GETADDRINFO
-
- AC_SUBST([GETADDRINFO_LIB])
-])
-
-# Prerequisites of lib/netdb.in.h and lib/getaddrinfo.c.
-AC_DEFUN([gl_PREREQ_GETADDRINFO], [
- AC_REQUIRE([gl_NETDB_H_DEFAULTS])
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
- AC_REQUIRE([gl_HOSTENT]) dnl for HOSTENT_LIB
- AC_REQUIRE([gl_SERVENT]) dnl for SERVENT_LIB
- AC_REQUIRE([gl_FUNC_INET_NTOP]) dnl for INET_NTOP_LIB
- AC_REQUIRE([AC_C_RESTRICT])
- AC_REQUIRE([gl_SOCKET_FAMILIES])
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-
- dnl Including sys/socket.h is wrong for Windows, but Windows does not
- dnl have sa_len so the result is correct anyway.
- AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [
-#include <sys/types.h>
-#include <sys/socket.h>
-])
-
- AC_CHECK_HEADERS_ONCE([netinet/in.h])
-
- 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. */
-#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
-]])
- if test $ac_cv_have_decl_getaddrinfo = no; then
- HAVE_DECL_GETADDRINFO=0
- fi
- if test $ac_cv_have_decl_freeaddrinfo = no; then
- HAVE_DECL_FREEADDRINFO=0
- fi
- if test $ac_cv_have_decl_gai_strerror = no; then
- HAVE_DECL_GAI_STRERROR=0
- fi
- if test $ac_cv_have_decl_getnameinfo = no; then
- HAVE_DECL_GETNAMEINFO=0
- fi
-
- AC_CHECK_TYPES([struct addrinfo],,,[
-#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
-])
- if test $ac_cv_type_struct_addrinfo = no; then
- HAVE_STRUCT_ADDRINFO=0
- fi
-
- dnl Append $HOSTENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
- case " $GETADDRINFO_LIB " in
- *" $HOSTENT_LIB "*) ;;
- *) GETADDRINFO_LIB="$GETADDRINFO_LIB $HOSTENT_LIB" ;;
- esac
-
- dnl Append $SERVENT_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
- case " $GETADDRINFO_LIB " in
- *" $SERVENT_LIB "*) ;;
- *) GETADDRINFO_LIB="$GETADDRINFO_LIB $SERVENT_LIB" ;;
- esac
-
- dnl Append $INET_NTOP_LIB to GETADDRINFO_LIB, avoiding gratuitous duplicates.
- case " $GETADDRINFO_LIB " in
- *" $INET_NTOP_LIB "*) ;;
- *) GETADDRINFO_LIB="$GETADDRINFO_LIB $INET_NTOP_LIB" ;;
- esac
-])
diff --git a/gl/m4/getcwd.m4 b/gl/m4/getcwd.m4
deleted file mode 100644
index fc986cdab5..0000000000
--- a/gl/m4/getcwd.m4
+++ /dev/null
@@ -1,155 +0,0 @@
-# getcwd.m4 - check for working getcwd that is compatible with glibc
-
-# Copyright (C) 2001, 2003-2007, 2009-2014 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# Written by Paul Eggert.
-# serial 12
-
-AC_DEFUN([gl_FUNC_GETCWD_NULL],
- [
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CHECK_HEADERS_ONCE([unistd.h])
- AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
- [gl_cv_func_getcwd_null],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-# if HAVE_UNISTD_H
-# include <unistd.h>
-# else /* on Windows with MSVC */
-# include <direct.h>
-# endif
-# ifndef getcwd
- char *getcwd ();
-# endif
-]], [[
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* mingw cwd does not start with '/', but getcwd does allocate.
- However, mingw fails to honor non-zero size. */
-#else
- if (chdir ("/") != 0)
- return 1;
- else
- {
- char *f = getcwd (NULL, 0);
- if (! f)
- return 2;
- if (f[0] != '/')
- return 3;
- if (f[1] != '\0')
- return 4;
- return 0;
- }
-#endif
- ]])],
- [gl_cv_func_getcwd_null=yes],
- [gl_cv_func_getcwd_null=no],
- [[case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_getcwd_null="guessing yes";;
- # Guess yes on Cygwin.
- cygwin*) gl_cv_func_getcwd_null="guessing yes";;
- # If we don't know, assume the worst.
- *) gl_cv_func_getcwd_null="guessing no";;
- esac
- ]])])
-])
-
-AC_DEFUN([gl_FUNC_GETCWD_SIGNATURE],
-[
- AC_CACHE_CHECK([for getcwd with POSIX signature],
- [gl_cv_func_getcwd_posix_signature],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <unistd.h>]],
- [[extern
- #ifdef __cplusplus
- "C"
- #endif
- char *getcwd (char *, size_t);
- ]])
- ],
- [gl_cv_func_getcwd_posix_signature=yes],
- [gl_cv_func_getcwd_posix_signature=no])
- ])
-])
-
-dnl Guarantee that getcwd will malloc with a NULL first argument. Assumes
-dnl that either the system getcwd is robust, or that calling code is okay
-dnl with spurious failures when run from a directory with an absolute name
-dnl larger than 4k bytes.
-dnl
-dnl Assumes that getcwd exists; if you are worried about obsolete
-dnl platforms that lacked getcwd(), then you need to use the GPL module.
-AC_DEFUN([gl_FUNC_GETCWD_LGPL],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([gl_FUNC_GETCWD_NULL])
- AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE])
-
- case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
- *yes,yes) ;;
- *)
- dnl Minimal replacement lib/getcwd-lgpl.c.
- REPLACE_GETCWD=1
- ;;
- esac
-])
-
-dnl Check for all known getcwd bugs; useful for a program likely to be
-dnl executed from an arbitrary location.
-AC_DEFUN([gl_FUNC_GETCWD],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([gl_FUNC_GETCWD_NULL])
- AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-
- gl_abort_bug=no
- case "$host_os" in
- mingw*)
- gl_cv_func_getcwd_path_max=yes
- ;;
- *)
- gl_FUNC_GETCWD_PATH_MAX
- case "$gl_cv_func_getcwd_null" in
- *yes)
- gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes])
- ;;
- esac
- ;;
- esac
- dnl Define HAVE_MINIMALLY_WORKING_GETCWD and HAVE_PARTLY_WORKING_GETCWD
- dnl if appropriate.
- case "$gl_cv_func_getcwd_path_max" in
- "no"|"no, it has the AIX bug") ;;
- *)
- AC_DEFINE([HAVE_MINIMALLY_WORKING_GETCWD], [1],
- [Define to 1 if getcwd minimally works, that is, its result can be
- trusted when it succeeds.])
- ;;
- esac
- case "$gl_cv_func_getcwd_path_max" in
- "no, but it is partly working")
- AC_DEFINE([HAVE_PARTLY_WORKING_GETCWD], [1],
- [Define to 1 if getcwd works, except it sometimes fails when it
- shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT.])
- ;;
- esac
-
- if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
- || test $gl_cv_func_getcwd_posix_signature != yes \
- || test "$gl_cv_func_getcwd_path_max" != yes \
- || test $gl_abort_bug = yes; then
- REPLACE_GETCWD=1
- fi
-])
-
-# Prerequisites of lib/getcwd.c, when full replacement is in effect.
-AC_DEFUN([gl_PREREQ_GETCWD],
-[
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO])
- :
-])
diff --git a/gl/m4/getdtablesize.m4 b/gl/m4/getdtablesize.m4
deleted file mode 100644
index aa523b63d7..0000000000
--- a/gl/m4/getdtablesize.m4
+++ /dev/null
@@ -1,44 +0,0 @@
-# getdtablesize.m4 serial 5
-dnl Copyright (C) 2008-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_GETDTABLESIZE],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([AC_CANONICAL_HOST])
- AC_CHECK_FUNCS_ONCE([getdtablesize])
- if test $ac_cv_func_getdtablesize = yes; then
- # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit
- # up to an unchangeable hard limit; all other platforms correctly
- # require setrlimit before getdtablesize() can report a larger value.
- AC_CACHE_CHECK([whether getdtablesize works],
- [gl_cv_func_getdtablesize_works],
- [AC_RUN_IFELSE([
- AC_LANG_PROGRAM([[#include <unistd.h>]],
- [int size = getdtablesize();
- if (dup2 (0, getdtablesize()) != -1)
- return 1;
- if (size != getdtablesize())
- return 2;
- ])],
- [gl_cv_func_getdtablesize_works=yes],
- [gl_cv_func_getdtablesize_works=no],
- [case "$host_os" in
- cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
- gl_cv_func_getdtablesize_works="guessing no" ;;
- *) gl_cv_func_getdtablesize_works="guessing yes" ;;
- esac])
- ])
- case "$gl_cv_func_getdtablesize_works" in
- *yes) ;;
- *) REPLACE_GETDTABLESIZE=1 ;;
- esac
- else
- HAVE_GETDTABLESIZE=0
- fi
-])
-
-# Prerequisites of lib/getdtablesize.c.
-AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [:])
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 1f55d540ca..2ac68e5d1f 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -27,35 +27,29 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca base64 bind byteswap c-ctype close connect extensions func gendocs getaddrinfo getpass gettext gettimeofday hash-pjw-bare havelib iconv inet_ntop inet_pton intprops lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html read-file recv recvfrom select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strerror strndup strtok_r strverscmp sys_socket sys_stat time_r u64 unistd valgrind-tests vasprintf vsnprintf warnings
+# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files alloca base64 bind byteswap c-ctype connect extensions func gendocs getpass gettext gettimeofday hash-pjw-bare havelib iconv intprops lib-msvc-compat lib-symbol-versions maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html read-file snprintf stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r u64 unistd valgrind-tests vasprintf vsnprintf warnings
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([gl/override])
gl_MODULES([
- accept
alloca
base64
bind
byteswap
c-ctype
- close
connect
extensions
func
gendocs
- getaddrinfo
getpass
gettext
gettimeofday
hash-pjw-bare
havelib
iconv
- inet_ntop
- inet_pton
intprops
lib-msvc-compat
lib-symbol-versions
- listen
maintainer-makefile
manywarnings
memmem-simple
@@ -64,21 +58,9 @@ gl_MODULES([
netinet_in
pmccabe2html
read-file
- recv
- recvfrom
- select
- send
- sendto
- servent
- setsockopt
- shutdown
snprintf
- socket
- sockets
- socklen
stdint
strcase
- strerror
strndup
strtok_r
strverscmp
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index a3182204ee..8c7dbab045 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -39,8 +39,6 @@ AC_DEFUN([gl_EARLY],
m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
AC_REQUIRE([gl_PROG_AR_RANLIB])
# Code from module absolute-header:
- # Code from module accept:
- # Code from module accept-tests:
# Code from module alloca:
# Code from module alloca-opt:
# Code from module alloca-opt-tests:
@@ -56,13 +54,8 @@ AC_DEFUN([gl_EARLY],
# Code from module byteswap-tests:
# Code from module c-ctype:
# Code from module c-ctype-tests:
- # Code from module close:
- # Code from module close-tests:
# Code from module connect:
# Code from module connect-tests:
- # Code from module dosname:
- # Code from module dup2:
- # Code from module dup2-tests:
# Code from module errno:
# Code from module errno-tests:
# Code from module extensions:
@@ -93,26 +86,16 @@ AC_DEFUN([gl_EARLY],
# Code from module ftello:
AC_REQUIRE([AC_FUNC_FSEEKO])
# Code from module ftello-tests:
- # Code from module ftruncate:
- # Code from module ftruncate-tests:
# Code from module func:
# Code from module func-tests:
# Code from module fwrite-tests:
# Code from module gendocs:
- # Code from module getaddrinfo:
- # Code from module getaddrinfo-tests:
- # Code from module getcwd-lgpl:
- # Code from module getcwd-lgpl-tests:
# Code from module getdelim:
# Code from module getdelim-tests:
- # Code from module getdtablesize:
- # Code from module getdtablesize-tests:
# Code from module getline:
# Code from module getline-tests:
# Code from module getpagesize:
# Code from module getpass:
- # Code from module getpeername:
- # Code from module getpeername-tests:
# Code from module gettext:
# Code from module gettext-h:
# Code from module gettimeofday:
@@ -120,14 +103,9 @@ AC_DEFUN([gl_EARLY],
# Code from module gnumakefile:
# Code from module hash-pjw-bare:
# Code from module havelib:
- # Code from module hostent:
# Code from module iconv:
# Code from module iconv-tests:
- # Code from module ignore-value:
- # Code from module ignore-value-tests:
# Code from module include_next:
- # Code from module inet_ntop:
- # Code from module inet_ntop-tests:
# Code from module inet_pton:
# Code from module inet_pton-tests:
# Code from module intprops:
@@ -135,18 +113,11 @@ AC_DEFUN([gl_EARLY],
# Code from module inttypes:
# Code from module inttypes-incomplete:
# Code from module inttypes-tests:
- # Code from module ioctl:
- # Code from module ioctl-tests:
# Code from module largefile:
AC_REQUIRE([AC_SYS_LARGEFILE])
# Code from module lib-msvc-compat:
# Code from module lib-symbol-versions:
- # Code from module listen:
- # Code from module listen-tests:
- # Code from module lock:
# Code from module lseek:
- # Code from module lstat:
- # Code from module lstat-tests:
# Code from module maintainer-makefile:
# Code from module malloc-posix:
# Code from module manywarnings:
@@ -161,36 +132,10 @@ AC_DEFUN([gl_EARLY],
# Code from module netdb-tests:
# Code from module netinet_in:
# Code from module netinet_in-tests:
- # Code from module open:
- # Code from module open-tests:
- # Code from module pathmax:
- # Code from module pathmax-tests:
- # Code from module perror:
- # Code from module perror-tests:
- # Code from module pipe-posix:
- # Code from module pipe-posix-tests:
# Code from module pmccabe2html:
# Code from module read-file:
# Code from module read-file-tests:
# Code from module realloc-posix:
- # Code from module recv:
- # Code from module recv-tests:
- # Code from module recvfrom:
- # Code from module recvfrom-tests:
- # Code from module same-inode:
- # Code from module select:
- # Code from module select-tests:
- # Code from module send:
- # Code from module send-tests:
- # Code from module sendto:
- # Code from module sendto-tests:
- # Code from module servent:
- # Code from module setsockopt:
- # Code from module setsockopt-tests:
- # Code from module shutdown:
- # Code from module shutdown-tests:
- # Code from module signal-h:
- # Code from module signal-h-tests:
# Code from module size_max:
# Code from module snippet/_Noreturn:
# Code from module snippet/arg-nonnull:
@@ -198,14 +143,11 @@ AC_DEFUN([gl_EARLY],
# Code from module snippet/warn-on-use:
# Code from module snprintf:
# Code from module snprintf-tests:
- # Code from module socket:
# Code from module socketlib:
# Code from module sockets:
# Code from module sockets-tests:
# Code from module socklen:
# Code from module ssize_t:
- # Code from module stat:
- # Code from module stat-tests:
# Code from module stdalign:
# Code from module stdalign-tests:
# Code from module stdbool:
@@ -220,11 +162,6 @@ AC_DEFUN([gl_EARLY],
# Code from module stdlib-tests:
# Code from module strcase:
# Code from module strdup-posix:
- # Code from module strerror:
- # Code from module strerror-override:
- # Code from module strerror-tests:
- # Code from module strerror_r-posix:
- # Code from module strerror_r-posix-tests:
# Code from module string:
# Code from module string-tests:
# Code from module strings:
@@ -235,12 +172,6 @@ AC_DEFUN([gl_EARLY],
# Code from module strtok_r:
# Code from module strverscmp:
# Code from module strverscmp-tests:
- # Code from module symlink:
- # Code from module symlink-tests:
- # Code from module sys_ioctl:
- # Code from module sys_ioctl-tests:
- # Code from module sys_select:
- # Code from module sys_select-tests:
# Code from module sys_socket:
# Code from module sys_socket-tests:
# Code from module sys_stat:
@@ -253,8 +184,6 @@ AC_DEFUN([gl_EARLY],
# Code from module sys_uio-tests:
# Code from module test-framework-sh:
# Code from module test-framework-sh-tests:
- # Code from module threadlib:
- gl_THREADLIB_EARLY
# Code from module time:
# Code from module time-tests:
# Code from module time_r:
@@ -294,18 +223,11 @@ AC_DEFUN([gl_INIT],
m4_pushdef([gl_LIBSOURCES_DIR], [])
gl_COMMON
gl_source_base='gl'
- 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])
changequote(,)dnl
LTALLOCA=`echo "$ALLOCA" | sed -e 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
changequote([, ])dnl
AC_SUBST([LTALLOCA])
gl_FUNC_ALLOCA
- gl_HEADER_ARPA_INET
- AC_PROG_MKDIR_P
gl_FUNC_BASE64
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
if test "$ac_cv_header_winsock2_h" = yes; then
@@ -313,22 +235,11 @@ AC_SUBST([LTALLOCA])
fi
gl_SYS_SOCKET_MODULE_INDICATOR([bind])
gl_BYTESWAP
- gl_FUNC_CLOSE
- if test $REPLACE_CLOSE = 1; then
- AC_LIBOBJ([close])
- fi
- 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_DUP2
- if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
- AC_LIBOBJ([dup2])
- gl_PREREQ_DUP2
- fi
- gl_UNISTD_MODULE_INDICATOR([dup2])
gl_HEADER_ERRNO_H
AC_REQUIRE([gl_EXTERN_INLINE])
gl_FLOAT_H
@@ -367,14 +278,6 @@ AC_SUBST([LTALLOCA])
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])
gl_FUNC_GETDELIM
if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then
AC_LIBOBJ([getdelim])
@@ -392,11 +295,6 @@ AC_SUBST([LTALLOCA])
AC_LIBOBJ([getpass])
gl_PREREQ_GETPASS
fi
- 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])
dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
AM_GNU_GETTEXT_VERSION([0.18.1])
AC_SUBST([LIBINTL])
@@ -417,30 +315,12 @@ AC_SUBST([LTALLOCA])
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_FUNC_INET_NTOP
- if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; 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 || test $REPLACE_INET_NTOP = 1; then
- AC_LIBOBJ([inet_pton])
- gl_PREREQ_INET_PTON
- fi
- gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
AC_REQUIRE([gl_LARGEFILE])
gl_LD_OUTPUT_DEF
gl_LD_VERSION_SCRIPT
- 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_FUNC_LSEEK
if test $REPLACE_LSEEK = 1; then
AC_LIBOBJ([lseek])
@@ -485,63 +365,11 @@ AC_SUBST([LTALLOCA])
AC_LIBOBJ([realloc])
fi
gl_STDLIB_MODULE_INDICATOR([realloc-posix])
- 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_FUNC_SELECT
- if test $REPLACE_SELECT = 1; then
- AC_LIBOBJ([select])
- fi
- gl_SYS_SELECT_MODULE_INDICATOR([select])
- 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_SIGNAL_H
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_STDALIGN_H
@@ -565,18 +393,6 @@ AC_SUBST([LTALLOCA])
gl_PREREQ_STRDUP
fi
gl_STRING_MODULE_INDICATOR([strdup])
- gl_FUNC_STRERROR
- if test $REPLACE_STRERROR = 1; then
- AC_LIBOBJ([strerror])
- fi
- gl_MODULE_INDICATOR([strerror])
- gl_STRING_MODULE_INDICATOR([strerror])
- AC_REQUIRE([gl_HEADER_ERRNO_H])
- AC_REQUIRE([gl_FUNC_STRERROR_0])
- if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
- AC_LIBOBJ([strerror-override])
- gl_PREREQ_SYS_H_WINSOCK2
- fi
gl_HEADER_STRING_H
gl_HEADER_STRINGS_H
gl_FUNC_STRNDUP
@@ -602,8 +418,6 @@ AC_SUBST([LTALLOCA])
gl_PREREQ_STRVERSCMP
fi
gl_STRING_MODULE_INDICATOR([strverscmp])
- gl_HEADER_SYS_SELECT
- AC_PROG_MKDIR_P
gl_HEADER_SYS_SOCKET
AC_PROG_MKDIR_P
gl_HEADER_SYS_STAT_H
@@ -679,6 +493,8 @@ changequote([, ])dnl
AC_SUBST([gltests_WITNESS])
gl_module_indicator_condition=$gltests_WITNESS
m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
+ gl_HEADER_ARPA_INET
+ AC_PROG_MKDIR_P
gl_FCNTL_H
gl_FUNC_FDOPEN
if test $REPLACE_FDOPEN = 1; then
@@ -690,94 +506,32 @@ changequote([, ])dnl
gl_FUNC_UNGETC_WORKS
gl_FUNC_UNGETC_WORKS
gl_FUNC_UNGETC_WORKS
- gl_FUNC_FTRUNCATE
- if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then
- AC_LIBOBJ([ftruncate])
- gl_PREREQ_FTRUNCATE
- fi
- gl_UNISTD_MODULE_INDICATOR([ftruncate])
- gl_FUNC_GETCWD_LGPL
- if test $REPLACE_GETCWD = 1; then
- AC_LIBOBJ([getcwd-lgpl])
- fi
- gl_UNISTD_MODULE_INDICATOR([getcwd])
- gl_FUNC_GETDTABLESIZE
- if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
- AC_LIBOBJ([getdtablesize])
- gl_PREREQ_GETDTABLESIZE
- fi
- gl_UNISTD_MODULE_INDICATOR([getdtablesize])
gl_FUNC_GETPAGESIZE
if test $REPLACE_GETPAGESIZE = 1; then
AC_LIBOBJ([getpagesize])
fi
gl_UNISTD_MODULE_INDICATOR([getpagesize])
- AC_C_BIGENDIAN
+ gl_FUNC_INET_PTON
+ if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then
+ AC_LIBOBJ([inet_pton])
+ gl_PREREQ_INET_PTON
+ fi
+ gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
AC_C_BIGENDIAN
gl_INTTYPES_H
gl_INTTYPES_INCOMPLETE
- gl_FUNC_IOCTL
- if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then
- AC_LIBOBJ([ioctl])
- fi
- gl_SYS_IOCTL_MODULE_INDICATOR([ioctl])
- gl_LOCK
- gl_MODULE_INDICATOR([lock])
- gl_FUNC_LSTAT
- if test $REPLACE_LSTAT = 1; then
- AC_LIBOBJ([lstat])
- gl_PREREQ_LSTAT
- fi
- gl_SYS_STAT_MODULE_INDICATOR([lstat])
dnl Check for prerequisites for memory fence checks.
gl_FUNC_MMAP_ANON
AC_CHECK_HEADERS_ONCE([sys/mman.h])
AC_CHECK_FUNCS_ONCE([mprotect])
- gl_FUNC_OPEN
- if test $REPLACE_OPEN = 1; then
- AC_LIBOBJ([open])
- gl_PREREQ_OPEN
- fi
- gl_FCNTL_MODULE_INDICATOR([open])
- gl_PATHMAX
- gl_FUNC_PERROR
- if test $REPLACE_PERROR = 1; then
- AC_LIBOBJ([perror])
- fi
- gl_STRING_MODULE_INDICATOR([perror])
- gl_FUNC_PIPE
- if test $HAVE_PIPE = 0; then
- AC_LIBOBJ([pipe])
- fi
- gl_UNISTD_MODULE_INDICATOR([pipe])
- AC_CHECK_HEADERS_ONCE([sys/wait.h])
- gl_FUNC_STAT
- if test $REPLACE_STAT = 1; then
- AC_LIBOBJ([stat])
- gl_PREREQ_STAT
- fi
- gl_SYS_STAT_MODULE_INDICATOR([stat])
+ gl_SOCKETS
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
- gl_FUNC_STRERROR_R
- if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
- AC_LIBOBJ([strerror_r])
- gl_PREREQ_STRERROR_R
- fi
- gl_STRING_MODULE_INDICATOR([strerror_r])
dnl Check for prerequisites for memory fence checks.
gl_FUNC_MMAP_ANON
AC_CHECK_HEADERS_ONCE([sys/mman.h])
AC_CHECK_FUNCS_ONCE([mprotect])
- gl_FUNC_SYMLINK
- if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
- AC_LIBOBJ([symlink])
- fi
- gl_UNISTD_MODULE_INDICATOR([symlink])
- gl_SYS_IOCTL_H
- AC_PROG_MKDIR_P
AC_CHECK_FUNCS_ONCE([shutdown])
- gl_THREADLIB
gl_VALGRIND_TESTS
abs_aux_dir=`cd "$ac_aux_dir"; pwd`
AC_SUBST([abs_aux_dir])
@@ -884,10 +638,8 @@ AC_DEFUN([gl_FILE_LIST], [
build-aux/useless-if-before-free
build-aux/vc-list-files
doc/gendocs_template
- lib/accept.c
lib/alloca.c
lib/alloca.in.h
- lib/arpa_inet.in.h
lib/asnprintf.c
lib/asprintf.c
lib/base64.c
@@ -896,12 +648,8 @@ AC_DEFUN([gl_FILE_LIST], [
lib/byteswap.in.h
lib/c-ctype.c
lib/c-ctype.h
- lib/close.c
lib/connect.c
- lib/dup2.c
lib/errno.in.h
- lib/fd-hook.c
- lib/fd-hook.h
lib/float+.h
lib/float.c
lib/float.in.h
@@ -910,22 +658,16 @@ AC_DEFUN([gl_FILE_LIST], [
lib/fstat.c
lib/ftell.c
lib/ftello.c
- lib/gai_strerror.c
- lib/getaddrinfo.c
lib/getdelim.c
lib/getline.c
lib/getpass.c
lib/getpass.h
- lib/getpeername.c
lib/gettext.h
lib/gettimeofday.c
lib/hash-pjw-bare.c
lib/hash-pjw-bare.h
- lib/inet_ntop.c
- lib/inet_pton.c
lib/intprops.h
lib/itold.c
- lib/listen.c
lib/lseek.c
lib/malloc.c
lib/memchr.c
@@ -945,19 +687,8 @@ AC_DEFUN([gl_FILE_LIST], [
lib/read-file.c
lib/read-file.h
lib/realloc.c
- lib/recv.c
- lib/recvfrom.c
- lib/select.c
- lib/send.c
- lib/sendto.c
- lib/setsockopt.c
- lib/shutdown.c
- lib/signal.in.h
lib/size_max.h
lib/snprintf.c
- lib/socket.c
- lib/sockets.c
- lib/sockets.h
lib/stdalign.in.h
lib/stdbool.in.h
lib/stddef.in.h
@@ -968,9 +699,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/str-two-way.h
lib/strcasecmp.c
lib/strdup.c
- lib/strerror-override.c
- lib/strerror-override.h
- lib/strerror.c
lib/string.in.h
lib/strings.in.h
lib/strncasecmp.c
@@ -978,7 +706,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/strnlen.c
lib/strtok_r.c
lib/strverscmp.c
- lib/sys_select.in.h
lib/sys_socket.c
lib/sys_socket.in.h
lib/sys_stat.in.h
@@ -1006,9 +733,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/arpa_inet_h.m4
m4/base64.m4
m4/byteswap.m4
- m4/close.m4
m4/codeset.m4
- m4/dup2.m4
m4/errno_h.m4
m4/exponentd.m4
m4/extensions.m4
@@ -1023,12 +748,8 @@ AC_DEFUN([gl_FILE_LIST], [
m4/fstat.m4
m4/ftell.m4
m4/ftello.m4
- m4/ftruncate.m4
m4/func.m4
- m4/getaddrinfo.m4
- m4/getcwd.m4
m4/getdelim.m4
- m4/getdtablesize.m4
m4/getline.m4
m4/getpagesize.m4
m4/getpass.m4
@@ -1037,10 +758,8 @@ AC_DEFUN([gl_FILE_LIST], [
m4/glibc2.m4
m4/glibc21.m4
m4/gnulib-common.m4
- m4/hostent.m4
m4/iconv.m4
m4/include_next.m4
- m4/inet_ntop.m4
m4/inet_pton.m4
m4/intdiv0.m4
m4/intl.m4
@@ -1051,7 +770,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/inttypes-pri.m4
m4/inttypes.m4
m4/inttypes_h.m4
- m4/ioctl.m4
m4/largefile.m4
m4/lcmessage.m4
m4/ld-output-def.m4
@@ -1062,7 +780,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/lock.m4
m4/longlong.m4
m4/lseek.m4
- m4/lstat.m4
m4/malloc.m4
m4/manywarnings.m4
m4/math_h.m4
@@ -1070,7 +787,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/memmem.m4
m4/minmax.m4
m4/mmap-anon.m4
- m4/mode_t.m4
m4/msvc-inval.m4
m4/msvc-nothrow.m4
m4/multiarch.m4
@@ -1078,19 +794,12 @@ AC_DEFUN([gl_FILE_LIST], [
m4/netinet_in_h.m4
m4/nls.m4
m4/off_t.m4
- m4/open.m4
- m4/pathmax.m4
- m4/perror.m4
- m4/pipe.m4
m4/po.m4
m4/printf-posix.m4
m4/printf.m4
m4/progtest.m4
m4/read-file.m4
m4/realloc.m4
- m4/select.m4
- m4/servent.m4
- m4/signal_h.m4
m4/size_max.m4
m4/snprintf.m4
m4/socketlib.m4
@@ -1098,7 +807,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/socklen.m4
m4/sockpfaf.m4
m4/ssize_t.m4
- m4/stat.m4
m4/stdalign.m4
m4/stdbool.m4
m4/stddef_h.m4
@@ -1108,17 +816,12 @@ AC_DEFUN([gl_FILE_LIST], [
m4/stdlib_h.m4
m4/strcase.m4
m4/strdup.m4
- m4/strerror.m4
- m4/strerror_r.m4
m4/string_h.m4
m4/strings_h.m4
m4/strndup.m4
m4/strnlen.m4
m4/strtok_r.m4
m4/strverscmp.m4
- m4/symlink.m4
- m4/sys_ioctl_h.m4
- m4/sys_select_h.m4
m4/sys_socket_h.m4
m4/sys_stat_h.m4
m4/sys_time_h.m4
@@ -1144,7 +847,6 @@ AC_DEFUN([gl_FILE_LIST], [
tests/init.sh
tests/macros.h
tests/signature.h
- tests/test-accept.c
tests/test-alloca-opt.c
tests/test-arpa_inet.c
tests/test-base64.c
@@ -1153,9 +855,7 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-bind.c
tests/test-byteswap.c
tests/test-c-ctype.c
- tests/test-close.c
tests/test-connect.c
- tests/test-dup2.c
tests/test-errno.c
tests/test-fcntl-h.c
tests/test-fdopen.c
@@ -1184,72 +884,32 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-ftello3.c
tests/test-ftello4.c
tests/test-ftello4.sh
- tests/test-ftruncate.c
- tests/test-ftruncate.sh
tests/test-func.c
tests/test-fwrite.c
- tests/test-getaddrinfo.c
- tests/test-getcwd-lgpl.c
tests/test-getdelim.c
- tests/test-getdtablesize.c
tests/test-getline.c
- tests/test-getpeername.c
tests/test-gettimeofday.c
tests/test-iconv.c
- tests/test-ignore-value.c
- tests/test-inet_ntop.c
tests/test-inet_pton.c
tests/test-init.sh
tests/test-intprops.c
tests/test-inttypes.c
- tests/test-ioctl.c
- tests/test-listen.c
- tests/test-lstat.c
- tests/test-lstat.h
tests/test-memchr.c
tests/test-netdb.c
tests/test-netinet_in.c
- tests/test-open.c
- tests/test-open.h
- tests/test-pathmax.c
- tests/test-perror.c
- tests/test-perror.sh
- tests/test-perror2.c
- tests/test-pipe.c
tests/test-read-file.c
- tests/test-recv.c
- tests/test-recvfrom.c
- tests/test-select-fd.c
- tests/test-select-in.sh
- tests/test-select-out.sh
- tests/test-select-stdin.c
- tests/test-select.c
- tests/test-select.h
- tests/test-send.c
- tests/test-sendto.c
- tests/test-setsockopt.c
- tests/test-shutdown.c
- tests/test-signal-h.c
tests/test-snprintf.c
tests/test-sockets.c
- tests/test-stat.c
- tests/test-stat.h
tests/test-stdalign.c
tests/test-stdbool.c
tests/test-stddef.c
tests/test-stdint.c
tests/test-stdio.c
tests/test-stdlib.c
- tests/test-strerror.c
- tests/test-strerror_r.c
tests/test-string.c
tests/test-strings.c
tests/test-strnlen.c
tests/test-strverscmp.c
- tests/test-symlink.c
- tests/test-symlink.h
- tests/test-sys_ioctl.c
- tests/test-sys_select.c
tests/test-sys_socket.c
tests/test-sys_stat.c
tests/test-sys_time.c
@@ -1268,32 +928,19 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-vsnprintf.c
tests/test-wchar.c
tests/zerosize-ptr.h
+ tests=lib/arpa_inet.in.h
tests=lib/binary-io.c
tests=lib/binary-io.h
- tests=lib/dosname.h
tests=lib/fcntl.in.h
+ tests=lib/fd-hook.c
+ tests=lib/fd-hook.h
tests=lib/fdopen.c
tests=lib/fpucw.h
- tests=lib/ftruncate.c
- tests=lib/getcwd-lgpl.c
- tests=lib/getdtablesize.c
tests=lib/getpagesize.c
- tests=lib/glthread/lock.c
- tests=lib/glthread/lock.h
- tests=lib/glthread/threadlib.c
- tests=lib/ignore-value.h
+ tests=lib/inet_pton.c
tests=lib/inttypes.in.h
- tests=lib/ioctl.c
- tests=lib/lstat.c
- tests=lib/open.c
- tests=lib/pathmax.h
- tests=lib/perror.c
- tests=lib/pipe.c
- tests=lib/same-inode.h
- tests=lib/stat.c
- tests=lib/strerror_r.c
- tests=lib/symlink.c
- tests=lib/sys_ioctl.in.h
+ tests=lib/sockets.c
+ tests=lib/sockets.h
tests=lib/w32sock.h
top/GNUmakefile
top/maint.mk
diff --git a/gl/m4/hostent.m4 b/gl/m4/hostent.m4
deleted file mode 100644
index dd8fc0709d..0000000000
--- a/gl/m4/hostent.m4
+++ /dev/null
@@ -1,49 +0,0 @@
-# hostent.m4 serial 2
-dnl Copyright (C) 2008, 2010-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_HOSTENT],
-[
- dnl Where are gethostent(), sethostent(), endhostent(), gethostbyname(),
- dnl gethostbyaddr() defined?
- dnl - On Solaris, they are in libnsl. Ignore libxnet.
- dnl - On Haiku, they are in libnetwork.
- dnl - On BeOS, they are in libnet.
- dnl - On native Windows, they are in ws2_32.dll.
- dnl - Otherwise they are in libc.
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
- HOSTENT_LIB=
- gl_saved_libs="$LIBS"
- AC_SEARCH_LIBS([gethostbyname], [nsl network net],
- [if test "$ac_cv_search_gethostbyname" != "none required"; then
- HOSTENT_LIB="$ac_cv_search_gethostbyname"
- fi])
- LIBS="$gl_saved_libs"
- if test -z "$HOSTENT_LIB"; then
- AC_CHECK_FUNCS([gethostbyname], , [
- AC_CACHE_CHECK([for gethostbyname in winsock2.h and -lws2_32],
- [gl_cv_w32_gethostbyname],
- [gl_cv_w32_gethostbyname=no
- gl_save_LIBS="$LIBS"
- LIBS="$LIBS -lws2_32"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#include <stddef.h>
- ]],
- [[gethostbyname(NULL);]])],
- [gl_cv_w32_gethostbyname=yes])
- LIBS="$gl_save_LIBS"
- ])
- if test "$gl_cv_w32_gethostbyname" = "yes"; then
- HOSTENT_LIB="-lws2_32"
- fi
- ])
- fi
- AC_SUBST([HOSTENT_LIB])
-])
diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4
deleted file mode 100644
index 5b27759c5e..0000000000
--- a/gl/m4/inet_ntop.m4
+++ /dev/null
@@ -1,68 +0,0 @@
-# inet_ntop.m4 serial 19
-dnl Copyright (C) 2005-2006, 2008-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_INET_NTOP],
-[
- AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
-
- dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop.
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
- AC_REQUIRE([AC_C_RESTRICT])
-
- dnl Most platforms that provide inet_ntop define it in libc.
- dnl Solaris 8..10 provide inet_ntop in libnsl instead.
- dnl Solaris 2.6..7 provide inet_ntop in libresolv instead.
- dnl Native Windows provides it in -lws2_32 instead, with a declaration in
- dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl
- dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it).
- HAVE_INET_NTOP=1
- INET_NTOP_LIB=
- gl_PREREQ_SYS_H_WINSOCK2
- if test $HAVE_WINSOCK2_H = 1; then
- AC_CHECK_DECLS([inet_ntop],,, [[#include <ws2tcpip.h>]])
- if test $ac_cv_have_decl_inet_ntop = yes; then
- dnl It needs to be overridden, because the stdcall calling convention
- dnl is not compliant with POSIX.
- REPLACE_INET_NTOP=1
- INET_NTOP_LIB="-lws2_32"
- else
- HAVE_DECL_INET_NTOP=0
- HAVE_INET_NTOP=0
- fi
- else
- gl_save_LIBS=$LIBS
- AC_SEARCH_LIBS([inet_ntop], [nsl resolv], [],
- [AC_CHECK_FUNCS([inet_ntop])
- if test $ac_cv_func_inet_ntop = no; then
- HAVE_INET_NTOP=0
- fi
- ])
- LIBS=$gl_save_LIBS
-
- if test "$ac_cv_search_inet_ntop" != "no" \
- && test "$ac_cv_search_inet_ntop" != "none required"; then
- INET_NTOP_LIB="$ac_cv_search_inet_ntop"
- fi
-
- AC_CHECK_HEADERS_ONCE([netdb.h])
- AC_CHECK_DECLS([inet_ntop],,,
- [[#include <arpa/inet.h>
- #if HAVE_NETDB_H
- # include <netdb.h>
- #endif
- ]])
- if test $ac_cv_have_decl_inet_ntop = no; then
- HAVE_DECL_INET_NTOP=0
- fi
- fi
- AC_SUBST([INET_NTOP_LIB])
-])
-
-# Prerequisites of lib/inet_ntop.c.
-AC_DEFUN([gl_PREREQ_INET_NTOP], [
- AC_REQUIRE([gl_SOCKET_FAMILIES])
-])
diff --git a/gl/m4/ioctl.m4 b/gl/m4/ioctl.m4
deleted file mode 100644
index 5a31a396f9..0000000000
--- a/gl/m4/ioctl.m4
+++ /dev/null
@@ -1,41 +0,0 @@
-# ioctl.m4 serial 4
-dnl Copyright (C) 2008-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_IOCTL],
-[
- AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])
- HAVE_IOCTL=1
- if test "$ac_cv_header_winsock2_h" = yes; then
- dnl Even if the 'socket' module is not used here, another part of the
- dnl application may use it and pass file descriptors that refer to
- dnl sockets to the ioctl() function. So enable the support for sockets.
- HAVE_IOCTL=0
- else
- AC_CHECK_FUNCS([ioctl])
- dnl On glibc systems, the second parameter is 'unsigned long int request',
- dnl not 'int request'. We cannot simply cast the function pointer, but
- dnl instead need a wrapper.
- AC_CACHE_CHECK([for ioctl with POSIX signature],
- [gl_cv_func_ioctl_posix_signature],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <sys/ioctl.h>]],
- [[extern
- #ifdef __cplusplus
- "C"
- #endif
- int ioctl (int, int, ...);
- ]])
- ],
- [gl_cv_func_ioctl_posix_signature=yes],
- [gl_cv_func_ioctl_posix_signature=no])
- ])
- if test $gl_cv_func_ioctl_posix_signature != yes; then
- REPLACE_IOCTL=1
- fi
- fi
-])
diff --git a/gl/m4/lstat.m4 b/gl/m4/lstat.m4
deleted file mode 100644
index c5e72b81e8..0000000000
--- a/gl/m4/lstat.m4
+++ /dev/null
@@ -1,73 +0,0 @@
-# serial 26
-
-# Copyright (C) 1997-2001, 2003-2014 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 Jim Meyering.
-
-AC_DEFUN([gl_FUNC_LSTAT],
-[
- AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
- dnl If lstat does not exist, the replacement <sys/stat.h> does
- dnl "#define lstat stat", and lstat.c is a no-op.
- AC_CHECK_FUNCS_ONCE([lstat])
- if test $ac_cv_func_lstat = yes; then
- AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
- case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
- *no)
- REPLACE_LSTAT=1
- ;;
- esac
- else
- HAVE_LSTAT=0
- fi
-])
-
-# Prerequisites of lib/lstat.c.
-AC_DEFUN([gl_PREREQ_LSTAT], [:])
-
-AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
-[
- dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it
- dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ.
- AC_CACHE_CHECK([whether lstat correctly handles trailing slash],
- [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
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [AC_INCLUDES_DEFAULT],
- [[struct stat sbuf;
- /* Linux will dereference the symlink and fail, as required by
- POSIX. That is better in the sense that it means we will not
- have to compile and use the lstat wrapper. */
- return lstat ("conftest.sym/", &sbuf) == 0;
- ]])],
- [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
- [gl_cv_func_lstat_dereferences_slashed_symlink=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
- esac
- ])
- else
- # If the 'ln -s' command failed, then we probably don't even
- # have an lstat function.
- gl_cv_func_lstat_dereferences_slashed_symlink="guessing no"
- fi
- rm -f conftest.sym conftest.file
- ])
- case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
- *yes)
- AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
- [Define to 1 if 'lstat' dereferences a symlink specified
- with a trailing slash.])
- ;;
- esac
-])
diff --git a/gl/m4/mode_t.m4 b/gl/m4/mode_t.m4
deleted file mode 100644
index db6e192be9..0000000000
--- a/gl/m4/mode_t.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-# mode_t.m4 serial 2
-dnl Copyright (C) 2009-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# 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/gl/m4/open.m4 b/gl/m4/open.m4
deleted file mode 100644
index 68f116f0a8..0000000000
--- a/gl/m4/open.m4
+++ /dev/null
@@ -1,91 +0,0 @@
-# open.m4 serial 14
-dnl Copyright (C) 2007-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_OPEN],
-[
- AC_REQUIRE([AC_CANONICAL_HOST])
- case "$host_os" in
- mingw* | pw*)
- REPLACE_OPEN=1
- ;;
- *)
- 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.])
- REPLACE_OPEN=1
- ;;
- esac
- ;;
- esac
- dnl Replace open() for supporting the gnulib-defined fchdir() function,
- dnl to keep fchdir's bookkeeping up-to-date.
- m4_ifdef([gl_FUNC_FCHDIR], [
- if test $REPLACE_OPEN = 0; then
- gl_TEST_FCHDIR
- if test $HAVE_FCHDIR = 0; then
- REPLACE_OPEN=1
- fi
- fi
- ])
- dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag.
- m4_ifdef([gl_NONBLOCKING_IO], [
- if test $REPLACE_OPEN = 0; then
- gl_NONBLOCKING_IO
- if test $gl_cv_have_open_O_NONBLOCK != yes; then
- REPLACE_OPEN=1
- fi
- fi
- ])
-])
-
-# Prerequisites of lib/open.c.
-AC_DEFUN([gl_PREREQ_OPEN],
-[
- AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T])
- :
-])
diff --git a/gl/m4/pathmax.m4 b/gl/m4/pathmax.m4
deleted file mode 100644
index 114f91f04b..0000000000
--- a/gl/m4/pathmax.m4
+++ /dev/null
@@ -1,42 +0,0 @@
-# pathmax.m4 serial 10
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2014 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_PATHMAX],
-[
- dnl Prerequisites of lib/pathmax.h.
- AC_CHECK_HEADERS_ONCE([sys/param.h])
-])
-
-# Expands to a piece of C program that defines PATH_MAX in the same way as
-# "pathmax.h" will do.
-AC_DEFUN([gl_PATHMAX_SNIPPET], [[
-/* Arrange to define PATH_MAX, like "pathmax.h" does. */
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#include <limits.h>
-#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
-# include <sys/param.h>
-#endif
-#if !defined PATH_MAX && defined MAXPATHLEN
-# define PATH_MAX MAXPATHLEN
-#endif
-#ifdef __hpux
-# undef PATH_MAX
-# define PATH_MAX 1024
-#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-# undef PATH_MAX
-# define PATH_MAX 260
-#endif
-]])
-
-# Prerequisites of gl_PATHMAX_SNIPPET.
-AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ],
-[
- AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h])
-])
diff --git a/gl/m4/perror.m4 b/gl/m4/perror.m4
deleted file mode 100644
index ff9c08f9e3..0000000000
--- a/gl/m4/perror.m4
+++ /dev/null
@@ -1,63 +0,0 @@
-# perror.m4 serial 6
-dnl Copyright (C) 2008-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_PERROR],
-[
- AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- AC_REQUIRE([gl_HEADER_ERRNO_H])
- AC_REQUIRE([gl_FUNC_STRERROR_R])
- AC_REQUIRE([gl_FUNC_STRERROR_0])
- dnl We intentionally do not check for the broader REPLACE_STRERROR_R,
- dnl since on glibc systems, strerror_r is replaced only for signature
- dnl issues, and perror is just fine. Rather, we only want to
- dnl replace perror if strerror_r was replaced for a content fix.
- if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then
- dnl The system's perror() cannot know about the new errno values we add
- dnl to <errno.h>, or any fix for strerror(0). Replace it.
- REPLACE_PERROR=1
- fi
- case ${gl_cv_func_strerror_r_works-unset} in
- unset|*yes)
- AC_CACHE_CHECK([whether perror matches strerror],
- [gl_cv_func_perror_works],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <errno.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- ]],
- [[char *str = strerror (-1);
- if (!getenv("CONFTEST_OUTPUT")) return 0;
- if (!str) str = "";
- puts (str);
- errno = -1;
- perror ("");
- return 0;
- ]])],
- [if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \
- && cmp conftest.txt1 conftest.txt2 >/dev/null; then
- gl_cv_func_perror_works=yes
- else
- gl_cv_func_perror_works=no
- fi
- rm -rf conftest.txt1 conftest.txt2],
- [gl_cv_func_perror_works=no],
- [dnl Guess no when cross-compiling.
- gl_cv_func_perror_works="guessing no"
- ])
- ])
- if test "$gl_cv_func_perror_works" != yes; then
- REPLACE_PERROR=1
- fi
- ;;
- *)
- dnl The system's perror() probably inherits the bugs in the
- dnl system's strerror_r(). Replace it.
- REPLACE_PERROR=1
- ;;
- esac
-])
diff --git a/gl/m4/pipe.m4 b/gl/m4/pipe.m4
deleted file mode 100644
index d3532d5ddc..0000000000
--- a/gl/m4/pipe.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-# pipe.m4 serial 2
-dnl Copyright (C) 2010-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_PIPE],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-
- AC_CHECK_FUNCS_ONCE([pipe])
- if test $ac_cv_func_pipe != yes; then
- HAVE_PIPE=0
- fi
-])
diff --git a/gl/m4/select.m4 b/gl/m4/select.m4
deleted file mode 100644
index 1d2fcb373b..0000000000
--- a/gl/m4/select.m4
+++ /dev/null
@@ -1,113 +0,0 @@
-# select.m4 serial 7
-dnl Copyright (C) 2009-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_SELECT],
-[
- AC_REQUIRE([gl_HEADER_SYS_SELECT])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([gl_SOCKETS])
- if test "$ac_cv_header_winsock2_h" = yes; then
- REPLACE_SELECT=1
- else
- dnl On Interix 3.5, select(0, NULL, NULL, NULL, timeout) fails with error
- dnl EFAULT.
- AC_CHECK_HEADERS_ONCE([sys/select.h])
- AC_CACHE_CHECK([whether select supports a 0 argument],
- [gl_cv_func_select_supports0],
- [
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <sys/types.h>
-#include <sys/time.h>
-#if HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-int main ()
-{
- struct timeval timeout;
- timeout.tv_sec = 0;
- timeout.tv_usec = 5;
- return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0;
-}]])], [gl_cv_func_select_supports0=yes], [gl_cv_func_select_supports0=no],
- [
-changequote(,)dnl
- case "$host_os" in
- # Guess no on Interix.
- interix*) gl_cv_func_select_supports0="guessing no";;
- # Guess yes otherwise.
- *) gl_cv_func_select_supports0="guessing yes";;
- esac
-changequote([,])dnl
- ])
- ])
- case "$gl_cv_func_select_supports0" in
- *yes) ;;
- *) REPLACE_SELECT=1 ;;
- esac
-
- dnl On FreeBSD 8.2, select() doesn't always reject bad fds.
- AC_CACHE_CHECK([whether select detects invalid fds],
- [gl_cv_func_select_detects_ebadf],
- [
- AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#include <sys/types.h>
-#include <sys/time.h>
-#if HAVE_SYS_SELECT_H
-# include <sys/select.h>
-#endif
-#include <unistd.h>
-#include <errno.h>
-]],[[
- fd_set set;
- dup2(0, 16);
- FD_ZERO(&set);
- FD_SET(16, &set);
- close(16);
- struct timeval timeout;
- timeout.tv_sec = 0;
- timeout.tv_usec = 5;
- return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF;
-]])], [gl_cv_func_select_detects_ebadf=yes],
- [gl_cv_func_select_detects_ebadf=no],
- [
- case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_select_detects_ebadf="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_select_detects_ebadf="guessing no" ;;
- esac
- ])
- ])
- case $gl_cv_func_select_detects_ebadf in
- *yes) ;;
- *) REPLACE_SELECT=1 ;;
- esac
- fi
-
- dnl Determine the needed libraries.
- LIB_SELECT="$LIBSOCKET"
- if test $REPLACE_SELECT = 1; then
- case "$host_os" in
- mingw*)
- dnl On the MSVC platform, the function MsgWaitForMultipleObjects
- dnl (used in lib/select.c) requires linking with -luser32. On mingw,
- dnl it is implicit.
- AC_LINK_IFELSE(
- [AC_LANG_SOURCE([[
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-int
-main ()
-{
- MsgWaitForMultipleObjects (0, NULL, 0, 0, 0);
- return 0;
-}]])],
- [],
- [LIB_SELECT="$LIB_SELECT -luser32"])
- ;;
- esac
- fi
- AC_SUBST([LIB_SELECT])
-])
diff --git a/gl/m4/servent.m4 b/gl/m4/servent.m4
deleted file mode 100644
index 4dc7a9f706..0000000000
--- a/gl/m4/servent.m4
+++ /dev/null
@@ -1,51 +0,0 @@
-# servent.m4 serial 2
-dnl Copyright (C) 2008, 2010-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_SERVENT],
-[
- dnl Where are getservent(), setservent(), endservent(), getservbyname(),
- dnl getservbyport() defined?
- dnl Where are getprotoent(), setprotoent(), endprotoent(), getprotobyname(),
- dnl getprotobynumber() defined?
- dnl - On Solaris, they are in libsocket. Ignore libxnet.
- dnl - On Haiku, they are in libnetwork.
- dnl - On BeOS, they are in libnet.
- dnl - On native Windows, they are in ws2_32.dll.
- dnl - Otherwise they are in libc.
- AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
- SERVENT_LIB=
- gl_saved_libs="$LIBS"
- AC_SEARCH_LIBS([getservbyname], [socket network net],
- [if test "$ac_cv_search_getservbyname" != "none required"; then
- SERVENT_LIB="$ac_cv_search_getservbyname"
- fi])
- LIBS="$gl_saved_libs"
- if test -z "$SERVENT_LIB"; then
- AC_CHECK_FUNCS([getservbyname], , [
- AC_CACHE_CHECK([for getservbyname in winsock2.h and -lws2_32],
- [gl_cv_w32_getservbyname],
- [gl_cv_w32_getservbyname=no
- gl_save_LIBS="$LIBS"
- LIBS="$LIBS -lws2_32"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-#include <stddef.h>
- ]],
- [[getservbyname(NULL,NULL);]])],
- [gl_cv_w32_getservbyname=yes])
- LIBS="$gl_save_LIBS"
- ])
- if test "$gl_cv_w32_getservbyname" = "yes"; then
- SERVENT_LIB="-lws2_32"
- fi
- ])
- fi
- AC_SUBST([SERVENT_LIB])
-])
diff --git a/gl/m4/signal_h.m4 b/gl/m4/signal_h.m4
deleted file mode 100644
index c8f664fbf3..0000000000
--- a/gl/m4/signal_h.m4
+++ /dev/null
@@ -1,83 +0,0 @@
-# signal_h.m4 serial 18
-dnl Copyright (C) 2007-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_SIGNAL_H],
-[
- AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
- AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
- gl_NEXT_HEADERS([signal.h])
-
-# AIX declares sig_atomic_t to already include volatile, and C89 compilers
-# then choke on 'volatile sig_atomic_t'. C99 requires that it compile.
- AC_CHECK_TYPE([volatile sig_atomic_t], [],
- [HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0], [[
-#include <signal.h>
- ]])
-
- dnl Ensure the type pid_t gets defined.
- AC_REQUIRE([AC_TYPE_PID_T])
-
- AC_REQUIRE([AC_TYPE_UID_T])
-
- dnl Persuade glibc <signal.h> to define sighandler_t.
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_TYPE([sighandler_t], [], [HAVE_SIGHANDLER_T=0], [[
-#include <signal.h>
- ]])
-
- dnl Check for declarations of anything we want to poison if the
- dnl corresponding gnulib module is not in use.
- gl_WARN_ON_USE_PREPARE([[#include <signal.h>
- ]], [pthread_sigmask sigaction
- sigaddset sigdelset sigemptyset sigfillset sigismember
- sigpending sigprocmask])
-])
-
-AC_DEFUN([gl_CHECK_TYPE_SIGSET_T],
-[
- AC_CHECK_TYPES([sigset_t],
- [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no],
- [[
- #include <signal.h>
- /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. */
- #include <sys/types.h>
- ]])
- if test $gl_cv_type_sigset_t != yes; then
- HAVE_SIGSET_T=0
- fi
-])
-
-AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
-[
- dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
- AC_REQUIRE([gl_SIGNAL_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_SIGNAL_H_DEFAULTS],
-[
- GNULIB_PTHREAD_SIGMASK=0; AC_SUBST([GNULIB_PTHREAD_SIGMASK])
- GNULIB_RAISE=0; AC_SUBST([GNULIB_RAISE])
- GNULIB_SIGNAL_H_SIGPIPE=0; AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE])
- GNULIB_SIGPROCMASK=0; AC_SUBST([GNULIB_SIGPROCMASK])
- GNULIB_SIGACTION=0; AC_SUBST([GNULIB_SIGACTION])
- dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING])
- HAVE_PTHREAD_SIGMASK=1; AC_SUBST([HAVE_PTHREAD_SIGMASK])
- HAVE_RAISE=1; AC_SUBST([HAVE_RAISE])
- HAVE_SIGSET_T=1; AC_SUBST([HAVE_SIGSET_T])
- HAVE_SIGINFO_T=1; AC_SUBST([HAVE_SIGINFO_T])
- HAVE_SIGACTION=1; AC_SUBST([HAVE_SIGACTION])
- HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
- AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION])
- HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
- AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T])
- HAVE_SIGHANDLER_T=1; AC_SUBST([HAVE_SIGHANDLER_T])
- REPLACE_PTHREAD_SIGMASK=0; AC_SUBST([REPLACE_PTHREAD_SIGMASK])
- REPLACE_RAISE=0; AC_SUBST([REPLACE_RAISE])
-])
diff --git a/gl/m4/stat.m4 b/gl/m4/stat.m4
deleted file mode 100644
index 1ae327b368..0000000000
--- a/gl/m4/stat.m4
+++ /dev/null
@@ -1,71 +0,0 @@
-# serial 11
-
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_STAT],
-[
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([lstat])
- dnl mingw is the only known platform where stat(".") and stat("./") differ
- AC_CACHE_CHECK([whether stat handles trailing slashes on directories],
- [gl_cv_func_stat_dir_slash],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <sys/stat.h>
-]], [[struct stat st; return stat (".", &st) != stat ("./", &st);]])],
- [gl_cv_func_stat_dir_slash=yes], [gl_cv_func_stat_dir_slash=no],
- [case $host_os in
- mingw*) gl_cv_func_stat_dir_slash="guessing no";;
- *) gl_cv_func_stat_dir_slash="guessing yes";;
- esac])])
- dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
- dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
- dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
- AC_CACHE_CHECK([whether stat handles trailing slashes on files],
- [gl_cv_func_stat_file_slash],
- [touch conftest.tmp
- # Assume that if we have lstat, we can also check symlinks.
- if test $ac_cv_func_lstat = yes; then
- ln -s conftest.tmp conftest.lnk
- fi
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <sys/stat.h>
-]], [[int result = 0;
- struct stat st;
- if (!stat ("conftest.tmp/", &st))
- result |= 1;
-#if HAVE_LSTAT
- if (!stat ("conftest.lnk/", &st))
- result |= 2;
-#endif
- return result;
- ]])],
- [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_stat_file_slash="guessing no" ;;
- esac
- ])
- rm -f conftest.tmp conftest.lnk])
- case $gl_cv_func_stat_dir_slash in
- *no) REPLACE_STAT=1
- AC_DEFINE([REPLACE_FUNC_STAT_DIR], [1], [Define to 1 if stat needs
- help when passed a directory name with a trailing slash]);;
- esac
- case $gl_cv_func_stat_file_slash in
- *no) REPLACE_STAT=1
- AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
- help when passed a file name with a trailing slash]);;
- esac
-])
-
-# Prerequisites of lib/stat.c.
-AC_DEFUN([gl_PREREQ_STAT], [:])
diff --git a/gl/m4/strerror.m4 b/gl/m4/strerror.m4
deleted file mode 100644
index 0763fe3b4d..0000000000
--- a/gl/m4/strerror.m4
+++ /dev/null
@@ -1,96 +0,0 @@
-# strerror.m4 serial 17
-dnl Copyright (C) 2002, 2007-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_STRERROR],
-[
- AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- AC_REQUIRE([gl_HEADER_ERRNO_H])
- AC_REQUIRE([gl_FUNC_STRERROR_0])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
- AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
- ])
- if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
- AC_CACHE_CHECK([for working strerror function],
- [gl_cv_func_working_strerror],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <string.h>
- ]],
- [[if (!*strerror (-2)) return 1;]])],
- [gl_cv_func_working_strerror=yes],
- [gl_cv_func_working_strerror=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_working_strerror="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_working_strerror="guessing no" ;;
- esac
- ])
- ])
- case "$gl_cv_func_working_strerror" in
- *yes) ;;
- *)
- dnl The system's strerror() fails to return a string for out-of-range
- dnl integers. Replace it.
- REPLACE_STRERROR=1
- ;;
- esac
- m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
- dnl If the system's strerror_r or __xpg_strerror_r clobbers strerror's
- dnl buffer, we must replace strerror.
- case "$gl_cv_func_strerror_r_works" in
- *no) REPLACE_STRERROR=1 ;;
- esac
- ])
- else
- dnl The system's strerror() cannot know about the new errno values we add
- dnl to <errno.h>, or any fix for strerror(0). Replace it.
- REPLACE_STRERROR=1
- fi
-])
-
-dnl Detect if strerror(0) passes (that is, does not set errno, and does not
-dnl return a string that matches strerror(-1)).
-AC_DEFUN([gl_FUNC_STRERROR_0],
-[
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- REPLACE_STRERROR_0=0
- AC_CACHE_CHECK([whether strerror(0) succeeds],
- [gl_cv_func_strerror_0_works],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <string.h>
- #include <errno.h>
- ]],
- [[int result = 0;
- char *str;
- errno = 0;
- str = strerror (0);
- if (!*str) result |= 1;
- if (errno) result |= 2;
- if (strstr (str, "nknown") || strstr (str, "ndefined"))
- result |= 4;
- return result;]])],
- [gl_cv_func_strerror_0_works=yes],
- [gl_cv_func_strerror_0_works=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_strerror_0_works="guessing no" ;;
- esac
- ])
- ])
- case "$gl_cv_func_strerror_0_works" in
- *yes) ;;
- *)
- REPLACE_STRERROR_0=1
- AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0)
- does not return a message implying success.])
- ;;
- esac
-])
diff --git a/gl/m4/strerror_r.m4 b/gl/m4/strerror_r.m4
deleted file mode 100644
index e13a369b28..0000000000
--- a/gl/m4/strerror_r.m4
+++ /dev/null
@@ -1,173 +0,0 @@
-# strerror_r.m4 serial 15
-dnl Copyright (C) 2002, 2007-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_STRERROR_R],
-[
- AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
-
- dnl Persuade Solaris <string.h> to declare strerror_r().
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
- dnl Some systems don't declare strerror_r() if _THREAD_SAFE and _REENTRANT
- dnl are not defined.
- AC_CHECK_DECLS_ONCE([strerror_r])
- if test $ac_cv_have_decl_strerror_r = no; then
- HAVE_DECL_STRERROR_R=0
- fi
-
- if test $ac_cv_func_strerror_r = yes; then
- if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
- if test $gl_cv_func_strerror_r_posix_signature = yes; then
- case "$gl_cv_func_strerror_r_works" in
- dnl The system's strerror_r has bugs. Replace it.
- *no) REPLACE_STRERROR_R=1 ;;
- esac
- else
- dnl The system's strerror_r() has a wrong signature. Replace it.
- REPLACE_STRERROR_R=1
- fi
- else
- dnl The system's strerror_r() cannot know about the new errno values we
- dnl add to <errno.h>, or any fix for strerror(0). Replace it.
- REPLACE_STRERROR_R=1
- fi
- fi
-])
-
-# Prerequisites of lib/strerror_r.c.
-AC_DEFUN([gl_PREREQ_STRERROR_R], [
- dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r.
- AC_CHECK_FUNCS_ONCE([__xpg_strerror_r])
- AC_CHECK_FUNCS_ONCE([catgets])
- AC_CHECK_FUNCS_ONCE([snprintf])
-])
-
-# Detect if strerror_r works, but without affecting whether a replacement
-# strerror_r will be used.
-AC_DEFUN([gl_FUNC_STRERROR_R_WORKS],
-[
- AC_REQUIRE([gl_HEADER_ERRNO_H])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([gl_FUNC_STRERROR_0])
-
- AC_CHECK_FUNCS_ONCE([strerror_r])
- if test $ac_cv_func_strerror_r = yes; then
- if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
- dnl The POSIX prototype is: int strerror_r (int, char *, size_t);
- dnl glibc, Cygwin: char *strerror_r (int, char *, size_t);
- dnl AIX 5.1, OSF/1 5.1: int strerror_r (int, char *, int);
- AC_CACHE_CHECK([for strerror_r with POSIX signature],
- [gl_cv_func_strerror_r_posix_signature],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <string.h>
- int strerror_r (int, char *, size_t);
- ]],
- [])],
- [gl_cv_func_strerror_r_posix_signature=yes],
- [gl_cv_func_strerror_r_posix_signature=no])
- ])
- if test $gl_cv_func_strerror_r_posix_signature = yes; then
- dnl AIX 6.1 strerror_r fails by returning -1, not an error number.
- dnl HP-UX 11.31 strerror_r always fails when the buffer length argument
- dnl is less than 80.
- dnl FreeBSD 8.s strerror_r claims failure on 0
- dnl Mac OS X 10.5 strerror_r treats 0 like -1
- dnl Solaris 10 strerror_r corrupts errno on failure
- AC_CACHE_CHECK([whether strerror_r works],
- [gl_cv_func_strerror_r_works],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <errno.h>
- #include <string.h>
- ]],
- [[int result = 0;
- char buf[79];
- if (strerror_r (EACCES, buf, 0) < 0)
- result |= 1;
- errno = 0;
- if (strerror_r (EACCES, buf, sizeof buf) != 0)
- result |= 2;
- strcpy (buf, "Unknown");
- if (strerror_r (0, buf, sizeof buf) != 0)
- result |= 4;
- if (errno)
- result |= 8;
- if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
- result |= 0x10;
- errno = 0;
- *buf = 0;
- if (strerror_r (-3, buf, sizeof buf) < 0)
- result |= 0x20;
- if (errno)
- result |= 0x40;
- if (!*buf)
- result |= 0x80;
- return result;
- ]])],
- [gl_cv_func_strerror_r_works=yes],
- [gl_cv_func_strerror_r_works=no],
- [
-changequote(,)dnl
- case "$host_os" in
- # Guess no on AIX.
- aix*) gl_cv_func_strerror_r_works="guessing no";;
- # Guess no on HP-UX.
- hpux*) gl_cv_func_strerror_r_works="guessing no";;
- # Guess no on BSD variants.
- *bsd*) gl_cv_func_strerror_r_works="guessing no";;
- # Guess yes otherwise.
- *) gl_cv_func_strerror_r_works="guessing yes";;
- esac
-changequote([,])dnl
- ])
- ])
- else
- dnl The system's strerror() has a wrong signature.
- dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r.
- AC_CHECK_FUNCS_ONCE([__xpg_strerror_r])
- dnl In glibc < 2.14, __xpg_strerror_r does not populate buf on failure.
- dnl In cygwin < 1.7.10, __xpg_strerror_r clobbers strerror's buffer.
- if test $ac_cv_func___xpg_strerror_r = yes; then
- AC_CACHE_CHECK([whether __xpg_strerror_r works],
- [gl_cv_func_strerror_r_works],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <errno.h>
- #include <string.h>
- extern
- #ifdef __cplusplus
- "C"
- #endif
- int __xpg_strerror_r(int, char *, size_t);
- ]],
- [[int result = 0;
- char buf[256] = "^";
- char copy[256];
- char *str = strerror (-1);
- strcpy (copy, str);
- if (__xpg_strerror_r (-2, buf, 1) == 0)
- result |= 1;
- if (*buf)
- result |= 2;
- __xpg_strerror_r (-2, buf, 256);
- if (strcmp (str, copy))
- result |= 4;
- return result;
- ]])],
- [gl_cv_func_strerror_r_works=yes],
- [gl_cv_func_strerror_r_works=no],
- [dnl Guess no on all platforms that have __xpg_strerror_r,
- dnl at least until fixed glibc and cygwin are more common.
- gl_cv_func_strerror_r_works="guessing no"
- ])
- ])
- fi
- fi
- fi
- fi
-])
diff --git a/gl/m4/symlink.m4 b/gl/m4/symlink.m4
deleted file mode 100644
index de4924b431..0000000000
--- a/gl/m4/symlink.m4
+++ /dev/null
@@ -1,53 +0,0 @@
-# serial 6
-# See if we need to provide symlink replacement.
-
-dnl Copyright (C) 2009-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# Written by Eric Blake.
-
-AC_DEFUN([gl_FUNC_SYMLINK],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CHECK_FUNCS_ONCE([symlink])
- dnl The best we can do on mingw is provide a dummy that always fails, so
- dnl that compilation can proceed with fewer ifdefs. On FreeBSD 7.2, AIX 7.1,
- dnl and Solaris 9, we want to fix a bug with trailing slash handling.
- if test $ac_cv_func_symlink = no; then
- HAVE_SYMLINK=0
- else
- AC_CACHE_CHECK([whether symlink handles trailing slash correctly],
- [gl_cv_func_symlink_works],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <unistd.h>
- ]],
- [[int result = 0;
- if (!symlink ("a", "conftest.link/"))
- result |= 1;
- if (symlink ("conftest.f", "conftest.lnk2"))
- result |= 2;
- else if (!symlink ("a", "conftest.lnk2/"))
- result |= 4;
- return result;
- ]])],
- [gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_symlink_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_symlink_works="guessing no" ;;
- esac
- ])
- rm -f conftest.f conftest.link conftest.lnk2])
- case "$gl_cv_func_symlink_works" in
- *yes) ;;
- *)
- REPLACE_SYMLINK=1
- ;;
- esac
- fi
-])
diff --git a/gl/m4/sys_ioctl_h.m4 b/gl/m4/sys_ioctl_h.m4
deleted file mode 100644
index 1654231921..0000000000
--- a/gl/m4/sys_ioctl_h.m4
+++ /dev/null
@@ -1,64 +0,0 @@
-# sys_ioctl_h.m4 serial 10
-dnl Copyright (C) 2008-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Written by Bruno Haible.
-
-AC_DEFUN([gl_SYS_IOCTL_H],
-[
- dnl Use AC_REQUIRE here, so that the default behavior below is expanded
- dnl once only, before all statements that occur in other macros.
- AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
-
- AC_CHECK_HEADERS_ONCE([sys/ioctl.h])
- if test $ac_cv_header_sys_ioctl_h = yes; then
- HAVE_SYS_IOCTL_H=1
- dnl Test whether <sys/ioctl.h> declares ioctl(), or whether some other
- dnl header file, such as <unistd.h> or <stropts.h>, is needed for that.
- AC_CACHE_CHECK([whether <sys/ioctl.h> declares ioctl],
- [gl_cv_decl_ioctl_in_sys_ioctl_h],
- [dnl We cannot use AC_CHECK_DECL because it produces its own messages.
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [AC_INCLUDES_DEFAULT([#include <sys/ioctl.h>])],
- [(void) ioctl;])],
- [gl_cv_decl_ioctl_in_sys_ioctl_h=yes],
- [gl_cv_decl_ioctl_in_sys_ioctl_h=no])
- ])
- else
- HAVE_SYS_IOCTL_H=0
- fi
- AC_SUBST([HAVE_SYS_IOCTL_H])
- dnl <sys/ioctl.h> is always overridden, because of GNULIB_POSIXCHECK.
- gl_CHECK_NEXT_HEADERS([sys/ioctl.h])
-
- dnl Check for declarations of anything we want to poison if the
- dnl corresponding gnulib module is not in use.
- gl_WARN_ON_USE_PREPARE([[#include <sys/ioctl.h>
-/* Some platforms declare ioctl in the wrong header. */
-#if !(defined __GLIBC__ && !defined __UCLIBC__)
-# include <unistd.h>
-#endif
- ]], [ioctl])
-])
-
-AC_DEFUN([gl_SYS_IOCTL_MODULE_INDICATOR],
-[
- dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
- AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
- gl_MODULE_INDICATOR_SET_VARIABLE([$1])
- dnl Define it also as a C macro, for the benefit of the unit tests.
- gl_MODULE_INDICATOR_FOR_TESTS([$1])
-])
-
-AC_DEFUN([gl_SYS_IOCTL_H_DEFAULTS],
-[
- GNULIB_IOCTL=0; AC_SUBST([GNULIB_IOCTL])
- dnl Assume proper GNU behavior unless another module says otherwise.
- SYS_IOCTL_H_HAVE_WINSOCK2_H=0; AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H])
- SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
- AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])
- REPLACE_IOCTL=0; AC_SUBST([REPLACE_IOCTL])
-])
diff --git a/gl/m4/sys_select_h.m4 b/gl/m4/sys_select_h.m4
deleted file mode 100644
index 1a502b4eb0..0000000000
--- a/gl/m4/sys_select_h.m4
+++ /dev/null
@@ -1,95 +0,0 @@
-# sys_select_h.m4 serial 20
-dnl Copyright (C) 2006-2014 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_HEADER_SYS_SELECT],
-[
- AC_REQUIRE([AC_C_RESTRICT])
- AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS])
- AC_CACHE_CHECK([whether <sys/select.h> is self-contained],
- [gl_cv_header_sys_select_h_selfcontained],
- [
- dnl Test against two bugs:
- dnl 1. On many platforms, <sys/select.h> assumes prior inclusion of
- dnl <sys/types.h>.
- dnl 2. On OSF/1 4.0, <sys/select.h> provides only a forward declaration
- dnl of 'struct timeval', and no definition of this type.
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/select.h>]],
- [[struct timeval b;]])],
- [gl_cv_header_sys_select_h_selfcontained=yes],
- [gl_cv_header_sys_select_h_selfcontained=no])
- dnl Test against another bug:
- dnl 3. On Solaris 10, <sys/select.h> provides an FD_ZERO implementation
- dnl that relies on memset(), but without including <string.h>.
- if test $gl_cv_header_sys_select_h_selfcontained = yes; then
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[#include <sys/select.h>]],
- [[int memset; int bzero;]])
- ],
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([[#include <sys/select.h>]], [[
- #undef memset
- #define memset nonexistent_memset
- extern
- #ifdef __cplusplus
- "C"
- #endif
- void *memset (void *, int, unsigned long);
- #undef bzero
- #define bzero nonexistent_bzero
- extern
- #ifdef __cplusplus
- "C"
- #endif
- void bzero (void *, unsigned long);
- fd_set fds;
- FD_ZERO (&fds);
- ]])
- ],
- [],
- [gl_cv_header_sys_select_h_selfcontained=no])
- ])
- fi
- ])
- dnl <sys/select.h> is always overridden, because of GNULIB_POSIXCHECK.
- gl_CHECK_NEXT_HEADERS([sys/select.h])
- if test $ac_cv_header_sys_select_h = yes; then
- HAVE_SYS_SELECT_H=1
- else
- HAVE_SYS_SELECT_H=0
- fi
- AC_SUBST([HAVE_SYS_SELECT_H])
- gl_PREREQ_SYS_H_WINSOCK2
-
- dnl Check for declarations of anything we want to poison if the
- dnl corresponding gnulib module is not in use.
- gl_WARN_ON_USE_PREPARE([[
-/* Some systems require prerequisite headers. */
-#include <sys/types.h>
-#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#include <sys/select.h>
- ]], [pselect select])
-])
-
-AC_DEFUN([gl_SYS_SELECT_MODULE_INDICATOR],
-[
- dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
- AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS])
- gl_MODULE_INDICATOR_SET_VARIABLE([$1])
- dnl Define it also as a C macro, for the benefit of the unit tests.
- gl_MODULE_INDICATOR_FOR_TESTS([$1])
-])
-
-AC_DEFUN([gl_SYS_SELECT_H_DEFAULTS],
-[
- GNULIB_PSELECT=0; AC_SUBST([GNULIB_PSELECT])
- GNULIB_SELECT=0; AC_SUBST([GNULIB_SELECT])
- dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_PSELECT=1; AC_SUBST([HAVE_PSELECT])
- REPLACE_PSELECT=0; AC_SUBST([REPLACE_PSELECT])
- REPLACE_SELECT=0; AC_SUBST([REPLACE_SELECT])
-])