我如何在mac上构建gcc? [英] how do i build gcc on a mac?

查看:189
本文介绍了我如何在mac上构建gcc?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在mac上构建最新版本的gcc。我有最新的xcode,但我正在寻找一些c ++ 0x功能,在更新的版本(lambda函数等)。



一个选项是安装MacPorts 并安装 gcc46 包:

  sudo port install gcc46 

另一个选择是下载源代码和构建它如下:

  tar xzvf gcc-4.6.0.tar.gz 
cd gcc-4.6.0
./configure
make

请注意,GCC 4.6.0需要作为先决条件< a href =http://gmplib.org/> GMP 4.2及更高版本, MPFR 2.3.1+和 MPC 0.8.0+。如果 ./ configure 失败,可能是因为您缺少其中一个(尽管它在任何情况下都会给您一个有用的错误消息)。



建筑需要一段时间,可能需要几个小时,具体取决于您的硬件。


I'd like to build the latest version of gcc on a mac. I have the latest xcode but I'm looking for some of the c++0x features that are in more recent versions (the lambda functions, etc).

Are there any good step-by-step tutorials on doing this?

解决方案

One option is to install MacPorts and install the gcc46 package:

sudo port install gcc46

Another option is to download the source code and build it as follows:

tar xzvf gcc-4.6.0.tar.gz
cd gcc-4.6.0
./configure
make

Note that GCC 4.6.0 requires as prerequisites GMP 4.2+, MPFR 2.3.1+, and MPC 0.8.0+. If ./configure fails, it's probably because you're missing one of these (though it should give you a helpful error message in any case).

Building will take a while—likely several hours, depending on your hardware.

这篇关于我如何在mac上构建gcc?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆