How to compile GCC-4.3.3 in the Linux?

来源:互联网 发布:linux显示命令运行 编辑:程序博客网 时间:2024/04/30 00:58

 

 

[How to compile GCC-4.3.3 in the Linux?]

GMP and MPFR are two essential external libs to compile GCC. If you haveinstalled them into your environment, please skip the related sectionsfollowed.

 

[Where to download GCC?]

 

Login ftp.gnu.org and find the latestversion. It is gcc-4.3.3.tar.bz2when I explore whole folder.

 

[Where to download GMP?]

 

Login www.sfr-fresh.com and find thelatest version. It is gmp-4.2.4.tar.gzwhen I explore the whole web page.

 

[Where to download MPFR?]

Login www.mpfr.org and find the latestversion. It is mpfr-2.4.1.tar.bz2when I explore the whole web page.

 

[How to install GMP?]

 

$ tar xvzf ./ gmp-4.2.4.tar.gz

$ cd ./ gmp-4.2.4

$ ./configure

$ make

$ make check

$ make install

$ make distclean

 

[How to install MPFR?]

 

$ tar xvjf ./mpfr-2.4.1.tar.bz2

$ cd ./ mpfr-2.4.1

$ ./configure --with-gmp=/usr/local --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib

$ make

$ make check

$ make install

$ make distclean

 

[How to install GCC-4.3.3?]

 

$ tar xvjf ./gcc-4.3.3.tar.bz2

$ cd ./ gcc-4.3.3

$ mkdir ./build

$ cd ./build

$ export LD_RUN_PATH=/usr/local/lib

$ export LD_LIBRARY_PATH=/usr/local/lib

$ mkdir –p /usr/gcc-4.3.3

$ LD_RUN_PATH=/usr/local/lib LD_LIBRARY_PATH=/usr/local/lib ../configure --prefix=/usr/gcc-4.3.3 --enable-languages=all --with-gmp=/usr/local --with-mpfr=/usr/local --enable-libgomp

$ make

$ make install

$ rm -rf *

If you fail to build GCC-4.3.3, please add exportLDFLAGS="-L/usr/local/lib -R/usr/local/lib". In myenvironment, it is unnecessary.

 

In normal case, your system will own twodifferent versions of GCC. If you can make full use of GCC-4.3.3, please ensurethe PREFIX path when configuring environment. For instance:

make distclean; ./configure --bindir=/usr/gcc-4.3.3/bin --libexecdir=/usr/gcc-4.3.3/libexec --datadir=/usr/gcc-4.3.3/share --libdir=/usr/gcc-4.3.3/lib --includedir=/usr/gcc-4.3.3/include --infodir=/usr/gcc-4.3.3/info --mandir=/usr/gcc-4.3.3/man --enable-optimize=-O3 --disable-debug --with-pthreads && make

The RED options are utilized to re-directto GCC-4.3.3 and do NOT the defaults of system.

 

Anyway, the configuration mustbe rechecked in the different environment. As a result, you had better verify themby ./configure –h or ./configure --help commands.