ceph/do_cmake.sh
Alan Somers 44c6a47fb6 do_{cmake,freebsd}: Don't invoke nproc(1) on FreeBSD
Use sysctl(8) instead.  Also, there's no longer any need for /bin/bash
on FreeBSD.

Signed-off-by: Alan Somers <asomers@gmail.com>
2017-09-25 16:24:06 -06:00

29 lines
549 B
Bash
Executable File

#!/bin/sh -x
git submodule update --init --recursive
if test -e build; then
echo 'build dir already exists; rm -rf build and re-run'
exit 1
fi
ARGS=""
if which ccache ; then
echo "enabling ccache"
ARGS="$ARGS -DWITH_CCACHE=ON"
fi
mkdir build
cd build
NPROC=${NPROC:-$(nproc)}
cmake -DBOOST_J=$NPROC $ARGS "$@" ..
# minimal config to find plugins
cat <<EOF > ceph.conf
plugin dir = lib
erasure code dir = lib
EOF
# give vstart a (hopefully) unique mon port to start with
echo $(( RANDOM % 1000 + 40000 )) > .ceph_port
echo done.