2013-04-17 23:26:01 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-09-17 18:05:10 +08:00
|
|
|
# Change directory to the location of this script
|
|
|
|
cd $(dirname ${BASH_SOURCE[0]})
|
|
|
|
|
2014-02-12 22:01:46 +08:00
|
|
|
if [ ! $(command -v apt-get) ]; then
|
|
|
|
echo "Not a .deb package system. Please install dependencies manually"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2015-01-14 14:22:08 +08:00
|
|
|
#install g++-4.9
|
2016-09-01 16:25:47 +08:00
|
|
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y > /dev/null
|
2015-01-14 14:22:08 +08:00
|
|
|
sudo apt-get update
|
|
|
|
|
2013-04-17 23:26:01 +08:00
|
|
|
DEPENDS='libx11-dev'
|
|
|
|
DEPENDS+=' libxmu-dev'
|
|
|
|
DEPENDS+=' libglu1-mesa-dev'
|
|
|
|
DEPENDS+=' libgl2ps-dev'
|
|
|
|
DEPENDS+=' libxi-dev'
|
2017-01-19 13:55:14 +08:00
|
|
|
DEPENDS+=' gcc-4.9'
|
2015-01-14 14:22:08 +08:00
|
|
|
DEPENDS+=' g++-4.9'
|
2013-04-17 23:26:01 +08:00
|
|
|
DEPENDS+=' libzip-dev'
|
2013-08-06 11:34:48 +08:00
|
|
|
DEPENDS+=' libpng12-dev'
|
2013-04-17 23:26:01 +08:00
|
|
|
DEPENDS+=' libcurl4-gnutls-dev'
|
|
|
|
DEPENDS+=' libfontconfig1-dev'
|
|
|
|
DEPENDS+=' libsqlite3-dev'
|
2015-01-14 14:22:08 +08:00
|
|
|
DEPENDS+=' libglew-dev'
|
2014-02-13 10:08:03 +08:00
|
|
|
DEPENDS+=' libssl-dev'
|
2015-06-06 14:20:16 +08:00
|
|
|
DEPENDS+=' libgtk-3-dev'
|
2017-01-19 13:55:14 +08:00
|
|
|
DEPENDS+=' binutils'
|
2013-04-17 23:26:01 +08:00
|
|
|
|
|
|
|
MISSING=
|
|
|
|
echo "Checking for missing packages ..."
|
|
|
|
for i in $DEPENDS; do
|
|
|
|
if ! dpkg-query -W --showformat='${Status}\n' $i | grep "install ok installed" > /dev/null; then
|
|
|
|
MISSING+="$i "
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -n "$MISSING" ]; then
|
|
|
|
TXTCOLOR_DEFAULT="\033[0;m"
|
|
|
|
TXTCOLOR_GREEN="\033[0;32m"
|
|
|
|
echo -e $TXTCOLOR_GREEN"Missing packages: $MISSING.\nYou may be asked for your password for package installation."$TXTCOLOR_DEFAULT
|
2016-09-01 16:25:47 +08:00
|
|
|
sudo apt-get --force-yes --yes install $MISSING > /dev/null
|
2013-04-17 23:26:01 +08:00
|
|
|
fi
|
|
|
|
|
2017-01-19 13:55:14 +08:00
|
|
|
sudo update-alternatives --remove-all gcc
|
|
|
|
sudo update-alternatives --remove-all g++
|
|
|
|
|
|
|
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60
|
|
|
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 60
|
|
|
|
|
|
|
|
echo "Cocos uses GCC Version: `gcc --version`"
|
|
|
|
echo "Cocos uses G++ Version: `g++ --version`"
|
|
|
|
echo "Cocos uses ld Version: `ld --version`"
|
|
|
|
echo "Cocos uses /usr/bin/ld Version: `/usr/bin/ld --version`"
|
2013-09-17 16:04:44 +08:00
|
|
|
|