Fix IPv6 detection under Windows.

This commit is contained in:
Giuseppe Scrivano 2010-06-15 16:35:29 +02:00
parent 5af14a7589
commit f9c765d8e6
4 changed files with 53 additions and 13 deletions

View File

@ -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> 2010-06-10 Giuseppe Scrivano <gscrivano@gnu.org>
* configure.ac (AM_INIT_AUTOMAKE): Remove dist-bzip2 dist-lzma from * configure.ac (AM_INIT_AUTOMAKE): Remove dist-bzip2 dist-lzma from

View File

@ -31,6 +31,7 @@ bind
c-ctype c-ctype
close close
connect connect
getaddrinfo
getopt-gnu getopt-gnu
getpass-gnu getpass-gnu
getpeername getpeername

View File

@ -301,9 +301,9 @@ dnl **********************************************************************
dnl dnl
dnl We test for IPv6 by checking, in turn, for availability of dnl We test for IPv6 by checking, in turn, for availability of
dnl getaddrinfo, presence of the INET6 address/protocol family, and dnl presence of the INET6 address/protocol family and the existence of
dnl the existence of struct sockaddr_in6. If any of them is missing, dnl struct sockaddr_in6. If any of them is missing, IPv6 is disabled,
dnl IPv6 is disabled, and the code reverts to old-style gethostbyname. dnl and the code reverts to old-style gethostbyname.
dnl dnl
dnl If --enable-ipv6 is explicitly specified on the configure command 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 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 if test "X$ipv6" = "Xyes"; then
PROTO_INET6([], [ PROTO_INET6([], [
AC_MSG_NOTICE([Disabling IPv6 support: your system does not support the PF_INET6 protocol family]) AC_MSG_NOTICE([Disabling IPv6 support: your system does not support the PF_INET6 protocol family])

View File

@ -122,8 +122,18 @@ AC_DEFUN([TYPE_STRUCT_SOCKADDR_IN6],[
wget_have_sockaddr_in6=no wget_have_sockaddr_in6=no
],[ ],[
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h> #include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <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 : 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 wget_member_sin6_scope_id=no
],[ ],[
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h> #include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <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 fi
@ -164,13 +184,23 @@ AC_DEFUN([PROTO_INET6],[
AC_CACHE_CHECK([for INET6 protocol support], [wget_cv_proto_inet6],[ AC_CACHE_CHECK([for INET6 protocol support], [wget_cv_proto_inet6],[
AC_TRY_CPP([ AC_TRY_CPP([
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <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 #ifndef PF_INET6
#error Missing PF_INET6 #error Missing PF_INET6
#endif #endif
#ifndef AF_INET6 #ifndef AF_INET6
#error Mlssing AF_INET6 #error Missing AF_INET6
#endif #endif
],[ ],[
wget_cv_proto_inet6=yes wget_cv_proto_inet6=yes
@ -190,8 +220,13 @@ AC_DEFUN([PROTO_INET6],[
AC_DEFUN([WGET_STRUCT_SOCKADDR_STORAGE],[ AC_DEFUN([WGET_STRUCT_SOCKADDR_STORAGE],[
AC_CHECK_TYPES([struct sockaddr_storage],[], [], [ AC_CHECK_TYPES([struct sockaddr_storage],[], [], [
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h> #include <sys/socket.h>
]) #endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
])
]) ])
dnl ************************************************************ dnl ************************************************************