2016-03-24 11:47:34 +00:00
|
|
|
#!/bin/sh -xve
|
|
|
|
NPROC=`sysctl -n hw.ncpu`
|
|
|
|
|
2016-11-20 21:17:15 +00:00
|
|
|
# we need bash first otherwise almost nothing will work
|
|
|
|
if [ ! -L /bin/bash ]; then
|
|
|
|
echo install bash and link /bin/bash to /usr/local/bin/bash
|
|
|
|
echo Run:
|
|
|
|
echo sudo pkg install bash
|
|
|
|
echo ln -s /usr/local/bin/bash /bin/bash
|
|
|
|
exit 1
|
|
|
|
fi
|
2016-03-24 11:47:34 +00:00
|
|
|
if [ x"$1"x = x"--deps"x ]; then
|
|
|
|
sudo ./install-deps.sh
|
|
|
|
fi
|
2016-11-20 21:17:15 +00:00
|
|
|
if ! grep -q ENODATA /usr/include/errno.h; then
|
|
|
|
echo Need ENODATA in /usr/include/errno.h for cython compilations
|
|
|
|
echo Please add it manually after ENOATTR with value 87
|
|
|
|
echo '#define ENOATTR 87'
|
|
|
|
exit 1
|
|
|
|
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"
|
|
|
|
CXX_FLAGS_DEBUG="-DCEPH_DEV"
|
|
|
|
C_FLAGS_DEBUG="-DCEPH_DEV"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# To test with a new release Clang, use with cmake:
|
|
|
|
# -D CMAKE_CXX_COMPILER="/usr/local/bin/clang++-devel" \
|
|
|
|
# -D CMAKE_C_COMPILER="/usr/local/bin/clang-devel" \
|
|
|
|
|
2016-09-15 06:16:57 +00:00
|
|
|
rm -rf build && ./do_cmake.sh "$*" \
|
|
|
|
-D CMAKE_BUILD_TYPE=Debug \
|
2016-11-20 21:17:15 +00:00
|
|
|
-D CMAKE_CXX_FLAGS_DEBUG="$CXX_FLAGS_DEBUG -O0 -g" \
|
|
|
|
-D CMAKE_C_FLAGS_DEBUG="$C_FLAGS_DEBUG -O0 -g" \
|
2016-09-15 06:16:57 +00:00
|
|
|
-D ENABLE_GIT_VERSION=OFF \
|
2016-12-02 10:11:57 +00:00
|
|
|
-D WITH_SYSTEM_BOOST=ON \
|
2016-10-19 08:58:22 +00:00
|
|
|
-D WITH_LTTNG=OFF \
|
2016-11-20 21:17:15 +00:00
|
|
|
-D WITH_BLKID=OFF \
|
2016-09-15 06:16:57 +00:00
|
|
|
-D WITH_FUSE=OFF \
|
|
|
|
-D WITH_RBD=OFF \
|
|
|
|
-D WITH_XFS=OFF \
|
|
|
|
-D WITH_KVS=OFF \
|
|
|
|
-D WITH_MANPAGE=OFF \
|
|
|
|
-D WITH_LIBCEPHFS=OFF \
|
|
|
|
-D WITH_CEPHFS=OFF \
|
|
|
|
2>&1 | tee cmake.log
|
|
|
|
|
|
|
|
cd build
|
2016-11-20 21:17:15 +00:00
|
|
|
gmake -j$NPROC $BUILDOPTS
|
|
|
|
gmake check
|
2016-03-24 11:47:34 +00:00
|
|
|
|