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.