1.環境:Linux xxx 2.6.18-371.3.1.el5xen #1 SMP Mon Nov 11 03:28:23 EST 2013 x86_64 x86_64 x86_64 GNU/Linuxjava
2.下載linux
gcc4.8包 gmp包、mpfr包、mpc包(都要安裝)c++
(../configure --prefix=/home/mawanli/work/gcc482 --mandir=/home/mawanli/work/gcc482/man --infodir=/home/mawanli/work/gcc482/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++ --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --build=x86_64-redhat-linux --with-gmp=/home/mawanli/soft/gcc-4.8.2/work/gmpwork/ --with-mpfr=/home/mawanli/soft/gcc-4.8.2/work/mpfrwork/ --with-mpc=/home/mawanli/soft/gcc-4.8.2/work/mpcwork/)app
3.安裝出現問題jvm
3.1 configure: error: cannot compute suffix of object files: cannot compileui
解決:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{$gmppath}/lib:{$mpfrpath}/lib:{$mpcpath}/lib線程
3.2 x86_64-redhat-linux-ar: Command not foundcode
解決 --host=x86_64-redhat-linux改成--build=x86_64-redhat-linuxget
3.3 gcc GNAT is required to build adait
解決 configure時--enable-languages=c,c++,(ada去掉)
3.4 configure-fixincludes錯誤 1
make disclean (不太好使)
把gcc下東西所有刪除 從新編譯
4. make是用 (make -j 8)快
~/work/gcc482/bin/gcc -v 使用內建 specs。 COLLECT_GCC=/home/mawanli/work/gcc482/bin/gcc COLLECT_LTO_WRAPPER=/home/mawanli/work/gcc482/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper 目標:x86_64-redhat-linux 配置爲:../configure --prefix=/home/mawanli/work/gcc482 --mandir=/home/mawanli/work/gcc482/man --infodir=/home/mawanli/work/gcc482/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++ --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --build=x86_64-redhat-linux --with-gmp=/home/mawanli/soft/gcc-4.8.2/work/gmpwork/ --with-mpfr=/home/mawanli/soft/gcc-4.8.2/work/mpfrwork/ --with-mpc=/home/mawanli/soft/gcc-4.8.2/work/mpcwork/ 線程模型:posix gcc 版本 4.8.2 (GCC)
4.1 error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory
解決:加環境變量裏面
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/mawanli/soft/gcc-4.8.2/work/gmpwork/lib:/home/mawanli/soft/gcc-4.8.2/work/mpcwork/lib:/home/mawanli/soft/gcc-4.8.2/work/mpfrwork/lib
總結:這個耗費我大把時間 不過幹完以後跑起來真的開心(中途我有放棄不玩了,可是仍是作完啦)