Index: configure.in =================================================================== --- configure.in (revision 66818) +++ configure.in (working copy) @@ -3283,7 +3283,24 @@ # check for endianness AC_C_BIGENDIAN +AH_VERBATIM([WORDS_BIGENDIAN], +[ + /* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). + The block below does compile-time checking for endianness on platforms + that use GCC and therefore allows compiling fat binaries on OSX by using + '-arch ppc -arch i386' as the compile flags. The phrasing was choosen + such that the configure-result is used on systems that don't use GCC. + */ +#ifdef __BIG_ENDIAN__ +#define WORDS_BIGENDIAN 1 +#else +#ifndef __LITTLE_ENDIAN__ +#undef WORDS_BIGENDIAN +#endif +#endif]) + # Check whether right shifting a negative integer extends the sign bit # or fills with zeros (like the Cray J90, according to Tim Peters). AC_MSG_CHECKING(whether right shift extends the sign bit) Index: pyconfig.h.in =================================================================== --- pyconfig.h.in (revision 66818) +++ pyconfig.h.in (working copy) @@ -979,9 +979,22 @@ /* Define to profile with the Pentium timestamp counter */ #undef WITH_TSC -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ + + /* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). + + The block below does compile-time checking for endianness on platforms + that use GCC and therefore allows compiling fat binaries on OSX by using + '-arch ppc -arch i386' as the compile flags. The phrasing was choosen + such that the configure-result is used on systems that don't use GCC. + */ +#ifdef __BIG_ENDIAN__ +#define WORDS_BIGENDIAN 1 +#else +#ifndef __LITTLE_ENDIAN__ #undef WORDS_BIGENDIAN +#endif +#endif /* Define to 1 if on AIX 3. System headers sometimes define this.