]> git.proxmox.com Git - ceph.git/blame - ceph/do_cmake.sh
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / do_cmake.sh
CommitLineData
7c673cae
FG
1#!/bin/sh -x
2git submodule update --init --recursive
3if test -e build; then
4 echo 'build dir already exists; rm -rf build and re-run'
5 exit 1
6fi
31f18b77 7
11fdf7f2
TL
8PYBUILD="2"
9source /etc/os-release
10case "$ID" in
11 fedora)
12 if [ "$VERSION_ID" -ge "29" ] ; then
13 PYBUILD="3"
14 fi
15 ;;
16 rhel|centos)
17 MAJOR_VER=$(echo "$VERSION_ID" | sed -e 's/\..*$//')
18 if [ "$MAJOR_VER" -ge "8" ] ; then
19 PYBUILD="3"
20 fi
21 ;;
22 opensuse*|suse|sles)
23 PYBUILD="3"
24 WITH_RADOSGW_AMQP_ENDPOINT="OFF"
25 ;;
26esac
27if [ "$PYBUILD" = "3" ] ; then
28 ARGS="$ARGS -DWITH_PYTHON2=OFF -DWITH_PYTHON3=ON -DMGR_PYTHON_VERSION=3"
29fi
30
31if type ccache > /dev/null 2>&1 ; then
31f18b77 32 echo "enabling ccache"
c07f9fc5 33 ARGS="$ARGS -DWITH_CCACHE=ON"
31f18b77 34fi
11fdf7f2
TL
35if [ -n "$WITH_RADOSGW_AMQP_ENDPOINT" ] ; then
36 ARGS="$ARGS -DWITH_RADOSGW_AMQP_ENDPOINT=$WITH_RADOSGW_AMQP_ENDPOINT"
37fi
31f18b77 38
7c673cae
FG
39mkdir build
40cd build
11fdf7f2
TL
41if type cmake3 > /dev/null 2>&1 ; then
42 CMAKE=cmake3
43else
44 CMAKE=cmake
45fi
46${CMAKE} -DCMAKE_BUILD_TYPE=Debug $ARGS "$@" .. || exit 1
7c673cae
FG
47
48# minimal config to find plugins
49cat <<EOF > ceph.conf
50plugin dir = lib
51erasure code dir = lib
52EOF
53
7c673cae 54echo done.
11fdf7f2
TL
55cat <<EOF
56
57****
58WARNING: do_cmake.sh now creates debug builds by default. Performance
59may be severely affected. Please use -DCMAKE_BUILD_TYPE=RelWithDebInfo
60if a performance sensitive build is required.
61****
62EOF