diff options
author | Bastien Roucariès <roucaries.bastien@gmail.com> | 2011-03-08 10:37:18 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2011-03-09 23:59:16 +0100 |
commit | e22d9a3b0b6979a518e3b292317088245d959e13 (patch) | |
tree | 9d0fae82e93fffdcd9fb481747bfdc183ad98488 /m4/sockpfaf.m4 | |
parent | fbfced515f325dd000c80fa35ade86e567d0ea3c (diff) | |
download | gnulib-e22d9a3b0b6979a518e3b292317088245d959e13.tar.gz |
passfd module, part 1.
* m4/afunix.m4: New file.
* m4/sockpfaf.m4 (gl_SOCKET_FAMILIES): Also test for UNIX domain
sockets.
Diffstat (limited to 'm4/sockpfaf.m4')
-rw-r--r-- | m4/sockpfaf.m4 | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/m4/sockpfaf.m4 b/m4/sockpfaf.m4 index 27899aa59b..b8a64ad991 100644 --- a/m4/sockpfaf.m4 +++ b/m4/sockpfaf.m4 @@ -1,4 +1,4 @@ -# sockpfaf.m4 serial 7 +# sockpfaf.m4 serial 8 dnl Copyright (C) 2004, 2006, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -58,4 +58,25 @@ AC_DEFUN([gl_SOCKET_FAMILIES], 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_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 ]) |