1.简化版:
http://www.cnblogs.com/linbc/archive/2012/08/03/2621169.html
sudo yum install glibc-static libstdc++-static
wget http://ftp.gnu.org/gnu/gcc/gcc-4.7.0/gcc-4.7.0.tar.gz
tar xzf gcc-4.7.0.tar.gz
cd gcc-4.7.0
使用./contrib/download_prerequisites ,他会自动下载,自动编译
./contrib/download_prerequisites
cd ..
mkdir build_gcc4.7
cd build_gcc4.7
../gcc-4.7.0/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j4
sudo make install
参考文件:
http://xiangjie88.iteye.com/blog/1684529
gcc下载参考:
http://download.chinaunix.net/download/0001000/69.shtml