How to build the GCC-4.3.3 in MinGW?

54 篇文章 1 订阅
37 篇文章 0 订阅

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

$ 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?”.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值