monotone

monotone Mtn Source Tree

Root/m4/netxx.m4

1# checks done primarily for the benefit of netxx
2
3# Check for IPv6. Let the user enable or disable it manually using a
4# three-state (yes|no|auto) --enable argument.
5AC_DEFUN([AC_NET_IPV6],
6[AC_ARG_ENABLE(ipv6,
7 AS_HELP_STRING([--enable-ipv6],[enable IPv6 support (default=auto)]), ,
8 enable_ipv6=auto)
9 if test x"${enable_ipv6}" = xauto || test x"${enable_ipv6}" = xyes; then
10 AC_CHECK_TYPE([sockaddr_in6],
11 [enable_ipv6=yes],
12 [if test x"${enable_ipv6}" = xyes; then
13 AC_MSG_FAILURE([IPv6 explicitly requested but it could not be found])
14 fi
15 enable_ipv6=no],
16 [#ifdef WIN32
17 #include <winsock2.h>
18 #else
19 #include <sys/types.h>
20 #include <sys/socket.h>
21 #include <netinet/in.h>
22 #include <arpa/inet.h>
23 #endif])
24 fi
25 # Control cannot reach this point without $enable_ipv6 being either
26 # "yes" or "no".
27 if test $enable_ipv6 = yes; then
28 AC_DEFINE(USE_IPV6, 1, [Define if IPv6 support should be included.])
29 fi
30])
31
32AC_DEFUN([MTN_NETXX_DEPENDENCIES],
33[AC_NET_IPV6
34 AM_CONDITIONAL(MISSING_INET6, [test $enable_ipv6 = no])
35 AC_SEARCH_LIBS([gethostbyname], [nsl])
36 AC_SEARCH_LIBS([accept], [socket])
37 AC_SEARCH_LIBS([inet_aton], [resolv])
38 AC_CHECK_FUNCS([gethostbyaddr inet_ntoa socket])
39 AC_CHECK_FUNC(inet_pton, [AM_CONDITIONAL(MISSING_INET_PTON, false)],
40 [AM_CONDITIONAL(MISSING_INET_PTON, true)])
41
42 AC_CHECK_FUNC(inet_ntop, [AM_CONDITIONAL(MISSING_INET_NTOP, false)],
43 [AM_CONDITIONAL(MISSING_INET_NTOP, true)])
44
45 AC_CHECK_FUNC(getaddrinfo, [AM_CONDITIONAL(MISSING_GETADDRINFO, false)],
46 [AM_CONDITIONAL(MISSING_GETADDRINFO, true)])
47 AC_HAVE_INADDR_NONE
48 AC_CHECK_TYPES([socklen_t],,,[
49 #include <sys/types.h>
50 #include <sys/socket.h>
51 ])
52])

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status