]> sjero.net Git - wget/commitdiff
[svn] Don't set ipv6 to yes only because struct sockaddr_in6 was found. Stop the
authorhniksic <devnull@localhost>
Fri, 29 Apr 2005 12:17:25 +0000 (05:17 -0700)
committerhniksic <devnull@localhost>
Fri, 29 Apr 2005 12:17:25 +0000 (05:17 -0700)
rest of the IPv6 checks when one check fails.  Abort if IPv6 was explicitly
requested, but not found.

ChangeLog
configure.in

index 667b0de5d1dd6b42b30c20f14fd9a4ca38cddb6a..4db4831365a6b2297f0ee6710570aff2f210713b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-04-29  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * configure.in: Don't set ipv6 to yes only because struct
+       sockaddr_in6 was found.  Stop the rest of the IPv6 checks when one
+       check fails.  Abort if IPv6 was explicitly requested, but not
+       found.
+
 2005-04-28  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * windows/Makefile.top.bor: Use MAKEDIR for make clean too.
index ecc45824f322eb3b686a44395b4077b89bbb8cd0..d6d82c339565a44d60cc36bdbb88f403e6904269 100644 (file)
@@ -508,45 +508,54 @@ dnl **********************************************************************
 dnl
 dnl If --enable-ipv6 is specified, we try to use IPv6 (as long as
 dnl getaddrinfo is also present).  If --disable-ipv6 is specified, we
-dnl don't use IPv6 or getaddrinfo.
+dnl don't use IPv6 or getaddrinfo.  Otherwise we detect IPv6 and use
+dnl it where available.
 dnl
 
-ipv6=
-check_for_ipv6=no
 AC_ARG_ENABLE(ipv6,
   AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
   [case "${enable_ipv6}" in
-  no)
-    AC_MSG_NOTICE([disabling IPv6 at user request])
-    ipv6=no
-    ;;
-  *)
+    no)
+      AC_MSG_NOTICE([disabling IPv6 at user request])
+      dnl Disable IPv6 checking
+      ipv6=no
+      ;;
+    yes)
+      dnl IPv6 explicitly enabled: force its use (abort if unavailable).
+      ipv6=yes
+      force_ipv6=yes
+      ;;
+    auto)
+      dnl Auto-detect IPv6, i.e. check for IPv6, but don't force it.
+      ipv6=yes
+      ;;
+    *)
+      AC_MSG_ERROR([Invalid --enable-ipv6 argument \`$enable_ipv6'])
+      ;;
+    esac
+  ], [
+    dnl If nothing is specified, assume auto-detection.
     ipv6=yes
-    ;;
-  esac],
-  dnl If unspecified, check for IPv6 and use it where available.
-  [check_for_ipv6=yes]
+  ]
 )
 
-if test "X$ipv6" = "Xyes" || test "X$check_for_ipv6" = "Xyes"; then
+if test "X$ipv6" = "Xyes"; then
   AC_CHECK_FUNCS(getaddrinfo, [], [
     AC_MSG_NOTICE([Disabling IPv6 support: your system does not support getaddrinfo(3)])
     ipv6=no
   ])
 fi
 
-if test "X$ipv6" = "Xyes" || test "X$check_for_ipv6" = "Xyes"; then
+if test "X$ipv6" = "Xyes"; then
   PROTO_INET6([], [
     AC_MSG_NOTICE([Disabling IPv6 support: your system does not support the PF_INET6 protocol family])
     ipv6=no
   ])
 fi
 
-if test "X$ipv6" = "Xyes" || test "X$check_for_ipv6" = "Xyes"; then
-  TYPE_STRUCT_SOCKADDR_IN6([
-    ipv6=yes
-  ],[
-    AC_MSG_NOTICE([Disabling IPv6 support: your system does not support 'struct sockaddr_in6'])
+if test "X$ipv6" = "Xyes"; then
+  TYPE_STRUCT_SOCKADDR_IN6([],[
+    AC_MSG_NOTICE([Disabling IPv6 support: your system does not support \`struct sockaddr_in6'])
     ipv6=no
   ])
   if test "X$ipv6" = "Xyes"; then
@@ -557,6 +566,8 @@ fi
 
 if test "X$ipv6" = "Xyes"; then
   AC_DEFINE([ENABLE_IPV6], 1, [Define if IPv6 support is enabled.])
+elif test "x$force_ipv6" = "xyes"; then
+  AC_MSG_ERROR([IPv6 support requested but not found; aborting])
 fi