summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxin B. John <maxin.john@intel.com>2024-04-25 10:51:02 +0200
committerPhil Sutter <phil@nwl.cc>2024-04-25 13:22:30 +0200
commit653db8b938166db7833135f615b90c38a3f27a30 (patch)
tree61f7b2881146cc9a632ddd73c47dc830b9b3150a
parent8bf2bab8eb2e4f5ae2fef859ea7c877662854101 (diff)
configure: Add option to enable/disable libnfnetlinkHEADmaster
Default behavior (autodetecting) does not change, but specifying either option would explicitly disable or enable libnfnetlink support, and if the library is not found in the latter case, ./configure will error out. Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Phil Sutter <phil@nwl.cc>
-rw-r--r--configure.ac13
1 files changed, 11 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index d99fa3b9..2293702b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,6 +63,9 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
AC_ARG_ENABLE([nftables],
AS_HELP_STRING([--disable-nftables], [Do not build nftables compat]),
[enable_nftables="$enableval"], [enable_nftables="yes"])
+AC_ARG_ENABLE([libnfnetlink],
+ AS_HELP_STRING([--disable-libnfnetlink], [Do not use netfilter netlink library]),
+ [enable_libnfnetlink="$enableval"], [enable_libnfnetlink="auto"])
AC_ARG_ENABLE([connlabel],
AS_HELP_STRING([--disable-connlabel],
[Do not build libnetfilter_conntrack]),
@@ -113,8 +116,14 @@ AM_CONDITIONAL([ENABLE_SYNCONF], [test "$enable_nfsynproxy" = "yes"])
AM_CONDITIONAL([ENABLE_NFTABLES], [test "$enable_nftables" = "yes"])
AM_CONDITIONAL([ENABLE_CONNLABEL], [test "$enable_connlabel" = "yes"])
-PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
- [nfnetlink=1], [nfnetlink=0])
+# If specified explicitly on the command line, error out when library was not found
+# Otherwise, disable and continue
+AS_IF([test "x$enable_libnfnetlink" = "xyes"],
+ [PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
+ [nfnetlink=1])],
+ [test "x$enable_libnfnetlink" = "xauto"],
+ [PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
+ [nfnetlink=1], [nfnetlink=0])])
AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
if test "x$enable_bpfc" = "xyes" || test "x$enable_nfsynproxy" = "xyes"; then