diff mbox

iproute2: proper detection of libxtables position and flags

Message ID alpine.LNX.2.01.1112312317220.24158@frira.zrqbmnf.qr
State Accepted, archived
Delegated to: stephen hemminger
Headers show

Commit Message

Jan Engelhardt Dec. 31, 2011, 10:17 p.m. UTC
From: Jan Engelhardt <jengelh@medozas.de>
Date: 2011-09-24 23:37:34.405739159 +0200
Upstream: not sent yet

Any tests involving iptables _MUST_ utilize pkg-config to find the
proper locations of the installation. 

---
 configure   |    2 +-
 tc/Makefile |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

stephen hemminger Jan. 3, 2012, 9:47 p.m. UTC | #1
On Sat, 31 Dec 2011 23:17:56 +0100 (CET)
Jan Engelhardt <jengelh@medozas.de> wrote:

> From: Jan Engelhardt <jengelh@medozas.de>
> Date: 2011-09-24 23:37:34.405739159 +0200
> Upstream: not sent yet
> 
> Any tests involving iptables _MUST_ utilize pkg-config to find the
> proper locations of the installation. 
> 

Will this work for all distros? Is this backwards compatiable?


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jan Engelhardt Jan. 3, 2012, 10:18 p.m. UTC | #2
On Tuesday 2012-01-03 22:47, Stephen Hemminger wrote:

>On Sat, 31 Dec 2011 23:17:56 +0100 (CET)
>Jan Engelhardt <jengelh@medozas.de> wrote:
>
>> From: Jan Engelhardt <jengelh@medozas.de>
>> Date: 2011-09-24 23:37:34.405739159 +0200
>> Upstream: not sent yet
>> 
>> Any tests involving iptables _MUST_ utilize pkg-config to find the
>> proper locations of the installation. 
>> 
>
>Will this work for all distros? Is this backwards compatiable?

The pkg-config file was shipped since the start, and it is the
one supported variant to find/link the lib.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: iproute2-2.6.39/configure
===================================================================
--- iproute2-2.6.39.orig/configure
+++ iproute2-2.6.39/configure
@@ -49,7 +49,7 @@  int main(int argc, char **argv)
 
 EOF
 
-if gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl -lxtables >/dev/null 2>&1
+if gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL $(pkg-config xtables --cflags --libs) -ldl >/dev/null 2>&1
 then
 	echo "TC_CONFIG_XT:=y" >>Config
 	echo "using xtables"
Index: iproute2-2.6.39/tc/Makefile
===================================================================
--- iproute2-2.6.39.orig/tc/Makefile
+++ iproute2-2.6.39/tc/Makefile
@@ -124,10 +124,10 @@  q_atm.so: q_atm.c
 	$(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
 
 m_xt.so: m_xt.c
-	$(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt.so m_xt.c -lxtables
+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt.so m_xt.c $$(pkg-config xtables --cflags --libs)
 
 m_xt_old.so: m_xt_old.c
-	$(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt_old.so m_xt_old.c -lxtables
+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt_old.so m_xt_old.c $$(pkg-config xtables --cflags --libs)
 
 %.yacc.c: %.y
 	$(YACC) $(YACCFLAGS) -o $@ $<