由于苹果只在Xcode4中附带了SDK10.6,所以用Xcode4开发PPC应用程序变得不可能了。虽然可以使用Xcode4开发也可以在10.5甚至10.4系统上运行的应用程序(通过选择SDK10.6,但部署目标是10.5或10.4),但它们只能在Intel上运行,因为构建PPC应用程序至少需要SDK10.5。
此外,也有一些罕见的情况,您确实需要在10.6之前针对SDK构建完整的平台支持,例如,如果某些不推荐的功能已从10.6 SDK中完全消失,但您将不得不使用它,在这些情况下,动态链接并不总是最好的选择。此外,与早期SDK链接有时会简化开发,因为您不应该使用它,因为它会导致与早期OS版本不兼容,因此无法使用,而且任何使用它的尝试都会立即导致编译器或链接器错误。
最后但并非最不重要的是,苹果还从Xcode4中删除了GCC 4.0的支持,这对于某些软件的正确构建可能是必要的,而且苹果从未允许在使用SDK 10.4时用GCC 4.2编译软件,尽管我几乎不相信这真的会造成任何问题,因为所有使用MacOS 4.2和SDK10.6构建的软件都可以在MacOS10.4上运行,只要部署目标设置正确,并且没有使用MacOS 10.4下不可用的功能。
当然,Xcode3的并行安装可以与Xcode4并行,但这意味着您必须放弃所有(很好的?)Xcode4的新特性,并继续使用过时的Xcode3 IDE。如果您还可以在与新IDE相同的IDE中管理所有旧项目,并从任何可用的新功能中受益,那当然会好得多。并不是所有的项目都能在可预见的将来实现10.6或Intel。此外,我严格反对提前取消对旧平台的支持,这是非常必要的。
我们能把这个功能恢复到Xcode4?吗?
发布于 2011-04-05 00:00:21
另一种简单的方法是只使用Xcode4,不再需要Xcode3。
$ sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/ppc /Developer/usr/libexec/gcc/darwin
$ sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/ppc /usr/libexec/gcc/darwin
编辑:
对于Xcode 4.1,
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/ppc /Developer/usr/libexec/gcc/darwin
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/ppc /usr/libexec/gcc/darwin
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/powerpc-apple-darwin10-cpp-4.2.1 /usr/bin/powerpc-apple-darwin11-cpp-4.2.1
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/powerpc-apple-darwin10-gcc-4.2.1 /usr/bin/powerpc-apple-darwin11-gcc-4.2.1
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/powerpc-apple-darwin10-g++-4.2.1 /usr/bin/powerpc-apple-darwin11-g++-4.2.1
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/powerpc-apple-darwin10-cpp-4.2.1 /Developer/usr/bin/powerpc-apple-darwin11-cpp-4.2.1
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/powerpc-apple-darwin10-gcc-4.2.1 /Developer/usr/bin/powerpc-apple-darwin11-gcc-4.2.1
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/powerpc-apple-darwin10-g++-4.2.1 /Developer/usr/bin/powerpc-apple-darwin11-g++-4.2.1
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/powerpc-apple-darwin10 /Developer/SDKs/MacOSX10.6.sdk/usr/lib/gcc
您可以只对PowerPC使用gcc-4.2。并且需要“-isysroot/Developer/SDKs/MacOSX10.6.sdk”选项,因为10.7SDK不再支持PowerPC。
发布于 2011-08-11 20:54:43
我收集了本页面、Mac提示、splhack.org和这里引用的其他来源的所有信息,并汇集了一组BASH脚本,这些脚本使用XCode 3安装或仅使用XCode 4自己的iPhone平台文件自动恢复PPC和GCC 4.0支持的过程。
和往常一样,小心使用!并请提供任何修正或改进。这些脚本只在我自己的系统上进行了测试。
您可以从GitHub下载它们:
发布于 2011-03-21 08:54:46
如果您想让gcc也从命令行工作(以及上面的内容),您还需要:
cd /usr/libexec/gcc/powerpc-apple-darwin10/4.2.1
sudo mv as as.bak
sudo ln -s /Xcode3/usr/bin/as .
https://stackoverflow.com/questions/5333490
复制相似问题