--------------------- PatchSet 1468 Date: 2005/06/20 08:58:06 Author: rmartinez Branch: squid3-ipv6 Tag: (none) Log: Added support to check IPv6 availability. These are very weak approach. Should be enforced Members: configure.in:1.63.2.6->1.63.2.7 Index: squid3/configure.in =================================================================== RCS file: /cvsroot/squid-sf//squid3/configure.in,v retrieving revision 1.63.2.6 retrieving revision 1.63.2.7 diff -u -r1.63.2.6 -r1.63.2.7 --- squid3/configure.in 7 May 2005 11:55:12 -0000 1.63.2.6 +++ squid3/configure.in 20 Jun 2005 08:58:06 -0000 1.63.2.7 @@ -3,7 +3,7 @@ dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.63.2.6 2005/05/07 11:55:12 rmartinez Exp $ +dnl $Id: configure.in,v 1.63.2.7 2005/06/20 08:58:06 rmartinez Exp $ dnl dnl dnl @@ -13,7 +13,7 @@ AC_CONFIG_AUX_DIR(cfgaux) AM_INIT_AUTOMAKE(squid, 3.0-PRE3-CVS) AM_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.63.2.6 $)dnl +AC_REVISION($Revision: 1.63.2.7 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -1515,174 +1515,46 @@ ]) - dnl Enable IPv6 support dnl For the time beeing, let's try a modest IPv6-only port dnl IPv6-IPv4 (protocol independent) may be harder. AC_MSG_CHECKING([whether to enable ipv6]) + AC_ARG_ENABLE(ipv6, [ --enable-ipv6 Enable ipv6 support - --disable-ipv6 Disable ipv6 support], -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - ipv6=no - ;; - *) AC_MSG_RESULT(yes) - AC_DEFINE(INET6,1,[Enable support for IPv6 ]) - ipv6=yes - ;; - esac ], + --disable-ipv6 Disable ipv6 support], +[ENABLE_IPv6=$enableval]) + - AC_TRY_RUN([ /* AF_INET6 avalable check */ +if test "$ENABLE_IPv6" = "yes"; then + AC_MSG_RESULT(yes) + AC_CACHE_CHECK(if PF_INET6 is available, ac_cv_const_AF_INET6, + AC_TRY_RUN([ /* PF_INET6 avalable check */ #include #include main() { - if (socket(AF_INET6, SOCK_STREAM, 0) < 0) + if (socket(PF_INET6, SOCK_STREAM, 0) < 0) exit(1); else exit(0); } -], - AC_MSG_RESULT(yes) - AC_DEFINE(INET6) - ipv6=yes, - AC_MSG_RESULT(no) - ipv6=no, - AC_MSG_RESULT(no) - ipv6=no -)) - -ipv6type=unknown -ipv6lib=none - -if test "$ipv6" = "yes"; then - AC_MSG_CHECKING([ipv6 stack type]) - for i in inria freebsd kame linux-glibc linux-inet6 toshiba v6d zeta; do - case $i in - inria) - dnl http://www.kame.net/ - AC_EGREP_CPP(yes, [dnl -#include -#ifdef IPV6_INRIA_VERSION -yes -#endif], - [ipv6type=$i; - CFLAGS="-DINET6 $CFLAGS"]) - ;; - freebsd) - dnl http://www.freebsd.org/ - dnl Check before Kame since FreeBSD uses Kame natively - dnl but doesn't have extra libs - AC_EGREP_CPP(yes, [dnl -#include -#include -#if defined(__KAME__) && defined(__FreeBSD_version) && (__FreeBSD_version > 400000) -yes -#endif], - [ipv6type=$i; - ipv6lib=none; - CFLAGS="-DINET6 $CFLAGS"]) - ;; - kame) - dnl http://www.kame.net/ - AC_EGREP_CPP(yes, [dnl -#include -#ifdef __KAME__ -yes -#endif], - [ipv6type=$i; - ipv6lib=inet6; - ipv6libdir=/usr/local/v6/lib; - CFLAGS="-DINET6 $CFLAGS"]) - ;; - linux-glibc) - dnl http://www.linux-ipv6.org/ - AC_EGREP_CPP(yes, [dnl -#include -#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)) -yes -#endif], - [ipv6type=$i; - ipv6lib=none; - CFLAGS="-DINET6 $CFLAGS"]) - ;; - linux-inet6) - dnl http://www.linux-ipv6.org/ - if test -d /usr/inet6; then - ipv6type=$i - ipv6lib=inet6 - ipv6libdir=/usr/inet6/lib - CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS" - fi - ;; - toshiba) - AC_EGREP_CPP(yes, [dnl -#include -#ifdef _TOSHIBA_INET6 -yes -#endif], - [ipv6type=$i; - ipv6lib=inet6; - ipv6libdir=/usr/local/v6/lib; - CFLAGS="-DINET6 $CFLAGS"]) - ;; - v6d) - AC_EGREP_CPP(yes, [dnl -#include -#ifdef __V6D__ -yes -#endif], - [ipv6type=$i; - ipv6lib=v6; - ipv6libdir=/usr/local/v6/lib; - CFLAGS="-I/usr/local/v6/include $CFLAGS"]) - ;; - zeta) - AC_EGREP_CPP(yes, [dnl -#include -#ifdef _ZETA_MINAMI_INET6 -yes -#endif], - [ipv6type=$i; - ipv6lib=inet6; - ipv6libdir=/usr/local/v6/lib; - CFLAGS="-DINET6 $CFLAGS"]) - ;; - esac - if test "$ipv6type" != "unknown"; then - break - fi - done - AC_MSG_RESULT($ipv6type) +], ac_cv_const_AF_INET6="yes",ac_cv_const_AF_INET6="no") +) +if test $ac_cv_const_AF_INET6 = "yes"; then + AC_DEFINE(INET6,1,[Enable support for IPv6 ]) +else + echo + echo "Hmm... Your system seems not to support IPv6 ... disable IPv6 support ! " + echo + exit 1 fi -if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then - if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then - LIBS="-L$ipv6libdir -l$ipv6lib $LIBS" - else - echo 'Fatal: no $ipv6lib library found. cannot continue.' - echo "You need to fetch lib$ipv6lib.a from appropriate" - echo 'ipv6 kit and compile beforehand.' - exit 1 - fi +else + AC_MSG_RESULT(no) fi -AC_MSG_CHECKING([whether struct sockaddr_storage has __ss_family]) -AC_TRY_COMPILE([ -#include -#include -],[ -struct sockaddr_storage ss; -int i = ss.__ss_family; -], -[AC_MSG_RESULT(yes) - CFLAGS="$CFLAGS -Dss_family=__ss_family -Dss_len=__ss_len" - ], -AC_MSG_RESULT(no), AC_MSG_RESULT(no)) - AC_ARG_WITH(filedescriptors, [ --with-filedescriptors=NUMBER Force squid to support NUMBER filedescriptors], [ squid_filedescriptors_num=$withval ])