diff options
Diffstat (limited to 'gnulib/m4')
-rw-r--r-- | gnulib/m4/asm-underscore.m4 | 71 | ||||
-rw-r--r-- | gnulib/m4/gnulib-cache.m4 | 4 | ||||
-rw-r--r-- | gnulib/m4/gnulib-comp.m4 | 46 | ||||
-rw-r--r-- | gnulib/m4/ioctl.m4 | 41 | ||||
-rw-r--r-- | gnulib/m4/nonblocking.m4 | 29 | ||||
-rw-r--r-- | gnulib/m4/socklen.m4 | 77 | ||||
-rw-r--r-- | gnulib/m4/sockpfaf.m4 | 87 | ||||
-rw-r--r-- | gnulib/m4/sys_ioctl_h.m4 | 64 | ||||
-rw-r--r-- | gnulib/m4/sys_uio_h.m4 | 31 |
9 files changed, 449 insertions, 1 deletions
diff --git a/gnulib/m4/asm-underscore.m4 b/gnulib/m4/asm-underscore.m4 new file mode 100644 index 00000000..910144aa --- /dev/null +++ b/gnulib/m4/asm-underscore.m4 @@ -0,0 +1,71 @@ +# asm-underscore.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. + +dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp. + +# gl_ASM_SYMBOL_PREFIX +# Tests for the prefix of C symbols at the assembly language level and the +# linker level. This prefix is either an underscore or empty. Defines the +# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to +# a stringified variant of this prefix. + +AC_DEFUN([gl_ASM_SYMBOL_PREFIX], +[ + dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because + dnl 1. It works only for GCC. + dnl 2. It is incorrectly defined on some platforms, in some GCC versions. + AC_REQUIRE([gl_C_ASM]) + AC_CACHE_CHECK( + [whether C symbols are prefixed with underscore at the linker level], + [gl_cv_prog_as_underscore], + [cat > conftest.c <<EOF +#ifdef __cplusplus +extern "C" int foo (void); +#endif +int foo(void) { return 0; } +EOF + # Look for the assembly language name in the .s file. + AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1 + if grep _foo conftest.$gl_asmext >/dev/null ; then + gl_cv_prog_as_underscore=yes + else + gl_cv_prog_as_underscore=no + fi + rm -f conftest* + ]) + if test $gl_cv_prog_as_underscore = yes; then + USER_LABEL_PREFIX=_ + else + USER_LABEL_PREFIX= + fi + AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX], + [Define to the prefix of C symbols at the assembler and linker level, + either an underscore or empty.]) + ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"' + AC_SUBST([ASM_SYMBOL_PREFIX]) +]) + +# gl_C_ASM +# Determines how to produce an assembly language file from C source code. +# Sets the variables: +# gl_asmext - the extension of assembly language output, +# gl_c_asm_opt - the C compiler option that produces assembly language output. + +AC_DEFUN([gl_C_ASM], +[ + AC_EGREP_CPP([MicrosoftCompiler], + [ +#ifdef _MSC_VER +MicrosoftCompiler +#endif + ], + [gl_asmext='asm' + gl_c_asm_opt='-c -Fa' + ], + [gl_asmext='s' + gl_c_asm_opt='-S' + ]) +]) diff --git a/gnulib/m4/gnulib-cache.m4 b/gnulib/m4/gnulib-cache.m4 index 4f8d9c4b..7bbccd63 100644 --- a/gnulib/m4/gnulib-cache.m4 +++ b/gnulib/m4/gnulib-cache.m4 @@ -27,7 +27,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --po-base=gnulib/po --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=gl --po-domain=man-db --no-vc-files argp canonicalize closedir dirent dirname error flock fnmatch-gnu fstat futimens getline getopt-gnu gettext gitlog-to-changelog glob gnupload idpriv-drop idpriv-droptemp lib-ignore localcharset lock minmax mkdtemp mkstemp opendir regex rename setenv sigaction signal sigprocmask stat-time strerror strsep timespec unsetenv utimens warnings xalloc xgetcwd xstrndup xvasprintf +# gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --po-base=gnulib/po --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=gl --po-domain=man-db --no-vc-files argp canonicalize closedir dirent dirname error flock fnmatch-gnu fstat futimens getline getopt-gnu gettext gitlog-to-changelog glob gnupload idpriv-drop idpriv-droptemp lib-ignore localcharset lock minmax mkdtemp mkstemp nonblocking openat opendir regex rename setenv sigaction signal sigprocmask stat-time strerror strsep timespec unsetenv utimens warnings xalloc xgetcwd xstrndup xvasprintf # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) @@ -56,6 +56,8 @@ gl_MODULES([ minmax mkdtemp mkstemp + nonblocking + openat opendir regex rename diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4 index 1463c38f..697ac272 100644 --- a/gnulib/m4/gnulib-comp.m4 +++ b/gnulib/m4/gnulib-comp.m4 @@ -111,6 +111,7 @@ AC_DEFUN([gl_EARLY], # Code from module idpriv-droptemp: # Code from module include_next: # Code from module intprops: + # Code from module ioctl: # Code from module langinfo: # Code from module largefile: AC_REQUIRE([AC_SYS_LARGEFILE]) @@ -138,6 +139,7 @@ AC_DEFUN([gl_EARLY], # Code from module multiarch: # Code from module nl_langinfo: # Code from module nocrash: + # Code from module nonblocking: # Code from module open: # Code from module openat: # Code from module openat-die: @@ -168,6 +170,7 @@ AC_DEFUN([gl_EARLY], # Code from module snippet/arg-nonnull: # Code from module snippet/c++defs: # Code from module snippet/warn-on-use: + # Code from module socklen: # Code from module ssize_t: # Code from module stat: # Code from module stat-time: @@ -196,9 +199,12 @@ AC_DEFUN([gl_EARLY], # Code from module strnlen1: # Code from module strsep: # Code from module sys_file: + # Code from module sys_ioctl: + # Code from module sys_socket: # Code from module sys_stat: # Code from module sys_time: # Code from module sys_types: + # Code from module sys_uio: # Code from module sysexits: # Code from module tempname: # Code from module threadlib: @@ -450,6 +456,11 @@ AC_SUBST([LTALLOCA]) fi gl_IDPRIV gl_IDPRIV + gl_FUNC_IOCTL + if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then + AC_LIBOBJ([ioctl]) + fi + gl_SYS_IOCTL_MODULE_INDICATOR([ioctl]) gl_LANGINFO_H AC_REQUIRE([gl_LARGEFILE]) gl_IGNORE_UNUSED_LIBRARIES @@ -552,6 +563,17 @@ AC_SUBST([LTALLOCA]) AC_LIBOBJ([nl_langinfo]) fi gl_LANGINFO_MODULE_INDICATOR([nl_langinfo]) + gl_NONBLOCKING_IO + gl_FCNTL_MODULE_INDICATOR([nonblocking]) + dnl Define the C macro GNULIB_NONBLOCKING to 1. + gl_MODULE_INDICATOR([nonblocking]) + dnl Define the substituted variable GNULIB_STDIO_H_NONBLOCKING to 1. + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_REQUIRE([gl_ASM_SYMBOL_PREFIX]) + GNULIB_STDIO_H_NONBLOCKING=1 + dnl Define the substituted variable GNULIB_UNISTD_H_NONBLOCKING to 1. + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + GNULIB_UNISTD_H_NONBLOCKING=1 gl_FUNC_OPEN if test $REPLACE_OPEN = 1; then AC_LIBOBJ([open]) @@ -651,6 +673,7 @@ AC_SUBST([LTALLOCA]) AC_LIBOBJ([sleep]) fi gl_UNISTD_MODULE_INDICATOR([sleep]) + gl_TYPE_SOCKLEN_T gt_TYPE_SSIZE_T gl_FUNC_STAT if test $REPLACE_STAT = 1; then @@ -721,12 +744,18 @@ AC_SUBST([LTALLOCA]) gl_STRING_MODULE_INDICATOR([strsep]) gl_HEADER_SYS_FILE_H AC_PROG_MKDIR_P + gl_SYS_IOCTL_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_SYS_TYPES_H AC_PROG_MKDIR_P + gl_HEADER_SYS_UIO + AC_PROG_MKDIR_P gl_SYSEXITS gl_FUNC_GEN_TEMPNAME gl_THREADLIB @@ -1008,6 +1037,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/idpriv-droptemp.c lib/idpriv.h lib/intprops.h + lib/ioctl.c lib/itold.c lib/langinfo.in.h lib/localcharset.c @@ -1038,6 +1068,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/msvc-nothrow.c lib/msvc-nothrow.h lib/nl_langinfo.c + lib/nonblocking.c + lib/nonblocking.h lib/open.c lib/openat-die.c lib/openat-priv.h @@ -1090,6 +1122,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/stdbool.in.h lib/stddef.in.h lib/stdint.in.h + lib/stdio-read.c + lib/stdio-write.c lib/stdio.in.h lib/stdlib.in.h lib/strcasecmp.c @@ -1110,9 +1144,13 @@ AC_DEFUN([gl_FILE_LIST], [ lib/strnlen1.h lib/strsep.c lib/sys_file.in.h + lib/sys_ioctl.in.h + lib/sys_socket.c + lib/sys_socket.in.h lib/sys_stat.in.h lib/sys_time.in.h lib/sys_types.in.h + lib/sys_uio.in.h lib/sysexits.in.h lib/tempname.c lib/tempname.h @@ -1131,6 +1169,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/vasprintf.c lib/verify.h lib/vsnprintf.c + lib/w32sock.h lib/wchar.in.h lib/wcrtomb.c lib/wctype-h.c @@ -1152,6 +1191,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/absolute-header.m4 m4/alloca.m4 m4/argp.m4 + m4/asm-underscore.m4 m4/btowc.m4 m4/canonicalize.m4 m4/chdir-long.m4 @@ -1213,6 +1253,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/intmax_t.m4 m4/inttypes-pri.m4 m4/inttypes_h.m4 + m4/ioctl.m4 m4/langinfo_h.m4 m4/largefile.m4 m4/lcmessage.m4 @@ -1251,6 +1292,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/nl_langinfo.m4 m4/nls.m4 m4/nocrash.m4 + m4/nonblocking.m4 m4/off_t.m4 m4/onceonly.m4 m4/open.m4 @@ -1279,6 +1321,8 @@ AC_DEFUN([gl_FILE_LIST], [ m4/signalblocking.m4 m4/size_max.m4 m4/sleep.m4 + m4/socklen.m4 + m4/sockpfaf.m4 m4/ssize_t.m4 m4/stat-time.m4 m4/stat.m4 @@ -1300,10 +1344,12 @@ AC_DEFUN([gl_FILE_LIST], [ m4/strnlen.m4 m4/strsep.m4 m4/sys_file_h.m4 + m4/sys_ioctl_h.m4 m4/sys_socket_h.m4 m4/sys_stat_h.m4 m4/sys_time_h.m4 m4/sys_types_h.m4 + m4/sys_uio_h.m4 m4/sysexits.m4 m4/tempname.m4 m4/threadlib.m4 diff --git a/gnulib/m4/ioctl.m4 b/gnulib/m4/ioctl.m4 new file mode 100644 index 00000000..5a31a396 --- /dev/null +++ b/gnulib/m4/ioctl.m4 @@ -0,0 +1,41 @@ +# 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/gnulib/m4/nonblocking.m4 b/gnulib/m4/nonblocking.m4 new file mode 100644 index 00000000..4efefd0b --- /dev/null +++ b/gnulib/m4/nonblocking.m4 @@ -0,0 +1,29 @@ +# nonblocking.m4 serial 2 +dnl Copyright (C) 2011-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 Tests whether non-blocking I/O is natively supported by read(), write(). +dnl Sets gl_cv_have_nonblocking. +dnl Also tests whether open() supports O_NONBLOCK. +dnl Sets gl_cv_have_open_O_NONBLOCK. +AC_DEFUN([gl_NONBLOCKING_IO], +[ + 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_NONBLOCKING_IO_BODY]) +]) + +AC_DEFUN([gl_NONBLOCKING_IO_BODY], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) gl_cv_have_nonblocking=no ;; + *) gl_cv_have_nonblocking=yes ;; + esac + case "$host_os" in + mingw*) gl_cv_have_open_O_NONBLOCK=no ;; + *) gl_cv_have_open_O_NONBLOCK=yes ;; + esac +]) diff --git a/gnulib/m4/socklen.m4 b/gnulib/m4/socklen.m4 new file mode 100644 index 00000000..4c07f864 --- /dev/null +++ b/gnulib/m4/socklen.m4 @@ -0,0 +1,77 @@ +# socklen.m4 serial 10 +dnl Copyright (C) 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. + +dnl From Albert Chin, Windows fixes from Simon Josefsson. + +dnl Check for socklen_t: historically on BSD it is an int, and in +dnl POSIX 1g it is a type of its own, but some platforms use different +dnl types for the argument to getsockopt, getpeername, etc.: +dnl HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS. +dnl So we have to test to find something that will work. + +AC_DEFUN([gl_TYPE_SOCKLEN_T], + [AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl + AC_CHECK_TYPE([socklen_t], , + [AC_MSG_CHECKING([for socklen_t equivalent]) + AC_CACHE_VAL([gl_cv_socklen_t_equiv], + [# Systems have either "struct sockaddr *" or + # "void *" as the second argument to getpeername + gl_cv_socklen_t_equiv= + for arg2 in "struct sockaddr" void; do + for t in int size_t "unsigned int" "long int" "unsigned long int"; do + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include <sys/types.h> + #include <sys/socket.h> + + int getpeername (int, $arg2 *, $t *);]], + [[$t len; + getpeername (0, 0, &len);]])], + [gl_cv_socklen_t_equiv="$t"]) + test "$gl_cv_socklen_t_equiv" != "" && break + done + test "$gl_cv_socklen_t_equiv" != "" && break + done + ]) + if test "$gl_cv_socklen_t_equiv" = ""; then + AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) + fi + AC_MSG_RESULT([$gl_cv_socklen_t_equiv]) + AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv], + [type to use in place of socklen_t if not defined])], + [gl_SOCKET_HEADERS])]) + +dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find +dnl it there too. But on Cygwin, wc2tcpip.h must not be included. Users +dnl of this module should use the same include pattern as gl_SOCKET_HEADERS. +dnl When you change this macro, keep also in sync: +dnl - gl_CHECK_SOCKET_HEADERS, +dnl - the Include section of modules/socklen. +AC_DEFUN([gl_SOCKET_HEADERS], +[ +/* <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> +#if HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#elif HAVE_WS2TCPIP_H +# include <ws2tcpip.h> +#endif +]) + +dnl Tests for the existence of the header for socket facilities. +dnl Defines the C macros HAVE_SYS_SOCKET_H, HAVE_WS2TCPIP_H. +dnl This macro must match gl_SOCKET_HEADERS. +AC_DEFUN([gl_CHECK_SOCKET_HEADERS], + [AC_CHECK_HEADERS_ONCE([sys/socket.h]) + if test $ac_cv_header_sys_socket_h = no; then + dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make + dnl the check for those headers unconditional; yet cygwin reports + dnl that the headers are present but cannot be compiled (since on + dnl cygwin, all socket information should come from sys/socket.h). + AC_CHECK_HEADERS([ws2tcpip.h]) + fi + ]) diff --git a/gnulib/m4/sockpfaf.m4 b/gnulib/m4/sockpfaf.m4 new file mode 100644 index 00000000..31d436f0 --- /dev/null +++ b/gnulib/m4/sockpfaf.m4 @@ -0,0 +1,87 @@ +# sockpfaf.m4 serial 8 +dnl Copyright (C) 2004, 2006, 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. + +dnl Test for some common socket protocol families (PF_INET, PF_INET6, ...) +dnl and some common address families (AF_INET, AF_INET6, ...). +dnl This test assumes that a system supports an address family if and only if +dnl it supports the corresponding protocol family. + +dnl From Bruno Haible. + +AC_DEFUN([gl_SOCKET_FAMILIES], +[ + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_CHECK_HEADERS_ONCE([netinet/in.h]) + + AC_MSG_CHECKING([for IPv4 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv4], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif]], +[[int x = AF_INET; struct in_addr y; struct sockaddr_in z; + if (&x && &y && &z) return 0;]])], + gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)]) + AC_MSG_RESULT([$gl_cv_socket_ipv4]) + if test $gl_cv_socket_ipv4 = yes; then + AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if <sys/socket.h> defines AF_INET.]) + fi + + AC_MSG_CHECKING([for IPv6 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv6], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif]], +[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; + if (&x && &y && &z) return 0;]])], + gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)]) + AC_MSG_RESULT([$gl_cv_socket_ipv6]) + if test $gl_cv_socket_ipv6 = yes; then + AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.]) + fi +]) + +AC_DEFUN([gl_SOCKET_FAMILY_UNIX], +[ + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_CHECK_HEADERS_ONCE([sys/un.h]) + + AC_MSG_CHECKING([for UNIX domain sockets]) + AC_CACHE_VAL([gl_cv_socket_unix], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_SYS_UN_H +#include <sys/un.h> +#endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#endif]], +[[int x = AF_UNIX; struct sockaddr_un y; + if (&x && &y) return 0;]])], + gl_cv_socket_unix=yes, gl_cv_socket_unix=no)]) + AC_MSG_RESULT([$gl_cv_socket_unix]) + if test $gl_cv_socket_unix = yes; then + AC_DEFINE([HAVE_UNIXSOCKET], [1], [Define to 1 if <sys/socket.h> defines AF_UNIX.]) + fi +]) diff --git a/gnulib/m4/sys_ioctl_h.m4 b/gnulib/m4/sys_ioctl_h.m4 new file mode 100644 index 00000000..16542319 --- /dev/null +++ b/gnulib/m4/sys_ioctl_h.m4 @@ -0,0 +1,64 @@ +# 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/gnulib/m4/sys_uio_h.m4 b/gnulib/m4/sys_uio_h.m4 new file mode 100644 index 00000000..ba6b4b5e --- /dev/null +++ b/gnulib/m4/sys_uio_h.m4 @@ -0,0 +1,31 @@ +# sys_uio_h.m4 serial 1 +dnl Copyright (C) 2011-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_UIO], +[ + AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS]) + dnl <sys/uio.h> is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([sys/uio.h]) + if test $ac_cv_header_sys_uio_h = yes; then + HAVE_SYS_UIO_H=1 + else + HAVE_SYS_UIO_H=0 + fi + AC_SUBST([HAVE_SYS_UIO_H]) +]) + +AC_DEFUN([gl_SYS_UIO_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_UIO_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_UIO_H_DEFAULTS], +[ +]) |