summaryrefslogtreecommitdiff
blob: 682dece1b2b61cd6103dde34aec41737ee63ec2d (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
From 928d69309592704892d124b1f8de9111164c3793 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Mon, 18 Jun 2018 22:11:21 -0400
Subject: [PATCH] configure: add a --without-rpc flag

The build already supports NO_RPC to disable all RPC logic.  Turn it
into a proper configure flag so people don't have to hack it up.
---
 configure.ac | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8d0b562ddaac..75ae7fb472dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,11 +37,6 @@ AC_CHECK_LIB([m], [log10], [
 	AC_MSG_ERROR([Unable to find working libm.so])
 ])
 AC_SUBST([LIBM_LIBS])
-PKG_CHECK_MODULES([TIRPC],[libtirpc], [
-	AC_DEFINE([HAVE_RPCENT_H], [1], [Have <rpc/rpcent.h>.])
-], [
-	AC_MSG_WARN([Libtirpc not found, will not use <rpc/rpcent.h>])
-])
 
 # ======================================
 # Check for various headers and settings
@@ -112,6 +107,26 @@ AS_IF([test x"$with_labeled_networking" != "xno"], [
     ])
 ])
 
+AC_ARG_WITH([rpc],
+    [AS_HELP_STRING([--without-rpc], [Do not include RPC support])],
+    [with_rpc="$withval"],
+    [with_rpc="auto"]
+)
+AS_IF([test x"$with_rpc" != "xno"], [
+    PKG_CHECK_MODULES([TIRPC],[libtirpc], [
+        AC_DEFINE([HAVE_RPCENT_H], [1], [Have <rpc/rpcent.h>.])
+    ], [
+        AS_IF([test x"$with_rpc" = "xyes"], [
+            AC_MSG_ERROR([RPC support requested but not found])
+        ])
+        with_rpc="no"
+        AC_MSG_WARN([Libtirpc not found, will not use <rpc/rpcent.h>])
+    ])
+])
+AS_IF([test x"$with_rpc" = "xno"], [
+    AC_DEFINE([NO_RPC], [1], [Omit RPC support.])
+])
+
 # =========
 # Hardening
 # =========
-- 
2.16.1