1From 0096c854d5015918ed154dccb3ad472fd06c1010 Mon Sep 17 00:00:00 2001
2From: "Maxin B. John" <maxin.john@intel.com>
3Date: Tue, 21 Feb 2017 11:16:31 +0200
4Subject: [PATCH] configure: Add option to enable/disable libnfnetlink
5
6This changes the configure behaviour from autodetecting
7for libnfnetlink to having an option to disable it explicitly
8
9Upstream-Status: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Signed-off-by: Maxin B. John <maxin.john@intel.com>
13
14---
15 configure.ac | 10 +++++++---
16 1 file changed, 7 insertions(+), 3 deletions(-)
17
18diff --git a/configure.ac b/configure.ac
19index d99fa3b..d607772 100644
20--- a/configure.ac
21+++ b/configure.ac
22@@ -63,6 +63,9 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
23 AC_ARG_ENABLE([nftables],
24 	AS_HELP_STRING([--disable-nftables], [Do not build nftables compat]),
25 	[enable_nftables="$enableval"], [enable_nftables="yes"])
26+AC_ARG_ENABLE([libnfnetlink],
27+    AS_HELP_STRING([--disable-libnfnetlink], [Do not use netfilter netlink library]),
28+    [enable_libnfnetlink="$enableval"], [enable_libnfnetlink="yes"])
29 AC_ARG_ENABLE([connlabel],
30 	AS_HELP_STRING([--disable-connlabel],
31 	[Do not build libnetfilter_conntrack]),
32@@ -113,9 +116,10 @@ AM_CONDITIONAL([ENABLE_SYNCONF], [test "$enable_nfsynproxy" = "yes"])
33 AM_CONDITIONAL([ENABLE_NFTABLES], [test "$enable_nftables" = "yes"])
34 AM_CONDITIONAL([ENABLE_CONNLABEL], [test "$enable_connlabel" = "yes"])
35
36-PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
37-	[nfnetlink=1], [nfnetlink=0])
38-AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
39+AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
40+    PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0])
41+    ])
42+AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "x$enable_libnfnetlink" = "xyes"])
43
44 if test "x$enable_bpfc" = "xyes" || test "x$enable_nfsynproxy" = "xyes"; then
45 	PKG_CHECK_MODULES([libpcap], [libpcap], [], [
46