]> sjero.net Git - wget/commitdiff
Fix IPv6 detection under Windows.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 15 Jun 2010 14:35:29 +0000 (16:35 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 15 Jun 2010 14:35:29 +0000 (16:35 +0200)
ChangeLog
bootstrap.conf
configure.ac
m4/wget.m4

index 5fd93a9345d9a975d54fd2ebdf9ca06f02d78f41..fedc6a5151696dbe22db48c7ba9ff496b5f28caa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-06-15  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * m4/wget.m4 (WGET_STRUCT_SOCKADDR_STORAGE): Guard header inclusions.
+       (TYPE_STRUCT_SOCKADDR_IN6): Likewise.
+       (MEMBER_SIN6_SCOPE_ID): Likewise.
+       (PROTO_INET6): Likewise.
+
+       * configure.ac: Don't check for `getaddrinfo'.
+
+       * bootstrap.conf (gnulib_modules): Add `getaddrinfo' module.
+
 2010-06-10  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * configure.ac (AM_INIT_AUTOMAKE): Remove dist-bzip2 dist-lzma from
index 3498df5872798bad821114701e1aeceacc7690b4..36778f7c91ecbc19e83558765837d599197a8dc7 100644 (file)
@@ -31,6 +31,7 @@ bind
 c-ctype
 close
 connect
+getaddrinfo
 getopt-gnu
 getpass-gnu
 getpeername
index 1cdba2f4519b9981202ebc1c63647c730016baab..fa3d5b977b9c0afaa115e968cd651b5377b76175 100644 (file)
@@ -301,9 +301,9 @@ dnl **********************************************************************
 
 dnl
 dnl We test for IPv6 by checking, in turn, for availability of
-dnl getaddrinfo, presence of the INET6 address/protocol family, and
-dnl the existence of struct sockaddr_in6.  If any of them is missing,
-dnl IPv6 is disabled, and the code reverts to old-style gethostbyname.
+dnl presence of the INET6 address/protocol family and the existence of
+dnl struct sockaddr_in6.  If any of them is missing, IPv6 is disabled,
+dnl and the code reverts to old-style gethostbyname.
 dnl
 dnl If --enable-ipv6 is explicitly specified on the configure command
 dnl line, we check for IPv6 and abort if not found.  If --disable-ipv6
@@ -338,13 +338,6 @@ AC_ARG_ENABLE(ipv6,
   ]
 )
 
-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"; then
   PROTO_INET6([], [
     AC_MSG_NOTICE([Disabling IPv6 support: your system does not support the PF_INET6 protocol family])
index 5948b37b33d24cfcd06fa600bc73849544952fde..0827272487f96002015e0ee540864c652b9d4f44 100644 (file)
@@ -122,8 +122,18 @@ AC_DEFUN([TYPE_STRUCT_SOCKADDR_IN6],[
     wget_have_sockaddr_in6=no
   ],[
 #include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
   ])
 
   if test "X$wget_have_sockaddr_in6" = "Xyes"; then :
@@ -145,8 +155,18 @@ AC_DEFUN([MEMBER_SIN6_SCOPE_ID],[
       wget_member_sin6_scope_id=no
     ],[
 #include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
     ])
   fi
 
@@ -164,13 +184,23 @@ AC_DEFUN([PROTO_INET6],[
   AC_CACHE_CHECK([for INET6 protocol support], [wget_cv_proto_inet6],[
     AC_TRY_CPP([
 #include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
-
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
 #ifndef PF_INET6
 #error Missing PF_INET6
 #endif
 #ifndef AF_INET6
-#error Mlssing AF_INET6
+#error Missing AF_INET6
 #endif
     ],[
       wget_cv_proto_inet6=yes
@@ -190,8 +220,13 @@ AC_DEFUN([PROTO_INET6],[
 AC_DEFUN([WGET_STRUCT_SOCKADDR_STORAGE],[
   AC_CHECK_TYPES([struct sockaddr_storage],[], [], [
 #include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
-  ])
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+])
 ])
 
 dnl ************************************************************