[Pythonmac-SIG] building universal binaries

Bob Ippolito bob at redivi.com
Fri Jan 27 04:02:53 CET 2006


On Jan 26, 2006, at 6:28 PM, Kevin Ollivier wrote:

> On Jan 26, 2006, at 12:48 AM, Ronald Oussoren wrote:
>
> [snip]
>
>> 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).
>
> IMHO, what would be cool is to allow the user to pass the SDK in as
> some sort of configure flag or maybe a shell variable, something like:
>
> ./configure <flags> MACOSX_SDK=/my/path/to/SDK
>
> This, along with the addition of the -arch i386 -arch ppc flags would
> be enough to enable someone to write a script to create a Panther-
> compatible Universal build. Which I'm pretty sure someone will do
> sooner or later. :-)

No, it wouldn't actually.  The 10.3 SDK is ppc only, and a Panther- 
compatible build (well, something compatible with 10.3.8 and below)  
must use GCC 3.3, but an x86 compatible build must use GCC 4.

In other words, something Panther compatible needs to use different  
compilers with totally different options for x86 and PPC.  It's not  
going to be easy, distutils doesn't come anywhere near close to  
supporting anything like that and neither does autoconf.

I think the only approach that doesn't require hacking a significant  
amount of Python's build process and distutils is to have two Python  
installations, one x86 only and one PPC only.  For distribution, you  
would cook up some way to lipo it all together.

-bob



More information about the Pythonmac-SIG mailing list