作者: yupanlovehlq
2013-10-12 16:19:20
RedFlag Linux SP3 升级最新版gcc4.8.1
首先需要准备需要材料:
mpc-1.0.1.tar.gz
mpfr-3.1.2.tar.gz
gmp-5.1.3.tar.gz
分别解压缩
tar zxvf gmp-5.1.3.tar.gz
tar zxvf mpfr-3.1.2.tar.gz
tar zxvf mpc-1.0.1.tar.gz
解压之后, 按照下面步骤安装。
1. 安装gmp:
# ./configure
# make
# make check
这一步用来查看有没有文件不匹配或缺失,然后安装:
# make install
2. 安装mpfr
配置:
# ./configure --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib
# make
# make check
接下来安装:
# make install
3. 安装mpc
配置:
# ./configure --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib --with-mpfr-include=/usr/local/include --with-mpfr-lib=/usr/local/lib
# make
# make check
接下来安装:
# make install
准备工作完成,以下是gcc的安装与更新。
4. 配置
在我的机器上,我是这样配置的:
$ ./configure --prefix=/usr/local/gcc4.8 --with-gmp-include=/usr/local/include --with-gmp-lib=/usr/local/lib --with-mpfr-include=/usr/local/include --with-mpfr-lib=/usr/local/lib --with-mpc-include=/usr/local/include --with-mpc-lib=/usr/local/lib
(注:/usr/local/gcc4.8是自定的安装目录)
将GCC安装在/usr/local/gcc4.8目录下。
5. 编译
$ make
6. 安装
# make install
至此,GCC 安装过程就完成了。