xref: /haiku/headers/build/config/HaikuConfig.h (revision a1f8d8a11c9ba7d1697a6270a221693a0c969667)
1 /*
2  * Copyright 2009, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _CONFIG_HAIKU_CONFIG_H
6 #define _CONFIG_HAIKU_CONFIG_H
7 
8 
9 /* Determine the architecture and define macros for some fundamental
10    properties:
11    __HAIKU_ARCH			- short name of the architecture (used in paths)
12    __HAIKU_ARCH_<arch>	- defined to 1 for the respective architecture
13    __HAIKU_ARCH_64_BIT	- defined to 1 on 64 bit architectures
14    __HAIKU_BIG_ENDIAN	- defined to 1 on big endian architectures
15 */
16 #ifdef __INTEL__
17 #	ifdef HAIKU_HOST_PLATFORM_64_BIT
18 #		define __HAIKU_ARCH			x86_64
19 #		define __HAIKU_ARCH_X86_64	1
20 #		define __HAIKU_ARCH_64_BIT	1
21 #	else
22 #		define __HAIKU_ARCH			x86
23 #		define __HAIKU_ARCH_X86		1
24 #	endif
25 #elif __POWERPC__
26 #	define __HAIKU_ARCH				ppc
27 #	define __HAIKU_ARCH_PPC			1
28 #	define __HAIKU_BIG_ENDIAN		1
29 #elif __M68K__
30 #	define __HAIKU_ARCH	m68k		1
31 #	define __HAIKU_ARCH_M68K		1
32 #	define __HAIKU_BIG_ENDIAN		1
33 #elif __MIPSEL__
34 #	define __HAIKU_ARCH				mipsel
35 #	define __HAIKU_ARCH_MIPSEL		1
36 #elif __ARM__
37 #	define __HAIKU_ARCH				arm
38 #	define __HAIKU_ARCH_ARM			1
39 #else
40 #	error Unsupported architecture!
41 #endif
42 
43 /* implied properties */
44 #ifndef __HAIKU_ARCH_64_BIT
45 #	define	__HAIKU_ARCH_32_BIT		1
46 #endif
47 #ifndef __HAIKU_BIG_ENDIAN
48 #	define	__HAIKU_LITTLE_ENDIAN	1
49 #endif
50 
51 /* architecture specific include macros */
52 #define __HAIKU_ARCH_HEADER(header)					<arch/__HAIKU_ARCH/header>
53 #define __HAIKU_SUBDIR_ARCH_HEADER(subdir, header)	\
54 	<subdir/arch/__HAIKU_ARCH/header>
55 
56 /* BeOS R5 binary compatibility (gcc 2 on x86) */
57 #if defined(__HAIKU_ARCH_X86) && __GNUC__ == 2
58 #	define __HAIKU_BEOS_COMPATIBLE	1
59 #endif
60 
61 /* BeOS R5 compatible types */
62 #ifdef __HAIKU_ARCH_X86
63 	/* TODO: This should be "#ifdef __HAIKU_BEOS_COMPATIBLE", but this will
64 	   break all gcc 4 C++ optional packages. I.e. switch that at a suitable
65 	   time.
66 	*/
67 #	define __HAIKU_BEOS_COMPATIBLE_TYPES	1
68 #endif
69 
70 #endif	/* _CONFIG_HAIKU_CONFIG_H */
71