2 # Checks to see if there's a sockaddr_storage structure
6 # AMANDA_SOCKADDR_STORAGE
10 # HAVE_SOCKADDR_STORAGE (defined)
12 AC_DEFUN([AMANDA_SOCKADDR_STORAGE],
14 AC_CACHE_CHECK([if sockaddr_storage struct exists],
15 ac_cv_has_sockaddr_storage,
18 # include <sys/types.h>
19 # include <sys/socket.h>],
20 [u_int i = sizeof (struct sockaddr_storage)],
21 ac_cv_has_sockaddr_storage=yes,
22 ac_cv_has_sockaddr_storage=no)
25 if test $ac_cv_has_sockaddr_storage = yes ; then
26 AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,
27 [struct sockaddr_storage exists])
37 # Determine if this system has basic IPv6 support. This
38 # addresse general availability (defining WORKING_IPV6 if
39 # there's some amount of compatibility there), as well as
40 # searching for specific functionality by requiring the other
41 # macros in this file.
43 AC_DEFUN([AMANDA_CHECK_IPV6],
45 AC_REQUIRE([AMANDA_SOCKADDR_STORAGE])
49 AS_HELP_STRING([--with-ipv6],
50 [enable IPv6 support (default if IPv6 is found)])
51 AS_HELP_STRING([--without-ipv6],
55 y | ye | yes) amanda_with_ipv6=yes;;
56 n | no) amanda_with_ipv6=no;;
58 AC_MSG_ERROR([*** You must not supply an argument to --with-ipv6 option.])
62 amanda_with_ipv6=maybe
66 if test x"$amanda_with_ipv6" = x"yes" ||
67 test x"$amanda_with_ipv6" = x"maybe" ; then
68 AC_CACHE_CHECK([for working IPv6],
69 amanda_cv_working_ipv6,
72 *-pc-cygwin) amanda_cv_working_ipv6=no;;
74 AC_RUN_IFELSE([AC_LANG_SOURCE([[
75 #include <sys/types.h>
76 #ifdef HAVE_SYS_SOCKET_H
77 #include <sys/socket.h>
79 #ifdef HAVE_NETINET_IN_H
80 #include <netinet/in.h>
82 #ifdef HAVE_WINSOCK2_H
85 #include <sys/socket.h>
91 aa = socket(AF_INET6, SOCK_STREAM, 0);
95 [ amanda_cv_working_ipv6=yes ],
96 [ amanda_cv_working_ipv6=no ],
97 [ amanda_cv_working_ipv6=yes ]
102 if test "$amanda_cv_working_ipv6" = yes; then
104 AC_DEFINE(WORKING_IPV6,1,
105 [This system has functional IPv6 support (kernel and compiler)])
107 # error out only if the user specifically requested support
108 if test x"$amanda_with_ipv6" = x"yes"; then
109 AC_MSG_ERROR([IPv6 support was requested, but opening an IPv6 socket failed])
117 # AMANDA_SHOW_IPV6_SUMMARY
121 # Show a summary of the settings from this file.
123 AC_DEFUN([AMANDA_SHOW_IPV6_SUMMARY],
125 echo "Working IPv6:" $WORKING_IPV6