From 41c5d99d584f8bffa77b94dcfcc0fa3c4c406e81 Mon Sep 17 00:00:00 2001 From: Peter Stuge Date: Thu, 14 Mar 2013 17:15:17 +0100 Subject: [PATCH] netsniff-ng trafgen: Find libnl-3.0 and libnl-genl-3.0 using pkg-config Call pkg-config --cflags and pkg-config --libs to find correct CFLAGS and LDFLAGS respectively. Signed-off-by: Peter Stuge Signed-off-by: Daniel Borkmann --- Makefile | 4 ++-- netsniff-ng/Makefile | 4 ++-- trafgen/Makefile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a211137e..645cb2d3 100644 --- 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} diff --git a/netsniff-ng/Makefile b/netsniff-ng/Makefile index 269d4036..46b885db 100644 --- a/netsniff-ng/Makefile +++ b/netsniff-ng/Makefile @@ -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 diff --git a/trafgen/Makefile b/trafgen/Makefile index 289aa28f..b34b98c0 100644 --- a/trafgen/Makefile +++ b/trafgen/Makefile @@ -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 \ -- 2.11.4.GIT