]> git.proxmox.com Git - ceph.git/blobdiff - ceph/do_cmake.sh
update ceph source to reef 18.1.2
[ceph.git] / ceph / do_cmake.sh
index 3eb9b08d8afd95531e26aae2f954690afffd0c0d..50274547fbf995795d11e2bd070fd72f4a941aa3 100755 (executable)
@@ -42,6 +42,13 @@ if [ -r /etc/os-release ]; then
           ARGS+=" -DWITH_RADOSGW_AMQP_ENDPOINT=OFF"
           ARGS+=" -DWITH_RADOSGW_KAFKA_ENDPOINT=OFF"
           ;;
+      ubuntu)
+          MAJOR_VER=$(echo "$VERSION_ID" | sed -e 's/\..*$//')
+          if [ "$MAJOR_VER" -ge "22" ] ; then
+              PYBUILD="3.10"
+          fi
+          ;;
+
   esac
 elif [ "$(uname)" == FreeBSD ] ; then
   PYBUILD="3"
@@ -59,6 +66,19 @@ if type ccache > /dev/null 2>&1 ; then
     ARGS+=" -DWITH_CCACHE=ON"
 fi
 
+cxx_compiler="g++"
+c_compiler="gcc"
+# 20 is used for more future-proof
+for i in $(seq 20 -1 11); do
+  if type -t gcc-$i > /dev/null; then
+    cxx_compiler="g++-$i"
+    c_compiler="gcc-$i"
+    break
+  fi
+done
+ARGS+=" -DCMAKE_CXX_COMPILER=$cxx_compiler"
+ARGS+=" -DCMAKE_C_COMPILER=$c_compiler"
+
 mkdir $BUILD_DIR
 cd $BUILD_DIR
 if type cmake3 > /dev/null 2>&1 ; then