创建“通用二进制”来自两个应用程序?

发布于 2024-08-02 11:33:15 字数 374 浏览 7 评论 0原文

简短问题:如何将两个应用程序(一个用于 intel,另一个用于 ppc)将它们打包到一个通用二进制文件中?

我目前对此问题的想法:

我已经阅读了有关通用二进制文件的苹果开发人员文档,但无法找到答案,因此它可能是不可能的。

由于我不会在这里讨论的原因,我的程序有两个应用程序(与使用 xtools 通用编译二进制文件相反),一个用于 Intel Mac,另一个用于在 PPC 上运行的 Mac >=10.3.9。共享资源不是问题。

我可以将 MyProg_intel.app 和 MyProg_ppc.app 放入一个 zip 中并以这种方式分发;但这可能会导致我将向其分发程序的许多人感到困惑。

Short question: How do you take two apps, one for intel and the other ppc, and package them into one Universal Binary?

My current thoughts on this problem:

I have read though the apple developer documentation on universal binaries and haven't been able to find an answer so it may not be possible.

Due to reasons I won't go into here I have two apps of my program (apposed to using xtools to compile the binary universally once), one for Intel Macs and the other for Mac >=10.3.9 running on PPC. Sharing resources is a non-issue.

I could put both MyProg_intel.app and MyProg_ppc.app into one zip and distribute it that way; but that may result in confusion for many people who I will be distributing my program to.

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

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

发布评论

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

评论(4

云淡风轻 2024-08-09 11:33:16

请参阅 lipo 工具。它将让您将 PPC 和 i386 二进制文件拼接在一起。

此外,有时可以通过使用 条件构建设置。例如,如果您需要为每个架构链接不同的二进制库,这非常有用。

See the lipo tool. It will let you stitch together your PPC and i386 binaries.

Also, sometimes separate targets for different architectures can be avoided by using conditional build settings in Xcode. This is useful if you need to link against a different binary library for each architecture, for example.

岁月蹉跎了容颜 2024-08-09 11:33:16

查看 lipo 的手册页。我相信您可以使用 -create 获取多个输入文件并创建具有多个体系结构的单个输出文件。

Check out the man page for lipo. I believe you can use -create to take multiple input files and create a single output file with multiple architectures.

故人的歌 2024-08-09 11:33:16

Apple 的开发者网站上有一篇关于构建开源通用二进制文件的文章,其中解释了如何使用 Xcode 使用构建脚本“打包”通用二进制文件。这可能是你恢复理智的最佳途径。您可以使用 lipo,但从长远来看,如果您要更新和维护您的应用程序,拥有一个能为您带来魔力的 Xcode 项目将占用您更少的时间。

Apple's developer web site has an article on Building an Open Source Universal Binary that explains how to use Xcode to 'package' a Universal Binary using build scripts. This is probably your best road to sanity. You could use lipo, but in the long run if you are going to update and maintain your application, having an Xcode project that does the magic for you is going to take up a lot less of your time.

向日葵 2024-08-09 11:33:16

为了创建通用二进制文件,您必须使用 Xcode 并选择 Intel 和 PPC 目标架构。据我所知,您不能事后将两个不同的二进制文件塞到一个 .app 中。

In order to create a Universal Binary, you have to use Xcode and select both Intel and PPC target architectures. As far as I know, you can't just stuff two different binaries into one .app ex post facto.

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