]> sjero.net Git - wget/blobdiff - configure.in
[svn] Also check for short for int32_t.
[wget] / configure.in
index 3f91f1561a6e9da4ee43fb9ab57c1ccb571bfd70..d9104895ebb171d52780f89506152f12db45c078 100644 (file)
@@ -15,12 +15,22 @@ dnl You should have received a copy of the GNU General Public License
 dnl along with this program; if not, write to the Free Software
 dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
+dnl In addition, as a special exception, the Free Software Foundation
+dnl gives permission to link the code of its release of Wget with the
+dnl OpenSSL project's "OpenSSL" library (or with modified versions of it
+dnl that use the same license as the "OpenSSL" library), and distribute
+dnl the linked executables.  You must obey the GNU General Public License
+dnl in all respects for all of the code used other than "OpenSSL".  If you
+dnl modify this file, you may extend this exception to your version of the
+dnl file, but you are not obligated to do so.  If you do not wish to do
+dnl so, delete this exception statement from your version.
+
 dnl
 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
@@ -46,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],
@@ -61,8 +71,8 @@ test x"${USE_DIGEST}" = xyes && AC_DEFINE(USE_DIGEST)
 
 AC_ARG_ENABLE(debug,
 [  --disable-debug         disable support for debugging output],
-DEBUG=$enableval, DEBUG=yes)
-test x"${DEBUG}" = xyes && AC_DEFINE(DEBUG)
+ENABLE_DEBUG=$enableval, ENABLE_DEBUG=yes)
+test x"${ENABLE_DEBUG}" = xyes && AC_DEFINE(ENABLE_DEBUG)
 
 wget_need_md5=no
 
@@ -145,12 +155,17 @@ 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.
+dnl
+dnl Check integral type sizes.
+dnl
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
 AC_CHECK_SIZEOF(long)
 AC_CHECK_SIZEOF(long long)
+AC_CHECK_TYPES(int32_t)
+AC_CHECK_TYPES(u_int32_t)
 
 dnl
 dnl Checks for headers
@@ -166,8 +181,10 @@ dnl
 AC_TYPE_SIGNAL
 
 dnl
-dnl Check for struct utimbuf
+dnl Call several of Wget's macros.
+dnl
 WGET_STRUCT_UTIMBUF
+WGET_SOCKLEN_T
 
 dnl
 dnl Checks for library functions.
@@ -290,7 +307,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
@@ -299,13 +316,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
@@ -344,15 +361,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
@@ -364,7 +381,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'
@@ -432,10 +449,80 @@ fi
 AC_DEFINE(HAVE_MD5)
 AC_SUBST(MD5_OBJ)
 
+dnl **********************************************************************
+dnl Checks for IPv6
+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
+    ;;
+  *)
+    ipv6=yes
+    ;;
+  esac],
+  [check_for_ipv6=no]
+)
+
+if test "X$ipv6" = "Xyes" || test "X$check_for_ipv6" = "Xyes"; then
+  AC_CHECK_FUNCS(getaddrinfo,[
+    GETADDRINFO_AI_ADDRCONFIG(
+      AC_DEFINE(
+        [HAVE_GETADDRINFO_AI_ADDRCONFIG], 1, 
+        [Define if the system headers support the AI_ADDRCONFIG flag.]
+      )
+    )
+    GETADDRINFO_AI_V4MAPPED(
+      AC_DEFINE(
+        [HAVE_GETADDRINFO_AI_V4MAPPED], 1, 
+        [Define if the system headers support the AI_V4MAPPED flag.]
+      )
+    )
+    GETADDRINFO_AI_ALL(
+      AC_DEFINE(
+        [HAVE_GETADDRINFO_AI_ALL], 1, 
+        [Define if the system headers support the AI_ALL flag.]
+      )
+    )
+  ],[
+    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
+  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'])
+    ipv6=no
+  ])
+  if test "X$ipv6" = "Xyes"; then
+    MEMBER_SIN6_SCOPE_ID
+  fi
+fi
+
+if test "X$ipv6" = "Xyes"; then
+  AC_DEFINE([ENABLE_IPV6], 1, [Define if IPv6 support is enabled.])
+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 ..."