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