]> sjero.net Git - wget/blobdiff - configure.in
[svn] IPv6 configure auto-detection.
[wget] / configure.in
index 7847ea88d22b64cd00e07b4cf8312ec8a428e101..55555b27cd19af11a95bb79ed68ff722aa9ddea9 100644 (file)
@@ -30,7 +30,7 @@ dnl Process this file with autoconf to produce a configure script.
 dnl
 
 AC_INIT(src/version.c)
-AC_PREREQ(2.12)
+AC_PREREQ(2.50)
 AC_CONFIG_HEADER(src/config.h)
 
 dnl
@@ -56,8 +56,8 @@ AC_ARG_WITH(socks,
 [AC_DEFINE(HAVE_SOCKS)])
 
 AC_ARG_WITH(ssl,
-[  --with-ssl[=SSL-ROOT]   link with SSL support [default=auto]
-  --without-ssl           disable SSL autodetection])
+[[  --with-ssl[=SSL-ROOT]   link with SSL support [default=auto]
+  --without-ssl           disable SSL autodetection]])
 
 AC_ARG_ENABLE(opie,
 [  --disable-opie          disable support for opie or s/key FTP login],
@@ -155,7 +155,6 @@ AC_C_CONST
 AC_C_INLINE
 AC_TYPE_SIZE_T
 AC_TYPE_PID_T
-dnl #### This generates a warning.  What do I do to shut it up?
 AC_C_BIGENDIAN
 
 # Check size of long.
@@ -300,7 +299,7 @@ if test x"$with_ssl" != x"no"; then
       LDFLAGS="-L$ssl_root/lib -R$ssl_root/lib $wget_save_LDFLAGS"
     fi
 
-    AC_MSG_RESULT(["Looking for SSL libraries in $ssl_root"])
+    AC_MSG_RESULT([Looking for SSL libraries in $ssl_root])
 
     dnl Check whether the compiler can find the include files.  On
     dnl some systems Gcc finds libraries in /usr/local/lib, but fails
@@ -309,13 +308,13 @@ if test x"$with_ssl" != x"no"; then
     ssl_found_includes=no
     CPPFLAGS="$SSL_INCLUDES $wget_save_CPPFLAGS"
 
-    AC_MSG_CHECKING(["for includes"])
+    AC_MSG_CHECKING([for includes])
 
     AC_TRY_CPP([#include <openssl/ssl.h>
 #include <openssl/rsa.h>
 ],
-      AC_MSG_RESULT("found"); ssl_found_includes=yes,
-      AC_MSG_RESULT("not found")
+      AC_MSG_RESULT(found); ssl_found_includes=yes,
+      AC_MSG_RESULT([not found])
     )
 
     if test x"$ssl_found_includes" = xno; then
@@ -354,15 +353,15 @@ if test x"$with_ssl" != x"no"; then
 
     ssl_run_failure=no
 
-    AC_MSG_CHECKING("whether SSL libs are resolved at runtime")
+    AC_MSG_CHECKING([whether SSL libs are resolved at runtime])
     AC_TRY_RUN([
 int RSA_new();
 int SSL_new();
 main(){return 0;}
 ],
-      AC_MSG_RESULT("yes"),
-      AC_MSG_RESULT("no"); ssl_run_failure=yes,
-      AC_MSG_RESULT("cross")
+      AC_MSG_RESULT(yes),
+      AC_MSG_RESULT(no); ssl_run_failure=yes,
+      AC_MSG_RESULT(cross)
     )
 
     if test x"$ssl_run_failure" = xno; then
@@ -374,7 +373,7 @@ main(){return 0;}
   if test x"$ssl_success" = xyes; then
     dnl AC_MSG_RESULT doesn't look right here, but I'm not sure what
     dnl to use instead.
-    AC_MSG_RESULT("Compiling in support for SSL in $ssl_root")
+    AC_MSG_RESULT([Compiling in support for SSL in $ssl_root])
     AC_DEFINE(HAVE_SSL)
     AC_SUBST(SSL_INCLUDES)
     SSL_OBJ='gen_sslfunc$o'
@@ -442,10 +441,59 @@ fi
 AC_DEFINE(HAVE_MD5)
 AC_SUBST(MD5_OBJ)
 
+dnl **********************************************************************
+dnl Checks for IPv6
+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.  If neither are specified, we test
+dnl whether it's possible to create an AF_INET6 socket and if yes, use
+dnl IPv6.
+dnl
+
+AC_MSG_CHECKING([whether to enable ipv6])
+AC_ARG_ENABLE(ipv6,
+AC_HELP_STRING([--enable-ipv6],[Enable ipv6 support])
+AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
+[ case "$enableval" in
+  no)
+       AC_MSG_RESULT(no)
+       ipv6=no
+       ;;
+  *)   AC_MSG_RESULT(yes)
+       ipv6=yes
+       ;;
+  esac ],
+
+  AC_TRY_RUN([ /* is AF_INET6 available? */
+#include <sys/types.h>
+#include <sys/socket.h>
+main()
+{
+ if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
+   exit(1);
+ else
+   exit(0);
+}
+],
+  AC_MSG_RESULT(yes)
+  ipv6=yes,
+  AC_MSG_RESULT(no)
+  ipv6=no,
+  AC_MSG_RESULT(no)
+  ipv6=no
+))
+
+if test x"$ipv6" = xyes; then
+  WGET_CHECK_WORKING_GETADDRINFO
+fi
+
 dnl
 dnl Set of available languages.
 dnl
-ALL_LINGUAS=`(cd ${srcdir}/po && ls *.po | sed -e 's/\.po$//')`
+ALL_LINGUAS=`(cd ${srcdir}/po && ls *.po | sed -e 's/\.po$//' | tr '\012' ' ')`
 
 dnl Originally this used to be static, looking like this:
 dnl     ALL_LINGUAS="cs de hr it ..."