blob: 9e058c18ccd744b577b1f845730a108cc2b6ba63 [file] [log] [blame]
Georg Brandlfcaf9102008-07-16 02:17:56 +00001#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 Pitrou7f14f0d2010-05-09 16:14:21 +00007 * the values redefined below aren't configure-time constant but
Georg Brandlfcaf9102008-07-16 02:17:56 +00008 * 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 Petersonc39d7622008-12-30 17:56:45 +000018# undef SIZEOF__BOOL
19# undef WORDS_BIGENDIAN
Mark Dickinsonb08a53a2009-04-16 19:52:09 +000020# undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754
21# undef DOUBLE_IS_BIG_ENDIAN_IEEE754
22# undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
Mark Dickinson0cd526e2009-04-25 18:22:27 +000023# undef HAVE_GCC_ASM_FOR_X87
Georg Brandlfcaf9102008-07-16 02:17:56 +000024
25# undef VA_LIST_IS_ARRAY
26# if defined(__LP64__) && defined(__x86_64__)
27# define VA_LIST_IS_ARRAY 1
28# endif
29
30# undef HAVE_LARGEFILE_SUPPORT
31# ifndef __LP64__
32# define HAVE_LARGEFILE_SUPPORT 1
33# endif
34
35# undef SIZEOF_LONG
36# ifdef __LP64__
Antoine Pitrou7f14f0d2010-05-09 16:14:21 +000037# define SIZEOF__BOOL 1
38# define SIZEOF__BOOL 1
39# define SIZEOF_LONG 8
40# define SIZEOF_PTHREAD_T 8
41# define SIZEOF_SIZE_T 8
42# define SIZEOF_TIME_T 8
43# define SIZEOF_VOID_P 8
Georg Brandlfcaf9102008-07-16 02:17:56 +000044# else
Benjamin Petersonc39d7622008-12-30 17:56:45 +000045# ifdef __ppc__
Antoine Pitrou7f14f0d2010-05-09 16:14:21 +000046# define SIZEOF__BOOL 4
Benjamin Petersonc39d7622008-12-30 17:56:45 +000047# else
Antoine Pitrou7f14f0d2010-05-09 16:14:21 +000048# define SIZEOF__BOOL 1
Benjamin Petersonc39d7622008-12-30 17:56:45 +000049# endif
Antoine Pitrou7f14f0d2010-05-09 16:14:21 +000050# define SIZEOF_LONG 4
51# define SIZEOF_PTHREAD_T 4
52# define SIZEOF_SIZE_T 4
53# define SIZEOF_TIME_T 4
54# define SIZEOF_VOID_P 4
Georg Brandlfcaf9102008-07-16 02:17:56 +000055# endif
56
57# if defined(__LP64__)
Antoine Pitrou7f14f0d2010-05-09 16:14:21 +000058 /* MacOSX 10.4 (the first release to suppport 64-bit code
59 * at all) only supports 64-bit in the UNIX layer.
60 * Therefore surpress the toolbox-glue in 64-bit mode.
61 */
Georg Brandlfcaf9102008-07-16 02:17:56 +000062
Antoine Pitrou7f14f0d2010-05-09 16:14:21 +000063 /* In 64-bit mode setpgrp always has no argments, in 32-bit
64 * mode that depends on the compilation environment
65 */
66# undef SETPGRP_HAVE_ARG
Georg Brandlfcaf9102008-07-16 02:17:56 +000067
68# endif
69
Benjamin Petersonc39d7622008-12-30 17:56:45 +000070#ifdef __BIG_ENDIAN__
71#define WORDS_BIGENDIAN 1
Mark Dickinsonb08a53a2009-04-16 19:52:09 +000072#define DOUBLE_IS_BIG_ENDIAN_IEEE754
73#else
74#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754
Benjamin Petersonc39d7622008-12-30 17:56:45 +000075#endif /* __BIG_ENDIAN */
76
Ronald Oussoren2cfd61a2009-12-08 16:36:47 +000077#ifdef __i386__
78# define HAVE_GCC_ASM_FOR_X87
79#endif
80
Antoine Pitrou7f14f0d2010-05-09 16:14:21 +000081 /*
82 * The definition in pyconfig.h is only valid on the OS release
83 * where configure ran on and not necessarily for all systems where
84 * the executable can be used on.
85 *
86 * Specifically: OSX 10.4 has limited supported for '%zd', while
87 * 10.5 has full support for '%zd'. A binary built on 10.5 won't
88 * work properly on 10.4 unless we surpress the definition
89 * of PY_FORMAT_SIZE_T
90 */
91#undef PY_FORMAT_SIZE_T
Ronald Oussoren1cc369c2009-04-19 10:40:48 +000092
Benjamin Petersonc39d7622008-12-30 17:56:45 +000093
Georg Brandlfcaf9102008-07-16 02:17:56 +000094#endif /* defined(_APPLE__) */
95
96#endif /* PYMACCONFIG_H */