cpp-cheat/configure
2017-11-18 14:12:31 +00:00

41 lines
650 B
Bash
Executable File

#!/usr/bin/env bash
travis=false
y=''
while getopts t OPT; do
case "$OPT" in
t)
travis=true
y='-y'
;;
esac
done
shift $(($OPTIND - 1))
if "$travis"; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
fi
sudo apt-get update $y
cmd="sudo apt-get install $y \
build-essential \
gfortran \
libncurses5-dev \
python-software-properties \
"
if "$travis"; then
cmd="$cmd \
gcc-7 \
g++-7 \
"
else
cmd="$cmd \
gcc \
g++ \
"
fi
echo "$cmd"
eval "$cmd"
if "$travis"; then
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 50
fi