用 macports 软件替换 xcode

发布于 2024-10-10 11:35:01 字数 542 浏览 3 评论 0原文

我一直在尝试用我可以从 macports 获得的东西替换 xcode 中的所有内容。到目前为止,我安装了xcode,然后安装了macports,然后使用macports安装了gcc,gcc_select,gmake,elf-bintools,bintools,arm-bintools(只是为了确保我替换了所有bintools),然后卸载了所有xcode。然后,我将 /usr/bin/make 与 /opt/local/bin/gmake 链接起来,并使用 gcc_select 选择 gcc44——来自 macports 的 gcc44。我还将所有 bintool 可执行路径导出到 .profile 路径中。

我确信这会起作用(尽管在连续工作 48 小时后我应该更清楚),但没有任何配置,并且日志文件都有常见错误: :info:configure 配置:错误:C 编译器无法创建可执行文件

我感觉它与库有关,但我真的不确定。

我使用的是 Mac 10.5.8。

如果这确实“不可能”,那么我需要 xcode 的哪些部分才能使 macports 工作?例如,我可以毫无问题地卸载 xcode 文件夹。

I have been trying to replace everything in xcode with stuff I can get from macports. So far, I installed xcode, then macports, then used macports to install gcc, gcc_select, gmake, elf-bintools, bintools, arm-bintools (just to be sure I replaced all the bintools), and then uninstalled all of xcode. I then linked /usr/bin/make with /opt/local/bin/gmake and used gcc_select to select gcc44--the one from macports. I also exported all the bintool executable paths into the .profile path.

I was sure this would work (although I should have known better after working on it for 48 hours straight), but nothing will configure, and the log files all have the common error:
:info:configure configure: error: C compiler cannot create executables

I have a feeling it has something to do with libraries, but I am really not sure.

I use a mac 10.5.8.

If this is truely 'impossible', what parts of xcode to I need for macports to work? For example, I can uninstall the xcode folder without a problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

染年凉城似染瑾 2024-10-17 11:35:02

如果你的意思真的是“Xcode 中的一切”,那是不可能的。但是,如果您只是谈论命令行工具(可能性更大),那么这可能是可能的,但这听起来是一个糟糕的主意。如果您不编写 Mac 或 iOS 应用程序,那么您可能对 Xcode 应用程序本身不感兴趣。

澄清您实际上希望使用您计划最终使用的最少工具集来完成什么将有助于我们提供更好的答案。你提到arm-bintools的事实让我猜测你可能希望开发iOS应用程序——我会回应评论中的警告,你会自找痛苦,却得不到任何东西相当可观的。我理解想要减少磁盘使用,但是购买更大的硬盘比您花额外的时间尝试做 Xcode 所做的事情要便宜得多。 (不仅仅是设置成本,还有日常使用中的生产力损失。)

顺便说一句,Xcode 中的 gcc 版本可能落后于 MacPorts 中的版本的原因之一是因为 Apple 投入了大量资金来替换 gcc clang-llvm,您会发现它的速度要快得多,并且正在更积极的开发中。


编辑回应OP:

鉴于目的只是开发科学计算代码的澄清,还有另一种选择。您仍然想安装 Xcode 来获取所有命令行工具,但您也许可以摆脱 Xcode 和您不喜欢使用的其他 GUI 应用程序。

运行 Xcode 安装程序时,在“安装类型”屏幕上暂停 - 选中“UNIX 开发”并取消选中其他所有选项。这会将组件安装到 /System/Library/usr 中。 (您可以通过在安装程序中选择文件 > 显示文件并展开 UNIX 开发子包来查看完整的文件列表。)Essentials 包(这是必需的安装)将安装到您选择的位置(默认为 /Developer),可以在安装完成后删除。安装在 /System/Library 中的额外 Mac 相关内容足够小(比 Essentials 包小一个数量级),我建议只保留 /System共。

这应该会在 /usr/bin/usr/lib/usr/include中留下 Xcode 提供的工件。 /usr/share/man 等,并允许您构建所需的任何自定义工具。我建议将它们构建到 /usr/local/* 中,以防止它们与现有工具发生冲突。祝你好运!

If you really mean "everything in Xcode", it's not possible. However, if you're just talking about the command-line tools (which is more likely) it may be possible, but it sounds like a terrible idea. If you're not writing Mac or iOS applications, the Xcode application itself may not be of interest to you.

Clarifying what you're actually hoping to accomplish with the minimal set of tools you plan to end up with would help us provide a better answer. The fact that you mention arm-bintools leads me to guess you may be hoping to develop iOS apps — and I'll echo the warnings from the comments that you'd be asking for pain and not gaining anything appreciable. I understand wanting to reduce disk usage, but shelling out for a larger hard drive will be much less expensive than the extra time you'd spend just trying to do what Xcode does. (Not just the setup cost, but loss of productivity in daily usage.)

BTW, one reason that the gcc version in Xcode may lag behind the one in MacPorts is because Apple is extremely invested in replacing gcc with clang-llvm, which you'll find is vastly faster and under more active development.


Edit in response to OP:

Given the clarification that the intent is to only develop scientific computing code, there's another option. You still want to install Xcode to get all the command-line tools, but you may be able to get rid of Xcode and the other GUI apps you don't care to use.

When running the Xcode installer, pause on the Installation Type screen — check "UNIX Development" and uncheck everything else you can. This will install components into /System/Library and /usr. (You can see the full list of files by selecting File > Show Files within the installer and expanding the UNIX Development sub-package.) The Essentials package (which is a required install) will install into a location of your choosing (default is /Developer) which can be deleted after the install completes. The extra Mac-related stuff installed in /System/Library is small enough (an order of magnitutde smaller than the Essentials package) that I'd recommend just leaving /System alone altogether.

This should leave you with the Xcode-provided artifacts in /usr/bin, /usr/lib, /usr/include, /usr/share/man, etc. and allow you to build whatever custom tools you need. I recommend building them into /usr/local/* to keep them from conflicting with existing tools. Good luck!

屌丝范 2024-10-17 11:35:02

你不能这样做,因为 macports 需要 Xcode。

有一些 macports 使用 macports gcc - 但大多数使用 Apple 工具。

You can't do this as macports needs Xcode.

There are some macports that use a macports gcc - but most use Apple tools.

多情出卖 2024-10-17 11:35:02

您可能遇到的一个问题是 OSX 不使用 ELF 二进制文件,因此 elf-bintools 可能没有多大帮助......

One issue you may be running into is that OSX doesn't use ELF binaries, so elf-bintools is probably not helping much...

谁的新欢旧爱 2024-10-17 11:35:02

另一种方法是使用 Gentoo 前缀 作为港口系统。这尝试仅使用自身的代码,因此您最终会使用更少的 Apple 代码,这似乎正是您想要的/

Another way would be to use Gentoo prefix as the port system. This tries to use only code from itself so you end up using less Apple code which seems to be what you want/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文