Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: build/common.gypi

Issue 18846002: Factor out toolset definitions in a separate gypi file (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Makefile ('k') | build/features.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2012 the V8 project authors. All rights reserved.
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
28 # Shared definitions for all V8-related targets.
29
30 {
31 'variables': {
32 'msvs_use_common_release': 0,
33 'gcc_version%': 'unknown',
34 'CXX%': '${CXX:-$(which g++)}', # Used to assemble a shell command.
35 'v8_compress_startup_data%': 'off',
36 'v8_target_arch%': '<(target_arch)',
37 # Native Client builds currently use the V8 ARM JIT and
38 # arm/simulator-arm.cc to defer the significant effort required
39 # for NaCl JIT support. The nacl_target_arch variable provides
40 # the 'true' target arch for places in this file that need it.
41 # TODO(bradchen): get rid of nacl_target_arch when someday
42 # NaCl V8 builds stop using the ARM simulator
43 'nacl_target_arch%': 'none', # must be set externally
44
45 # Setting 'v8_can_use_unaligned_accesses' to 'true' will allow the code
46 # generated by V8 to do unaligned memory access, and setting it to 'false'
47 # will ensure that the generated code will always do aligned memory
48 # accesses. The default value of 'default' will try to determine the correct
49 # setting. Note that for Intel architectures (ia32 and x64) unaligned memory
50 # access is allowed for all CPUs.
51 'v8_can_use_unaligned_accesses%': 'default',
52
53 # Setting 'v8_can_use_vfp32dregs' to 'true' will cause V8 to use the VFP
54 # registers d16-d31 in the generated code, both in the snapshot and for the
55 # ARM target. Leaving the default value of 'false' will avoid the use of
56 # these registers in the snapshot and use CPU feature probing when running
57 # on the target.
58 'v8_can_use_vfp32dregs%': 'false',
59 'arm_test%': 'off',
60
61 # Similar to vfp but on MIPS.
62 'v8_can_use_fpu_instructions%': 'true',
63
64 # Similar to the ARM hard float ABI but on MIPS.
65 'v8_use_mips_abi_hardfloat%': 'true',
66
67 # Default arch variant for MIPS.
68 'mips_arch_variant%': 'mips32r2',
69
70 'v8_enable_debugger_support%': 1,
71
72 'v8_enable_backtrace%': 0,
73
74 'v8_enable_disassembler%': 0,
75
76 'v8_enable_gdbjit%': 0,
77
78 'v8_object_print%': 0,
79
80 # Enable profiling support. Only required on Windows.
81 'v8_enable_prof%': 0,
82
83 'v8_enable_verify_heap%': 0,
84
85 # Some versions of GCC 4.5 seem to need -fno-strict-aliasing.
86 'v8_no_strict_aliasing%': 0,
87
88 # Chrome needs this definition unconditionally. For standalone V8 builds,
89 # it's handled in build/standalone.gypi.
90 'want_separate_host_toolset%': 1,
91
92 'v8_use_snapshot%': 'true',
93 'host_os%': '<(OS)',
94 'werror%': '-Werror',
95
96 # With post mortem support enabled, metadata is embedded into libv8 that
97 # describes various parameters of the VM for use by debuggers. See
98 # tools/gen-postmortem-metadata.py for details.
99 'v8_postmortem_support%': 'false',
100
101 # For a shared library build, results in "libv8-<(soname_version).so".
102 'soname_version%': '',
103
104 # Interpreted regexp engine exists as platform-independent alternative
105 # based where the regular expression is compiled to a bytecode.
106 'v8_interpreted_regexp%': 0,
107
108 # Enable ECMAScript Internationalization API. Enabling this feature will
109 # add a dependency on the ICU library.
110 'v8_enable_i18n_support%': 0,
111 },
112 'target_defaults': {
113 'conditions': [
114 ['v8_enable_debugger_support==1', {
115 'defines': ['ENABLE_DEBUGGER_SUPPORT',],
116 }],
117 ['v8_enable_disassembler==1', {
118 'defines': ['ENABLE_DISASSEMBLER',],
119 }],
120 ['v8_enable_gdbjit==1', {
121 'defines': ['ENABLE_GDB_JIT_INTERFACE',],
122 }],
123 ['v8_object_print==1', {
124 'defines': ['OBJECT_PRINT',],
125 }],
126 ['v8_enable_verify_heap==1', {
127 'defines': ['VERIFY_HEAP',],
128 }],
129 ['v8_interpreted_regexp==1', {
130 'defines': ['V8_INTERPRETED_REGEXP',],
131 }],
132 ['v8_enable_i18n_support==1', {
133 'defines': ['V8_I18N_SUPPORT',],
134 }],
135 ['v8_target_arch=="arm"', {
136 'defines': [
137 'V8_TARGET_ARCH_ARM',
138 ],
139 'target_conditions': [
140 ['_toolset=="host"', {
141 'variables': {
142 'armcompiler': '<!($(echo ${CXX_host:-$(which g++)}) -v 2>&1 | gre p -q "^Target: arm" && echo "yes" || echo "no")',
143 },
144 'conditions': [
145 ['armcompiler=="yes"', {
146 'conditions': [
147 [ 'armv7==1', {
148 'cflags': ['-march=armv7-a',],
149 }],
150 [ 'armv7==1 or armv7=="default"', {
151 'conditions': [
152 [ 'arm_neon==1', {
153 'cflags': ['-mfpu=neon',],
154 },
155 {
156 'conditions': [
157 [ 'arm_fpu!="default"', {
158 'cflags': ['-mfpu=<(arm_fpu)',],
159 }],
160 ],
161 }],
162 ],
163 }],
164 [ 'arm_float_abi!="default"', {
165 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
166 }],
167 [ 'arm_thumb==1', {
168 'cflags': ['-mthumb',],
169 }],
170 [ 'arm_thumb==0', {
171 'cflags': ['-marm',],
172 }],
173 [ 'arm_test=="on"', {
174 'defines': [
175 'ARM_TEST',
176 ],
177 }],
178 ],
179 }, {
180 # armcompiler=="no"
181 'conditions': [
182 [ 'armv7==1 or armv7=="default"', {
183 'defines': [
184 'CAN_USE_ARMV7_INSTRUCTIONS=1',
185 ],
186 'conditions': [
187 [ 'arm_fpu=="default"', {
188 'defines': [
189 'CAN_USE_VFP3_INSTRUCTIONS',
190 ],
191 }],
192 [ 'arm_fpu=="vfpv3-d16"', {
193 'defines': [
194 'CAN_USE_VFP3_INSTRUCTIONS',
195 ],
196 }],
197 [ 'arm_fpu=="vfpv3"', {
198 'defines': [
199 'CAN_USE_VFP3_INSTRUCTIONS',
200 'CAN_USE_VFP32DREGS',
201 ],
202 }],
203 [ 'arm_fpu=="neon" or arm_neon==1', {
204 'defines': [
205 'CAN_USE_VFP3_INSTRUCTIONS',
206 'CAN_USE_VFP32DREGS',
207 ],
208 }],
209 ],
210 }],
211 [ 'arm_float_abi=="hard"', {
212 'defines': [
213 'USE_EABI_HARDFLOAT=1',
214 ],
215 }],
216 [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', {
217 'defines': [
218 'USE_EABI_HARDFLOAT=0',
219 ],
220 }],
221 ],
222 'defines': [
223 'ARM_TEST',
224 ],
225 }],
226 ],
227 }], # _toolset=="host"
228 ['_toolset=="target"', {
229 'variables': {
230 'armcompiler': '<!($(echo ${CXX_target:-<(CXX)}) -v 2>&1 | grep -q "^Target: arm" && echo "yes" || echo "no")',
231 },
232 'conditions': [
233 ['armcompiler=="yes"', {
234 'conditions': [
235 [ 'armv7==1', {
236 'cflags': ['-march=armv7-a',],
237 }],
238 [ 'armv7==1 or armv7=="default"', {
239 'conditions': [
240 [ 'arm_neon==1', {
241 'cflags': ['-mfpu=neon',],
242 },
243 {
244 'conditions': [
245 [ 'arm_fpu!="default"', {
246 'cflags': ['-mfpu=<(arm_fpu)',],
247 }],
248 ],
249 }],
250 ],
251 }],
252 [ 'arm_float_abi!="default"', {
253 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
254 }],
255 [ 'arm_thumb==1', {
256 'cflags': ['-mthumb',],
257 }],
258 [ 'arm_thumb==0', {
259 'cflags': ['-marm',],
260 }],
261 [ 'arm_test=="on"', {
262 'defines': [
263 'ARM_TEST',
264 ],
265 }],
266 ],
267 }, {
268 # armcompiler=="no"
269 'conditions': [
270 [ 'armv7==1 or armv7=="default"', {
271 'defines': [
272 'CAN_USE_ARMV7_INSTRUCTIONS=1',
273 ],
274 'conditions': [
275 [ 'arm_fpu=="default"', {
276 'defines': [
277 'CAN_USE_VFP3_INSTRUCTIONS',
278 ],
279 }],
280 [ 'arm_fpu=="vfpv3-d16"', {
281 'defines': [
282 'CAN_USE_VFP3_INSTRUCTIONS',
283 ],
284 }],
285 [ 'arm_fpu=="vfpv3"', {
286 'defines': [
287 'CAN_USE_VFP3_INSTRUCTIONS',
288 'CAN_USE_VFP32DREGS',
289 ],
290 }],
291 [ 'arm_fpu=="neon" or arm_neon==1', {
292 'defines': [
293 'CAN_USE_VFP3_INSTRUCTIONS',
294 'CAN_USE_VFP32DREGS',
295 ],
296 }],
297 ],
298 }],
299 [ 'arm_float_abi=="hard"', {
300 'defines': [
301 'USE_EABI_HARDFLOAT=1',
302 ],
303 }],
304 [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', {
305 'defines': [
306 'USE_EABI_HARDFLOAT=0',
307 ],
308 }],
309 ],
310 'defines': [
311 'ARM_TEST',
312 ],
313 }],
314 ],
315 }], # _toolset=="target"
316 ],
317 }], # v8_target_arch=="arm"
318 ['v8_target_arch=="ia32"', {
319 'defines': [
320 'V8_TARGET_ARCH_IA32',
321 ],
322 }], # v8_target_arch=="ia32"
323 ['v8_target_arch=="mipsel"', {
324 'defines': [
325 'V8_TARGET_ARCH_MIPS',
326 ],
327 'variables': {
328 'mipscompiler': '<!($(echo <(CXX)) -v 2>&1 | grep -q "^Target: mips" & & echo "yes" || echo "no")',
329 },
330 'conditions': [
331 ['mipscompiler=="yes"', {
332 'target_conditions': [
333 ['_toolset=="target"', {
334 'cflags': ['-EL'],
335 'ldflags': ['-EL'],
336 'conditions': [
337 [ 'v8_use_mips_abi_hardfloat=="true"', {
338 'cflags': ['-mhard-float'],
339 'ldflags': ['-mhard-float'],
340 }, {
341 'cflags': ['-msoft-float'],
342 'ldflags': ['-msoft-float'],
343 }],
344 ['mips_arch_variant=="mips32r2"', {
345 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
346 }],
347 ['mips_arch_variant=="mips32r1"', {
348 'cflags': ['-mips32', '-Wa,-mips32'],
349 }],
350 ['mips_arch_variant=="loongson"', {
351 'cflags': ['-mips3', '-Wa,-mips3'],
352 }],
353 ],
354 }],
355 ],
356 }],
357 [ 'v8_can_use_fpu_instructions=="true"', {
358 'defines': [
359 'CAN_USE_FPU_INSTRUCTIONS',
360 ],
361 }],
362 [ 'v8_use_mips_abi_hardfloat=="true"', {
363 'defines': [
364 '__mips_hard_float=1',
365 'CAN_USE_FPU_INSTRUCTIONS',
366 ],
367 }, {
368 'defines': [
369 '__mips_soft_float=1'
370 ],
371 }],
372 ['mips_arch_variant=="mips32r2"', {
373 'defines': ['_MIPS_ARCH_MIPS32R2',],
374 }],
375 ['mips_arch_variant=="loongson"', {
376 'defines': ['_MIPS_ARCH_LOONGSON',],
377 }],
378 ],
379 }], # v8_target_arch=="mipsel"
380 ['v8_target_arch=="x64"', {
381 'defines': [
382 'V8_TARGET_ARCH_X64',
383 ],
384 'xcode_settings': {
385 'ARCHS': [ 'x86_64' ],
386 },
387 'msvs_settings': {
388 'VCLinkerTool': {
389 'StackReserveSize': '2097152',
390 },
391 },
392 'msvs_configuration_platform': 'x64',
393 }], # v8_target_arch=="x64"
394 ['v8_compress_startup_data=="bz2"', {
395 'defines': [
396 'COMPRESS_STARTUP_DATA_BZ2',
397 ],
398 }],
399 ['OS=="win"', {
400 'defines': [
401 'WIN32',
402 ],
403 'msvs_configuration_attributes': {
404 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
405 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
406 'CharacterSet': '1',
407 },
408 }],
409 ['OS=="win" and v8_enable_prof==1', {
410 'msvs_settings': {
411 'VCLinkerTool': {
412 'GenerateMapFile': 'true',
413 },
414 },
415 }],
416 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
417 or OS=="netbsd"', {
418 'conditions': [
419 [ 'v8_no_strict_aliasing==1', {
420 'cflags': [ '-fno-strict-aliasing' ],
421 }],
422 ], # conditions
423 }],
424 ['OS=="solaris"', {
425 'defines': [ '__C99FEATURES__=1' ], # isinf() etc.
426 }],
427 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
428 or OS=="netbsd" or OS=="mac" or OS=="android") and \
429 (v8_target_arch=="arm" or v8_target_arch=="ia32" or \
430 v8_target_arch=="mipsel")', {
431 # Check whether the host compiler and target compiler support the
432 # '-m32' option and set it if so.
433 'target_conditions': [
434 ['_toolset=="host"', {
435 'variables': {
436 'm32flag': '<!((echo | $(echo ${CXX_host:-$(which g++)}) -m32 -E - > /dev/null 2>&1) && echo "-m32" || true)',
437 },
438 'cflags': [ '<(m32flag)' ],
439 'ldflags': [ '<(m32flag)' ],
440 'xcode_settings': {
441 'ARCHS': [ 'i386' ],
442 },
443 }],
444 ['_toolset=="target"', {
445 'variables': {
446 'm32flag': '<!((echo | $(echo ${CXX_target:-<(CXX)}) -m32 -E - > / dev/null 2>&1) && echo "-m32" || true)',
447 'clang%': 0,
448 },
449 'conditions': [
450 ['(OS!="android" or clang==1) and \
451 nacl_target_arch!="nacl_x64"', {
452 'cflags': [ '<(m32flag)' ],
453 'ldflags': [ '<(m32flag)' ],
454 }],
455 ],
456 'xcode_settings': {
457 'ARCHS': [ 'i386' ],
458 },
459 }],
460 ],
461 }],
462 ['(OS=="linux") and (v8_target_arch=="x64")', {
463 # Check whether the host compiler and target compiler support the
464 # '-m64' option and set it if so.
465 'target_conditions': [
466 ['_toolset=="host"', {
467 'variables': {
468 'm64flag': '<!((echo | $(echo ${CXX_host:-$(which g++)}) -m64 -E - > /dev/null 2>&1) && echo "-m64" || true)',
469 },
470 'cflags': [ '<(m64flag)' ],
471 'ldflags': [ '<(m64flag)' ],
472 }],
473 ['_toolset=="target"', {
474 'variables': {
475 'm64flag': '<!((echo | $(echo ${CXX_target:-<(CXX)}) -m64 -E - > / dev/null 2>&1) && echo "-m64" || true)',
476 },
477 'cflags': [ '<(m64flag)' ],
478 'ldflags': [ '<(m64flag)' ],
479 }]
480 ],
481 }],
482 ['OS=="freebsd" or OS=="openbsd"', {
483 'cflags': [ '-I/usr/local/include' ],
484 }],
485 ['OS=="netbsd"', {
486 'cflags': [ '-I/usr/pkg/include' ],
487 }],
488 ], # conditions
489 'configurations': {
490 'Debug': {
491 'variables': {
492 'v8_enable_extra_checks%': 1,
493 },
494 'defines': [
495 'DEBUG',
496 'ENABLE_DISASSEMBLER',
497 'V8_ENABLE_CHECKS',
498 'OBJECT_PRINT',
499 'VERIFY_HEAP',
500 ],
501 'msvs_settings': {
502 'VCCLCompilerTool': {
503 'Optimization': '0',
504
505 'conditions': [
506 ['OS=="win" and component=="shared_library"', {
507 'RuntimeLibrary': '3', # /MDd
508 }, {
509 'RuntimeLibrary': '1', # /MTd
510 }],
511 ],
512 },
513 'VCLinkerTool': {
514 'LinkIncremental': '2',
515 },
516 },
517 'conditions': [
518 ['v8_enable_extra_checks==1', {
519 'defines': ['ENABLE_EXTRA_CHECKS',],
520 }],
521 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
522 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
523 '-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
524 }],
525 ['OS=="linux" and v8_enable_backtrace==1', {
526 # Support for backtrace_symbols.
527 'ldflags': [ '-rdynamic' ],
528 }],
529 ['OS=="android"', {
530 'variables': {
531 'android_full_debug%': 1,
532 },
533 'conditions': [
534 ['android_full_debug==0', {
535 # Disable full debug if we want a faster v8 in a debug build.
536 # TODO(2304): pass DISABLE_DEBUG_ASSERT instead of hiding DEBUG.
537 'defines!': [
538 'DEBUG',
539 ],
540 }],
541 ],
542 }],
543 ['OS=="mac"', {
544 'xcode_settings': {
545 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
546 },
547 }],
548 ],
549 }, # Debug
550 'Release': {
551 'variables': {
552 'v8_enable_extra_checks%': 0,
553 },
554 'conditions': [
555 ['v8_enable_extra_checks==1', {
556 'defines': ['ENABLE_EXTRA_CHECKS',],
557 }],
558 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
559 'cflags!': [
560 '-O2',
561 '-Os',
562 ],
563 'cflags': [
564 '-fdata-sections',
565 '-ffunction-sections',
566 '-O3',
567 ],
568 'conditions': [
569 [ 'gcc_version==44 and clang==0', {
570 'cflags': [
571 # Avoid crashes with gcc 4.4 in the v8 test suite.
572 '-fno-tree-vrp',
573 ],
574 }],
575 ],
576 }],
577 ['OS=="android"', {
578 'cflags!': [
579 '-O3',
580 '-Os',
581 ],
582 'cflags': [
583 '-fdata-sections',
584 '-ffunction-sections',
585 '-O2',
586 ],
587 'conditions': [
588 [ 'gcc_version==44 and clang==0', {
589 'cflags': [
590 # Avoid crashes with gcc 4.4 in the v8 test suite.
591 '-fno-tree-vrp',
592 ],
593 }],
594 ],
595 }],
596 ['OS=="mac"', {
597 'xcode_settings': {
598 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
599
600 # -fstrict-aliasing. Mainline gcc
601 # enables this at -O2 and above,
602 # but Apple gcc does not unless it
603 # is specified explicitly.
604 'GCC_STRICT_ALIASING': 'YES',
605 },
606 }], # OS=="mac"
607 ['OS=="win"', {
608 'msvs_settings': {
609 'VCCLCompilerTool': {
610 'Optimization': '2',
611 'InlineFunctionExpansion': '2',
612 'EnableIntrinsicFunctions': 'true',
613 'FavorSizeOrSpeed': '0',
614 'StringPooling': 'true',
615 'conditions': [
616 ['OS=="win" and component=="shared_library"', {
617 'RuntimeLibrary': '2', #/MD
618 }, {
619 'RuntimeLibrary': '0', #/MT
620 }],
621 ['v8_target_arch=="x64"', {
622 # TODO(2207): remove this option once the bug is fixed.
623 'WholeProgramOptimization': 'true',
624 }],
625 ],
626 },
627 'VCLinkerTool': {
628 'LinkIncremental': '1',
629 'OptimizeReferences': '2',
630 'EnableCOMDATFolding': '2',
631 },
632 },
633 }], # OS=="win"
634 ], # conditions
635 }, # Release
636 }, # configurations
637 }, # target_defaults
638 }
OLDNEW
« no previous file with comments | « Makefile ('k') | build/features.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698