diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2016-08-18 11:06:16 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2016-09-02 16:24:31 +0300 |
commit | c09e0c773ea8543c077f93d658ec3062ceef4f1a (patch) | |
tree | 9899546ec53e39f80c79347e049f132e91ef1d93 /configure.ac | |
parent | 43cc63daf896bfec1a6eefe5a376975d357b7191 (diff) | |
download | connman-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.ac | 32 |
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}]) |