How to build the GCC-4.3.3 in MinGW?
The package is essential to build the environment of GCC. If you have installed them into your MinGW, please skip to the next session.
[Where to download GCC-4.3.3?]
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.
[Where to download pthread-win32?]
Login pthreads-win32 and find the latest dll version. It includes libpthreadGC2.a, pthreadGC2.dll, pthread.h, sched.h and semaphore.h.
[Where to download binutils-2.19.1?]
Login sourceforge.net and download binutils-2.19.1-src.tar.gz.
[1. Build and Install gmp-4.2.4.tar.gz]
$ tar xvzf ./gmp-4.3.4.tar.gz $ cd ./gmp-4.2.4/ $ ./configure --prefix=/mingw –disable-shared –enable-static $ make $ make check $ make install $ make distclean |
[2. Build and Install mpfrmpfr-2.4.1.tar.bz2]
$ tar xvjf ./mpfr-2.4.1.tar.bz2 $ cd ./mpfr-2.4.1/ $ ./configure --prefix=/mingw –disable-shared –enable-static –with-gmp=/mingw $ make $ make check $ make install $ make distclean |
[3. Copy pthread into MinGW]
$ cd ./pthreads $ cp -f ./pthread.h /mingw/include $ cp -f ./sched.h /mingw/include $ cp -f ./semaphore.h /mingw/include $ cp -f ./pthreadGC2.dll /mingw/bin $ cp -f ./libpthreadGC2.a /ming/lib/libpthread.a |
[4. Build and Install gcc-4.3.3.tar.bz2]
$ tar xvjf ./gcc-4.3.3.tar.bz2 $ mkdir –p ./gcc-4.3.3/build $ cd ./gcc-4.3.3/build $ export LD_RUN_PATH=/mingw/lib $ export LD_LIBRARY_PATH=/mingw/lib $ LD_RUN_PATH=/mingw/lib LD_LIBRARY_PATH=/mingw/lib ../configure --prefix=/mingw --with-gmp=/mingw --with-mpfr=/mingw --oldincludedir=/mingw/include --disable-nls --disable-win32-registry --disable-shared --enable-version-specific-runtime-libs --enable-languages=c,c++,fortran,java,objc --enable-optimize --enable-libgomp $ make DESTDIR=/gcc-4.3.3-build install $ make install $ rm -rf * |
[5. Build and Install binutils-2.19.1-src.tar.gz]
$ tar xvzf ./binutils-2.19.1-src.tar.gz $ cd binutils-2.19.1/ $ ./configure --prefix=/mingw –disable-shared –enable-static –oldincludedir=/mingw/include --with-mpfr=/mingw --with-gmp=/mingw $ make $ make DESTDIR=/ binutils-2.19.1-build install $ make install $ make distclean $ rm -rf /mingw/mingw32 $ mv /mingw/ i686-pc-mingw32 / mingw/mingw32 |
[Summarization]
1. GCC and Binutils must be synchronized together, otherwise the programs compiled will be crashed in the runtime. In normal case, Binutils had better use the latest version.
2. The boring operations in every step should be edited into a shell script, and it will help readers automatically build all tasks. As readers know, it takes long time to completely build GCC.
3. If readers want to know HOWTO in Linux. Please refer to “How to compile GCC-4.3.3 in the Linux?”.