app/test: link with ring pmd when needed
authorTomasz Kulasek <tomaszx.kulasek@intel.com>
Fri, 13 Feb 2015 10:38:15 +0000 (11:38 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 18 Feb 2015 17:58:55 +0000 (18:58 +0100)
This patch links test application against librte_pmd_ring.so for shared
libraries. It's required as long as librte_pmd_ring provides some additional
routines used for testing purposes and must be "hard-linked".

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
app/test/Makefile

index a4e4bae..89fac6d 100644 (file)
@@ -130,8 +130,12 @@ SRCS-y += test_devargs.c
 SRCS-y += virtual_pmd.c
 SRCS-y += packet_burst_generator.c
 SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c
+
+ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y)
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_mode4.c
+endif
+
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring.c
 SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) += test_kvargs.c
 
@@ -149,6 +153,17 @@ CFLAGS += -D_GNU_SOURCE
 # this application needs libraries first
 DEPDIRS-y += lib
 
+# Link against shared libraries when needed
+ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y)
+ifneq ($(CONFIG_RTE_LIBRTE_PMD_RING),y)
+$(error Link bonding tests require CONFIG_RTE_LIBRTE_PMD_RING=y)
+else
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
+LDLIBS += -lrte_pmd_ring
+endif
+endif
+endif
+
 include $(RTE_SDK)/mk/rte.app.mk
 
 endif