Deepin Linux 12.06安装gcc-4.1.2

最近在了解分布式文件系统, 看到了淘宝自己的开源分布式文件系统 tfs, 因为他要求编译最好是使用 4.1.2 版本的 gcc 编译, 因此需要安装此版本的 gcc.
其他少说, 直接开始安装吧:

1. 下载&解压源码

$ wget http://ftp.gnu.org/gnu/gcc/gcc-4.1.2/gcc-4.1.2.tar.bz2
$ tar xvjf gcc-4.1.2.tar.bz2

2. 安装依赖库, 以及软件

$ sudo apt-get install libc6-dev libgmp-dev libmpfr-dev texinfo

3. 为头文件以及所需库添加链接
添加如下链接, 这取决于你的 Ubuntu 系统架构, 如果你使用的是64位的ubuntu系统应当使用x86_64-linux-gnu替代i386-linux-gnu

$ cd /usr/include
$ sudo ln -s i386-linux-gnu/bits bits
$ sudo ln -s i386-linux-gnu/gnu gnu
$ sudo ln -s i386-linux-gnu/sys sys
$ sudo ln -s i386-linux-gnu/asm asm
$ cd /usr/lib
$ sudo ln -s i386-linux-gnu/crt1.o crt1.o
$ sudo ln -s i386-linux-gnu/crti.o crti.o
$ sudo ln -s i386-linux-gnu/crtn.o crtn.o 

4. 编译gcc

$ cd gcc-4.1.2
$ mkdir build
$ cd build
$ ../configure --prefix=/usr/local --program-prefix=sse- --libexecdir=/usr/local/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --enable-languages=c,c++
$ make bootstrap

如果出现了如下错误:

WARNING: `makeinfo’ is missing on your system. You should only need it
if you modified a `.texi’ or `.texinfo’ file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make’ (AIX,
DU, IRIX). You might want to install the `Texinfo’ package or
the `GNU make’ package. Grab either from any GNU archive site.

请使用以下命令编译:

$ make bootstrap MAKEINFO=makeinfo

5. 安装gcc

$ make install
$ cd /usr/local/bin
$ ll *gcc*

看到类似以下几个文件, 安装就完成了

i686-pc-linux-gnu-gcc-4.1.2 i686-pc-linux-gnu-ssegcc ssegcc ssegccbug

参考文献: Building GCC 4.1.2 on Ubuntu 12.04.1 LTS

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值