From e029dfe9eac32c35ed34eb12927aa6a0b5af31f1 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 21 May 2008 21:27:45 +0200 Subject: libreplace: add test for HAVE_IPV6 Samba can later just check libreplace_cv_HAVE_IPV6 = yes. metze (This used to be commit e835e7eebcc064ce0813814796828f15ad112fbd) --- source4/lib/replace/libreplace_network.m4 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'source4/lib/replace/libreplace_network.m4') diff --git a/source4/lib/replace/libreplace_network.m4 b/source4/lib/replace/libreplace_network.m4 index f2d177b165..6cde6b9e0c 100644 --- a/source4/lib/replace/libreplace_network.m4 +++ b/source4/lib/replace/libreplace_network.m4 @@ -339,6 +339,35 @@ if test x"$libreplace_cv_HAVE_IFACE_IFREQ" = x"yes"; then fi fi +dnl test for ipv6 +AC_CACHE_CHECK([for ipv6 support],libreplace_cv_HAVE_IPV6,[ + AC_TRY_COMPILE([ +#include /* for NULL */ +#include +#include +#include + ], + [ +struct sockaddr_storage sa_store; +struct addrinfo *ai = NULL; +struct in6_addr in6addr; +int idx = if_nametoindex("iface1"); +int s = socket(AF_INET6, SOCK_STREAM, 0); +int ret = getaddrinfo(NULL, NULL, NULL, &ai); +if (ret != 0) { + const char *es = gai_strerror(ret); +} +freeaddrinfo(ai); + ],[ + libreplace_cv_HAVE_IPV6=yes + ],[ + libreplace_cv_HAVE_IPV6=no + ]) +]) +if test x"$libreplace_cv_HAVE_IPV6" = x"yes"; then + AC_DEFINE(HAVE_IPV6,1,[Whether the system has IPv6 support]) +fi + LIBS=$old_LIBS CPPFLAGS="$SAVE_CPPFLAGS" -- cgit