How to compile GCC-4.3.3 in the cygwin?

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

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.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值