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:
129
cf/krb-ipv6.m4
129
cf/krb-ipv6.m4
@@ -2,94 +2,97 @@ 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
|
||||||
case $i in
|
|
||||||
v6d)
|
AC_CACHE_CHECK([for IPv6 stack type], rk_cv_v6type,
|
||||||
AC_EGREP_CPP(yes, [
|
[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
|
||||||
|
v6d)
|
||||||
|
AC_EGREP_CPP(yes, [
|
||||||
#include </usr/local/v6/include/sys/types.h>
|
#include </usr/local/v6/include/sys/types.h>
|
||||||
#ifdef __V6D__
|
#ifdef __V6D__
|
||||||
yes
|
yes
|
||||||
#endif],
|
#endif],
|
||||||
[v6type=$i; v6lib=v6;
|
[v6type=$i; v6lib=v6;
|
||||||
v6libdir=/usr/local/v6/lib;
|
v6libdir=/usr/local/v6/lib;
|
||||||
CFLAGS="-I/usr/local/v6/include $CFLAGS"])
|
CFLAGS="-I/usr/local/v6/include $CFLAGS"])
|
||||||
;;
|
;;
|
||||||
toshiba)
|
toshiba)
|
||||||
AC_EGREP_CPP(yes, [
|
AC_EGREP_CPP(yes, [
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#ifdef _TOSHIBA_INET6
|
#ifdef _TOSHIBA_INET6
|
||||||
yes
|
yes
|
||||||
#endif],
|
#endif],
|
||||||
[v6type=$i; v6lib=inet6;
|
[v6type=$i; v6lib=inet6;
|
||||||
v6libdir=/usr/local/v6/lib;
|
v6libdir=/usr/local/v6/lib;
|
||||||
CFLAGS="-DINET6 $CFLAGS"])
|
CFLAGS="-DINET6 $CFLAGS"])
|
||||||
;;
|
;;
|
||||||
kame)
|
kame)
|
||||||
AC_EGREP_CPP(yes, [
|
AC_EGREP_CPP(yes, [
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#ifdef __KAME__
|
#ifdef __KAME__
|
||||||
yes
|
yes
|
||||||
#endif],
|
#endif],
|
||||||
[v6type=$i; v6lib=inet6;
|
[v6type=$i; v6lib=inet6;
|
||||||
v6libdir=/usr/local/v6/lib;
|
v6libdir=/usr/local/v6/lib;
|
||||||
CFLAGS="-DINET6 $CFLAGS"])
|
CFLAGS="-DINET6 $CFLAGS"])
|
||||||
;;
|
;;
|
||||||
inria)
|
inria)
|
||||||
AC_EGREP_CPP(yes, [
|
AC_EGREP_CPP(yes, [
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#ifdef IPV6_INRIA_VERSION
|
#ifdef IPV6_INRIA_VERSION
|
||||||
yes
|
yes
|
||||||
#endif],
|
#endif],
|
||||||
[v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
|
[v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
|
||||||
;;
|
;;
|
||||||
zeta)
|
zeta)
|
||||||
AC_EGREP_CPP(yes, [
|
AC_EGREP_CPP(yes, [
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#ifdef _ZETA_MINAMI_INET6
|
#ifdef _ZETA_MINAMI_INET6
|
||||||
yes
|
yes
|
||||||
#endif],
|
#endif],
|
||||||
[v6type=$i; v6lib=inet6;
|
[v6type=$i; v6lib=inet6;
|
||||||
v6libdir=/usr/local/v6/lib;
|
v6libdir=/usr/local/v6/lib;
|
||||||
CFLAGS="-DINET6 $CFLAGS"])
|
CFLAGS="-DINET6 $CFLAGS"])
|
||||||
;;
|
;;
|
||||||
linux)
|
linux)
|
||||||
if test -d /usr/inet6; then
|
if test -d /usr/inet6; then
|
||||||
v6type=$i
|
v6type=$i
|
||||||
v6lib=inet6
|
v6lib=inet6
|
||||||
v6libdir=/usr/inet6
|
v6libdir=/usr/inet6
|
||||||
CFLAGS="-DINET6 $CFLAGS"
|
CFLAGS="-DINET6 $CFLAGS"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if test "$v6type" != "unknown"; then
|
if test "$v6type" != "unknown"; then
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if test "$v6lib" != "none"; then
|
|
||||||
for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
|
|
||||||
if test -d $dir -a -f $dir/lib$v6lib.a; then
|
|
||||||
LIBS="-L$dir -l$v6lib $LIBS"
|
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_CACHE_CHECK([for IPv6], rk_cv_lib_ipv6, [
|
if test "$v6lib" != "none"; then
|
||||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
|
||||||
|
if test -d $dir -a -f $dir/lib$v6lib.a; then
|
||||||
|
LIBS="-L$dir -l$v6lib $LIBS"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi])
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([for IPv6], rk_cv_lib_ipv6, [
|
||||||
|
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
|
||||||
|
Reference in New Issue
Block a user