[Pythonmac-SIG] universal python framework?
ronaldoussoren at mac.com
Sat Dec 10 10:04:44 CET 2005
On 9-dec-2005, at 21:36, Jack Jansen wrote:
> On 9-dec-2005, at 18:56, William Kyngesburye wrote:
>> I'm starting to build universal binaries for a bunch of 'nix stuff,
>> some of which have python bindings/extensions. Has anyone looked at
>> a universal Python framework? I'd hate to have to step backwards to
>> Apple's included Python framework for that, but I may have to.
> There's a fairly recent Apple technote that discusses how to build
> universal binaries for products with a configure/make build
> procedure, such as Python, and I hope to look at that next week. But
> Ronald already discovered that distutils has problems with building
> universal extensions, so that may also turn out to be a problem
> (although he wants to build something more complicated, with the PPC
> binary being 10.3/10.4 compatible).
The problem I discovered has nothing to do with being 10.3
problem is that distutils exposes the contents of pyconfig.h through a
python interface. Some python packages use that functionality
guess only those of people that really understand distutils). This is
from the setup.py in cElementTree:
config_h = sysconfig.get_config_h_filename()
config_h_vars = sysconfig.parse_config_h(open(config_h))
for feature_macro in ["HAVE_MEMMOVE", "HAVE_BCOPY"]:
if sys.byteorder == "little":
This luckily doesn't use stuff like 'WORDS_BIGENDIAN' or 'SIZEOF_INT'
therefore not cause problems with universal builds in that regard.
sys.byteorder to the compiler does of course cause minor problems.
I don't know how serious this problem is, I'd guess that most python
extensions don't contain compilications like this.
I ran into this issue when I tried to build a binary installer for
I tried to replace pyconfig.h by a header file that includes the
pyconfig.h for 10.3
or 10.4 based on feature macros, but that caused problems when I
tried to build
With respect to 10.3 compatibility: I like the fact that there's
currently 1 binairy
distribution of python for OSX and would like to keep it that way.
having discrepancies in functionality between python-universal
running on 10.4-x86
and python-universal running on 10.4-ppc is a bit of a challenge, but
> And the "easy" way is to simply configure Python twice (Python builds
> nicely in a different directory than the source, I'm doing that all
> the time), once for ppc once for x86, and then using lipo to combine
> Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
> If I can't dance I don't want to be part of your revolution -- Emma
> Pythonmac-SIG maillist - Pythonmac-SIG at python.org
More information about the Pythonmac-SIG