5 AC_DEFUN(AC_KRB_IPV6, [
7 [ --without-ipv6 do not enable IPv6 support],[
8 if test "$withval" = "no"; then
11 AC_CACHE_VAL(ac_cv_lib_ipv6,
12 [dnl check for different v6 implementations (by itojun)
16 AC_MSG_CHECKING([ipv6 stack type])
17 for i in v6d toshiba kame inria zeta linux; do
20 AC_EGREP_CPP(yes, [dnl
21 #include </usr/local/v6/include/sys/types.h>
26 v6libdir=/usr/local/v6/lib;
27 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
30 AC_EGREP_CPP(yes, [dnl
31 #include <sys/param.h>
35 [v6type=$i; v6lib=inet6;
36 v6libdir=/usr/local/v6/lib;
37 CFLAGS="-DINET6 $CFLAGS"])
40 AC_EGREP_CPP(yes, [dnl
41 #include <netinet/in.h>
45 [v6type=$i; v6lib=inet6;
46 v6libdir=/usr/local/v6/lib;
47 CFLAGS="-DINET6 $CFLAGS"])
50 AC_EGREP_CPP(yes, [dnl
51 #include <netinet/in.h>
52 #ifdef IPV6_INRIA_VERSION
55 [v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
58 AC_EGREP_CPP(yes, [dnl
59 #include <sys/param.h>
60 #ifdef _ZETA_MINAMI_INET6
63 [v6type=$i; v6lib=inet6;
64 v6libdir=/usr/local/v6/lib;
65 CFLAGS="-DINET6 $CFLAGS"])
68 if test -d /usr/inet6; then
72 CFLAGS="-DINET6 $CFLAGS"
76 if test "$v6type" != "unknown"; then
80 AC_MSG_RESULT($v6type)
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"
91 #ifdef HAVE_SYS_TYPES_H
92 #include <sys/types.h>
94 #ifdef HAVE_SYS_SOCKET_H
95 #include <sys/socket.h>
97 #ifdef HAVE_NETINET_IN_H
98 #include <netinet/in.h>
100 #ifdef HAVE_NETINET_IN6_H
101 #include <netinet/in6.h>
105 struct sockaddr_in6 sin6;
108 s = socket(AF_INET6, SOCK_DGRAM, 0);
110 sin6.sin6_family = AF_INET6;
111 sin6.sin6_port = htons(17);
112 sin6.sin6_addr = in6addr_any;
113 bind(s, (struct sockaddr *)&sin6, sizeof(sin6));
117 AC_MSG_CHECKING(for IPv6)
118 AC_MSG_RESULT($ac_cv_lib_ipv6)
119 if test "$ac_cv_lib_ipv6" = yes; then
120 AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPv6.])