netsniff-ng trafgen: Find libnl-3.0 and libnl-genl-3.0 using pkg-config
authorPeter Stuge <peter@stuge.se>
Thu, 14 Mar 2013 16:15:17 +0000 (14 17:15 +0100)
committerDaniel Borkmann <dborkman@redhat.com>
Fri, 15 Mar 2013 10:17:02 +0000 (15 11:17 +0100)
Call pkg-config --cflags and pkg-config --libs to find correct CFLAGS
and LDFLAGS respectively.

Signed-off-by: Peter Stuge <peter@stuge.se>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Makefile
netsniff-ng/Makefile
trafgen/Makefile

index a211137..645cb2d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -215,8 +215,8 @@ $(foreach tool,$(TOOLS),$(eval $(call TOOL_templ,$(tool))))
 
 %:: ;
 
-netsniff-ng: ALL_CFLAGS += -I$(INCDIR)/libnl3/ -D__WITH_PROTOS -D__WITH_TCPDUMP_LIKE_FILTER
-trafgen: ALL_CFLAGS += -I.. -I$(INCDIR)/libnl3/ -D__WITH_PROTOS
+netsniff-ng: ALL_CFLAGS += $(shell pkg-config --cflags libnl-3.0) $(shell pkg-config --cflags libnl-genl-3.0) -D__WITH_PROTOS -D__WITH_TCPDUMP_LIKE_FILTER
+trafgen: ALL_CFLAGS += -I.. $(shell pkg-config --cflags libnl-3.0) $(shell pkg-config --cflags libnl-genl-3.0) -D__WITH_PROTOS
 bpfc: ALL_CFLAGS += -I..
 curvetun: ALL_CFLAGS += -I ${NACL_INC_DIR}
 curvetun: ALL_LDFLAGS += -L ${NACL_LIB_DIR}
index 269d403..46b885d 100644 (file)
@@ -1,6 +1,6 @@
 netsniff-ng-libs =     -lGeoIP \
-                       -lnl-genl-3 \
-                       -lnl-3 \
+                       $(shell pkg-config --libs libnl-3.0) \
+                       $(shell pkg-config --libs libnl-genl-3.0) \
                        -lpcap \
                        -lpthread \
                        -lz
index 289aa28..b34b98c 100644 (file)
@@ -1,5 +1,5 @@
-trafgen-libs = -lnl-genl-3 \
-               -lnl-3 \
+trafgen-libs = $(shell pkg-config --libs libnl-3.0) \
+               $(shell pkg-config --libs libnl-genl-3.0) \
                -lm
 
 trafgen-objs = xmalloc.o \