Commit a4747c60 authored by Ben Walker's avatar Ben Walker
Browse files

env: Make the environment library configurable.



This allows users to swap out SPDK's third party
libraries for an implementation based on their own
framework.

Change-Id: Ia0b7384ce5e31acba5ad0d7002dec9e95b759c52
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
parent a30b5532
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -43,9 +43,14 @@ CONFIG_COVERAGE?=n
# Build with Address Sanitizer enabled
CONFIG_ADDRESS_SANITIZER?=n

# Directory that contains the desired SPDK environment library.
# By default, this is implemented using DPDK.
CONFIG_ENV?=$(SPDK_ROOT_DIR)/lib/env

# This directory should contain 'include' and 'lib' directories for your DPDK
# installation. Alternatively you can specify this on the command line
# with 'make DPDK_DIR=/path/to/dpdk'.
# with 'make DPDK_DIR=/path/to/dpdk'. This is only a valid entry
# when using the default SPDK environment library.
CONFIG_DPDK_DIR?=/path/to/dpdk

# Header file to use for NVMe implementation specific functions.
+3 −4
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ include $(SPDK_ROOT_DIR)/mk/spdk.modules.mk

APP = iscsi_tgt

CFLAGS += $(DPDK_INC)
CFLAGS += $(ENV_CFLAGS)

# Add iSCSI library directory to include path
# TODO: remove this once iSCSI has a public API header
@@ -57,20 +57,19 @@ SPDK_LIBS = \
	$(SPDK_ROOT_DIR)/lib/trace/libspdk_trace.a \
	$(SPDK_ROOT_DIR)/lib/conf/libspdk_conf.a \
	$(SPDK_ROOT_DIR)/lib/util/libspdk_util.a \
	$(SPDK_ROOT_DIR)/lib/env/libspdk_env.a \
	$(SPDK_ROOT_DIR)/lib/log/libspdk_log.a \
	$(SPDK_ROOT_DIR)/lib/log/rpc/libspdk_log_rpc.a \
	$(SPDK_ROOT_DIR)/lib/event/libspdk_event.a \
	$(SPDK_ROOT_DIR)/lib/event/rpc/libspdk_app_rpc.a \

LIBS += -Wl,--whole-archive $(SPDK_LIBS) -Wl,--no-whole-archive
LIBS += -lcrypto $(DPDK_LIB)
LIBS += -lcrypto $(ENV_LINKER_ARGS)
LIBS += $(BLOCKDEV_MODULES_LINKER_ARGS) \
	$(COPY_MODULES_LINKER_ARGS)

all : $(APP)

$(APP) : $(OBJS) $(SPDK_LIBS)
$(APP) : $(OBJS) $(SPDK_LIBS) $(ENV_LIBS)
	$(LINK_C)

clean :
+3 −4
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ include $(SPDK_ROOT_DIR)/mk/spdk.modules.mk

APP = nvmf_tgt

CFLAGS += $(DPDK_INC)
CFLAGS += $(ENV_CFLAGS)

# Add NVMf library directory to include path
# TODO: remove this once NVMf has a public API header
@@ -53,7 +53,6 @@ SPDK_LIBS = \
	$(SPDK_ROOT_DIR)/lib/trace/libspdk_trace.a \
	$(SPDK_ROOT_DIR)/lib/conf/libspdk_conf.a \
	$(SPDK_ROOT_DIR)/lib/util/libspdk_util.a \
	$(SPDK_ROOT_DIR)/lib/env/libspdk_env.a \
	$(SPDK_ROOT_DIR)/lib/bdev/libspdk_bdev.a \
	$(SPDK_ROOT_DIR)/lib/copy/libspdk_copy.a \
	$(SPDK_ROOT_DIR)/lib/rpc/libspdk_rpc.a \
@@ -71,11 +70,11 @@ ifeq ($(CONFIG_RDMA),y)
LIBS += -libverbs -lrdmacm
endif

LIBS += $(DPDK_LIB)
LIBS += $(ENV_LINKER_ARGS)

all : $(APP)

$(APP) : $(OBJS) $(SPDK_LIBS) $(BLOCKDEV_MODULES) $(LINKER_MODULES)
$(APP) : $(OBJS) $(SPDK_LIBS) $(BLOCKDEV_MODULES) $(LINKER_MODULES) $(ENV_LIBS)
	$(LINK_C)

clean :
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

CXXFLAGS += $(DPDK_INC)
CXXFLAGS += $(ENV_CFLAGS)
CXX_SRCS := trace.cpp

APP = spdk_trace
+3 −4
Original line number Diff line number Diff line
@@ -38,18 +38,17 @@ APP = perf

C_SRCS := perf.c

CFLAGS += -I. $(DPDK_INC)
CFLAGS += -I. $(ENV_CFLAGS)

SPDK_LIBS += $(SPDK_ROOT_DIR)/lib/ioat/libspdk_ioat.a \
	     $(SPDK_ROOT_DIR)/lib/util/libspdk_util.a \
	     $(SPDK_ROOT_DIR)/lib/log/libspdk_log.a \
	     $(SPDK_ROOT_DIR)/lib/env/libspdk_env.a \

LIBS += $(SPDK_LIBS) $(DPDK_LIB)
LIBS += $(SPDK_LIBS) $(ENV_LINKER_ARGS)

all: $(APP)

$(APP): $(OBJS) $(SPDK_LIBS)
$(APP): $(OBJS) $(SPDK_LIBS) $(ENV_LIBS)
	$(LINK_C)

clean:
Loading