summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2016-08-18 11:06:16 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2016-09-02 16:24:31 +0300
commitc09e0c773ea8543c077f93d658ec3062ceef4f1a (patch)
tree9899546ec53e39f80c79347e049f132e91ef1d93 /configure.ac
parent43cc63daf896bfec1a6eefe5a376975d357b7191 (diff)
downloadconnman-c09e0c773ea8543c077f93d658ec3062ceef4f1a.tar.gz
firewall: Add nftables build infrastructure
Introduce --with-firewall configuration flag which is on default iptables. You can enable nftables by providing --with-firewall=nftables.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac32
1 files changed, 27 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 86b95167..b477aa16 100644
--- a/configure.ac
+++ b/configure.ac
@@ -265,11 +265,33 @@ if (test -n "${path_tmpfiles}"); then
AC_SUBST(SYSTEMD_TMPFILESDIR)
fi
-PKG_CHECK_MODULES(XTABLES, xtables >= 1.4.11, dummy=yes,
- AC_MSG_ERROR(Xtables library is required))
-AC_SUBST(XTABLES_CFLAGS)
-AC_SUBST(XTABLES_LIBS)
-AM_CONDITIONAL(XTABLES, test "${XTABLES}" != "no")
+AC_ARG_WITH(firewall, AC_HELP_STRING([--with-firewall=TYPE],
+ [specify which firewall type is used iptables or nftables [default=iptables]]),
+ [firewall_type=${withval}],
+ [firewall_type="iptables"])
+
+if (test "${firewall_type}" != "iptables" -a \
+ "${firewall_type}" != "nftables"); then
+ AC_MSG_ERROR(neither nftables nor iptables support enabled)
+fi
+
+found_iptables="no"
+if (test "${firewall_type}" = "iptables"); then
+ PKG_CHECK_MODULES(XTABLES, xtables >= 1.4.11, [found_iptables="yes"],
+ AC_MSG_ERROR(Xtables library is required))
+ AC_SUBST(XTABLES_CFLAGS)
+ AC_SUBST(XTABLES_LIBS)
+fi
+AM_CONDITIONAL(XTABLES, test "${found_iptables}" != "no")
+
+found_nftables="no"
+if (test "${firewall_type}" = "nftables"); then
+ PKG_CHECK_MODULES(NFTABLES, [libnftnl >= 1.0.4 libmnl >= 1.0.0], [found_nftables="yes"],
+ AC_MSG_ERROR([libnftnl >= 1.0.4 or libmnl >= 1.0.0 not found]))
+ AC_SUBST(NFTABLES_CFLAGS)
+ AC_SUBST(NFTABLES_LIBS)
+fi
+AM_CONDITIONAL(NFTABLES, test "${found_nftables}" != "no")
AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
[enable test/example scripts]), [enable_test=${enableval}])