#include <sys/socket.h>
#include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
[ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
-if test "$ac_cv_ipv6_support" = yes; then
- AC_DEFINE(HAVE_IPV6,1,[Whether you have IPv6 support])
-fi
])
fi
+PHP_ARG_ENABLE(ipv6,whether to enable IPv6 support,
+[ --enable-ipv6 Enable IPv6 support],yes)
+
+if test "$PHP_IPV6" != "no" && test "$ac_cv_ipv6_support" = yes; then
+ AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
+fi
+
AC_CHECK_LIB(crypt, crypt, [
PHP_ADD_LIBRARY(crypt)
PHP_ADD_LIBRARY(crypt, 1)
struct addrinfo hints, *res, *sai;
memset(&hints, '\0', sizeof(hints));
+# ifdef HAVE_IPV6
hints.ai_family = AF_UNSPEC;
+# else
+ hints.ai_family = AF_INET;
+# endif
if ((n = getaddrinfo(host, NULL, &hints, &res))) {
php_error(E_WARNING, "php_network_getaddresses: getaddrinfo failed: %s", PHP_GAI_STRERROR(n));
return 0;