当前位置: 技术问答>linux和unix
redhat9 下如何安装gcc 4.4.3
来源: 互联网 发布时间:2016-12-02
本文导语: 各位大侠: 我使用linux内核版本是Linux version 2.4.20-8 (bhcompile@porky.devel.redhat.com) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 Thu Mar 13 17:54:28 EST 2003 按照网上搜索的步骤,先解压到/usr/local/,会有...
各位大侠:
我使用linux内核版本是Linux version 2.4.20-8 (bhcompile@porky.devel.redhat.com) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 Thu Mar 13 17:54:28 EST 2003
按照网上搜索的步骤,先解压到/usr/local/,会有一个/gcc-4.4.3 文件夹,在/usr/local/下,
我新建一个文件夹gcc-new/ 之后进行如下操作,但是执行到make命令时,提示
make: *** No targets specified and no makefile found. Stop.,
使用make install 命令也是提示 make: *** No rule to make target `install'. Stop.
请问,正确的应该怎么做啊?
我很菜,希望各位大侠不要笑话。但是,仍恳请各位大侠不吝赐教。
还有,我在更新linux 内核 2.6.38 搜索资料说是需要先更新gcc,请问是这样的吗?谢谢!
[root@localhost gcc-new]# /usr/local/gcc-4.4.3/configure --prefix=/usr/local/gcc-new/ --enable-threads=posix --disable-checking --enable--long-long --host=i386-redhat-linux --with-system-zlib --enable-languages=c,c++,java
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... i386-redhat-linux-gnu
checking target system type... i386-redhat-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for i386-redhat-linux-gcc... i386-redhat-linux-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i386-redhat-linux-gcc accepts -g... yes
checking for i386-redhat-linux-gcc option to accept ANSI C... none needed
checking for i386-redhat-linux-g++... i386-redhat-linux-g++
checking whether we are using the GNU C++ compiler... yes
checking whether i386-redhat-linux-g++ accepts -g... yes
checking for i386-redhat-linux-gnatbind... no
checking for gnatbind... gnatbind
checking for i386-redhat-linux-gnatmake... no
checking for gnatmake... gnatmake
checking whether compiler driver understands Ada... yes
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.
[root@localhost gcc-new]# make
make: *** No targets specified and no makefile found. Stop.
[root@localhost gcc-new]# make install
make: *** No rule to make target `install'. Stop.
[root@localhost gcc-new]#
我使用linux内核版本是Linux version 2.4.20-8 (bhcompile@porky.devel.redhat.com) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 Thu Mar 13 17:54:28 EST 2003
按照网上搜索的步骤,先解压到/usr/local/,会有一个/gcc-4.4.3 文件夹,在/usr/local/下,
我新建一个文件夹gcc-new/ 之后进行如下操作,但是执行到make命令时,提示
make: *** No targets specified and no makefile found. Stop.,
使用make install 命令也是提示 make: *** No rule to make target `install'. Stop.
请问,正确的应该怎么做啊?
我很菜,希望各位大侠不要笑话。但是,仍恳请各位大侠不吝赐教。
还有,我在更新linux 内核 2.6.38 搜索资料说是需要先更新gcc,请问是这样的吗?谢谢!
[root@localhost gcc-new]# /usr/local/gcc-4.4.3/configure --prefix=/usr/local/gcc-new/ --enable-threads=posix --disable-checking --enable--long-long --host=i386-redhat-linux --with-system-zlib --enable-languages=c,c++,java
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... i386-redhat-linux-gnu
checking target system type... i386-redhat-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for i386-redhat-linux-gcc... i386-redhat-linux-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i386-redhat-linux-gcc accepts -g... yes
checking for i386-redhat-linux-gcc option to accept ANSI C... none needed
checking for i386-redhat-linux-g++... i386-redhat-linux-g++
checking whether we are using the GNU C++ compiler... yes
checking whether i386-redhat-linux-g++ accepts -g... yes
checking for i386-redhat-linux-gnatbind... no
checking for gnatbind... gnatbind
checking for i386-redhat-linux-gnatmake... no
checking for gnatmake... gnatmake
checking whether compiler driver understands Ada... yes
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.
[root@localhost gcc-new]# make
make: *** No targets specified and no makefile found. Stop.
[root@localhost gcc-new]# make install
make: *** No rule to make target `install'. Stop.
[root@localhost gcc-new]#
|
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
从这三句话中应该能看到问题所在:没有MPFR包(这个干什么的,查GNU官方网站手册),生成不了Makefile,也无法make了。
我的建议:
1、如果楼主想安装、使用高版本的gcc,最好换一个相对新的系统,如2楼所说,在rh9上要折腾的东西很多。我曾经将内核升级到2.6.18,不过不太稳定,效果不好。
2、如果楼主想学习如何构建工具链,可以学习LFS。
下面是在fc9上安装gcc的两篇文章:
http://www.latelee.org/using-gnu-linux/111-installing-gcc-2953.html
http://www.latelee.org/using-gnu-linux/92-installing-gcc-and-doxygen.html
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
从这三句话中应该能看到问题所在:没有MPFR包(这个干什么的,查GNU官方网站手册),生成不了Makefile,也无法make了。
我的建议:
1、如果楼主想安装、使用高版本的gcc,最好换一个相对新的系统,如2楼所说,在rh9上要折腾的东西很多。我曾经将内核升级到2.6.18,不过不太稳定,效果不好。
2、如果楼主想学习如何构建工具链,可以学习LFS。
下面是在fc9上安装gcc的两篇文章:
http://www.latelee.org/using-gnu-linux/111-installing-gcc-2953.html
http://www.latelee.org/using-gnu-linux/92-installing-gcc-and-doxygen.html
|
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
你的系统中没有GMPlib和MPFR lib
所以configure失败,没有生成makefile,自然也就无法make了
你的系统中没有GMPlib和MPFR lib
所以configure失败,没有生成makefile,自然也就无法make了
|
内核版本太低了,只能构建工具链,因为binutil、glibc、gcc版本匹配是有一定要求的
可以尝试先装一个新版本的linux到其它分区,然后chroot到另外较新版本的linux里面,这样全套的工具链都是匹配的
不过很奇怪啊,楼主用这么老的版本做宿主机,却要跨度如此之大用高若干版本的gcc
建议如果可能,装最近的版本吧,debian的squeeze(debian6)或者centos5.5或者centos6之类的做宿主机吧
可以尝试先装一个新版本的linux到其它分区,然后chroot到另外较新版本的linux里面,这样全套的工具链都是匹配的
不过很奇怪啊,楼主用这么老的版本做宿主机,却要跨度如此之大用高若干版本的gcc
建议如果可能,装最近的版本吧,debian的squeeze(debian6)或者centos5.5或者centos6之类的做宿主机吧
|
lz换系统吧,这个系统确实太老了
当成尝试过在这个系统上升级到最新的内核,更新了一堆工具和依赖库,最后勉强把新内核内核跑起来了,不过其他应用也是n多问题。。。。。建议lz还是不要费劲了
当成尝试过在这个系统上升级到最新的内核,更新了一堆工具和依赖库,最后勉强把新内核内核跑起来了,不过其他应用也是n多问题。。。。。建议lz还是不要费劲了
|
redhat9已经是非常老的发行版了 是2003年3月的版本 同年9月和fedora项目合并了 之后redhat公司就专注于服务器版的linux(RHEL)
现在fedora都出到15了
rhel都已经经历了rhel2.x rhel3.x rhel4.x rhel5.x rhel6.x
现在fedora都出到15了
rhel都已经经历了rhel2.x rhel3.x rhel4.x rhel5.x rhel6.x