最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
分享一段一键编译安装gcc的shell脚本代码
时间:2015-02-09 编辑:简简单单 来源:一聚教程网
今天看到一篇文章,作者通过一个shell脚本和一个Makefile,可以自动下载需要的所有安装包并且编译gcc:
代码如下 | 复制代码 |
$ # Download the scripts using wget. $ mkdir /opt/gcc-4.9.2 $ cd /opt/gcc-4.9.2 $ wget http://projects.joelinoff.com/gcc-4.9.2/bld.sh $ wget http://projects.joelinoff.com/gcc-4.9.2/Makefile $ chmod a+x bld.sh $ make [output snipped] $ # The compiler is installed in /opt/gcc-4.9.2/rtf/bin |
我试了一下,果然很方便。只要有一台可以联网的机器就可以了。感兴趣的朋友可以试一试。
P.S.:
(1)编译libiconv时可能会有“'gets' undeclared here“错误,请参考这篇文章。
(2)如果机器是64位的,但是缺少32位的库文件。这样在编译gcc时会出现错误:“configure: error: I suspect your system does not have 32-bit developement libraries (libc and headers). If you have them, rerun configure with –enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with –disable-multilib.”。提示需要配置“--disable-multilib”。
-
上一个: Unix平台下如何卸载gdb调试工具?
相关文章
- win11内核隔离和内存完整性介绍 10-31
- win10全屏缩放设置教程 10-31
- win10系统备份出错解决教程 10-31
- win10打开软件每次都要询问解决教程 10-31
- win10更新驱动后设备出现异常解决教程 10-31
- win10一直提示找到可能不需要的应用解决教程 10-31