分享一段一键编译安装gcc的shell脚本代码

SEO探索者团队 SEO服务&网站优化

gcc包括C、C++、Objective-C、Fortran、Java、Ada和Go语言的前端,所谓强大,本文是我从别人的一篇文章看到的,他是通过一个shell脚本和一个Makefile就一键安装编译gcc了,好东西要分享出来.

今天看到一篇文章,作者通过一个shell脚本和一个Makefile,可以自动下载需要的所有安装包并且编译gcc:

  1. $#Downloadthescriptsusingwget.
  2. $mkdir/opt/gcc-4.9.2
  3. $cd/opt/gcc-4.9.2
  4. $wgethttp://projects.joelinoff.com/gcc-4.9.2/bld.sh
  5. $wgethttp://projects.joelinoff.com/gcc-4.9.2/Makefile
  6. $chmoda+xbld.sh
  7. $make
  8. [outputsnipped]
  9. $#Thecompilerisinstalledin/opt/gcc-4.9.2/rtf/bin

我试了一下,果然很方便,只要有一台可以联网的机器就可以了,感兴趣的朋友可以试一试.

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”.

相关广告
  • 分享一段一键编译安装gcc的shell脚本代码 分享一段一键编译安装gcc的shell脚本代码 分享一段一键编译安装gcc的shell脚本代码
相关阅读

分享一段一键编译安装gcc的shell脚本代码

2019/10/10 17:46:27 | 谷歌SEO算法 | Google