Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
michael@0 | 2 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 3 | // found in the LICENSE file. |
michael@0 | 4 | |
michael@0 | 5 | // This file adds defines about the platform we're currently building on. |
michael@0 | 6 | // Operating System: |
michael@0 | 7 | // OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX) |
michael@0 | 8 | // Compiler: |
michael@0 | 9 | // COMPILER_MSVC / COMPILER_GCC |
michael@0 | 10 | // Processor: |
michael@0 | 11 | // ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64) |
michael@0 | 12 | // ARCH_CPU_32_BITS / ARCH_CPU_64_BITS |
michael@0 | 13 | |
michael@0 | 14 | #ifndef BUILD_BUILD_CONFIG_H_ |
michael@0 | 15 | #define BUILD_BUILD_CONFIG_H_ |
michael@0 | 16 | |
michael@0 | 17 | #if defined(__APPLE__) |
michael@0 | 18 | #include <TargetConditionals.h> |
michael@0 | 19 | #endif |
michael@0 | 20 | |
michael@0 | 21 | // A set of macros to use for platform detection. |
michael@0 | 22 | #if defined(ANDROID) |
michael@0 | 23 | #define OS_ANDROID 1 |
michael@0 | 24 | #elif defined(__APPLE__) |
michael@0 | 25 | #define OS_MACOSX 1 |
michael@0 | 26 | #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE |
michael@0 | 27 | #define OS_IOS 1 |
michael@0 | 28 | #endif // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE |
michael@0 | 29 | #elif defined(__native_client__) |
michael@0 | 30 | #define OS_NACL 1 |
michael@0 | 31 | #elif defined(__linux__) |
michael@0 | 32 | #define OS_LINUX 1 |
michael@0 | 33 | // Use TOOLKIT_GTK on linux if TOOLKIT_VIEWS isn't defined. |
michael@0 | 34 | #if !defined(TOOLKIT_VIEWS) && defined(USE_X11) |
michael@0 | 35 | #define TOOLKIT_GTK |
michael@0 | 36 | #endif |
michael@0 | 37 | #if defined(__GLIBC__) && !defined(__UCLIBC__) |
michael@0 | 38 | // we really are using glibc, not uClibc pretending to be glibc |
michael@0 | 39 | #define LIBC_GLIBC |
michael@0 | 40 | #endif |
michael@0 | 41 | #elif defined(_WIN32) |
michael@0 | 42 | #define OS_WIN 1 |
michael@0 | 43 | #define TOOLKIT_VIEWS 1 |
michael@0 | 44 | #elif defined(__FreeBSD__) |
michael@0 | 45 | #define OS_FREEBSD 1 |
michael@0 | 46 | #define TOOLKIT_GTK |
michael@0 | 47 | #elif defined(__OpenBSD__) |
michael@0 | 48 | #define OS_OPENBSD 1 |
michael@0 | 49 | #define TOOLKIT_GTK |
michael@0 | 50 | #elif defined(__sun) |
michael@0 | 51 | #define OS_SOLARIS 1 |
michael@0 | 52 | #define TOOLKIT_GTK |
michael@0 | 53 | #else |
michael@0 | 54 | #error Please add support for your platform in build/build_config.h |
michael@0 | 55 | #endif |
michael@0 | 56 | |
michael@0 | 57 | #if defined(USE_OPENSSL) && defined(USE_NSS) |
michael@0 | 58 | #error Cannot use both OpenSSL and NSS |
michael@0 | 59 | #endif |
michael@0 | 60 | |
michael@0 | 61 | // For access to standard BSD features, use OS_BSD instead of a |
michael@0 | 62 | // more specific macro. |
michael@0 | 63 | #if defined(OS_FREEBSD) || defined(OS_OPENBSD) |
michael@0 | 64 | #define OS_BSD 1 |
michael@0 | 65 | #endif |
michael@0 | 66 | |
michael@0 | 67 | // For access to standard POSIXish features, use OS_POSIX instead of a |
michael@0 | 68 | // more specific macro. |
michael@0 | 69 | #if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) || \ |
michael@0 | 70 | defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_ANDROID) || \ |
michael@0 | 71 | defined(OS_NACL) |
michael@0 | 72 | #define OS_POSIX 1 |
michael@0 | 73 | #endif |
michael@0 | 74 | |
michael@0 | 75 | // Use tcmalloc |
michael@0 | 76 | #if (defined(OS_WIN) || defined(OS_LINUX) || defined(OS_ANDROID)) && \ |
michael@0 | 77 | !defined(NO_TCMALLOC) |
michael@0 | 78 | #define USE_TCMALLOC 1 |
michael@0 | 79 | #endif |
michael@0 | 80 | |
michael@0 | 81 | // Compiler detection. |
michael@0 | 82 | #if defined(__GNUC__) |
michael@0 | 83 | #define COMPILER_GCC 1 |
michael@0 | 84 | #elif defined(_MSC_VER) |
michael@0 | 85 | #define COMPILER_MSVC 1 |
michael@0 | 86 | #else |
michael@0 | 87 | #error Please add support for your compiler in build/build_config.h |
michael@0 | 88 | #endif |
michael@0 | 89 | |
michael@0 | 90 | // Processor architecture detection. For more info on what's defined, see: |
michael@0 | 91 | // http://msdn.microsoft.com/en-us/library/b0084kay.aspx |
michael@0 | 92 | // http://www.agner.org/optimize/calling_conventions.pdf |
michael@0 | 93 | // or with gcc, run: "echo | gcc -E -dM -" |
michael@0 | 94 | #if defined(_M_X64) || defined(__x86_64__) |
michael@0 | 95 | #define ARCH_CPU_X86_FAMILY 1 |
michael@0 | 96 | #define ARCH_CPU_X86_64 1 |
michael@0 | 97 | #define ARCH_CPU_64_BITS 1 |
michael@0 | 98 | #define ARCH_CPU_LITTLE_ENDIAN 1 |
michael@0 | 99 | #elif defined(_M_IX86) || defined(__i386__) |
michael@0 | 100 | #define ARCH_CPU_X86_FAMILY 1 |
michael@0 | 101 | #define ARCH_CPU_X86 1 |
michael@0 | 102 | #define ARCH_CPU_32_BITS 1 |
michael@0 | 103 | #define ARCH_CPU_LITTLE_ENDIAN 1 |
michael@0 | 104 | #elif defined(__ARMEL__) |
michael@0 | 105 | #define ARCH_CPU_ARM_FAMILY 1 |
michael@0 | 106 | #define ARCH_CPU_ARMEL 1 |
michael@0 | 107 | #define ARCH_CPU_32_BITS 1 |
michael@0 | 108 | #define ARCH_CPU_LITTLE_ENDIAN 1 |
michael@0 | 109 | #elif defined(__pnacl__) |
michael@0 | 110 | #define ARCH_CPU_32_BITS 1 |
michael@0 | 111 | #elif defined(__MIPSEL__) |
michael@0 | 112 | #define ARCH_CPU_MIPS_FAMILY 1 |
michael@0 | 113 | #define ARCH_CPU_MIPSEL 1 |
michael@0 | 114 | #define ARCH_CPU_32_BITS 1 |
michael@0 | 115 | #define ARCH_CPU_LITTLE_ENDIAN 1 |
michael@0 | 116 | #else |
michael@0 | 117 | #error Please add support for your architecture in build/build_config.h |
michael@0 | 118 | #endif |
michael@0 | 119 | |
michael@0 | 120 | // Type detection for wchar_t. |
michael@0 | 121 | #if defined(OS_WIN) |
michael@0 | 122 | #define WCHAR_T_IS_UTF16 |
michael@0 | 123 | #elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ |
michael@0 | 124 | defined(__WCHAR_MAX__) && \ |
michael@0 | 125 | (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff) |
michael@0 | 126 | #define WCHAR_T_IS_UTF32 |
michael@0 | 127 | #elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ |
michael@0 | 128 | defined(__WCHAR_MAX__) && \ |
michael@0 | 129 | (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff) |
michael@0 | 130 | // On Posix, we'll detect short wchar_t, but projects aren't guaranteed to |
michael@0 | 131 | // compile in this mode (in particular, Chrome doesn't). This is intended for |
michael@0 | 132 | // other projects using base who manage their own dependencies and make sure |
michael@0 | 133 | // short wchar works for them. |
michael@0 | 134 | #define WCHAR_T_IS_UTF16 |
michael@0 | 135 | #else |
michael@0 | 136 | #error Please add support for your compiler in build/build_config.h |
michael@0 | 137 | #endif |
michael@0 | 138 | |
michael@0 | 139 | #if defined(__ARMEL__) && !defined(OS_IOS) |
michael@0 | 140 | #define WCHAR_T_IS_UNSIGNED 1 |
michael@0 | 141 | #elif defined(__MIPSEL__) |
michael@0 | 142 | #define WCHAR_T_IS_UNSIGNED 0 |
michael@0 | 143 | #endif |
michael@0 | 144 | |
michael@0 | 145 | #if defined(OS_ANDROID) |
michael@0 | 146 | // The compiler thinks std::string::const_iterator and "const char*" are |
michael@0 | 147 | // equivalent types. |
michael@0 | 148 | #define STD_STRING_ITERATOR_IS_CHAR_POINTER |
michael@0 | 149 | // The compiler thinks base::string16::const_iterator and "char16*" are |
michael@0 | 150 | // equivalent types. |
michael@0 | 151 | #define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER |
michael@0 | 152 | #endif |
michael@0 | 153 | |
michael@0 | 154 | #endif // BUILD_BUILD_CONFIG_H_ |