ceph/do_cmake.sh
Nathan Cutler 7a17722d45 build/ops: do_cmake.sh: get rid of which dependency
"which" is not available on minimal systems, whereas "type" is a shell builtin,
so the chances of the command "just working" are greater with type than with
which.

In other parts of Ceph build/ops we have replaced "which" with "type" to good
effect.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2018-04-23 10:50:04 +02:00

25 lines
451 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
if type ccache > /dev/null 2>&1 ; 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
echo done.