summaryrefslogtreecommitdiff
blob: 306b2b9fd22c4c0bb6d85c36e7cafe156555b60b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Index: bwping-1.7/configure.in
===================================================================
--- bwping-1.7.orig/configure.in
+++ bwping-1.7/configure.in
@@ -32,9 +32,30 @@ AC_CHECK_FUNC(getaddrinfo)
 if test $ac_cv_func_getaddrinfo = no; then
     AC_SEARCH_LIBS(getaddrinfo, [nsl socket], [], [ echo "getaddrinfo() is required for build"; exit -1 ])
 fi
-AC_MSG_CHECKING(for IPv6 support)
-AC_CACHE_VAL(ac_cv_ipv6,
-		AC_TRY_RUN([
+
+AC_ARG_ENABLE(ipv6,
+  AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
+  [case "${enable_ipv6}" in
+    no)
+      ipv6=no
+      ;;
+    yes)
+      ipv6=yes
+      ;;
+    *)
+      AC_MSG_ERROR([Invalid --enable-ipv6 argument '$enable_ipv6'])
+      ;;
+    esac
+  ], [
+    dnl If nothing is specified, assume auto-detection
+    ipv6=yes
+  ]
+)
+
+if test $ipv6 = yes; then
+	AC_MSG_CHECKING(for IPv6 support)
+	AC_CACHE_VAL(ac_cv_ipv6,
+		AC_TRY_LINK([
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -54,9 +75,12 @@ main()
 		ac_cv_ipv6=yes,
 		ac_cv_ipv6=no,
 		ac_cv_ipv6=no))
-AC_MSG_RESULT($ac_cv_ipv6)
-if test $ac_cv_ipv6 = yes ; then
-    AC_DEFINE(IPV6,, "check if system supports IPV6")
+	if test $ac_cv_ipv6 = yes ; then
+	    AC_DEFINE(IPV6,, "check if system supports IPV6")
+	else
+	    AC_MSG_ERROR([IPv6 support was request, but not found])
+	fi
+	AC_MSG_RESULT($ac_cv_ipv6)
 fi
-AM_CONDITIONAL([BUILDIPV6], [ test $ac_cv_ipv6 = yes ])
+AM_CONDITIONAL([BUILDIPV6], [ test $ipv6 = yes ])
 AC_OUTPUT(Makefile)