Patch from Björn Schlögl to enable disable-ness of ipv6.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23428 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-07-26 18:40:37 +00:00
parent 4701084d14
commit deb5139f4d

View File

@@ -2,19 +2,23 @@ dnl $Id$
dnl dnl
dnl test for IPv6 dnl test for IPv6
dnl dnl
ac_cv_lib_ipv6=check
AC_DEFUN([AC_KRB_IPV6], [ AC_DEFUN([AC_KRB_IPV6], [
AC_ARG_WITH(ipv6, AC_ARG_WITH(ipv6,
AS_HELP_STRING([--without-ipv6],[do not enable IPv6 support]),[ AS_HELP_STRING([--without-ipv6],[do not enable IPv6 support]),[
if test "$withval" = "no"; then ac_cv_lib_ipv6="$withval"
ac_cv_lib_ipv6=no ])
fi])
save_CFLAGS="${CFLAGS}" save_CFLAGS="${CFLAGS}"
AC_CACHE_CHECK([for IPv6 stack type], rk_cv_v6type,
[dnl check for different v6 implementations (by itojun)
v6type=unknown
v6lib=none
for i in v6d toshiba kame inria zeta linux; do if test "X$ac_cv_lib_ipv6" != "Xno"; then
AC_CACHE_CHECK([for IPv6 stack type], rk_cv_v6type,
[dnl check for different v6 implementations (by itojun)
v6type=unknown
v6lib=none
for i in v6d toshiba kame inria zeta linux; do
case $i in case $i in
v6d) v6d)
AC_EGREP_CPP(yes, [ AC_EGREP_CPP(yes, [
@@ -76,20 +80,19 @@ yes
if test "$v6type" != "unknown"; then if test "$v6type" != "unknown"; then
break break
fi fi
done done
if test "$v6lib" != "none"; then if test "$v6lib" != "none"; then
for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
if test -d $dir -a -f $dir/lib$v6lib.a; then if test -d $dir -a -f $dir/lib$v6lib.a; then
LIBS="-L$dir -l$v6lib $LIBS" LIBS="-L$dir -l$v6lib $LIBS"
break break
fi fi
done done
fi fi])
])
AC_CACHE_CHECK([for IPv6], rk_cv_lib_ipv6, [ AC_CACHE_CHECK([for IPv6], rk_cv_lib_ipv6, [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
#endif #endif
@@ -103,7 +106,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <netinet/in6.h> #include <netinet/in6.h>
#endif #endif
]], ]],
[[ [[
struct sockaddr_in6 sin6; struct sockaddr_in6 sin6;
int s; int s;
@@ -114,8 +117,10 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
sin6.sin6_addr = in6addr_any; sin6.sin6_addr = in6addr_any;
bind(s, (struct sockaddr *)&sin6, sizeof(sin6)); bind(s, (struct sockaddr *)&sin6, sizeof(sin6));
]])], ]])],
[ac_cv_lib_ipv6=yes], [ac_cv_lib_ipv6=yes],
[ac_cv_lib_ipv6=no])]) [ac_cv_lib_ipv6=no])])
fi
if test "$ac_cv_lib_ipv6" = yes; then if test "$ac_cv_lib_ipv6" = yes; then
AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPv6.]) AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPv6.])
else else