From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 01AB6AFDC for ; Tue, 15 Apr 2014 20:06:49 +0200 (CEST) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1Wa7kr-0002zM-U6; Tue, 15 Apr 2014 14:06:48 -0400 From: Neil Horman To: dev@dpdk.org Date: Tue, 15 Apr 2014 14:05:58 -0400 Message-Id: <1397585169-14537-5-git-send-email-nhorman@tuxdriver.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1397585169-14537-1-git-send-email-nhorman@tuxdriver.com> References: <1397585169-14537-1-git-send-email-nhorman@tuxdriver.com> X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: [dpdk-dev] [PATCH 04/15] pcap: Convert to use of PMD_REGISTER_DRIVER and fix linking X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2014 18:06:49 -0000 convert the pcap driver to use the PMD_REGISTER_DRIVER macro and fix up the Makefile so that its linkage is only done if we are building static libraries. This means that the test applications now have no reference to the pcap library when building DSO's and must specify its use on the command line with the -d option. Static linking will still initalize the driver automatically. Signed-off-by: Neil Horman --- lib/librte_pmd_pcap/rte_eth_pcap.c | 8 ++------ mk/rte.app.mk | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/librte_pmd_pcap/rte_eth_pcap.c b/lib/librte_pmd_pcap/rte_eth_pcap.c index 680dfdc..4167a26 100644 --- a/lib/librte_pmd_pcap/rte_eth_pcap.c +++ b/lib/librte_pmd_pcap/rte_eth_pcap.c @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -772,9 +773,4 @@ static struct rte_vdev_driver pmd_pcap_drv = { .init = rte_pmd_pcap_devinit, }; -__attribute__((constructor)) -static void -rte_pmd_pcap_init(void) -{ - rte_eal_vdev_driver_register(&pmd_pcap_drv); -} +PMD_REGISTER_DRIVER(pmd_pcap_drv, PMD_VDEV); diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 5a0ef0c..e6d09b8 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -172,9 +172,11 @@ ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) LDLIBS += -lrte_cmdline endif +ifeq ($(RTE_BUILD_SHARED_LIB),n) ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) LDLIBS += -lrte_pmd_pcap -lpcap endif +endif LDLIBS += $(EXECENV_LDLIBS) -- 1.8.3.1