How to compile GCC-4.3.3 in the cygwin?

本文档详细介绍了如何在Cygwin环境下编译安装GCC-4.3.3,包括必备的GMP和MPFR库的下载与配置过程。此外还提供了确保GCC-4.3.3正常工作的环境配置建议。

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.

 

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值