Commit f62a37b2 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

env_dpdk: use detected include file path



env.mk already detects the location of the include path (which may or
may not have 'dpdk' in the name depending on the DPDK version), so put
that into a DPDK_INC_DIR variable and use it in the libnuma check so we
find the correct rte_config.h location.

Also check if rte_config.h exists before trying to pass it to grep -
this prevents error messages when running 'make clean' using the dpdk
submodule, because the rte_config.h file is removed before the other
SPDK directories get a chance to run 'make clean'.

Change-Id: I903c9f5801c04302407b2217723466cd6883fbda
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/378163


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJohn Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 34162e72
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -50,10 +50,11 @@ export DPDK_ABS_DIR = $(abspath $(DPDK_DIR))
endif

ifneq (, $(wildcard $(DPDK_ABS_DIR)/include/rte_config.h))
DPDK_INC = -I$(DPDK_ABS_DIR)/include
DPDK_INC_DIR := $(DPDK_ABS_DIR)/include
else
DPDK_INC = -I$(DPDK_ABS_DIR)/include/dpdk
DPDK_INC_DIR := $(DPDK_ABS_DIR)/include/dpdk
endif
DPDK_INC := -I$(DPDK_INC_DIR)

ifneq (, $(wildcard $(DPDK_ABS_DIR)/lib/librte_eal.a))
DPDK_LIB_EXT = .a
@@ -83,9 +84,11 @@ ENV_DPDK_FILE = $(call spdk_lib_list_to_files,env_dpdk)
ENV_LIBS = $(ENV_DPDK_FILE) $(DPDK_LIB)
ENV_LINKER_ARGS = $(ENV_DPDK_FILE) -Wl,--start-group -Wl,--whole-archive $(DPDK_LIB) -Wl,--end-group -Wl,--no-whole-archive

ifneq (,$(shell grep "define RTE_LIBRTE_VHOST_NUMA 1" $(DPDK_DIR)/include/rte_config.h))
ifneq (,$(wildcard $(DPDK_INC_DIR)/rte_config.h))
ifneq (,$(shell grep "define RTE_LIBRTE_VHOST_NUMA 1" $(DPDK_INC_DIR)/rte_config.h))
ENV_LINKER_ARGS += -lnuma
endif
endif

ifeq ($(OS),Linux)
ENV_LINKER_ARGS += -ldl