red hat LINUX下安装GCC的问题。

来源:百度知道 编辑:UC知道 时间:2024/05/28 08:36:59
我已经把下好gcc.tar.bz2解压出来了,但是解压后我进入到解压的文件夹后,按照网上有些说的./configure
make
make install
的步骤试了遍,结果不行。请问到底应该怎么装?
输入后那些命令后的出现如下东西,请高手帮我看下谢谢~!

[root@localhost ~]# cd gcc-4.0.3/
[root@localhost gcc-4.0.3]# ./configure
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
configure: error: Building in the source directory is not supported in this release. See http://gcc.gnu.org/install/configure.html for more details.
[root@localhost gcc-4.0.3]# make
make: *** 没有指明目标并且找不到 makefile。 停止。
[root@localhost gcc-4.0.3]# make install
make: *** 没有规则可以创建目

假设你的gcc在gcc-4.0.3/ 目录里,不能直接在这个目录里build
mkdir /home/xxx/build/gcc/
cd /home/xxx/build/gcc/
../gcc-4.0.3/configure ..............
make
make check
make install

建议直接安装rpm包 ,另外那里有这么不负责任的教程说 源码编译安装gcc就是简单的 ./configure make make install ? 这网站该杀

另外你有没有仔细阅读出错提示呢, 已经说明了gcc不支持直接在源码目录中编译 需要你到http://gcc.gnu.org/install/configure.html 这个地址来了解相关的信息, 事实上,gcc源码包中已经包含详细的安装文档了

为了方便就安装rpm包吧

要学习gcc的编译,参考lfs手册,其中gcc编译了3次,目的不同,参数也不同:
http://www.linuxfromscratch.org/lfs/downloads/development/

推荐rpm安装(还有就是redhat本身不带么,应该已经装了的啊,)
你的错误时
configure: error: Building in the source directory is not supported in this release. See