在不安装 Xcode 的情况下将 GCC 安装到 Mac OS X Leopard
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4360110/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing GCC to Mac OS X Leopard without installing Xcode
提问by pts
I'd like to install gcc to Mac OS X Leopard, and compile some software from source using MacPorts. As http://www.macports.org/install.phphas suggested, I've registered as an Apple developer. Now I have to download the Xcode developer tools, but it seems to be enormous. Is such a big download (3.5GB or 1GB) really necessary just for gcc and some header files (mostly for console applications)? Is there a smaller download (possibly on some other site) which would work? Did I find the proper download (Xcode Developer Tools), as required by the MacPorts website?
我想将 gcc 安装到 Mac OS X Leopard,并使用 MacPorts 从源代码编译一些软件。正如http://www.macports.org/install.php所建议的,我已经注册为 Apple 开发人员。现在我必须下载 Xcode 开发人员工具,但它似乎是巨大的。这么大的下载(3.5GB 或 1GB)真的只需要 gcc 和一些头文件(主要用于控制台应用程序)吗?是否有较小的下载(可能在其他网站上)可以使用?我是否找到了 MacPorts 网站要求的正确下载(Xcode 开发人员工具)?
I don't need an IDE, I don't need any iOS-related software, I don't need big SDKs, I don't want to do any GUI programming.
我不需要IDE,我不需要任何iOS相关的软件,我不需要大的SDK,我不想做任何GUI编程。
I don't have an install disk.
我没有安装盘。
There was a similar question Is there a way to install gcc in OSX without installing Xcode?. My question is different, because I wouldn't mind downloading and istalling partsof Xcode to get gcc, as long as it's reasonably large, say 300 MB uncompressed. Is that possible?
有一个类似的问题有没有办法在不安装 Xcode 的情况下在 OSX 中安装 gcc?. 我的问题是不同的,因为我不会介意下载并istalling部分的Xcode让GCC,只要它是相当大的,说300 MB压缩。那可能吗?
At http://developer.apple.com/devcenter/mac/index.actionI've found the download link http://developer.apple.com/ios/download.action?path=/ios/ios_sdk_4.2__final/xcode_3.2.5_and_ios_sdk_4.2_final.dmg, which is a 3.5GB download. Based on some answers below, I noticed that Xcode 3.2.5 is for Snow Leopard, and I need Xcode 3.1.4 (1GB) for Leopard, which I can get from http://connect.apple.com/(titled Downloads and ADC Program Assets) after registration and logging in, clicking on the section Downloads / Developer Tools, then finding Xcode 3.1.4 Developer Tools. The download link is http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/download?path=%2FDeveloper_Tools%2Fxcode_3.1.4_developer_tools%2Fxcode314_2809_developerdvd.dmg.
在http://developer.apple.com/devcenter/mac/index.action我找到了下载链接http://developer.apple.com/ios/download.action?path=/ios/ios_sdk_4.2__final/ xcode_3.2.5_and_ios_sdk_4.2_final.dmg,这是一个 3.5GB 下载。根据下面的一些答案,我注意到 Xcode 3.2.5 适用于 Snow Leopard,而 Leopard 需要 Xcode 3.1.4 (1GB),我可以从http://connect.apple.com/(标题为下载和ADC Program Assets) 注册并登录后,点击下载/开发者工具部分,然后找到Xcode 3.1.4 Developer Tools。下载链接是http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/download?path=%2FDeveloper_Tools%2Fxcode_3.1.4_developer_tools%2Fxcode314_2809_developerdvd.dmg。
采纳答案by Ned Deily
If you don't have Xcode
on a system restore disk, retail copy of OS X, or as an optional installer on your hard drive, you will need to download the appropriate Xcode
package for Leopard. Xcode 3.2.5
is only for Snow Leopard, OS X 10.6. For 10.5, the most recent Xcode
is 3.1.4
(I believe) which is a 993MB download. When logged in, you should find it in your Developer Download and ADC Program Assets
section of the Developer Connection website (you may have to search a bit to find that, though).
如果您Xcode
的硬盘驱动器上没有系统还原盘、零售版 OS X 或可选安装程序,则需要Xcode
为 Leopard下载相应的软件包。 Xcode 3.2.5
仅适用于雪豹 OS X 10.6。对于 10.5,最新的Xcode
是3.1.4
(我相信)这是一个 993MB 的下载。登录后,您应该可以在Developer Download and ADC Program Assets
Developer Connection 网站的部分找到它(不过,您可能需要稍微搜索一下才能找到)。
Note the Apple-supplied GCC has a number of Apple-developed enhancements, particularly in the area of multi-architecture support, that some open-source projects, in particular, Python, depend on. You may be able to get things to work with a vanilla GCC but is it worth your time and hassle to hack around and test and guess?
请注意,Apple 提供的 GCC 有许多 Apple 开发的增强功能,特别是在多体系结构支持领域,某些开源项目(尤其是 Python)依赖于这些增强功能。您也许可以使用普通的 GCC 来完成工作,但是花时间和麻烦来破解、测试和猜测是否值得?
回答by leif
Maybe this one is right for you: https://github.com/kennethreitz/osx-gcc-installer
也许这个适合你:https: //github.com/kennethreitz/osx-gcc-installer
I'm using homebrew and everything is fine: http://blog.strug.de/2011/09/homebrew-without-xcode-save-15-gb/
我正在使用自制软件,一切都很好:http: //blog.strug.de/2011/09/homebrew-without-xcode-save-15-gb/
回答by Dennies Chang
Apple released the command line tools for Xcode in 2012 Feb, the URL: https://developer.apple.com/downloads/index.action?=command%20line%20tools
Apple 于 2012 年 2 月发布了 Xcode 的命令行工具,网址:https: //developer.apple.com/downloads/index.action?=command%20line%20tools
This tool package includes make and gcc, I searched for a very long time, and finally, Apple released it.
这个工具包包括make和gcc,找了很久,终于苹果发布了。
If you download Xcode 4.3 from AppStore for Mac, since the Xcode is packed as Xcode.app and placed in /Application folder, you will have no chance to use the LLVM compiler, nor make utility from the command line.
如果您从 Mac 的 AppStore 下载 Xcode 4.3,由于 Xcode 被打包为 Xcode.app 并放置在 /Application 文件夹中,您将无法使用 LLVM 编译器,也无法从命令行使用 make 实用程序。
So, download this package now, if you use Mac OSX Lion (Mac OSX 10.7.3 required), and you need to install some utilities, e.g., mySQL and php mCrpyt module, etc.
因此,如果您使用 Mac OSX Lion(需要 Mac OSX 10.7.3),并且您需要安装一些实用程序,例如 mySQL 和 php mCrpyt 模块等,请立即下载此软件包。
Quote from the Apple download site:
This package enables UNIX-style development via Terminal by installing command line developer tools, as well as Mac OSX SDK frameworks and headers. Many useful tools are included, such as the Apple LLVM compiler, linker, and Make. If you use Xcode, these tools are also embedded with the Xcode IDE, and can be installed on your system using the Downloads preferences pane with Xcode 4.3 and later. This package requires Mac OS X 10.7.3 or later.
来自苹果下载网站的引用:
该软件包通过安装命令行开发工具以及 Mac OSX SDK 框架和头文件,通过终端启用 UNIX 风格的开发。包括许多有用的工具,例如 Apple LLVM 编译器、链接器和 Make。如果您使用 Xcode,这些工具也嵌入在 Xcode IDE 中,并且可以使用 Xcode 4.3 及更高版本的“下载”首选项窗格安装在您的系统上。此软件包需要 Mac OS X 10.7.3 或更高版本。
回答by Wooble
回答by arystoteles
Have you thinked about GNU-Darwin ports? There are many binary packages, gcc too, but i don't tried it on my own.
您是否考虑过GNU-Darwin 端口?有很多二进制包,gcc 也是,但我没有自己尝试过。
回答by user475434
The Xcode download is quite big, but if you really want things to work well, you should use it. I've tried other distributions of GCC on the Mac OS X and I've got so much troubles with them... I could not compile PHP without the GCC Xcode distrib for instance.
Xcode 下载量很大,但如果您真的希望一切正常运行,则应该使用它。我已经在 Mac OS X 上尝试过其他 GCC 发行版,但我遇到了很多麻烦……例如,如果没有 GCC Xcode 发行版,我就无法编译 PHP。
回答by John Parker
You'll find an (albeit older) version of Xcode on your Mac OS X install disk.
您会在 Mac OS X 安装盘上找到(虽然较旧)版本的 Xcode。
This won't have the iOS bits, etc. (it will have the Cocos Mac OS X development bits however) , but should be all that you require.
这不会有 iOS 位等(但是它将有 Cocos Mac OS X 开发位),但应该是您所需要的。
回答by Dennies Chang
Apple had released the command line tool in Xcode 4.3.2 in late March 2012.
Apple 于 2012 年 3 月下旬在 Xcode 4.3.2 中发布了命令行工具。
I found the item can be downloaded from AppStore in Mac or the download section of XCode. GCC might be easier to get familier, and Apple version command line tool is fine to me.
我发现该项目可以从 Mac 的 AppStore 或 XCode 的下载部分下载。GCC 可能更容易上手,Apple 版本的命令行工具对我来说很好。