Conditionally add -lrte_malloc.

librte_malloc has been deprecated by DPDK, but to allow for backwards
compability, check for its existence and link with it if it exists.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3e05a3295b6768bd6804a8ec86c301e22040df37
This commit is contained in:
Jim Harris 2015-11-30 08:54:39 -07:00
parent ecf1d7d4d4
commit 38ea764f6d

View File

@ -118,7 +118,13 @@ DPDK_INC_DIR ?= $(DPDK_DIR)/include
DPDK_LIB_DIR ?= $(DPDK_DIR)/lib
DPDK_INC = -I$(DPDK_INC_DIR)
DPDK_LIB = -L$(DPDK_LIB_DIR) -lrte_eal -lrte_malloc -lrte_mempool -lrte_ring -Wl,-rpath=$(DPDK_LIB_DIR)
DPDK_LIB = -L$(DPDK_LIB_DIR) -lrte_eal -lrte_mempool -lrte_ring -Wl,-rpath=$(DPDK_LIB_DIR)
# librte_malloc was removed after DPDK 2.1. Link this library conditionally based on its
# existence to maintain backward compatibility.
ifneq ($(wildcard $(DPDK_DIR)/lib/librte_malloc.*),)
DPDK_LIB += -lrte_malloc
endif
# DPDK requires dl library for dlopen/dlclose on Linux.
ifeq ($(OS),Linux)
DPDK_LIB += -ldl