diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2016-10-18 14:13:09 +0200 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2016-10-26 10:58:22 -0700 |
commit | 4710e46ec31837254346766ed286f484ee61f24f (patch) | |
tree | 645ba7d6c178e4a07c49533df0fa993c3922f77b /configure | |
parent | 7a34b9d098fce6778a02c475fd877e0b34aa7a13 (diff) |
tc, ipt: don't enforce iproute2 dependency on iptables-devel
Since 5cd1adba79d3 ("Update to current iptables headers") compilation
of iproute2 broke for systems without iptables-devel package [1].
Reason is that even though we fall back to build m_ipt.c, the include
depends on a xtables-version.h header, which only ships with
iptables-devel. Machines not having this package fail compilation with:
[...]
CC m_ipt.o
In file included from ../include/iptables.h:5:0,
from m_ipt.c:17:
../include/xtables.h:34:29: fatal error: xtables-version.h: No such file or directory
compilation terminated.
../Config:31: recipe for target 'm_ipt.o' failed
make[1]: *** [m_ipt.o] Error 1
The configure script only barks that package xtables was not found in
the pkg-config search path. The generated Config then only contains f.e.
TC_CONFIG_IPSET. In tc's Makefile we thus fall back to adding m_ipt.o
to TCMODULES. m_ipt.c then includes the local include/iptables.h header
copy, which includes the include/xtables.h copy. Latter then includes
xtables-version.h, which only ships with iptables-devel.
One way to resolve this is to skip this whole mess when pkg-config has
no xtables config available. I've carried something along these lines
locally for a while now, but it's just too annyoing. :/ Build works fine
now also when xtables.pc is not available.
[1] http://www.spinics.net/lists/netdev/msg366162.html
Fixes: 5cd1adba79d3 ("Update to current iptables headers")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 33 |
1 files changed, 24 insertions, 9 deletions
@@ -57,6 +57,14 @@ EOF rm -f $TMPDIR/atmtest.c $TMPDIR/atmtest } +check_xtables() +{ + if ! ${PKG_CONFIG} xtables --exists + then + echo "TC_CONFIG_NO_XT:=y" >>Config + fi +} + check_xt() { #check if we have xtables from iptables >= 1.4.5. @@ -353,18 +361,25 @@ echo "TC schedulers" echo -n " ATM " check_atm -echo -n " IPT " -check_xt -check_xt_old -check_xt_old_internal_h -check_ipt +check_xtables +if ! grep -q TC_CONFIG_NO_XT Config +then + echo -n " IPT " + check_xt + check_xt_old + check_xt_old_internal_h + check_ipt -echo -n " IPSET " -check_ipset + echo -n " IPSET " + check_ipset +fi echo -echo -n "iptables modules directory: " -check_ipt_lib_dir +if ! grep -q TC_CONFIG_NO_XT Config +then + echo -n "iptables modules directory: " + check_ipt_lib_dir +fi echo -n "libc has setns: " check_setns |