From d0b2448b63255fb5ca0db8fcd4daf99a66b9230e Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Fri, 19 Feb 2021 17:31:12 +0800 Subject: [PATCH] mk/libvfio-user: support --with-vfio-user=/usr/path Users may not use SPDK libvfio-user submodule, so add a library path for this case, users can still just use '--with-vfio-user' without adding the path, for this case a submodule default path will be used. Change-Id: Ib0dd82ab6910056ff21b5b2d373c0d16916162c6 Signed-off-by: Changpeng Liu Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6471 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Thanos Makatos --- CONFIG | 1 + configure | 8 +++++++- mk/spdk.common.mk | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CONFIG b/CONFIG index b5fffae55..1f99a8b5b 100644 --- a/CONFIG +++ b/CONFIG @@ -122,6 +122,7 @@ CONFIG_VIRTIO=y # Build custom vfio-user transport for NVMf target and NVMe initiator. CONFIG_VFIO_USER=n +CONFIG_VFIO_USER_DIR= # Build with PMDK backends CONFIG_PMDK=n diff --git a/configure b/configure index e7c92ad73..0316ed389 100755 --- a/configure +++ b/configure @@ -59,7 +59,7 @@ function usage() { echo " virtio Build vhost initiator and virtio-pci bdev modules." echo " No path required." echo " vfio-user Build custom vfio-user transport for NVMf target and NVMe initiator." - echo " No path required." + echo " example: /usr/src/libvfio-user" echo " pmdk Build persistent memory bdev." echo " example: /usr/share/pmdk" echo " reduce Build vbdev compression module." @@ -340,6 +340,12 @@ for i in "$@"; do ;; --with-vfio-user) CONFIG[VFIO_USER]=y + CONFIG[VFIO_USER_DIR]="" + ;; + --with-vfio-user=*) + CONFIG[VFIO_USER]=y + check_dir "$i" + CONFIG[VFIO_USER_DIR]=$(readlink -f ${i#*=}) ;; --without-vfio-user) CONFIG[VFIO_USER]=n diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk index c78b42f17..e8bb0ffdd 100644 --- a/mk/spdk.common.mk +++ b/mk/spdk.common.mk @@ -171,8 +171,12 @@ SYS_LIBS += -L$(ISAL_DIR)/.libs -lisal COMMON_CFLAGS += -I$(ISAL_DIR)/.. endif -VFIO_USER_DIR=$(SPDK_ROOT_DIR)/libvfio-user ifeq ($(CONFIG_VFIO_USER), y) +ifneq ($(CONFIG_VFIO_USER_DIR),) +VFIO_USER_DIR=$(CONFIG_VFIO_USER_DIR) +else +VFIO_USER_DIR=$(SPDK_ROOT_DIR)/libvfio-user +endif ifeq ($(CONFIG_DEBUG), y) VFIO_USER_BUILD_TYPE=dbg else