From: Daniel Gryniewicz Date: Mon, 21 Sep 2015 16:18:43 +0000 (-0400) Subject: CMake - add check for XFS X-Git-Tag: v9.1.0~84^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3570dd562534fbf5d4344dc5f480ebadb02e5d14;p=ceph.git CMake - add check for XFS Signed-off-by: Daniel Gryniewicz --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b41278734b3..d9b37fb5991 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,12 @@ set(HAVE_LIBFUSE ${FUSE_FOUND}) CHECK_FUNCTION_EXISTS(fuse_getgroups HAVE_FUSE_GETGROUPS) endif(${WITH_FUSE}) +option(WITH_XFS "XFS is here" ON) +if(${WITH_XFS}) +find_package(xfs) +set(HAVE_XFS ${XFS_FOUND}) +endif(${WITH_XFS}) + find_package(blkid REQUIRED) set(HAVE_LIBBLKID ${BLKID_FOUND}) diff --git a/cmake/modules/Findxfs.cmake b/cmake/modules/Findxfs.cmake new file mode 100644 index 00000000000..ecbf91c0597 --- /dev/null +++ b/cmake/modules/Findxfs.cmake @@ -0,0 +1,33 @@ +# Try to find xfs +# Once done, this will define +# +# XFS_FOUND - system has Profiler +# XFS_INCLUDE_DIR - the Profiler include directories +# XFS_LIBRARIES - link these to use Profiler + +if(XFS_INCLUDE_DIR AND XFS_LIBRARIES) + set(XFS_FIND_QUIETLY TRUE) +endif(XFS_INCLUDE_DIR AND XFS_LIBRARIES) + +INCLUDE(CheckCXXSymbolExists) + +# include dir + +find_path(XFS_INCLUDE_DIR xfs.h NO_DEFAULT_PATH PATHS + /usr/include + /usr/include/xfs + /opt/local/include + /usr/local/include +) + + +# finally the library itself +find_library(LIBXFS NAMES handle) +set(XFS_LIBRARIES ${LIBXFS}) + +# handle the QUIETLY and REQUIRED arguments and set XFS_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(xfs DEFAULT_MSG XFS_LIBRARIES XFS_INCLUDE_DIR) + +mark_as_advanced(XFS_LIBRARIES XFS_INCLUDE_DIR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 582d4b9ad33..058f52084b6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -547,6 +547,11 @@ target_link_libraries(ceph-mon mon boost_thread common os global ${EXTRALIBS} install(TARGETS ceph-mon DESTINATION bin) # OSD +if(${HAVE_XFS}) + set(libos_xfs_srcs + os/XfsFileStoreBackend.cc + os/fs/XFS.cc) +endif(${HAVE_XFS}) set(libos_srcs os/FileJournal.cc os/FileStore.cc @@ -562,7 +567,6 @@ set(libos_srcs os/GenericFileStoreBackend.cc os/BtrfsFileStoreBackend.cc os/ZFSFileStoreBackend.cc - os/XfsFileStoreBackend.cc os/KeyValueStore.cc os/KeyValueDB.cc os/MemStore.cc @@ -571,7 +575,8 @@ set(libos_srcs os/newstore/NewStore.cc os/newstore/newstore_types.cc os/fs/FS.cc - os/fs/XFS.cc) + ${libos_xfs_srcs}) + set(os_mon_files os/LevelDBStore.cc) add_library(os_mon_objs OBJECT ${os_mon_files})