From f62a37b22f783d9881fe77166df923ee45c16b6d Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 12 Sep 2017 09:09:33 -0700 Subject: [PATCH] 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: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/378163 Tested-by: SPDK Automated Test System Reviewed-by: John Kariuki Reviewed-by: Jim Harris --- lib/env_dpdk/env.mk | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/env_dpdk/env.mk b/lib/env_dpdk/env.mk index 5d09bcfdf..66274692a 100644 --- a/lib/env_dpdk/env.mk +++ b/lib/env_dpdk/env.mk @@ -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