[Pythonmac-SIG] building universal binaries

Ronald Oussoren ronaldoussoren at mac.com
Thu Jan 26 09:48:48 CET 2006

On 26-jan-2006, at 0:47, bear wrote:

> Bob Ippolito wrote:
>> One thing to note is that you can probably build with minimal  
>> patching
>> (via the universal SDK), but the result will only run on Mac OS X  
>> 10.4
>> and later.  It requires major patching in order to create a Python
>> binary that is Mac OS X 10.3 or 10.2 compatible.
> My goal is first to get Python building on 10.4 (i386 arch) and  
> then to
> worry about multi-arch binaries.

That part is easy enough. If you want a framework build you'll have  
to patch Makefile.pre.in because it contains a hardcoded '-arch ppc'  
in the section that builds that actual framework. Otherwise it should  
just build (assuming you have an intel mac of course, cross-building  
from PPC to Intel will be hard because the build process assumes  
you'll do a native build).

> Once that happens I can start to do the steps to build multi-arch, but
> that is a secondary goal because I think we could live with different
> downloads for ppc and i386 for the short term.
>> Additionally, you'll end up with a Python that has these SDK-build
>> flags baked into its Makefile, so it's not ideally distributable --
>> because building extensions would require having the SDK(s)
>> installed...  but perhaps that's not a terrible idea, to have a
>> separate distribution of Python designed for building redistributable
>> applications.  It would certainly be easier than trying to make
>> distutils and autoconf smart.

I'm (very slowly) playing around with adding '-arch ppc -arch i386'  
to the build flags and building on an intel host. That way you won't  
have to use SDKs, which makes it less likely that configure picks up  
other information than the actual compile (not that there should be  
any differences if you use the 10.4u SDK).

With some effort it should be possible to build a version of python  
that will run on 10.3 as well. As far as python is concerned the  
differences between 10.3 and 10.4 seem to be fairly small. The reason  
I'd like to do this instead of merging a build-on-10.3 PPC version  
and a build-on-10.4 intel version is that the latter would contain  
small incompatibilities between the intel and ppc version (some  
scripts would work on intel but not on ppc).


More information about the Pythonmac-SIG mailing list