From 27b920a2a4fed59b6a2a2a88b6c04c4019aa4312 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Thu, 4 Jul 2019 21:51:04 +0200 Subject: [PATCH] configure: unset CONFIG_VHOST on BSD Remove linux #ifdefs from the vhost code and just implicitly disable CONFIG_VHOST for BSD systems. This serves as cleanup. Change-Id: I8b0e0e8f80478f50ca8586cc974f7afcee2566f0 Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460562 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- app/spdk_tgt/spdk_tgt.c | 5 ----- configure | 11 +++++++++++ lib/Makefile | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/spdk_tgt/spdk_tgt.c b/app/spdk_tgt/spdk_tgt.c index 2dde2f47f..03f3098cd 100644 --- a/app/spdk_tgt/spdk_tgt.c +++ b/app/spdk_tgt/spdk_tgt.c @@ -38,11 +38,6 @@ #include "spdk/event.h" #include "spdk/vhost.h" -/* TODO: this should be handled by configure */ -#if defined(SPDK_CONFIG_VHOST) && !defined(__linux__) -#undef SPDK_CONFIG_VHOST -#endif - #ifdef SPDK_CONFIG_VHOST #define SPDK_VHOST_OPTS "S:" #else diff --git a/configure b/configure index a1abdf342..005c5f4dc 100755 --- a/configure +++ b/configure @@ -431,6 +431,17 @@ if [[ "$OSTYPE" == "freebsd"* ]]; then fi fi +if [[ "$OSTYPE" == "freebsd"* ]]; then + if [[ "${CONFIG[VHOST]}" == "y" ]]; then + echo "Vhost is only supported on Linux. Disabling it." + CONFIG[VHOST]="n" + fi + if [[ "${CONFIG[VIRTIO]}" == "y" ]]; then + echo "Virtio is only supported on Linux. Disabling it." + CONFIG[VIRTIO]="n" + fi +fi + if [ "${CONFIG[RDMA]}" = "y" ]; then if ! echo -e '#include \n#include \n' \ 'int main(void) { return 0; }\n' \ diff --git a/lib/Makefile b/lib/Makefile index 6a7732015..0c7a45f79 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -39,10 +39,10 @@ DIRS-y += bdev blob blobfs conf copy event json jsonrpc \ ut_mock iscsi notify ifeq ($(OS),Linux) DIRS-y += nbd ftl -DIRS-$(CONFIG_VHOST) += vhost -DIRS-$(CONFIG_VIRTIO) += virtio endif +DIRS-$(CONFIG_VHOST) += vhost +DIRS-$(CONFIG_VIRTIO) += virtio DIRS-$(CONFIG_REDUCE) += reduce # If CONFIG_ENV is pointing at a directory in lib, build it.