gcc-4.1.2安装

本文档详细记录了在AIX系统上安装GCC 4.1.2的过程,包括下载源码、配置、编译时遇到的问题及解决方案。在编译过程中,由于系统缺少高版本的makeinfo工具导致错误,通过升级或修改configure文件以适应Texinfo 4.11版本。安装完成后,需要卸载旧版本GCC并创建新版本的软链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

昨晚编译一个交叉工具链的时候,需要gcc-4.1.2版本的,我的4.6版本它编译不了,很奇怪。下面是gcc-4.1.2的安装。

源码下载:ftp://ftp.gnu.org/gnu/gcc/gcc-4.1.2/

解包:tar -xvf gcc-4.1.2.tar.bz2

进入目录:cd gcc-4.1.2

# ./configure –prefix=/usr/local/gcc-4.1.2&& make

接着就出现错误

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[3]: *** [fastjar.info] 错误 1
make[3]:正在离开目录 `/home/ssm/gcc-obj/fastjar'
make[2]: *** [all] 错误 2
make[2]:正在离开目录 `/home/ssm/gcc-obj/fastjar'
make[1]: *** [all-fastjar] 错误 2
make[1]:正在离开目录 `/home/ssm/gcc-obj'
make: *** [all] 错误 2

这里有一个文章 http://blog.youkuaiyun.com/galois_godel/article/details/6750331

下面是摘要:

(主要原因是GCC的版本过高)

1:全英文的这部分说的是你的系统中缺少相应版本的makeinfo软件。

因为gcc4.1以上的版本需要makeinfo的版本为4.2或更高。
所以输入命令行:
makeinfo –version           想查看makeinfo的版本。结果得到了以下信息:
The program ‘makeinfo’ is currently not installed. You can install it by typing:
yum install texinfo
按照提示输入命令,问题得到解决。

2:本机使用的Texinfo是4.11版本,

出现此错误的原因也在于configure文件中texinfo对该版本不支持,可以在解压gcc4.1.1文件夹中的configure文件里找到

以下语句

# For an installed makeinfo, we require it to be from texinfo 4.2 or
# higher, else we use the “missing” dummy.
if ${MAKEINFO} –version \
| egrep ‘texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])’ >/dev/null 2>&1; then
:
else
MAKEINFO=”$MISSING makeinfo”
fi
;;

其中4\.[2-9]|[5-9]表示的是支持4.2-4.9之间的几个版本,所以需要自己添加4\.[1-9][0-9]*,以支持4.11版本。即把’texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])’编辑成’texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|4\.[1-9][0-9]*|[5-9])’后保存,编译通过。

安装:make install

这时候先查看gcc版本

#gcc -v

发现还是4.6版本的,于是就卸载4.6版本

#rpm -e gcc-c++

#rpm -e gcc 

然后建立链接

# ln -s /usr/local/gcc-4.1.2/bin/gcc /usr/bin/gcc2

# ln -s /usr/local/gcc-4.1.2/bin/g++ /usr/bin/g++2

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值