summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorDavid Marchand <david.marchand@6wind.com>2013-11-22 11:24:55 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-01-15 18:11:18 +0100
commit6578307bee3a248a3cab963084cbc52b4beb421a (patch)
tree1cee1754e541bb91bd4d331df3988f635374ec43 /mk
parent1d18730866baee49b61a620dff34927f6c471d6a (diff)
downloaddpdk-6578307bee3a248a3cab963084cbc52b4beb421a.zip
dpdk-6578307bee3a248a3cab963084cbc52b4beb421a.tar.gz
dpdk-6578307bee3a248a3cab963084cbc52b4beb421a.tar.xz
pcap: use pcap-config to guess compilation flags
Use pcap-config to populate CFLAGS and LDFLAGS. LIBPCAP_CFLAGS and LIBPCAP_LDFLAGS can be used to override this (useful when cross-compiling). Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Diffstat (limited to 'mk')
-rw-r--r--mk/rte.app.mk5
-rw-r--r--mk/rte.sdkbuild.mk8
-rw-r--r--mk/target/generic/rte.vars.mk2
3 files changed, 13 insertions, 2 deletions
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 1c875e5..786100c 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -150,7 +150,10 @@ LDLIBS += -lrte_eal
endif
ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y)
-LDLIBS += -lrte_pmd_pcap -lpcap
+LDLIBS += -lrte_pmd_pcap
+LIBPCAP_LDFLAGS ?= $(shell pcap-config --libs)
+$(if $(LIBPCAP_LDFLAGS),,$(error LIBPCAP_LDFLAGS is undefined))
+LDLIBS += $(LIBPCAP_LDFLAGS)
endif
LDLIBS += $(EXECENV_LDLIBS)
diff --git a/mk/rte.sdkbuild.mk b/mk/rte.sdkbuild.mk
index 0dc23ff..33bed57 100644
--- a/mk/rte.sdkbuild.mk
+++ b/mk/rte.sdkbuild.mk
@@ -40,6 +40,14 @@ else
include $(RTE_SDK)/mk/rte.vars.mk
endif
+ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y)
+LIBPCAP_CFLAGS ?= $(shell pcap-config --cflags)
+$(if $(LIBPCAP_CFLAGS),,$(error LIBPCAP_CFLAGS is undefined))
+EXTERNAL_LIB_CFLAGS += $(LIBPCAP_CFLAGS)
+endif
+
+export EXTERNAL_LIB_CFLAGS
+
#
# include .depdirs and define rules to order priorities between build
# of directories.
diff --git a/mk/target/generic/rte.vars.mk b/mk/target/generic/rte.vars.mk
index 9030f44..22893fc 100644
--- a/mk/target/generic/rte.vars.mk
+++ b/mk/target/generic/rte.vars.mk
@@ -104,7 +104,7 @@ ifeq ($(KERNELRELEASE),)
# merge all CFLAGS
CFLAGS := $(CPU_CFLAGS) $(EXECENV_CFLAGS) $(TOOLCHAIN_CFLAGS) $(MACHINE_CFLAGS)
-CFLAGS += $(TARGET_CFLAGS)
+CFLAGS += $(TARGET_CFLAGS) $(EXTERNAL_LIB_CFLAGS)
# merge all LDFLAGS
LDFLAGS := $(CPU_LDFLAGS) $(EXECENV_LDFLAGS) $(TOOLCHAIN_LDFLAGS) $(MACHINE_LDFLAGS)