How to compile GCC-4.3.3 in the cygwin?
GMP and MPFR are two essential external libs to compile GCC. If you have installed them into your environment, please skip the related sections followed.
[Where to download GCC?]
Login ftp.gnu.org and find the latest version. It is gcc-4.3.3.tar.bz2 when I explore whole folder.
[Where to download GMP?]
Login www.sfr-fresh.com and find the latest version. It is gmp-4.2.4.tar.gz when I explore the whole web page.
[Where to download MPFR?]
Login www.mpfr.org and find the latest version. It is mpfr-2.4.1.tar.bz2 when I explore the whole web page.
[How to install GMP?]
$ tar xvzf ./ gmp-4.2.4.tar.gz $ cd ./ gmp-4.2.4 $ ./configure –disable-shared –enable-static $ 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 --disable-shared –enable-static $ 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=c,c++,fortran,java,objc --enable-version-specific-runtime-libs --enable-threads=posix --with-gmp=/usr/local --with-mpfr=/usr/local --enable-libgomp $ make $ make install |
If you fail to build GCC-4.3.3, please add export LDFLAGS="-L/usr/local/lib -R/usr/local/lib". In my environment, it is unnecessary.
In normal case, your system will own two different versions of GCC. If you can make full use of GCC-4.3.3, please ensure the 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-direct to GCC-4.3.3 and do NOT the defaults of system.
Anyway, the configuration must be rechecked in the different environment. As a result, you had better verify them by ./configure –h or ./configure --help commands.