summaryrefslogtreecommitdiffstats
path: root/gl/m4/sockpfaf.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/sockpfaf.m4')
-rw-r--r--gl/m4/sockpfaf.m430
1 files changed, 28 insertions, 2 deletions
diff --git a/gl/m4/sockpfaf.m4 b/gl/m4/sockpfaf.m4
index 8806705..89557b1 100644
--- a/gl/m4/sockpfaf.m4
+++ b/gl/m4/sockpfaf.m4
@@ -1,5 +1,5 @@
1# sockpfaf.m4 serial 7 1# sockpfaf.m4 serial 8
2dnl Copyright (C) 2004, 2006, 2009, 2010 Free Software Foundation, Inc. 2dnl Copyright (C) 2004, 2006, 2009-2013 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -59,3 +59,29 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
59 AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.]) 59 AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.])
60 fi 60 fi
61]) 61])
62
63AC_DEFUN([gl_SOCKET_FAMILY_UNIX],
64[
65 AC_REQUIRE([gl_HEADER_SYS_SOCKET])
66 AC_CHECK_HEADERS_ONCE([sys/un.h])
67
68 AC_MSG_CHECKING([for UNIX domain sockets])
69 AC_CACHE_VAL([gl_cv_socket_unix],
70 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
71#ifdef HAVE_SYS_SOCKET_H
72#include <sys/socket.h>
73#endif
74#ifdef HAVE_SYS_UN_H
75#include <sys/un.h>
76#endif
77#ifdef HAVE_WINSOCK2_H
78#include <winsock2.h>
79#endif]],
80[[int x = AF_UNIX; struct sockaddr_un y;
81 if (&x && &y) return 0;]])],
82 gl_cv_socket_unix=yes, gl_cv_socket_unix=no)])
83 AC_MSG_RESULT([$gl_cv_socket_unix])
84 if test $gl_cv_socket_unix = yes; then
85 AC_DEFINE([HAVE_UNIXSOCKET], [1], [Define to 1 if <sys/socket.h> defines AF_UNIX.])
86 fi
87])