Skip to content

Instantly share code, notes, and snippets.

@datoubanzhuan
Forked from abhishekcs10/install-gcc-5.4.0.sh
Last active June 17, 2022 07:09
Show Gist options
  • Save datoubanzhuan/0e77c01226216424f75a02c3ed936dfa to your computer and use it in GitHub Desktop.
Save datoubanzhuan/0e77c01226216424f75a02c3ed936dfa to your computer and use it in GitHub Desktop.
Install GCC 5.4.0
#!/bin/bash
# this script installs GCC 5.4.0
# to use it navigate to your home directory and type:
# sh install-gcc-5.4.0.sh
# download and install gcc 4.9.3
wget https://github.com/gcc-mirror/gcc/archive/gcc-5_4_0-release.tar.gz
tar xzf gcc-5_4_0-release.tar.gz
cd gcc-5_4_0-release
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
../gcc-5_4_0-release/configure --prefix=$HOME/gcc-5.4.0 --disable-nls --enable-languages=c,c++ --with-ld=/bin/ld --with-nm=/bin/nm --with-as=/usr/bin/as --disable-multilib
make
# install
make install
# clean up
rm -rf ~/objdir
rm -f ~/gcc-5_4_0-release.tar.gz
# add to path (you may want to add these lines to $HOME/.bash_profile)
export PATH=$HOME/gcc-5.4.0/bin:$PATH
export LD_LIBRARY_PATH=$HOME/gcc-5.4.0/lib:$HOME/gcc-5.4.0/lib64:$LD_LIBRARY_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment