1 dnl $Heimdal: krb-ipv6.m4 14166 2004-08-26 12:35:42Z joda $
6 AC_DEFUN([AC_KRB_IPV6], [
8 AS_HELP_STRING([--without-ipv6],[do not enable IPv6 support]),[
9 if test "$withval" = "no"; then
12 save_CFLAGS="${CFLAGS}"
13 AC_CACHE_CHECK([for IPv6 stack type], v6type,
14 [dnl check for different v6 implementations (by itojun)
18 for i in v6d toshiba kame inria zeta linux; do
22 #include </usr/local/v6/include/sys/types.h>
27 v6libdir=/usr/local/v6/lib;
28 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
32 #include <sys/param.h>
36 [v6type=$i; v6lib=inet6;
37 v6libdir=/usr/local/v6/lib;
38 CFLAGS="-DINET6 $CFLAGS"])
42 #include <netinet/in.h>
46 [v6type=$i; v6lib=inet6;
47 v6libdir=/usr/local/v6/lib;
48 CFLAGS="-DINET6 $CFLAGS"])
52 #include <netinet/in.h>
53 #ifdef IPV6_INRIA_VERSION
56 [v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
60 #include <sys/param.h>
61 #ifdef _ZETA_MINAMI_INET6
64 [v6type=$i; v6lib=inet6;
65 v6libdir=/usr/local/v6/lib;
66 CFLAGS="-DINET6 $CFLAGS"])
69 if test -d /usr/inet6; then
73 CFLAGS="-DINET6 $CFLAGS"
77 if test "$v6type" != "unknown"; then
82 if test "$v6lib" != "none"; then
83 for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
84 if test -d $dir -a -f $dir/lib$v6lib.a; then
85 LIBS="-L$dir -l$v6lib $LIBS"
92 AC_CACHE_CHECK([for IPv6], ac_cv_lib_ipv6, [
93 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
94 #ifdef HAVE_SYS_TYPES_H
95 #include <sys/types.h>
97 #ifdef HAVE_SYS_SOCKET_H
98 #include <sys/socket.h>
100 #ifdef HAVE_NETINET_IN_H
101 #include <netinet/in.h>
103 #ifdef HAVE_NETINET_IN6_H
104 #include <netinet/in6.h>
108 struct sockaddr_in6 sin6;
111 s = socket(AF_INET6, SOCK_DGRAM, 0);
113 sin6.sin6_family = AF_INET6;
114 sin6.sin6_port = htons(17);
115 sin6.sin6_addr = in6addr_any;
116 bind(s, (struct sockaddr *)&sin6, sizeof(sin6));
118 [ac_cv_lib_ipv6=yes],
119 [ac_cv_lib_ipv6=no])])
120 if test "$ac_cv_lib_ipv6" = yes; then
121 AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPv6.])
123 CFLAGS="${save_CFLAGS}"
126 ## test for AIX missing in6addr_loopback
127 if test "$ac_cv_lib_ipv6" = yes; then
128 AC_CACHE_CHECK([for in6addr_loopback],[ac_cv_var_in6addr_loopback],[
129 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
130 #ifdef HAVE_SYS_TYPES_H
131 #include <sys/types.h>
133 #ifdef HAVE_SYS_SOCKET_H
134 #include <sys/socket.h>
136 #ifdef HAVE_NETINET_IN_H
137 #include <netinet/in.h>
139 #ifdef HAVE_NETINET_IN6_H
140 #include <netinet/in6.h>
142 struct sockaddr_in6 sin6;
143 sin6.sin6_addr = in6addr_loopback;
144 ]])],[ac_cv_var_in6addr_loopback=yes],[ac_cv_var_in6addr_loopback=no])])
145 if test "$ac_cv_var_in6addr_loopback" = yes; then
146 AC_DEFINE(HAVE_IN6ADDR_LOOPBACK, 1,
147 [Define if you have the in6addr_loopback variable])