miniupnpd: Use pkg-config under linux to find libiptc.

Thanks to Olivier Langlois
This commit is contained in:
Thomas Bernard 2013-05-03 11:33:36 +02:00
parent a0ac317b3b
commit 71dcf3565d
3 changed files with 29 additions and 6 deletions

View File

@ -1,4 +1,7 @@
$Id: Changelog.txt,v 1.337 2013/04/29 09:34:13 nanard Exp $ $Id: Changelog.txt,v 1.338 2013/05/03 09:30:32 nanard Exp $
2013/05/03:
Use pkg-config under linux to find libiptc. Thanks to Olivier Langlois
2013/04/29: 2013/04/29:
Add warning message when using IPv4 address for listening_ip with IPv6 enabled Add warning message when using IPv4 address for listening_ip with IPv6 enabled

View File

@ -1,5 +1,5 @@
MiniUPnP project. MiniUPnP project.
(c) 2006-2012 Thomas Bernard (c) 2006-2013 Thomas Bernard
Homepage : http://miniupnp.free.fr/ Homepage : http://miniupnp.free.fr/
Mirror: http://miniupnp.tuxfamily.org/ Mirror: http://miniupnp.tuxfamily.org/
github: https://github.com/miniupnp/miniupnp github: https://github.com/miniupnp/miniupnp
@ -74,8 +74,6 @@ To Build and install :
> make -f Makefile.linux > make -f Makefile.linux
If not using iptables from your system, If not using iptables from your system,
> IPTABLESPATH=/path/to/iptables-1.4.1 make -f Makefile.linux > IPTABLESPATH=/path/to/iptables-1.4.1 make -f Makefile.linux
note : make sure you have iptables with static libraries compiled.
use "./configure --enable-static" before compiling iptables
- install as root using : - install as root using :
> make -f Makefile.linux install > make -f Makefile.linux install
- A miniupnpd script should be installed to /etc/init.d - A miniupnpd script should be installed to /etc/init.d
@ -101,7 +99,7 @@ How to get libiptc with its headers on debian :
> ./configure --enable-static > ./configure --enable-static
> make > make
- it is now possible to compile miniupnpd using the following command : - it is now possible to compile miniupnpd using the following command :
> IPTABLESPATH=§path/to/iptables-x.x.x make -f Makefile.linux > IPTABLESPATH=/path/to/iptables-x.x.x make -f Makefile.linux
=========================== Configuration ============================= =========================== Configuration =============================
Edit the /etc/miniupnpd.conf file to set options. Almost all options are Edit the /etc/miniupnpd.conf file to set options. Almost all options are

View File

@ -1,4 +1,4 @@
# $Id: Makefile.linux,v 1.76 2013/02/07 15:56:10 nanard Exp $ # $Id: Makefile.linux,v 1.78 2013/05/03 09:30:33 nanard Exp $
# MiniUPnP project # MiniUPnP project
# (c) 2006-2013 Thomas Bernard # (c) 2006-2013 Thomas Bernard
# http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ # http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
@ -54,6 +54,27 @@ NETFILTEROBJS = netfilter/iptcrdr.o netfilter/iptpinhole.o
ALLOBJS = $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS) ALLOBJS = $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS)
PCFILE_FOUND := $(shell pkg-config --exists libiptc; echo $$?)
ifeq (${PCFILE_FOUND},0)
IPTABLESVERSION := $(shell pkg-config --modversion libiptc)
IPTABLESVERSION1 := $(shell echo $(IPTABLESVERSION) | cut -d. -f1 )
IPTABLESVERSION2 := $(shell echo $(IPTABLESVERSION) | cut -d. -f2 )
IPTABLESVERSION3 := $(shell echo $(IPTABLESVERSION) | cut -d. -f3 )
# test if iptables version >= 1.4.3
TEST := $(shell [ \( \( $(IPTABLESVERSION1) -ge 1 \) -a \( $(IPTABLESVERSION2) -ge 4 \) \) -a \( $(IPTABLESVERSION3) -ge 3 \) ] && echo 1 )
ifeq ($(TEST), 1)
CFLAGS += -DIPTABLES_143
endif
CFLAGS += $(shell pkg-config --cflags libiptc)
LIBS += $(shell pkg-config --libs-only-l libiptc)
LDFLAGS += $(shell pkg-config --libs-only-L libiptc)
LDFLAGS += $(shell pkg-config --libs-only-other libiptc)
else
ifeq "$(wildcard /etc/gentoo-release )" "" ifeq "$(wildcard /etc/gentoo-release )" ""
LIBS ?= -liptc LIBS ?= -liptc
else # gentoo else # gentoo
@ -115,6 +136,7 @@ LIBS := $(LIBS) -lip6tc
endif # ($(TESTIP6TC), 1) endif # ($(TESTIP6TC), 1)
endif # ($(TEST), 1) endif # ($(TEST), 1)
endif # ifdef IPTABLESPATH endif # ifdef IPTABLESPATH
endif # ifdef PCFILE_FOUND
LIBS += -lnfnetlink LIBS += -lnfnetlink