From f9c765d8e635728753572db7af242a8c167980d7 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 15 Jun 2010 16:35:29 +0200 Subject: [PATCH] Fix IPv6 detection under Windows. --- ChangeLog | 11 +++++++++++ bootstrap.conf | 1 + configure.ac | 13 +++---------- m4/wget.m4 | 41 ++++++++++++++++++++++++++++++++++++++--- 4 files changed, 53 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5fd93a93..fedc6a51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2010-06-15 Giuseppe Scrivano + + * 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 * configure.ac (AM_INIT_AUTOMAKE): Remove dist-bzip2 dist-lzma from diff --git a/bootstrap.conf b/bootstrap.conf index 3498df58..36778f7c 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -31,6 +31,7 @@ bind c-ctype close connect +getaddrinfo getopt-gnu getpass-gnu getpeername diff --git a/configure.ac b/configure.ac index 1cdba2f4..fa3d5b97 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/m4/wget.m4 b/m4/wget.m4 index 5948b37b..08272724 100644 --- a/m4/wget.m4 +++ b/m4/wget.m4 @@ -122,8 +122,18 @@ AC_DEFUN([TYPE_STRUCT_SOCKADDR_IN6],[ wget_have_sockaddr_in6=no ],[ #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#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 +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#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 +#ifdef HAVE_SYS_SOCKET_H #include - +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#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 +#ifdef HAVE_SYS_SOCKET_H #include - ]) +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +]) ]) dnl ************************************************************ -- 2.39.2