Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 1 | # Copyright 2011 the V8 project authors. All rights reserved. |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 2 | # Redistribution and use in source and binary forms, with or without |
| 3 | # modification, are permitted provided that the following conditions are |
| 4 | # met: |
| 5 | # |
| 6 | # * Redistributions of source code must retain the above copyright |
| 7 | # notice, this list of conditions and the following disclaimer. |
| 8 | # * Redistributions in binary form must reproduce the above |
| 9 | # copyright notice, this list of conditions and the following |
| 10 | # disclaimer in the documentation and/or other materials provided |
| 11 | # with the distribution. |
| 12 | # * Neither the name of Google Inc. nor the names of its |
| 13 | # contributors may be used to endorse or promote products derived |
| 14 | # from this software without specific prior written permission. |
| 15 | # |
| 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 28 | # Shared definitions for all V8-related targets. |
| 29 | |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 30 | { |
| 31 | 'variables': { |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 32 | 'use_system_v8%': 0, |
| 33 | 'msvs_use_common_release': 0, |
| 34 | 'gcc_version%': 'unknown', |
| 35 | 'v8_compress_startup_data%': 'off', |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 36 | 'v8_target_arch%': '<(target_arch)', |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 37 | |
| 38 | # Setting 'v8_can_use_unaligned_accesses' to 'true' will allow the code |
| 39 | # generated by V8 to do unaligned memory access, and setting it to 'false' |
| 40 | # will ensure that the generated code will always do aligned memory |
| 41 | # accesses. The default value of 'default' will try to determine the correct |
| 42 | # setting. Note that for Intel architectures (ia32 and x64) unaligned memory |
| 43 | # access is allowed for all CPUs. |
| 44 | 'v8_can_use_unaligned_accesses%': 'default', |
| 45 | |
| 46 | # Setting 'v8_can_use_vfp_instructions' to 'true' will enable use of ARM VFP |
| 47 | # instructions in the V8 generated code. VFP instructions will be enabled |
| 48 | # both for the snapshot and for the ARM target. Leaving the default value |
| 49 | # of 'false' will avoid VFP instructions in the snapshot and use CPU feature |
| 50 | # probing when running on the target. |
| 51 | 'v8_can_use_vfp_instructions%': 'false', |
| 52 | |
| 53 | # Setting v8_use_arm_eabi_hardfloat to true will turn on V8 support for ARM |
| 54 | # EABI calling convention where double arguments are passed in VFP |
| 55 | # registers. Note that the GCC flag '-mfloat-abi=hard' should be used as |
| 56 | # well when compiling for the ARM target. |
| 57 | 'v8_use_arm_eabi_hardfloat%': 'false', |
| 58 | |
| 59 | 'v8_enable_debugger_support%': 1, |
| 60 | |
| 61 | 'v8_enable_disassembler%': 0, |
| 62 | |
| 63 | 'v8_enable_gdbjit%': 0, |
| 64 | |
| 65 | # Enable profiling support. Only required on Windows. |
| 66 | 'v8_enable_prof%': 0, |
| 67 | |
| 68 | # Chrome needs this definition unconditionally. For standalone V8 builds, |
| 69 | # it's handled in build/standalone.gypi. |
| 70 | 'want_separate_host_toolset%': 1, |
| 71 | |
| 72 | 'v8_use_snapshot%': 'true', |
| 73 | 'host_os%': '<(OS)', |
| 74 | 'v8_use_liveobjectlist%': 'false', |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame^] | 75 | |
| 76 | # For a shared library build, results in "libv8-<(soname_version).so". |
| 77 | 'soname_version%': '', |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 78 | }, |
| 79 | 'target_defaults': { |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 80 | 'conditions': [ |
| 81 | ['v8_enable_debugger_support==1', { |
| 82 | 'defines': ['ENABLE_DEBUGGER_SUPPORT',], |
| 83 | }], |
| 84 | ['v8_enable_disassembler==1', { |
| 85 | 'defines': ['ENABLE_DISASSEMBLER',], |
| 86 | }], |
| 87 | ['v8_enable_gdbjit==1', { |
| 88 | 'defines': ['ENABLE_GDB_JIT_INTERFACE',], |
| 89 | }], |
| 90 | ['OS!="mac"', { |
| 91 | # TODO(mark): The OS!="mac" conditional is temporary. It can be |
| 92 | # removed once the Mac Chromium build stops setting target_arch to |
| 93 | # ia32 and instead sets it to mac. Other checks in this file for |
| 94 | # OS=="mac" can be removed at that time as well. This can be cleaned |
| 95 | # up once http://crbug.com/44205 is fixed. |
| 96 | 'conditions': [ |
| 97 | ['v8_target_arch=="arm"', { |
| 98 | 'defines': [ |
| 99 | 'V8_TARGET_ARCH_ARM', |
| 100 | ], |
| 101 | 'conditions': [ |
| 102 | [ 'v8_can_use_unaligned_accesses=="true"', { |
| 103 | 'defines': [ |
| 104 | 'CAN_USE_UNALIGNED_ACCESSES=1', |
| 105 | ], |
| 106 | }], |
| 107 | [ 'v8_can_use_unaligned_accesses=="false"', { |
| 108 | 'defines': [ |
| 109 | 'CAN_USE_UNALIGNED_ACCESSES=0', |
| 110 | ], |
| 111 | }], |
| 112 | [ 'v8_can_use_vfp_instructions=="true"', { |
| 113 | 'defines': [ |
| 114 | 'CAN_USE_VFP_INSTRUCTIONS', |
| 115 | ], |
| 116 | }], |
| 117 | [ 'v8_use_arm_eabi_hardfloat=="true"', { |
| 118 | 'defines': [ |
| 119 | 'USE_EABI_HARDFLOAT=1', |
| 120 | 'CAN_USE_VFP_INSTRUCTIONS', |
| 121 | ], |
| 122 | 'cflags': [ |
| 123 | '-mfloat-abi=hard', |
| 124 | ], |
| 125 | }, { |
| 126 | 'defines': [ |
| 127 | 'USE_EABI_HARDFLOAT=0', |
| 128 | ], |
| 129 | }], |
| 130 | # The ARM assembler assumes the host is 32 bits, |
| 131 | # so force building 32-bit host tools. |
| 132 | ['host_arch=="x64"', { |
| 133 | 'target_conditions': [ |
| 134 | ['_toolset=="host"', { |
| 135 | 'cflags': ['-m32'], |
| 136 | 'ldflags': ['-m32'], |
| 137 | }], |
| 138 | ], |
| 139 | }], |
| 140 | ], |
| 141 | }], |
| 142 | ['v8_target_arch=="ia32"', { |
| 143 | 'defines': [ |
| 144 | 'V8_TARGET_ARCH_IA32', |
| 145 | ], |
| 146 | }], |
| 147 | ['v8_target_arch=="mips"', { |
| 148 | 'defines': [ |
| 149 | 'V8_TARGET_ARCH_MIPS', |
| 150 | ], |
| 151 | }], |
| 152 | ['v8_target_arch=="x64"', { |
| 153 | 'defines': [ |
| 154 | 'V8_TARGET_ARCH_X64', |
| 155 | ], |
| 156 | }], |
| 157 | ], |
| 158 | }], |
| 159 | ['v8_use_liveobjectlist=="true"', { |
| 160 | 'defines': [ |
| 161 | 'ENABLE_DEBUGGER_SUPPORT', |
| 162 | 'INSPECTOR', |
| 163 | 'OBJECT_PRINT', |
| 164 | 'LIVEOBJECTLIST', |
| 165 | ], |
| 166 | }], |
| 167 | ['v8_compress_startup_data=="bz2"', { |
| 168 | 'defines': [ |
| 169 | 'COMPRESS_STARTUP_DATA_BZ2', |
| 170 | ], |
| 171 | }], |
| 172 | ['OS=="win" and v8_enable_prof==1', { |
| 173 | 'msvs_settings': { |
| 174 | 'VCLinkerTool': { |
| 175 | 'GenerateMapFile': 'true', |
| 176 | }, |
| 177 | }, |
| 178 | }], |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame^] | 179 | ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { |
| 180 | 'conditions': [ |
| 181 | [ 'target_arch=="ia32"', { |
| 182 | 'cflags': [ '-m32' ], |
| 183 | 'ldflags': [ '-m32' ], |
| 184 | }], |
| 185 | ], |
| 186 | }], |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 187 | ], |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 188 | 'configurations': { |
| 189 | 'Debug': { |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 190 | 'defines': [ |
| 191 | 'DEBUG', |
| 192 | 'ENABLE_DISASSEMBLER', |
| 193 | 'V8_ENABLE_CHECKS', |
| 194 | 'OBJECT_PRINT', |
| 195 | ], |
| 196 | 'msvs_settings': { |
| 197 | 'VCCLCompilerTool': { |
| 198 | 'Optimization': '0', |
| 199 | |
| 200 | 'conditions': [ |
| 201 | ['OS=="win" and component=="shared_library"', { |
| 202 | 'RuntimeLibrary': '3', # /MDd |
| 203 | }, { |
| 204 | 'RuntimeLibrary': '1', # /MTd |
| 205 | }], |
| 206 | ], |
| 207 | }, |
| 208 | 'VCLinkerTool': { |
| 209 | 'LinkIncremental': '2', |
| 210 | # For future reference, the stack size needs to be increased |
| 211 | # when building for Windows 64-bit, otherwise some test cases |
| 212 | # can cause stack overflow. |
| 213 | # 'StackReserveSize': '297152', |
| 214 | }, |
| 215 | }, |
| 216 | 'conditions': [ |
| 217 | ['OS=="freebsd" or OS=="openbsd"', { |
| 218 | 'cflags': [ '-I/usr/local/include' ], |
| 219 | }], |
| 220 | ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { |
| 221 | 'cflags': [ '-Wall', '-Werror', '-W', '-Wno-unused-parameter', |
| 222 | '-Wnon-virtual-dtor' ], |
| 223 | }], |
| 224 | ], |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 225 | }, |
| 226 | 'Release': { |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 227 | 'conditions': [ |
| 228 | ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { |
| 229 | 'cflags!': [ |
| 230 | '-O2', |
| 231 | '-Os', |
| 232 | ], |
| 233 | 'cflags': [ |
| 234 | '-fdata-sections', |
| 235 | '-ffunction-sections', |
| 236 | '-fomit-frame-pointer', |
| 237 | '-O3', |
| 238 | ], |
| 239 | 'conditions': [ |
| 240 | [ 'gcc_version==44', { |
| 241 | 'cflags': [ |
| 242 | # Avoid crashes with gcc 4.4 in the v8 test suite. |
| 243 | '-fno-tree-vrp', |
| 244 | ], |
| 245 | }], |
| 246 | ], |
| 247 | }], |
| 248 | ['OS=="freebsd" or OS=="openbsd"', { |
| 249 | 'cflags': [ '-I/usr/local/include' ], |
| 250 | }], |
| 251 | ['OS=="mac"', { |
| 252 | 'xcode_settings': { |
| 253 | 'GCC_OPTIMIZATION_LEVEL': '3', # -O3 |
| 254 | |
| 255 | # -fstrict-aliasing. Mainline gcc |
| 256 | # enables this at -O2 and above, |
| 257 | # but Apple gcc does not unless it |
| 258 | # is specified explicitly. |
| 259 | 'GCC_STRICT_ALIASING': 'YES', |
| 260 | }, |
| 261 | }], |
| 262 | ['OS=="win"', { |
| 263 | 'msvs_configuration_attributes': { |
| 264 | 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)', |
| 265 | 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', |
| 266 | 'CharacterSet': '1', |
| 267 | }, |
| 268 | 'msvs_settings': { |
| 269 | 'VCCLCompilerTool': { |
| 270 | 'Optimization': '2', |
| 271 | 'InlineFunctionExpansion': '2', |
| 272 | 'EnableIntrinsicFunctions': 'true', |
| 273 | 'FavorSizeOrSpeed': '0', |
| 274 | 'OmitFramePointers': 'true', |
| 275 | 'StringPooling': 'true', |
| 276 | |
| 277 | 'conditions': [ |
| 278 | ['OS=="win" and component=="shared_library"', { |
| 279 | 'RuntimeLibrary': '2', #/MD |
| 280 | }, { |
| 281 | 'RuntimeLibrary': '0', #/MT |
| 282 | }], |
| 283 | ], |
| 284 | }, |
| 285 | 'VCLinkerTool': { |
| 286 | 'LinkIncremental': '1', |
| 287 | 'OptimizeReferences': '2', |
| 288 | 'OptimizeForWindows98': '1', |
| 289 | 'EnableCOMDATFolding': '2', |
| 290 | # For future reference, the stack size needs to be |
| 291 | # increased when building for Windows 64-bit, otherwise |
| 292 | # some test cases can cause stack overflow. |
| 293 | # 'StackReserveSize': '297152', |
| 294 | }, |
| 295 | }, |
| 296 | }], |
| 297 | ], |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 298 | }, |
| 299 | }, |
| 300 | }, |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 301 | } |