$SUDO ln -nsf /usr/bin/g++ /usr/bin/$(uname -m)-linux-gnu-g++
}
+function install_pkg_on_ubuntu {
+ local project=$1
+ shift
+ local sha1=$1
+ shift
+ local codename=$1
+ shift
+ local pkgs=$@
+ local missing_pkgs
+ for pkg in $pkgs; do
+ if ! dpkg -s $pkg &> /dev/null; then
+ missing_pkgs+=" $pkg"
+ fi
+ done
+ if test -n "$missing_pkgs"; then
+ local shaman_url="https://shaman.ceph.com/api/repos/${project}/master/${sha1}/ubuntu/${codename}/repo"
+ $SUDO curl --silent --location $shaman_url --output /etc/apt/sources.list.d/$project.list
+ $SUDO env DEBIAN_FRONTEND=noninteractive apt-get update -y -o Acquire::Languages=none -o Acquire::Translation=none || true
+ $SUDO env DEBIAN_FRONTEND=noninteractive apt-get install --allow-unauthenticated -y $missing_pkgs
+ fi
+}
+
function version_lt {
test $1 != $(echo -e "$1\n$2" | sort -rV | head -n 1)
}
;;
*Xenial*)
ensure_decent_gcc_on_ubuntu 7 xenial
+ install_pkg_on_ubuntu \
+ ceph-libboost1.67 \
+ dd38c27740c1f9a9e6719a07eef84a1369dc168b \
+ xenial \
+ ceph-libboost-atomic1.67-dev \
+ ceph-libboost-chrono1.67-dev \
+ ceph-libboost-container1.67-dev \
+ ceph-libboost-context1.67-dev \
+ ceph-libboost-coroutine1.67-dev \
+ ceph-libboost-date-time1.67-dev \
+ ceph-libboost-filesystem1.67-dev \
+ ceph-libboost-iostreams1.67-dev \
+ ceph-libboost-program-options1.67-dev \
+ ceph-libboost-python1.67-dev \
+ ceph-libboost-random1.67-dev \
+ ceph-libboost-regex1.67-dev \
+ ceph-libboost-system1.67-dev \
+ ceph-libboost-thread1.67-dev \
+ ceph-libboost-timer1.67-dev
;;
*)
$SUDO apt-get install -y gcc
fi
}
+function detect_ceph_dev_pkgs() {
+ local cmake_opts
+ local boost_root=/opt/ceph
+ if test -f $boost_root/include/boost/config.hpp; then
+ cmake_opts+=" -DWITH_SYSTEM_BOOST=ON -DBOOST_ROOT=$boost_root"
+ fi
+ echo "$cmake_opts"
+}
+
function run() {
local install_cmd
local which_pkg="which"
if ! type python2 > /dev/null 2>&1 ; then
CMAKE_BUILD_OPTS+=" -DWITH_PYTHON2=OFF -DWITH_PYTHON3=ON -DMGR_PYTHON_VERSION=3"
fi
+ CMAKE_BUILD_OPTS+=$(detect_ceph_dev_pkgs)
cat <<EOM
Note that the binaries produced by this script do not contain correct time
and git version information, which may make them unsuitable for debugging