How to stop setup.py from trying to include -arch ppc in MacOSX builds?

It appears that Xcode4 no longer includes PPC as a build option. When using setup.py for modules that contain C extensions, setup.py always tries to build with these parameters:

gcc-4.2 ... -DMACOSX -arch i386 -arch ppc ...

This fails with error message

/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386

If I just remove -arch ppc from the failed command, it ends and I can restart setup.py buildto go to the next step.

This is normal for modules that include only one C extension, such as ssl, but for something like PIL, which creates a ton of extensions, this is a big pain.

Is there a way to prevent installing setup.py from including -arch ppc in compilation options?

+3
source share
1

, Xcode 4 ppc.

$ 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
+2

All Articles