From 3d712b67815cfabbc21288d11db67c7804a5ec86 Mon Sep 17 00:00:00 2001 From: Willem Jan Withagen Date: Sun, 2 Apr 2017 02:08:51 +0200 Subject: [PATCH] build: let FreeBSD build ceph-fuse Signed-off-by: Willem Jan Withagen --- do_freebsd.sh | 24 +++++++++++------------- install-deps.sh | 1 + src/CMakeLists.txt | 30 ++++++++++++++++-------------- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/do_freebsd.sh b/do_freebsd.sh index c07761329356..bf9007488f06 100755 --- a/do_freebsd.sh +++ b/do_freebsd.sh @@ -12,14 +12,6 @@ fi if [ x"$1"x = x"--deps"x ]; then sudo ./install-deps.sh fi -if [ -x /usr/bin/getopt ] && [ x"`/usr/bin/getopt -v`"x == x" --"x ]; then - echo fix getopt path - echo Native FreeBSD getopt is not compatible with the Linux getopt that is - echo expected with Ceph. - echo Easiest is to rename/remove /usr/bin/getopt. - echo mv /usr/bin/getopt /usr/bin/getopt.freebsd - exit 1 -fi if [ x"$CEPH_DEV"x != xx ]; then BUILDOPTS="$BUILDOPTS V=1 VERBOSE=1" @@ -39,18 +31,24 @@ rm -rf build && ./do_cmake.sh "$*" \ -D WITH_SYSTEM_BOOST=ON \ -D WITH_LTTNG=OFF \ -D WITH_BLKID=OFF \ - -D WITH_FUSE=OFF \ + -D WITH_FUSE=ON \ -D WITH_KRBD=OFF \ -D WITH_XFS=OFF \ -D WITH_KVS=OFF \ - -D WITH_MANPAGE=ON \ -D CEPH_MAN_DIR=man \ -D WITH_LIBCEPHFS=OFF \ -D WITH_CEPHFS=OFF \ -D WITH_EMBEDDED=OFF \ + -D WITH_MGR=YES \ 2>&1 | tee cmake.log -cd build -gmake -j$NPROC $BUILDOPTS -gmake check +echo start building +date +(cd build; gmake -j$NPROC $BUILDOPTS ) +(cd build; gmake -j$NPROC $BUILDOPTS ceph-disk) +(cd build; gmake -j$NPROC $BUILDOPTS ceph-detect-init) + +echo start testing +date +(cd build; ctest -j$NPROC || ctest --rerun-failed --output-on-failure) diff --git a/install-deps.sh b/install-deps.sh index 7f190fb51cde..e425bf4eadbd 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -57,6 +57,7 @@ if [ x`uname`x = xFreeBSDx ]; then www/py-flask \ www/fcgi \ sysutils/flock \ + sysutils/fusefs-libs \ exit else diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 33cfbb8c9a03..5eabb6515d12 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,8 +24,9 @@ set(prefix ${CMAKE_INSTALL_PREFIX}) add_definitions("-DCEPH_LIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\"") add_definitions("-DCEPH_PKGLIBDIR=\"${CMAKE_INSTALL_FULL_PKGLIBDIR}\"") add_definitions("-DHAVE_CONFIG_H -D__CEPH__ -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS") +add_definitions("-D_FILE_OFFSET_BITS=64") if(LINUX) - add_definitions("-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64") + add_definitions("-D_GNU_SOURCE") endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wtype-limits -Wignored-qualifiers -Winit-self") @@ -912,8 +913,9 @@ if(WITH_LIBCEPHFS OR WITH_KRBD) add_library(parse_secret_objs OBJECT ${parse_secret_files}) endif() +add_subdirectory(client) + if(WITH_LIBCEPHFS) - add_subdirectory(client) set(libcephfs_srcs libcephfs.cc) add_library(cephfs ${CEPH_SHARED} ${libcephfs_srcs}) target_link_libraries(cephfs LINK_PRIVATE client ceph-common @@ -949,20 +951,20 @@ if(WITH_LIBCEPHFS) install(TARGETS ceph-syn DESTINATION bin) install(TARGETS mount.ceph DESTINATION ${CMAKE_INSTALL_SBINDIR}) - - if(WITH_FUSE) - set(ceph_fuse_srcs - ceph_fuse.cc - client/fuse_ll.cc) - add_executable(ceph-fuse ${ceph_fuse_srcs}) - target_link_libraries(ceph-fuse ${ALLOC_LIBS} ${FUSE_LIBRARIES} - client common global-static) - set_target_properties(ceph-fuse PROPERTIES COMPILE_FLAGS "-I${FUSE_INCLUDE_DIRS}") - install(TARGETS ceph-fuse DESTINATION bin) - install(PROGRAMS mount.fuse.ceph DESTINATION ${CMAKE_INSTALL_SBINDIR}) - endif(WITH_FUSE) endif(WITH_LIBCEPHFS) +if(WITH_FUSE) + set(ceph_fuse_srcs + ceph_fuse.cc + client/fuse_ll.cc) + add_executable(ceph-fuse ${ceph_fuse_srcs}) + target_link_libraries(ceph-fuse ${ALLOC_LIBS} ${FUSE_LIBRARIES} + client common global-static) + set_target_properties(ceph-fuse PROPERTIES COMPILE_FLAGS "-I${FUSE_INCLUDE_DIRS}") + install(TARGETS ceph-fuse DESTINATION bin) + install(PROGRAMS mount.fuse.ceph DESTINATION ${CMAKE_INSTALL_SBINDIR}) +endif(WITH_FUSE) + add_subdirectory(journal) if(WITH_RBD) -- 2.47.3