Skip to content

Instantly share code, notes, and snippets.

@hellok
Last active December 21, 2015 13:48
Show Gist options
  • Save hellok/6314765 to your computer and use it in GitHub Desktop.
Save hellok/6314765 to your computer and use it in GitHub Desktop.
gcc centos
#! /bin/bash
GCC_V='4.6.0'
sudo yum install -y glibc-static libstdc++-static 
wget http://ftp.gnu.org/gnu/gcc/gcc-${GCC_V}/gcc-${GCC_V}.tar.gz  -O gcc-${GCC_V}.tar.gz
tar xzf gcc-${GCC_V}.tar.gz
cd gcc-${GCC_V}
./contrib/download_prerequisites
cd ..
mkdir build_gcc${GCC_V}
cd build_gcc${GCC_V}
../gcc-${GCC_V}/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j23
sudo make install
cd ..
rm -rf build_gcc${GCC_V} gcc-${GCC_V} gcc-${GCC_V}.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment