Makefile: let spdk/dpdk libraries linked in upper layer

Signed-off-by: Haomai Wang <haomai@xsky.com>
This commit is contained in:
Haomai Wang 2016-01-05 13:54:00 +08:00
parent f911e2bf94
commit 5aa1c86f96
3 changed files with 7 additions and 4 deletions

View File

@ -727,14 +727,14 @@ fi
AC_ARG_WITH(spdk,
[AC_HELP_STRING([--with-spdk], [build Ceph SPDK Support])], [], [with_spdk=no])
AM_CONDITIONAL(HAVE_SPDK, [test "x$with_spdk" != "xno"])
AM_CONDITIONAL(WITH_SPDK, [test "x$with_spdk" != "xno"])
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]))
SPDK_LIBS="-lspdk_nvme"
AC_DEFINE([HAVE_SPDK], [1], [SPDK conditional compilation])
AC_SUBST(SPDK_LIBS)
fi

View File

@ -233,6 +233,10 @@ if WITH_LIBZFS
LIBOS += libos_zfs.a -lzfs
endif # WITH_LIBZFS
if WITH_SPDK
LIBOS += -lpciaccess -lspdk_nvme -lspdk_util -lspdk_memory -lrte_eal -lrte_mempool -lrte_ring
endif # WITH_SPDK
if WITH_TCMALLOC_MINIMAL
LIBPERFGLUE += -ltcmalloc_minimal
endif # WITH_TCMALLOC_MINIMAL

View File

@ -120,9 +120,8 @@ noinst_LIBRARIES += libos_zfs.a
noinst_HEADERS += os/fs/ZFS.h
endif
if HAVE_SPDK
if WITH_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