automatic -lip4tc and -lip6tc in Makefile.linux

Added test of presence of /lib/libip4tc.so and /lib/libip6tc.so files in
Makefile.linux in order to add -lip4tc and -lip6tc to LIBS accordingly.
This commit is contained in:
Thomas Bernard 2012-02-03 16:12:22 +01:00
parent 8263cc243a
commit 87a8a06640
2 changed files with 14 additions and 3 deletions

View File

@ -1,7 +1,9 @@
$Id: Changelog.txt,v 1.250 2012/02/03 11:59:13 nanard Exp $
$Id: Changelog.txt,v 1.251 2012/02/03 15:10:10 nanard Exp $
2012/02/03:
Anchor name (PF) is now configurable through the config file with anchor=
Added test of presence of /lib/libip4tc.so and /lib/libip6tc.so files in
Makefile.linux in order to add -lip4tc and -lip6tc to LIBS accordingly.
2012/02/01:
always handle EAGAIN, EWOULDBLOCK and EINTR after recv()/recvfrom() calls

View File

@ -1,4 +1,4 @@
# $Id: Makefile.linux,v 1.60 2011/07/30 13:14:35 nanard Exp $
# $Id: Makefile.linux,v 1.61 2012/02/03 15:10:11 nanard Exp $
# MiniUPnP project
# (c) 2006-2011 Thomas Bernard
# http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
@ -48,6 +48,7 @@ else # gentoo
# see http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=1618
# and http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=2183
LIBS ?= -lip4tc
CFLAGS := -DIPTABLES_143 $(CFLAGS)
endif
ARCH ?= $(shell uname -m | grep -q "x86_64" && echo 64)
@ -90,7 +91,15 @@ else # ifdef IPTABLESPATH
TEST := $(shell test -f /usr/include/xtables.h && grep -q "XTABLES_VERSION_CODE" /usr/include/xtables.h && echo 1)
ifeq ($(TEST), 1)
CFLAGS := $(CFLAGS) -DIPTABLES_143
LIBS = -lip4tc
LIBS = -liptc
TESTIP4TC := $(shell test -f /lib/libip4tc.so && echo 1)
ifeq ($(TESTIP4TC), 1)
LIBS := $(LIBS) -lip4tc
endif # ($(TESTIP4TC), 1)
TESTIP6TC := $(shell test -f /lib/libip6tc.so && echo 1)
ifeq ($(TESTIP6TC), 1)
LIBS := $(LIBS) -lip6tc
endif # ($(TESTIP6TC), 1)
endif # ($(TEST), 1)
endif # ifdef IPTABLESPATH