# new enough
local old=$(gcc -dumpversion)
local new=$1
- if dpkg --compare-versions $old ge 5.1; then
+ if dpkg --compare-versions $old ge 7.0; then
return
fi
+ if [ ! -f /usr/bin/gcc-${old} ]; then
+ case $(lsb_release --short --codename) in
+ trusty)
+ old=4.8;;
+ xenial)
+ old=5;;
+ esac
+ fi
+ $SUDO update-alternatives --remove-all gcc || true
$SUDO update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-${new} 20 \
--slave /usr/bin/g++ g++ /usr/bin/g++-${new}
$SUDO apt-get install -y lsb-release devscripts equivs
$SUDO apt-get install -y dpkg-dev
case "$VERSION" in
- *Trusty*)
+ *Trusty*|*Xenial*)
$SUDO apt-get install -y software-properties-common
$SUDO add-apt-repository ppa:ubuntu-toolchain-r/test
$SUDO apt-get update