[Pythonmac-SIG] building universal binaries

Ronald Oussoren ronaldoussoren at mac.com
Fri Jan 27 09:06:19 CET 2006

On 27-jan-2006, at 4:02, Bob Ippolito wrote:

> 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.

The compiler issue really is a problem, although we could probably  
hack around this using a script that runs the actual compilers and  
then using lipo to merge the result. As I said before, it should be  
possible to build a 10.3.0 compatible build using the 10.4 SDK. This  
does require patching several modules (posixmodule.c is one of them)  
because 10.4 has several functions that are not available on earlier  
editions of the OS. I seem to have removed that patch from
my system, but recreating it shouldn't be very hard now that I know  
how to do it. Getting it accepted into the Python repository might be  
a different story.

The advantage of building on 10.4 is that the Intel and PPC versions  
will have the same features when run on a Tiger system.


> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2157 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20060127/de00b3eb/attachment-0001.bin 

More information about the Pythonmac-SIG mailing list