[Pythonmac-SIG] macpython on future apple's intel processors?

Russell Finn rsfinn at gmail.com
Wed Jun 8 21:28:33 CEST 2005


On 6/8/05, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
> It should be possible to split the configure script into two parts:
> one that tests cpu features (sizeof(int), byte order, ...) and one
> that tests API features (do we have sockets, ...). The cpu-features
> part can be converted to something that uses feature macros instead
> of detection, e.g.
> 
> #if defined __i386__
> #define LITTLE_ENDIAN
> ...
> #elif defined __ppc__
> #define BIG_ENDIAN
> ...
> #elif ...
> ...

It looks like Apple has anticipated you here
<http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/universal_binary_compiling/chapter_2_section_6.html>:

"If you are compiling a project that uses autoconf and trying to build
it for both the PowerPC and x86 architectures, you need to make sure
that when the project configures itself, it doesn't use autoconf
macros to determine the endian type of the runtime system. For
example, if your project uses the autoconf AC_C_BIGENDIAN macro, the
program won't work correctly when it is run on the opposite
architecture from the one you are targeting when you configure the
project. To correctly build for both PowerPC and x86 architectures,
use the compiler-defined __BIG_ENDIAN__ and __LITTLE_ENDIAN__ macros
in your code."

Apparently these symbols are already defined for you by gcc. (I'm
still trying to find exactly where it says so in the Apple
documentation.)

-- Russell Finn


More information about the Pythonmac-SIG mailing list