From eced116610312ef0d500ae24fb96e1d919b82cc3 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Mon, 15 Dec 2014 23:44:49 +0100 Subject: [PATCH] mk: fix build with shared pcap pmd Some applications doesn't have the pcap link flag when shared libraries are enabled. Indeed in such case, pcap PMD must not be linked but pcap library should. Actually -lpcap is always needed if pcap PMD is used, and -lrte_pmd_pcap must be set only with static PMD library. So the flags -lrte_pmd_pcap and -lpcap are enabled separately. Workarounds in test-pmd/ and test-pipeline/ can be removed. Reported-by: Stepan Sojka Signed-off-by: Thomas Monjalon Acked-by: Neil Horman --- app/test-pipeline/Makefile | 4 ---- app/test-pmd/Makefile | 4 ---- mk/rte.app.mk | 6 +++++- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/test-pipeline/Makefile b/app/test-pipeline/Makefile index b81652f582..aa6df0cf46 100644 --- a/app/test-pipeline/Makefile +++ b/app/test-pipeline/Makefile @@ -41,10 +41,6 @@ APP = testpipeline CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) -LDFLAGS += -lpcap -endif - # # all source are stored in SRCS-y # diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile index 97dc2e62f1..dcf26f4cfa 100644 --- a/app/test-pmd/Makefile +++ b/app/test-pmd/Makefile @@ -41,10 +41,6 @@ APP = testpmd CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) -LDFLAGS += -lpcap -endif - # # all source are stored in SRCS-y # diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 84ec4df8b4..c5eaf828d3 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -119,6 +119,10 @@ LDLIBS += -lm LDLIBS += -lrt endif +ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) +LDLIBS += -lpcap +endif + LDLIBS += --start-group ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) @@ -207,7 +211,7 @@ LDLIBS += -lrte_pmd_ring endif ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) -LDLIBS += -lrte_pmd_pcap -lpcap +LDLIBS += -lrte_pmd_pcap endif ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) -- 2.20.1