-AC_CHECK_FUNC([getaddrinfo],
- [AC_CHECK_FUNC([getnameinfo],
- [AC_DEFINE([HAVE_RFC2553], [1],
- [Define if RFC 2553 resolver functions like getaddrinfo(3) and
- getnameinfo(3) present])
- ])
-])
+AC_ARG_ENABLE(ipv6-support,
+[ --disable-ipv6-support Disable IPv6 support and other RFC-2554-related improvements],
+[if test $enableval = yes; then
+ enable_ipv6_support=yes
+fi], enable_ipv6_support=yes)
+
+if test $enable_ipv6_support != yes; then
+ AC_MSG_WARN([Skipping checks for IPv6 support and other RFC-2554-related improvements.
+ Due to lock contention, this may result in slower DNS resolution for IPv4 setups, too.])
+elif test $target_type = mingw; then
+ AC_CHECK_LIB(ws2_32, main)
+
+ AC_MSG_CHECKING(getaddrinfo in ws2_32)
+ AC_TRY_LINK(
+ [
+ #include<winsock2.h>
+ #include<windows.h>
+ #include<ws2tcpip.h>
+ ],
+ [getaddrinfo(0,0,0,0)],
+ have_ws2_32_getaddrinfo=yes
+ )
+ AC_MSG_RESULT($have_ws2_32_getaddrinfo)
+
+ AC_MSG_CHECKING(getnameinfo in ws2_32)
+ AC_TRY_LINK(
+ [
+ #include<winsock2.h>
+ #include<windows.h>
+ #include<ws2tcpip.h>
+ ],
+ [getnameinfo(0,0,0,0,0,0,0)],
+ have_ws2_32_getnameinfo=yes
+ )
+ AC_MSG_RESULT($have_ws2_32_getnameinfo)
+
+ if test $have_ws2_32_getaddrinfo ; then
+ if test $have_ws2_32_getnameinfo ; then
+ AC_DEFINE([HAVE_RFC2553], [1],
+ [Define if RFC 2553 resolver functions like getaddrinfo(3) and
+ getnameinfo(3) present])
+ fi
+ fi
+else
+ AC_CHECK_FUNC([getaddrinfo],
+ [AC_CHECK_FUNC([getnameinfo],
+ [AC_DEFINE([HAVE_RFC2553], [1],
+ [Define if RFC 2553 resolver functions like getaddrinfo(3) and
+ getnameinfo(3) present])
+ ])
+ ])
+fi