From: Haomai Wang Date: Mon, 4 Jan 2016 15:55:00 +0000 (+0800) Subject: configure.ac: fix spdk external header location X-Git-Tag: v10.0.4~81^2~44 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ba5973f7ff3a8b11d5438736a03077a049e1693f;p=ceph.git configure.ac: fix spdk external header location Signed-off-by: Haomai Wang --- diff --git a/configure.ac b/configure.ac index 9175d052aaaa..b0526708fc8b 100644 --- a/configure.ac +++ b/configure.ac @@ -724,12 +724,13 @@ fi # # SPDK # -AC_ARG_ENABLE(spdk, +AC_ARG_WITH(spdk, [AC_HELP_STRING([--with-spdk], [build Ceph SPDK Support])], [], [with_spdk=no]) -AM_CONDITIONAL(HAVE_SPDK, [test "x$with_spdk" = "xyes"]) +AM_CONDITIONAL(HAVE_SPDK, [test "x$with_spdk" != "xno"]) -if test "x$with_spdk" = x"yes"; then +if test "x$with_spdk" != x"no"; then + CPPFLAGS="$CPPFLAGS -I$with_spdk/include" AC_CHECK_HEADER([spdk/nvme.h], [], AC_MSG_ERROR([Cannot find header 'spdk/nvme.h'.])) AC_CHECK_LIB([spdk_nvme], [nvme_attach], [], AC_MSG_FAILURE([SPDK nvme_attach not found])) diff --git a/src/os/Makefile.am b/src/os/Makefile.am index ac11b8bd25ae..25f33964f7f5 100644 --- a/src/os/Makefile.am +++ b/src/os/Makefile.am @@ -121,6 +121,8 @@ noinst_HEADERS += os/fs/ZFS.h endif if HAVE_SPDK +libos_a_CXXFLAGS = ${AM_CXXFLAGS} -I ${with_spdk}/include -fPIC +libos_a_LIBADD += "-lspdk_nvme -lpciaccess -lpthread -lrte_eal -lrte_mempool -lrte_ring" libos_a_SOURCES += os/bluestore/NVMEDevice.cc noinst_HEADERS += os/bluestore/NVMEDevice.h endif diff --git a/src/os/bluestore/BlockDevice.cc b/src/os/bluestore/BlockDevice.cc index 528d71114ded..abe1dfffd44c 100644 --- a/src/os/bluestore/BlockDevice.cc +++ b/src/os/bluestore/BlockDevice.cc @@ -14,7 +14,7 @@ * */ -#include "BlockDevice.h" +#include "KernelDevice.h" #if defined(HAVE_SPDK) #include "NVMEDevice.h" #endif diff --git a/src/os/bluestore/NVMEDevice.h b/src/os/bluestore/NVMEDevice.h index b257f9348b2b..bc0534b3de7e 100644 --- a/src/os/bluestore/NVMEDevice.h +++ b/src/os/bluestore/NVMEDevice.h @@ -17,6 +17,10 @@ #ifndef CEPH_OS_BLUESTORE_NVMEDEVICE #define CEPH_OS_BLUESTORE_NVMEDEVICE +#include + +#include "spdk/nvme.h" + #include "BlockDevice.h" class NVMEDevice : public BlockDevice {