]>
Commit | Line | Data |
---|---|---|
81eedcae TL |
1 | #!/usr/bin/env bash |
2 | set -x | |
7c673cae FG |
3 | git submodule update --init --recursive |
4 | if test -e build; then | |
5 | echo 'build dir already exists; rm -rf build and re-run' | |
6 | exit 1 | |
7 | fi | |
31f18b77 | 8 | |
11fdf7f2 TL |
9 | PYBUILD="2" |
10 | source /etc/os-release | |
11 | case "$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 | ;; | |
27 | esac | |
28 | if [ "$PYBUILD" = "3" ] ; then | |
29 | ARGS="$ARGS -DWITH_PYTHON2=OFF -DWITH_PYTHON3=ON -DMGR_PYTHON_VERSION=3" | |
30 | fi | |
31 | ||
32 | if type ccache > /dev/null 2>&1 ; then | |
31f18b77 | 33 | echo "enabling ccache" |
c07f9fc5 | 34 | ARGS="$ARGS -DWITH_CCACHE=ON" |
31f18b77 | 35 | fi |
11fdf7f2 TL |
36 | if [ -n "$WITH_RADOSGW_AMQP_ENDPOINT" ] ; then |
37 | ARGS="$ARGS -DWITH_RADOSGW_AMQP_ENDPOINT=$WITH_RADOSGW_AMQP_ENDPOINT" | |
38 | fi | |
31f18b77 | 39 | |
7c673cae FG |
40 | mkdir build |
41 | cd build | |
11fdf7f2 TL |
42 | if type cmake3 > /dev/null 2>&1 ; then |
43 | CMAKE=cmake3 | |
44 | else | |
45 | CMAKE=cmake | |
46 | fi | |
47 | ${CMAKE} -DCMAKE_BUILD_TYPE=Debug $ARGS "$@" .. || exit 1 | |
7c673cae FG |
48 | |
49 | # minimal config to find plugins | |
50 | cat <<EOF > ceph.conf | |
51 | plugin dir = lib | |
52 | erasure code dir = lib | |
53 | EOF | |
54 | ||
7c673cae | 55 | echo done. |
11fdf7f2 TL |
56 | cat <<EOF |
57 | ||
58 | **** | |
59 | WARNING: do_cmake.sh now creates debug builds by default. Performance | |
60 | may be severely affected. Please use -DCMAKE_BUILD_TYPE=RelWithDebInfo | |
61 | if a performance sensitive build is required. | |
62 | **** | |
63 | EOF |