summaryrefslogtreecommitdiffstats
path: root/src/ceph/do_cmake.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/ceph/do_cmake.sh')
-rwxr-xr-xsrc/ceph/do_cmake.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ceph/do_cmake.sh b/src/ceph/do_cmake.sh
new file mode 100755
index 0000000..739da8e
--- /dev/null
+++ b/src/ceph/do_cmake.sh
@@ -0,0 +1,27 @@
+#!/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
+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.