X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=m4%2Fsockpfaf.m4;h=25d9755c5ea7b9a1f939fbfb22e5220fce6f24ed;hb=dbf8ca54bfdeaef894c8d0912df6e05b4c1a7302;hp=a0527f1df6e6fbb686fe64041b33775cd53fd835;hpb=63c34db808cb3e866dac9cf3e7d856a42751f064;p=gnulib.git diff --git a/m4/sockpfaf.m4 b/m4/sockpfaf.m4 index a0527f1df..25d9755c5 100644 --- a/m4/sockpfaf.m4 +++ b/m4/sockpfaf.m4 @@ -1,10 +1,8 @@ -# sockpfaf.m4 serial 1 -dnl Copyright (C) 2004 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. +# sockpfaf.m4 serial 5 +dnl Copyright (C) 2004, 2006 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, ...). @@ -15,12 +13,23 @@ 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_TRY_COMPILE([#include +#ifdef HAVE_SYS_SOCKET_H #include -#include ], -[int x = AF_INET; struct in_addr y; struct sockaddr_in z;], +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#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 @@ -30,9 +39,17 @@ AC_DEFUN([gl_SOCKET_FAMILIES], AC_MSG_CHECKING(for IPv6 sockets) AC_CACHE_VAL(gl_cv_socket_ipv6, [AC_TRY_COMPILE([#include +#ifdef HAVE_SYS_SOCKET_H #include -#include ], -[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;], +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#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