Added simple IPv6 recognition support
authorDaniel Stenberg <daniel@haxx.se>
Mon, 22 Jan 2001 23:54:54 +0000 (23:54 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 22 Jan 2001 23:54:54 +0000 (23:54 +0000)
acconfig.h
configure.in

index b908779..817ecc7 100644 (file)
@@ -36,3 +36,6 @@
 
 /* Define if you have the Kerberos4 libraries (including -ldes) */
 #undef KRB4
+
+/* Define if you want to enable IPv6 support */
+#undef ENABLE_IPV6
index c6de407..a1af285 100644 (file)
@@ -237,6 +237,44 @@ exit (rc != 0 ? 1 : 0); }],[
 
 ])
 
+dnl **********************************************************************
+dnl Checks for IPv6
+dnl **********************************************************************
+
+AC_MSG_CHECKING([whether to enable ipv6])
+AC_ARG_ENABLE(ipv6,
+[  --enable-ipv6               Enable ipv6 (with ipv4) support
+  --disable-ipv6               Disable ipv6 support],
+[ case "$enableval" in
+  no)
+       AC_MSG_RESULT(no)
+       ipv6=no
+       ;;
+  *)   AC_MSG_RESULT(yes)
+       AC_DEFINE(ENABLE_IPV6)
+       ipv6=yes
+       ;;
+  esac ],
+
+  AC_TRY_RUN([ /* is AF_INET6 available? */
+#include <sys/types.h>
+#include <sys/socket.h>
+main()
+{
+ if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
+   exit(1);
+ else
+   exit(0);
+}
+],
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(ENABLE_IPV6)
+  ipv6=yes,
+  AC_MSG_RESULT(no)
+  ipv6=no,
+  AC_MSG_RESULT(no)
+  ipv6=no
+))
 
 dnl **********************************************************************
 dnl Checks for libraries.