您的位置:首页 > 其它

安装GCC-4.1.1,问题解决

2009-10-20 12:04 316 查看
今安装GCC-4.1.1,遇到问题于下,(复制别人的,参考:http://www.linuxdiyf.com/bbs/thread-159161-1-1.html。因问题一样,但我已经完整解决该问题)

由于某种需要,需要把Fedora11 gcc的版本降到4.1.1,使用yum install gcc只会更新现有版本,不降反升了,那么只能通过其它途径进行安装,其过程如下:
1、先下载gcc-4.1.1.tar.bz2文件于/tmp目录下,并对其进行解压,于是在/tmp下有了gcc-4.1.1目录,它就是gcc-4.1.1的源目录
2、在/tmp下再建立一个gcc-4.1.1-bulid目录,作为gcc-4.1.1的目标目录。
3、在/usr/local下建立gcc-4.1.1-dest目录,作为gcc-4.1.1的配置目录。(需要root权限,所以可以这么做:sudo mkdir /usr/local/gcc-4.1.1-dest)
4、在gcc-4.1.1-bulid目录下(必须的),执行以下命令:
/tmp/gcc-4.1.1/configure --prefix=/usr/local/gcc-4.1.1-dest --enable-threads=posix --disable-checking --enable--long-long --with-system-zlib --enable-languages=c,c++,java(在http://hi.baidu.com/boyliupan/bl ... 259985800a18d2.html上还加了选项:--host=i386-redhat-linux,我不知它是什么意思,而且加了提示找不到i386-redhat-linux,于是没有加,其它选项也不知其意) //注by_benhu:我去掉了:--host=i386-redhat-linux,因为我的是X86_64,
5、进行编译,执行: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]: Leaving directory `/tmp/gcc-4.1.1-build/fastjar'
make[2]: *** [all] 错误 2
make[2]: Leaving directory `/tmp/gcc-4.1.1-build/fastjar'
make[1]: *** [all-fastjar] 错误 2
make[1]: Leaving directory `/tmp/gcc-4.1.1-build'
make: *** [all] 错误 2

此错误解决:

安装英文提示:可知是因为缺少依赖包Texinfo或GNU MAKE包,前者包含后者。

在目标文件目录下运行:$ yum install texinfo

安装完毕,查看makeinfo所在目录:
$ whereis makeinfo,
显示:usr/bin/makeinfo。
3、修改/tmp/gcc-4.1.1-bulid目录下的Makefile,把.../missing makeinfo改成usr/bin/makeinfo.

重新执行:make

又冒出新的错误:error: gnu/stubs-32.h: No such file or directory

我到/usr/include/gnu下一看,果然没有这一头文件,于是:

执行:yum -y install glibc-devel

但是还是冒出同样的问题,在看/usr/include/gnu下的文件,有一个stubs-64.h的头文件。可能我的是X86_64的,所以只有这一文件,不支持i386,为了得到stubs-32.h,支持这个编译器,我安装了一个i386arch的glibc-devel.i386的包:

运行:yum -y install glibc-devel.i386
再重新在gcc-4.1.1-build中make,

一切OK!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: