aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/quota/quota/config-tcpwrappers.patch
blob: 5f47fbd18336a53fbce047e54dab048c30d336e1 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Upstream-Status: Pending

--- quota-tools.orig/configure.in
+++ quota-tools/configure.in
@@ -151,33 +151,46 @@ AC_SUBST(QUOTA_NETLINK_PROG)
 AC_SUBST(NETLINKLIBS)

 AC_SEARCH_LIBS(gethostbyname, nsl)
-AC_MSG_CHECKING(for host_access in -lwrap)
-AC_CACHE_VAL(ac_cv_lib_wrap_main,
-	saved_LIBS="$LIBS"
-	LIBS="$LIBS -lwrap"
-	[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-	#include <stdio.h>
-	#include <sys/types.h>
-	#include <sys/socket.h>
-	#include <netinet/in.h>
-	#include <tcpd.h>
-	struct request_info request;
-	int deny_severity, allow_severity;]],[[hosts_access(&request);]])],
-	dnl We always restore LIBS as we add -lwrap in the next check
-	[ac_cv_lib_wrap_main=yes; LIBS="$saved_LIBS"; AC_MSG_RESULT(yes)],
-	[ac_cv_lib_wrap_main=no; LIBS="$saved_LIBS"; AC_MSG_RESULT(no)])
-	])

-if test ${ac_cv_lib_wrap_main} = yes; then
-	AC_CHECK_HEADER(tcpd.h,, [
-		echo 'ERROR: could not find tcpd.h - missing TCP wrappers package'
-		exit 1
-	])
-	LIBS="$LIBS -lwrap"
-	AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad])
-	COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS"
+AC_ARG_WITH(tcpwrappers,
+	[  --with-tcpwrappers=[yes/no/try]   Use hosts.allow and hosts.deny for access checking of rpc.rquota [default=yes, if available.]],
+	,
+	with_tcpwrappers="try")
+
+if test "x$with_tcpwrappers" != xno; then
+	AC_MSG_CHECKING(for host_access in -lwrap)
+	AC_CACHE_VAL(ac_cv_lib_wrap_main,
+		saved_LIBS="$LIBS"
+		LIBS="$LIBS -lwrap"
+		[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+		#include <stdio.h>
+		#include <sys/types.h>
+		#include <sys/socket.h>
+		#include <netinet/in.h>
+		#include <tcpd.h>
+		struct request_info request;
+		int deny_severity, allow_severity;]],[[hosts_access(&request);]])],
+		dnl We always restore LIBS as we add -lwrap in the next try
+		[ac_cv_lib_wrap_main=yes; LIBS="$saved_LIBS"; AC_MSG_RESULT(yes)],
+		[ac_cv_lib_wrap_main=no; LIBS="$saved_LIBS"; AC_MSG_RESULT(no)])
+		])
+
+	if test "x$ac_cv_lib_wrap_main" = xyes; then
+		AC_CHECK_HEADER(tcpd.h,, [
+			if test "x$with_tcpwrappers" != xtry; then
+				AC_MSG_ERROR([could not find tcpd.h - missing TCP wrappers package])
+			fi
+		])
+
+		LIBS="$LIBS -lwrap"
+		AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad])
+		COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS"
+	elif test "x$with_tcpwrappers" != xtry; then
+		AC_MSG_ERROR([could not find libwrap - missing TCP wrappers package])
+	fi
 fi

+
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_C_INLINE