Georg Brandl | fcaf910 | 2008-07-16 02:17:56 +0000 | [diff] [blame] | 1 | #ifndef PYMACCONFIG_H |
| 2 | #define PYMACCONFIG_H |
| 3 | /* |
| 4 | * This file moves some of the autoconf magic to compile-time |
| 5 | * when building on MacOSX. This is needed for building 4-way |
| 6 | * universal binaries and for 64-bit universal binaries because |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 7 | * the values redefined below aren't configure-time constant but |
Georg Brandl | fcaf910 | 2008-07-16 02:17:56 +0000 | [diff] [blame] | 8 | * only compile-time constant in these scenarios. |
| 9 | */ |
| 10 | |
| 11 | #if defined(__APPLE__) |
| 12 | |
| 13 | # undef SIZEOF_LONG |
| 14 | # undef SIZEOF_PTHREAD_T |
| 15 | # undef SIZEOF_SIZE_T |
| 16 | # undef SIZEOF_TIME_T |
| 17 | # undef SIZEOF_VOID_P |
Benjamin Peterson | c39d762 | 2008-12-30 17:56:45 +0000 | [diff] [blame] | 18 | # undef SIZEOF__BOOL |
Ronald Oussoren | c2e1cb7 | 2009-12-01 15:55:14 +0000 | [diff] [blame] | 19 | # undef SIZEOF_UINTPTR_T |
| 20 | # undef SIZEOF_PTHREAD_T |
Benjamin Peterson | c39d762 | 2008-12-30 17:56:45 +0000 | [diff] [blame] | 21 | # undef WORDS_BIGENDIAN |
Mark Dickinson | b08a53a | 2009-04-16 19:52:09 +0000 | [diff] [blame] | 22 | # undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 |
| 23 | # undef DOUBLE_IS_BIG_ENDIAN_IEEE754 |
| 24 | # undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754 |
Mark Dickinson | 0cd526e | 2009-04-25 18:22:27 +0000 | [diff] [blame] | 25 | # undef HAVE_GCC_ASM_FOR_X87 |
Georg Brandl | fcaf910 | 2008-07-16 02:17:56 +0000 | [diff] [blame] | 26 | |
| 27 | # undef VA_LIST_IS_ARRAY |
| 28 | # if defined(__LP64__) && defined(__x86_64__) |
| 29 | # define VA_LIST_IS_ARRAY 1 |
| 30 | # endif |
| 31 | |
| 32 | # undef HAVE_LARGEFILE_SUPPORT |
| 33 | # ifndef __LP64__ |
| 34 | # define HAVE_LARGEFILE_SUPPORT 1 |
| 35 | # endif |
| 36 | |
| 37 | # undef SIZEOF_LONG |
| 38 | # ifdef __LP64__ |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 39 | # define SIZEOF__BOOL 1 |
| 40 | # define SIZEOF__BOOL 1 |
| 41 | # define SIZEOF_LONG 8 |
| 42 | # define SIZEOF_PTHREAD_T 8 |
| 43 | # define SIZEOF_SIZE_T 8 |
| 44 | # define SIZEOF_TIME_T 8 |
| 45 | # define SIZEOF_VOID_P 8 |
| 46 | # define SIZEOF_UINTPTR_T 8 |
| 47 | # define SIZEOF_PTHREAD_T 8 |
Georg Brandl | fcaf910 | 2008-07-16 02:17:56 +0000 | [diff] [blame] | 48 | # else |
Benjamin Peterson | c39d762 | 2008-12-30 17:56:45 +0000 | [diff] [blame] | 49 | # ifdef __ppc__ |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 50 | # define SIZEOF__BOOL 4 |
Benjamin Peterson | c39d762 | 2008-12-30 17:56:45 +0000 | [diff] [blame] | 51 | # else |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 52 | # define SIZEOF__BOOL 1 |
Benjamin Peterson | c39d762 | 2008-12-30 17:56:45 +0000 | [diff] [blame] | 53 | # endif |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 54 | # define SIZEOF_LONG 4 |
| 55 | # define SIZEOF_PTHREAD_T 4 |
| 56 | # define SIZEOF_SIZE_T 4 |
| 57 | # define SIZEOF_TIME_T 4 |
| 58 | # define SIZEOF_VOID_P 4 |
| 59 | # define SIZEOF_UINTPTR_T 4 |
| 60 | # define SIZEOF_PTHREAD_T 4 |
Georg Brandl | fcaf910 | 2008-07-16 02:17:56 +0000 | [diff] [blame] | 61 | # endif |
| 62 | |
| 63 | # if defined(__LP64__) |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 64 | /* MacOSX 10.4 (the first release to suppport 64-bit code |
| 65 | * at all) only supports 64-bit in the UNIX layer. |
| 66 | * Therefore surpress the toolbox-glue in 64-bit mode. |
| 67 | */ |
Georg Brandl | fcaf910 | 2008-07-16 02:17:56 +0000 | [diff] [blame] | 68 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 69 | /* In 64-bit mode setpgrp always has no argments, in 32-bit |
| 70 | * mode that depends on the compilation environment |
| 71 | */ |
| 72 | # undef SETPGRP_HAVE_ARG |
Georg Brandl | fcaf910 | 2008-07-16 02:17:56 +0000 | [diff] [blame] | 73 | |
| 74 | # endif |
| 75 | |
Benjamin Peterson | c39d762 | 2008-12-30 17:56:45 +0000 | [diff] [blame] | 76 | #ifdef __BIG_ENDIAN__ |
| 77 | #define WORDS_BIGENDIAN 1 |
Mark Dickinson | b08a53a | 2009-04-16 19:52:09 +0000 | [diff] [blame] | 78 | #define DOUBLE_IS_BIG_ENDIAN_IEEE754 |
| 79 | #else |
| 80 | #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 |
Benjamin Peterson | c39d762 | 2008-12-30 17:56:45 +0000 | [diff] [blame] | 81 | #endif /* __BIG_ENDIAN */ |
| 82 | |
Ronald Oussoren | 309608b | 2009-12-08 16:35:28 +0000 | [diff] [blame] | 83 | #ifdef __i386__ |
| 84 | # define HAVE_GCC_ASM_FOR_X87 |
| 85 | #endif |
| 86 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 87 | /* |
| 88 | * The definition in pyconfig.h is only valid on the OS release |
| 89 | * where configure ran on and not necessarily for all systems where |
| 90 | * the executable can be used on. |
| 91 | * |
| 92 | * Specifically: OSX 10.4 has limited supported for '%zd', while |
| 93 | * 10.5 has full support for '%zd'. A binary built on 10.5 won't |
| 94 | * work properly on 10.4 unless we surpress the definition |
| 95 | * of PY_FORMAT_SIZE_T |
| 96 | */ |
| 97 | #undef PY_FORMAT_SIZE_T |
Ronald Oussoren | 1cc369c | 2009-04-19 10:40:48 +0000 | [diff] [blame] | 98 | |
Benjamin Peterson | c39d762 | 2008-12-30 17:56:45 +0000 | [diff] [blame] | 99 | |
Georg Brandl | fcaf910 | 2008-07-16 02:17:56 +0000 | [diff] [blame] | 100 | #endif /* defined(_APPLE__) */ |
| 101 | |
| 102 | #endif /* PYMACCONFIG_H */ |