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