这些是我安装 GCC 所遵循的步骤
- 下载并提取 GCC、GMP、MPFR、MPC(最新版本)。
- 无版本重命名 GMP、MPFR、MPC 并将 GMP、MPFR、MPC 移至 GCC 的源文件夹
- 获取 GCC 的路径并导出库“export LD_LIBRARY_PATH=LIBRARY_PATH:/usr/local/lib”
- 采用 GMP 路径并配置和安装(./configure ; make ; make check ; make install )
- 获取 MPFR 的路径并配置和安装 (./configure ; make ; make check ; make install )
- 获取 MPC 路径并配置和安装 (./configure ; make ; make check ; make install )
- GMP、MPFR、MPC 配置安装成功
- 在 GCC 之外创建目录 gccbuild 和 gccbin
走上了 gccbuild 的道路
配置 GCC
- sudo ../gcc-6.3.0/configure --prefix=/home/GCC_project/gccbin --enable-languages=c --program-suffix=6.3.0
配置成功完成,但是在执行“make”时出现以下错误
configure: error: source directory already configured; run "make distclean" there first Makefile:4999: recipe for target 'configure-stage1-gmp' failed make[2]: *** [configure-stage1-gmp] Error 1 make[2]: Leaving directory '/home/GCC_Project/gccbuild' Makefile:23312: recipe for target 'stage1-bubble' failed make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory '/home/GCC_Project/gccbuild' Makefile:919: recipe for target 'all' failed make: *** [all] Error 2
我在make之前尝试过“make distclean”,我又得到了同样的错误