简体   繁体   English

如何从Xcode调用MacPorts的GCC? 我也在一个过时的系统上

[英]How can I call MacPorts' GCC from Xcode? I'm also on an obsolete system

I'm trying to go back into programming after a few years break. 几年休息后,我正尝试重新编程。 I also want to try this C++11 stuff. 我也想尝试一下C ++ 11的东西。 So I installed GCC 4.6 from MacPorts. 所以我从MacPorts安装了GCC 4.6。 However, I still want to use Xcode. 但是,我仍然想使用Xcode。 I remember that I once tinkered with custom compilers, like creating a custom command line tool in one target and using that tool to create custom documentation in another target. 我记得我曾经修改过自定义编译器,例如在一个目标中创建自定义命令行工具,然后使用该工具在另一个目标中创建自定义文档。 Can we get Xcode, both the compiling and debugging systems, to use the newer stuff from MacPorts? 我们能否同时使用Xcode和编译系统来使用MacPorts中的更新内容? (I would adjust these per project so I can use the default tools on other projects, including Mac apps.) I would use the newer stuff to build command-line tools, like testing Boost. (我将对每个项目进行调整,以便可以在其他项目(包括Mac应用程序)上使用默认工具。)我将使用更新的工具来构建命令行工具,例如测试Boost。

Oh, by the way, I'm still on my obsolete system (August-2002 eMac with a G4 processor) stuck on Mac OS X 10.4 Tiger. 哦,顺便说一句,我仍然使用Mac OS X 10.4 Tiger上的旧系统(2002年8月的eMac,带有G4处理器)。 So any answers have to be for Xcode 2.5! 因此,任何答案都必须针对Xcode 2.5! (I guess you could provide answers for Xcode 3.x and 4.x to help others, but realize that those will be useless for me.) As a key for the speed, MacPorts took over 2 days straight to build GCC 4.6! (我想您可以为Xcode 3.x和4.x提供答案以帮助其他人,但要意识到这些对我来说将是无用的。)作为提高速度的关键,MacPorts连续花费了两天的时间来构建GCC 4.6!

Well, I certainly haven't tested any of this stuff on 10.4 or Xcode 2.5, but I did recently get GCC 4.6 working in Xcode 4.2. 好吧,我当然还没有在10.4或Xcode 2.5上测试过这些东西,但是最近我确实在Gcode 4.6中使用了GCC 4.6。 In 3.6 and 4.2 there are some compiler template XML files that you can modify once you install a new compiler. 在3.6和4.2中,有些编译器模板XML文件可以在安装新的编译器后进行修改。 In 4.2 they are here: 在4.2中,它们在这里:

/Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/ /Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/

In 3.6 the are in /Developer/Library/Xcode/Plug-ins 在3.6中,位于/ Developer / Library / Xcode / Plug-ins中

I have no idea if they exist in 2.5, but they might. 我不知道它们是否存在于2.5中,但它们可能存在。 If you want the details on how I did this with a more recent version you can find them here: 如果您想了解我如何使用最新版本进行此操作的详细信息,可以在这里找到它们:

http://thecoderslife.blogspot.com/2015/07/building-with-gcc-46-and-xcode-4.html http://thecoderslife.blogspot.com/2015/07/building-with-gcc-46-and-xcode-4.html

It might help give you some ideas on where to start with the older version. 它可能会帮助您从旧版本开始的一些思路。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM