- 论坛徽章:
- 0
|
这两天在尝试升级gcc
我用的是redhat 7.3 (毕业设计需要,高版本中的一些组件太新,和我毕业设计的东西有冲突,而且鉴于依赖关系的复杂性,索性就找了个老版本的装了)但是要升级gcc到3.0。
1. 用rpm 包 rpm -Uvh --froce --nodeps升级,失败了,好像一个库文件被改了,进不去kde(因为还要用java,那是另一段痛苦的经历),要进入kde是不是还要重新编译一遍kde????
2. 编译源代码也失败了(编译过程出现了2个ERROR,好像是和G++有关系的,不知道为什么)
是不是在编译安装的过程中有一些参数?请高手指点指点
找了好久的资料,看到了一篇文章(E文的)说的使用srpm进行安装,以前没有尝试过,看来这是最后的希望了 : (
以下是这篇文章相关内容的节选
Simple steps to test gcc on a remote system
This assumes both the build machine and the test machine are running Red Hat Linux 7.3. The procedure will be similar for many flavors of Unix.
In this example, the build machine is called 'krunch'; the machine that will run the binaries is called 'dual'. Warning: this is just a recipe I cooked up from a position of abject ignorance, so it might not be the right way to do things.
Reformat the hard drive and install a fresh copy of Linux. (Well, you don't have to, but these instructions should work even if you do.)
Install gcc if it isn't already. (It's usually installed by default with Linux.)
Install expect and dejagnu, e.g.
rpm -i /mnt/cdrom/RedHat/RPMS/{expect,dejagnu}*
Unpack gcc3.0.x source tarball and build gcc, e.g.
rpm -i /mnt/cdrom/RedHat/SRPMS/gcc3-3.0.1-3.src.rpm
cd /usr/src/redhat/SPECS
rpm -bp gcc3.spec
cd /usr/src/redhat/BUILD/gcc-3.0.1-20010905/obj-i386-redhat-linux
make
Verify that you can run the gcc tests locally, e.g.
cd /usr/src/redhat/BUILD/gcc-3.0.1-20010905/obj-i386-redhat-linux/gcc/testsuite
runtest --tool=g++
在执行rpm -bp gcc3.spec的时候说没有 rpm -bq,但是 在man rpm 中却有(莫名其妙,是不是rpm的版本问题???)
还好找到了另一篇值得推荐的文章是关于rpm 和srpm的
http://linux.vbird.org/linux_basic/0520rpm_and_srpm.php
我使用rpm -bb把它打包成为自己的rpm包,在编译的过程中出现了不少的warning.............
最后在/usr/src/redhat/RPMS/i386下面生成了10个rpm文件,OK,
#rpm -Uvh *.rpm
安装后在/usr/bin下面生成gcc3
下面重新命名一下,
#cd /usr/bin
#mv gcc gcc2
#mv gcc3 gcc
#gcc -v
.....
gcc version 3.0.2
同理 ls g*3
把所有的相关文件重名名
....
搞定~!幸福ing~~
希望能给大家点帮助 |
|