distutils & OS X universal binaries

"Martin v. Löwis" martin at v.loewis.de
Sat Dec 8 12:09:10 EST 2007


> PIL may also have a similar problem as the 1.1.6 setup.py script also
> defines WORDS_BIGENDIAN like this
> 
>         if struct.unpack("h", "\0\1")[0] == 1:
>             defs.append(("WORDS_BIGENDIAN", None))
> 
> probably I borrowed/stole this as we have something very similar in our
> setup.py.

All such checks are broken for fat binaries. Fat binaries essentially
are a form of cross-compilation, and in cross-compilation, thou shalt
not infer target system properties by looking at the host system.

(IOW, autoconf is, in principle, also broken for fat binaries. Indeed,
although the current solution for WORDS_BIGENDIAN is good for ppc
vs. x86, many of the other configure-time detected properties are
incorrect for ppc vs. ppc64 or x86 vs. amd64, such as SIZEOF_LONG)

Regards,
Martin



More information about the Python-list mailing list