From c208c783f5eefa48b0cacb15d848e1e310dc2ea8 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 17 Sep 2015 20:03:34 +0200 Subject: configure: detect IPv6 support on Windows This patch was "nicked" from the MINGW-packages project by Daniel. https://github.com/Alexpux/MINGW-packages/commit/9253d0bf58a1486e91f7efb5316e7fdb48fa4007 Signed-off-by: Johannes Schindelin --- configure.ac | 11 ++++++++++- m4/curl-functions.m4 | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4fba81715..7593e9609 100644 --- a/configure.ac +++ b/configure.ac @@ -1083,7 +1083,11 @@ AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]), AC_TRY_RUN([ /* is AF_INET6 available? */ #include +#ifdef HAVE_WINSOCK2_H +#include +#else #include +#endif #include /* for exit() */ main() { @@ -1110,7 +1114,12 @@ if test "$ipv6" = yes; then AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member]) AC_TRY_COMPILE([ #include -#include ] , +#ifdef HAVE_WINSOCK2_H +#include +#include +#else +#include +#endif] , struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes) if test "$have_sin6_scope_id" = yes; then AC_MSG_RESULT([yes]) diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4 index 0d6542121..0f8fb2a64 100644 --- a/m4/curl-functions.m4 +++ b/m4/curl-functions.m4 @@ -44,6 +44,10 @@ curl_includes_arpa_inet="\ #ifdef HAVE_ARPA_INET_H # include #endif +#ifdef HAVE_WINSOCK2_H +#include +#include +#endif /* includes end */" AC_CHECK_HEADERS( sys/types.h sys/socket.h netinet/in.h arpa/inet.h, @@ -2098,6 +2102,12 @@ AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [ struct addrinfo *ai = 0; int error; + #ifdef HAVE_WINSOCK2_H + WSADATA wsa; + if (WSAStartup(MAKEWORD(2,2), &wsa)) + exit(2); + #endif + memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_NUMERICHOST; hints.ai_family = AF_UNSPEC; -- cgit v1.2.3