linux install gcc 4.8

自己升级gcc 的时候大概参考别人的一份简记 可以大概看看作参考 

查看别人安装成功的系统和版本,对应着自己的系统进行安装

https://gcc.gnu.org/gcc-4.8/buildstat.html

下载解压:

$ cd localbuild-gcc-4-8-3
localbuild-gcc-4-8-3$ tar -jxf gcc-4.8.3.tar.bz2
localbuild-gcc-4-8-3$ tar -jxf binutils-2.24.tar.bz2
localbuild-gcc-4-8-3$ tar -jxf gmp-5.1.3.tar.bz2
localbuild-gcc-4-8-3$ tar -jxf mpfr-3.1.2.tar.bz2
localbuild-gcc-4-8-3$ tar -jxf mpc-1.0.1.tar.bz2
localbuild-gcc-4-8-3$ tar -jxf isl-0.12.2.tar.bz2
localbuild-gcc-4-8-3$ tar -xzf cloog-0.18.1.tar.gz
建立软连接
localbuild-gcc-4-8-3$ mkdir combined && cd combined

#Create symlinks to the gcc source tree - Files in the gcc tree are master copy.
#So, maintain the following order without fail.  
localbuild-gcc-4-8-3/combined$ ln -s ../gcc-4.8.3/* .

#Create symlinks to the binutils source tree. Ignore several complaints from ln about existing links
localbuild-gcc-4-8-3/combined$ ln -s ../binutils-2.24/* .

#Create symlinks to GMP,MPFR,MPC,ISL,CLOOG source trees without version numbers in links
localbuild-gcc-4-8-3/combined$ ln -s ../gmp-5.1.3 gmp 
localbuild-gcc-4-8-3/combined$ ln -s ../mpfr-3.1.2 mpfr 
localbuild-gcc-4-8-3/combined$ ln -s ../mpc-1.0.1 mpc 
localbuild-gcc-4-8-3/combined$ ln -s ../isl-0.12.2 isl 
localbuild-gcc-4-8-3/combined$ ln -s ../cloog-0.18.1 cloog
congifure编译
localbuild-gcc-4-8-3/combined$ cd .. 
localbuild-gcc-4-8-3$ mkdir build && cd build  

#Export build environment variables. For native build, host=build=target

#To know host info, use config.guess script 
localbuild-gcc-4-8-3/build$ ../combined/config.guess
i686-pc-linux-gnu

localbuild-gcc-4-8-3/build$ export host=i686-pc-linux-gnu
localbuild-gcc-4-8-3/build$ export build=$host
localbuild-gcc-4-8-3/build$ export target=$host
localbuild-gcc-4-8-3/build$ export prefix=/usr/local/gcc-4-8-3 

#Configure - Enabling 'C','C++' languages
#Configuring combined-tree - Since it includes binutils, --enable-shared NOT to be used. Build fails in stage2 if this option is used. You have been warned.
localbuild-gcc-4-8-3/build$ ../combined/configure --host=$host --build=$build --target=$target --prefix=/usr/local/gcc-4-8-3 --disable-nls --disable-werror --disable-multilib --enable-__cxa_atexit --enable-c99 --enable-long-long --enable-threads=posix --enable-checking=release --enable-libstdcxx-time --enable-languages=c,c++

#Parallel Build
localbuild-gcc-4-8-3/build$ make -j4
安装
#Install the toolchain
localbuild-gcc-4-8-3/build$ make install

参考文章:

http://www.linuxidc.com/Linux/2014-04/99583p2.htm  非常好的国内文章

https://raghunathlolur.wordpress.com/2014/06/30/combined-tree-build-of-gcc-binutils-and-libraries/ 非常好的一篇文章

http://my.oschina.net/vaero/blog?disp=2&p=1&catalog=375415 不错

转载于:https://my.oschina.net/u/1188877/blog/490200

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值