--- /dev/null
+
+The FreeBSD build will build most of the tools in Ceph.
+Note that the RBD dependant items will not work since FreeBSD does not have RBS
+
+Build Prerequisites
+===================
+
+Compiling and building Ceph is tested on 11-CURRENT
+It uses the CLANG toolset that is available, which needs to be atleast 3.7
+Clang 3.4 (on 10.2-STABLE) does not have all required capabilites to compile everything
+
+The following setup will get things running for FreeBSD:
+
+ - Install bash and link it in /bin
+ # requires root privileges
+ sudo pkg install bash
+ sudo ln -s /usr/local/bin/bash /bin/bash
+
+Building Ceph
+=============
+ - Go and start building
+ ./do_freebsd.sh
+
+Parts not (yet) included:
+=========================
+
+ - RBD kernel client
+ Rados Block Devices is implemented in the Linux kernel
+ It seems that there used to be a userspace implementation first.
+ And perhaps ggated could be used as a template since it does some of the
+ same, other than just between 2 disks. And it has a userspace counterpart.
+ * @trociny suggests:
+ Userspace RBD is available under FreeBSD (both librbd and rbd tool
+ (without linux specific commands) are buildable).
+ - BlueStore.
+ FreeBSD and Linux have different AIO API, and that needs to be made compatible
+ Next to that is there discussion in FreeBSD about aio_cancel not working for all
+ devicetypes
+ - CephFS
+ Cython tries to access an internal field in dirent which does not compile
+
+Tests that verify the correct working of the above are also excluded from the testset
+
+Test not (yet) include:
+=======================
+
+ - ceph-detect-init/run-tox.sh
+ Because the current implementation does not know anything about FreeBSD rc-init.
+ - Tests that make use on nosestests.
+ Calling these doest not really work since nostests is not in /usr/bin, and calling
+ thru /usr/bin/env/nosetests does not work on FreeBSD.
+ test/pybind/test_ceph_argparse.py
+ test/pybind/test_ceph_daemon.py
+
+Things to investigate:
+======================
+
+ - ceph-{osd,mon} need 2 signals before they actually terminate.
+
--- /dev/null
+# Set the FreeBSD specific configure flags
+FREEBSD_CONFIGURE_FLAGS=
+if [ x`uname`x = x"FreeBSD"x ]; then
+ MAKE=gmake
+ # We need at least something > clang 3.4
+ # tested with package clang37 on FreeBSD 10.2 ( Which has 3.4 as default )
+ if clang -v 2>&1 | grep -q "3.8" ; then
+ CC=clang
+ CXX=clang++
+ elif [ -f /usr/local/bin/clang37 ]; then
+ CC=clang37
+ CXX=clang++37
+ else
+ echo "Need a better compiler"
+ exit 1
+ fi
+ CWARN=""
+ CLANGWARN="-Wno-unused-function -Wno-unused-local-typedef -Wno-inconsistent-missing-override"
+ CLANGWARN="$CLANGWARN -Wno-unused-private-field"
+ CLANGWARN="$CLANGWARN -Wno-varargs"
+ CLANGWARN="$CLANGWARN -Wno-gnu-designator"
+
+# "-Wno-unused-local-typedef -Wno-mismatched-tags -Wno-macro-redefined -Wno-unused-function -Wno-unused-label -Wno-undefined-bool-conversion -Wno-unused-private-field -Wno-unused-local-typedef -Wno-uninitialized -Wno-gnu-designator -Wno-inconsistent-missing-override -Wno-deprecated-declarations -Wno-parentheses"
+
+ CFLAGS="-g -I/usr/local/include ${CWARN} ${CLANGWARN}"
+ CXXFLAGS="-g -DGTEST_USE_OWN_TR1_TUPLE=1 -I/usr/local/include ${CWARN} ${CLANGWARN}"
+ LDFLAGS="-g ${LDFLAGS} -L/usr/local/lib -export-dynamic -luuid"
+ FREEBSD_CONFIGURE_FLAGS="
+ --disable-silent-rules
+ --disable-gitversion
+ --with-debug
+ --with-rados
+ --without-rbd
+ --with-radosgw
+ --with-radosstriper
+ --with-mon
+ --with-osd
+ --with-mds
+ --with-radosgw
+ --with-nss
+ --without-tcmalloc
+ --without-libaio
+ --without-libxfs
+ --without-fuse
+ --without-lttng
+ --with-libzfs=no
+ --without-rocksdb
+ --without-cephfs
+ "
+# --without-radosgw
+# --with-gnu-ld
+fi
+
+CONFIGURE_FLAGS="${FREEBSD_CONFIGURE_FLAGS}"
+
+# Export these so that ./configure will pick up
+export MAKE
+export CC
+export CXX
+export CFLAGS
+export CXXFLAGS
+export CONFIGURE_FLAGS
+export LDFLAGS
--- /dev/null
+#!/bin/sh -xve
+NPROC=`sysctl -n hw.ncpu`
+
+if [ x"$1"x = x"--deps"x ]; then
+ # we need bash first otherwise almost nothing will work
+ sudo pkg install bash
+ if [ ! -L /bin/bash ]; then
+ echo linking /bin/bash to /usr/local/bin/bash
+ ln -s /usr/local/bin/bash /bin/bash
+ fi
+ sudo ./install-deps.sh
+fi
+. ./autogen_freebsd.sh
+./autogen.sh
+./configure ${CONFIGURE_FLAGS}
+( cd src/gmock/gtest; patch < /usr/ports/devel/googletest/files/patch-bsd-defines )
+gmake -j$NPROC ENABLE_GIT_VERSION=OFF
+gmake -j$NPROC check ENABLE_GIT_VERSION=OFF CEPH_BUFFER_NO_BENCH=yes
+