build GCC

来源:互联网 发布:知我药妆是正品吗知乎 编辑:程序博客网 时间:2024/06/02 05:23

参考http://blog.csdn.net/wfdtxz/article/details/7345541

1、gcc configure error:Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.

ftp://gcc.gnu.org/pub/gcc/infrastructure/下载相应的压缩包。由于MPFR依赖GMP,而MPC依赖GMP和MPFR,所以要先安装GMP,其次MPFR,最后才是MPC。安装上述3个包至old gcc 路径,会方便不少。

../gmp-4.3.2/configure --prefix=/usr

这里--prefix选项代表要将该库安装在哪里,我是装在/usr/local/gmp-4.3.2目录下,后面的安装都会用到这个选项。 

这时在gmp的编译目录下就会生成一个makefile文件,现在开始编译安装。

make

make check

sudo make install

这样就安装好了gmp。mpfr和mpc的安装方法与此类似。不过要注意配置的时候要把依赖关系选项加进去,具体后面两个库配置命令如下:

../mpfr-2.4.2/configure --prefix=/usr --with-gmp=/usr

../mpc-0.8.1/configure --prefix/usr --with-gmp=/usr/local/gmp-4.3.2 --with-mpfr=/usr

2、when config gmp :error: No usable m4 in $PATH or /usr/5bin

install 'm4' with synaptic.

3、when build gcc error:error: C++ compiler missing or inoperational: 

install g++ with synaptic.


4、gcc 步骤

 a、configure,configure目录不与source code相同。configure配置参考命令gcc -v输出。

b、make

c、make install

0 0
原创粉丝点击