安装GMP
cd gmp*;mkdir build && cd build
../configure --prefix=/usr/local/gcc4.9.2 --enable-cxx
make;make install
安装MPFR
cd ../../mpfr*;mkdir build && cd build
../configure --prefix=/usr/local/gcc4.9.2 --with-gmp=/usr/local/gcc4.9.2
make;make install
安装MPC
cd ../../mpc*;mkdir build && cd build
../configure --prefix=/usr/local/gcc4.9.2 --with-gmp=/usr/local/gcc4.9.2 --with-mpfr=/usr/local/gcc4.9.2
make;make install
安装GCC
cd ../../gcc* ;mkdir build && cd build
../configure --prefix=/usr/local/gcc4.9.2 --enable-checking=release --with-gmp=/usr/local/gcc4.9.2 --with-mpfr=/usr/local/gcc4.9.2 --with-mpc=/usr/local/gcc4.9.2 --program-suffix=4.9.2
可以只需要特定语言,可以加个选项:--enable-languages=c,c++,fortran
接着:make最后:make install
配置环境变量export GCC_HOME=/usr/local/gcc4.9.2export PATH=$GCC_HOME/bin:/usr/local/bin:$PG_HOME/bin:$FIREBIRD_HOME/bin:$PATH