Commit aaa87dc0 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

env_dpdk: allow linking against DPDK shared libs



Detect whether the specified DPDK directory contains static or shared
libraries, and use the appropriate extension when building the library
list. Static libraries are still preferred.

Change-Id: I78c68fd38fba1ea42dd605fb77209651f8cdca75
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent bc7b070d
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -54,15 +54,23 @@ DPDK_INC = -I$(DPDK_ABS_DIR)/include
else
DPDK_INC = -I$(DPDK_ABS_DIR)/include/dpdk
endif
DPDK_LIB = $(DPDK_ABS_DIR)/lib/librte_eal.a $(DPDK_ABS_DIR)/lib/librte_mempool.a \
	   $(DPDK_ABS_DIR)/lib/librte_ring.a

ifneq (, $(wildcard $(DPDK_ABS_DIR)/lib/librte_eal.a))
DPDK_LIB_EXT = .a
else
DPDK_LIB_EXT = .so
endif

DPDK_LIB_LIST = rte_eal rte_mempool rte_ring

# librte_malloc was removed after DPDK 2.1.  Link this library conditionally based on its
#  existence to maintain backward compatibility.
ifneq ($(wildcard $(DPDK_ABS_DIR)/lib/librte_malloc.*),)
DPDK_LIB += $(DPDK_ABS_DIR)/lib/librte_malloc.a
DPDK_LIB_LIST += rte_malloc
endif

DPDK_LIB = $(DPDK_LIB_LIST:%=$(DPDK_ABS_DIR)/lib/lib%$(DPDK_LIB_EXT))

ENV_CFLAGS = $(DPDK_INC)
ENV_CXXFLAGS = $(ENV_CFLAGS)
ENV_DPDK_FILE = $(call spdk_lib_list_to_files,env_dpdk)