我如何调用MacPorts?来自 Xcode 的 GCC?我也在使用过时的系统
中断几年后,我正尝试重新开始编程。我也想尝试一下 C++11 的东西。所以我从 MacPorts 安装了 GCC 4.6。但是,我仍然想使用 Xcode。我记得我曾经修改过自定义编译器,例如在一个目标中创建自定义命令行工具,然后使用该工具在另一个目标中创建自定义文档。我们能否让 Xcode(包括编译系统和调试系统)使用 MacPorts 的更新内容? (我会根据每个项目调整这些,以便我可以在其他项目(包括 Mac 应用程序)上使用默认工具。)我会使用较新的东西来构建命令行工具,例如测试 Boost。
哦,顺便说一句,我仍然使用我过时的系统(2002 年 8 月的带有 G4 处理器的 eMac),停留在 Mac OS X 10.4 Tiger 上。所以任何答案都必须针对 Xcode 2.5! (我猜你可以提供 Xcode 3.x 和 4.x 的答案来帮助其他人,但要意识到这些对我来说毫无用处。) 作为速度的关键,MacPorts 连续花了 2 天多的时间来构建 GCC 4.6!
I'm trying to go back into programming after a few years break. I also want to try this C++11 stuff. So I installed GCC 4.6 from MacPorts. However, I still want to use 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? (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.
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. So any answers have to be for 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我当然没有在 10.4 或 Xcode 2.5 上测试过这些东西,但我最近确实让 GCC 4.6 在 Xcode 4.2 中工作。在 3.6 和 4.2 中,有一些编译器模板 XML 文件,您可以在安装新编译器后对其进行修改。在 4.2 中,它们位于:
/Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/
在 3.6 中,位于 /Developer/Library/Xcode/Plug-ins
我有不知道它们是否存在于 2.5 中,但它们可能存在。如果您想了解我如何使用更新版本执行此操作的详细信息,您可以在这里找到它们:
http://thecoderslife.blogspot.com/2015/07/building-with-gcc-46-and-xcode-4.html
它可能帮助您了解从哪里开始使用旧版本。
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. In 3.6 and 4.2 there are some compiler template XML files that you can modify once you install a new compiler. In 4.2 they are here:
/Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/
In 3.6 the are in /Developer/Library/Xcode/Plug-ins
I have no idea if they exist in 2.5, but they might. 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
It might help give you some ideas on where to start with the older version.