Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / v8 / build / standalone.gypi
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 # Definitions to be used when building stand-alone V8 binaries.
29
30 {
31   # We need to include toolchain.gypi here for third-party sources that don't
32   # directly include it themselves.
33   'includes': ['toolchain.gypi'],
34   'variables': {
35     'component%': 'static_library',
36     'asan%': 0,
37     'tsan%': 0,
38     'visibility%': 'hidden',
39     'v8_enable_backtrace%': 0,
40     'v8_enable_i18n_support%': 1,
41     'v8_deprecation_warnings': 1,
42     'msvs_multi_core_compile%': '1',
43     'mac_deployment_target%': '10.5',
44     'variables': {
45       'variables': {
46         'variables': {
47           'conditions': [
48             ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or \
49                OS=="netbsd" or OS=="mac" or OS=="qnx"', {
50               # This handles the Unix platforms we generally deal with.
51               # Anything else gets passed through, which probably won't work
52               # very well; such hosts should pass an explicit target_arch
53               # to gyp.
54               'host_arch%': '<!pymod_do_main(detect_v8_host_arch)',
55             }, {
56               # OS!="linux" and OS!="freebsd" and OS!="openbsd" and
57               # OS!="netbsd" and OS!="mac"
58               'host_arch%': 'ia32',
59             }],
60           ],
61         },
62         'host_arch%': '<(host_arch)',
63         'target_arch%': '<(host_arch)',
64       },
65       'host_arch%': '<(host_arch)',
66       'target_arch%': '<(target_arch)',
67       'v8_target_arch%': '<(target_arch)',
68     },
69     'host_arch%': '<(host_arch)',
70     'target_arch%': '<(target_arch)',
71     'v8_target_arch%': '<(v8_target_arch)',
72     'werror%': '-Werror',
73
74     # .gyp files or targets should set v8_code to 1 if they build V8 specific
75     # code, as opposed to external code.  This variable is used to control such
76     # things as the set of warnings to enable, and whether warnings are treated
77     # as errors.
78     'v8_code%': 0,
79
80     # Speeds up Debug builds:
81     # 0 - Compiler optimizations off (debuggable) (default). This may
82     #     be 5x slower than Release (or worse).
83     # 1 - Turn on compiler optimizations. This may be hard or impossible to
84     #     debug. This may still be 2x slower than Release (or worse).
85     # 2 - Turn on optimizations, and also #undef DEBUG / #define NDEBUG
86     #     (but leave V8_ENABLE_CHECKS and most other assertions enabled.
87     #     This may cause some v8 tests to fail in the Debug configuration.
88     #     This roughly matches the performance of a Release build and can
89     #     be used by embedders that need to build their own code as debug
90     #     but don't want or need a debug version of V8. This should produce
91     #     near-release speeds.
92     'v8_optimized_debug%': 0,
93
94     # Relative path to icu.gyp from this file.
95     'icu_gyp_path': '../third_party/icu/icu.gyp',
96
97     'conditions': [
98       ['(v8_target_arch=="arm" and host_arch!="arm") or \
99         (v8_target_arch=="arm64" and host_arch!="arm64") or \
100         (v8_target_arch=="mipsel" and host_arch!="mipsel") or \
101         (v8_target_arch=="mips64el" and host_arch!="mips64el") or \
102         (v8_target_arch=="x64" and host_arch!="x64") or \
103         (OS=="android" or OS=="qnx")', {
104         'want_separate_host_toolset': 1,
105       }, {
106         'want_separate_host_toolset': 0,
107       }],
108       ['OS == "win"', {
109         'os_posix%': 0,
110       }, {
111         'os_posix%': 1,
112       }],
113       ['(v8_target_arch=="ia32" or v8_target_arch=="x64" or v8_target_arch=="x87") and \
114         (OS=="linux" or OS=="mac")', {
115         'v8_enable_gdbjit%': 1,
116       }, {
117         'v8_enable_gdbjit%': 0,
118       }],
119       ['OS=="mac"', {
120         'clang%': 1,
121       }, {
122         'clang%': 0,
123       }],
124     ],
125     # Default ARM variable settings.
126     'arm_version%': 'default',
127     'arm_fpu%': 'vfpv3',
128     'arm_float_abi%': 'default',
129     'arm_thumb': 'default',
130
131     # Default MIPS variable settings.
132     'mips_arch_variant%': 'r2',
133     # Possible values fp32, fp64, fpxx.
134     # fp32 - 32 32-bit FPU registers are available, doubles are placed in
135     #        register pairs.
136     # fp64 - 32 64-bit FPU registers are available.
137     # fpxx - compatibility mode, it chooses fp32 or fp64 depending on runtime
138     #        detection
139     'mips_fpu_mode%': 'fp32',
140   },
141   'target_defaults': {
142     'variables': {
143       'v8_code%': '<(v8_code)',
144     },
145     'default_configuration': 'Debug',
146     'configurations': {
147       'DebugBaseCommon': {
148         'cflags': [ '-g', '-O0' ],
149         'conditions': [
150           ['(v8_target_arch=="ia32" or v8_target_arch=="x87") and \
151             OS=="linux"', {
152             'defines': [
153               '_GLIBCXX_DEBUG'
154             ],
155           }],
156         ],
157       },
158       'Optdebug': {
159         'inherit_from': [ 'DebugBaseCommon', 'DebugBase2' ],
160       },
161       'Debug': {
162         # Xcode insists on this empty entry.
163       },
164       'Release': {
165         # Xcode insists on this empty entry.
166       },
167     },
168     'target_conditions': [
169       ['v8_code == 0', {
170         'defines!': [
171           'DEBUG',
172         ],
173         'conditions': [
174           ['os_posix == 1 and OS != "mac"', {
175             'cflags!': [
176               '-Werror',
177             ],
178           }],
179           ['OS == "mac"', {
180             'xcode_settings': {
181               'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',    # -Werror
182             },
183           }],
184           ['OS == "win"', {
185             'msvs_settings': {
186               'VCCLCompilerTool': {
187                 'WarnAsError': 'false',
188               },
189             },
190           }],
191         ],
192       }],
193     ],
194   },
195   'conditions': [
196     ['asan==1', {
197       'target_defaults': {
198         'cflags_cc+': [
199           '-fno-omit-frame-pointer',
200           '-gline-tables-only',
201           '-fsanitize=address',
202           '-w',  # http://crbug.com/162783
203         ],
204         'cflags_cc!': [
205           '-fomit-frame-pointer',
206         ],
207         'ldflags': [
208           '-fsanitize=address',
209         ],
210       },
211     }],
212     ['tsan==1', {
213       'target_defaults': {
214         'cflags+': [
215           '-fno-omit-frame-pointer',
216           '-gline-tables-only',
217           '-fsanitize=thread',
218           '-fPIC',
219           '-Wno-c++11-extensions',
220         ],
221         'cflags!': [
222           '-fomit-frame-pointer',
223         ],
224         'ldflags': [
225           '-fsanitize=thread',
226           '-pie',
227         ],
228         'defines': [
229           'THREAD_SANITIZER',
230         ],
231       },
232     }],
233     ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
234        or OS=="netbsd"', {
235       'target_defaults': {
236         'cflags': [
237           '-Wall',
238           '<(werror)',
239           '-W',
240           '-Wno-unused-parameter',
241           '-Wno-long-long',
242           '-pthread',
243           '-fno-exceptions',
244           '-pedantic',
245           # Don't warn about the "struct foo f = {0};" initialization pattern.
246           '-Wno-missing-field-initializers',
247         ],
248         'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti', '-std=gnu++0x' ],
249         'ldflags': [ '-pthread', ],
250         'conditions': [
251           [ 'visibility=="hidden" and v8_enable_backtrace==0', {
252             'cflags': [ '-fvisibility=hidden' ],
253           }],
254           [ 'component=="shared_library"', {
255             'cflags': [ '-fPIC', ],
256           }],
257         ],
258       },
259     }],
260     # 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"
261     #  or OS=="netbsd"'
262     ['OS=="qnx"', {
263       'target_defaults': {
264         'cflags': [
265           '-Wall',
266           '<(werror)',
267           '-W',
268           '-Wno-unused-parameter',
269           '-fno-exceptions',
270           # Don't warn about the "struct foo f = {0};" initialization pattern.
271           '-Wno-missing-field-initializers',
272         ],
273         'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti', '-std=gnu++0x' ],
274         'conditions': [
275           [ 'visibility=="hidden"', {
276             'cflags': [ '-fvisibility=hidden' ],
277           }],
278           [ 'component=="shared_library"', {
279             'cflags': [ '-fPIC' ],
280           }],
281         ],
282         'target_conditions': [
283           [ '_toolset=="host" and host_os=="linux"', {
284             'cflags': [ '-pthread' ],
285             'ldflags': [ '-pthread' ],
286             'libraries': [ '-lrt' ],
287           }],
288           [ '_toolset=="target"', {
289             'cflags': [ '-Wno-psabi' ],
290             'libraries': [ '-lbacktrace', '-lsocket', '-lm' ],
291           }],
292         ],
293       },
294     }],  # OS=="qnx"
295     ['OS=="win"', {
296       'target_defaults': {
297         'defines': [
298           '_CRT_SECURE_NO_DEPRECATE',
299           '_CRT_NONSTDC_NO_DEPRECATE',
300           '_USING_V110_SDK71_',
301         ],
302         'conditions': [
303           ['component=="static_library"', {
304             'defines': [
305               '_HAS_EXCEPTIONS=0',
306             ],
307           }],
308         ],
309         'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
310         'msvs_disabled_warnings': [4355, 4800],
311         'msvs_settings': {
312           'VCCLCompilerTool': {
313             'MinimalRebuild': 'false',
314             'BufferSecurityCheck': 'true',
315             'EnableFunctionLevelLinking': 'true',
316             'RuntimeTypeInfo': 'false',
317             'WarningLevel': '3',
318             'WarnAsError': 'true',
319             'DebugInformationFormat': '3',
320             'Detect64BitPortabilityProblems': 'false',
321             'conditions': [
322               [ 'msvs_multi_core_compile', {
323                 'AdditionalOptions': ['/MP'],
324               }],
325               ['component=="shared_library"', {
326                 'ExceptionHandling': '1',  # /EHsc
327               }, {
328                 'ExceptionHandling': '0',
329               }],
330             ],
331           },
332           'VCLibrarianTool': {
333             'AdditionalOptions': ['/ignore:4221'],
334             'conditions': [
335               ['v8_target_arch=="x64"', {
336                 'TargetMachine': '17',  # x64
337               }, {
338                 'TargetMachine': '1',  # ia32
339               }],
340             ],
341           },
342           'VCLinkerTool': {
343             'AdditionalDependencies': [
344               'ws2_32.lib',
345             ],
346             'GenerateDebugInformation': 'true',
347             'MapFileName': '$(OutDir)\\$(TargetName).map',
348             'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
349             'FixedBaseAddress': '1',
350             # LinkIncremental values:
351             #   0 == default
352             #   1 == /INCREMENTAL:NO
353             #   2 == /INCREMENTAL
354             'LinkIncremental': '1',
355             # SubSystem values:
356             #   0 == not set
357             #   1 == /SUBSYSTEM:CONSOLE
358             #   2 == /SUBSYSTEM:WINDOWS
359             'SubSystem': '1',
360
361             'conditions': [
362               ['v8_enable_i18n_support==1', {
363                 'AdditionalDependencies': [
364                   'advapi32.lib',
365                 ],
366               }],
367               ['v8_target_arch=="x64"', {
368                 'MinimumRequiredVersion': '5.02',  # Server 2003.
369                 'TargetMachine': '17',  # x64
370               }, {
371                 'MinimumRequiredVersion': '5.01',  # XP.
372                 'TargetMachine': '1',  # ia32
373               }],
374             ],
375           },
376         },
377       },
378     }],  # OS=="win"
379     ['OS=="mac"', {
380       'xcode_settings': {
381         'SYMROOT': '<(DEPTH)/xcodebuild',
382       },
383       'target_defaults': {
384         'xcode_settings': {
385           'ALWAYS_SEARCH_USER_PATHS': 'NO',
386           'GCC_C_LANGUAGE_STANDARD': 'c99',         # -std=c99
387           'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
388           'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
389                                                     # (Equivalent to -fPIC)
390           'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
391           'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
392           'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
393           # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
394           'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
395           'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
396           'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
397           'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
398           # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
399           'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
400           'PREBINDING': 'NO',                       # No -Wl,-prebind
401           'SYMROOT': '<(DEPTH)/xcodebuild',
402           'USE_HEADERMAP': 'NO',
403           'OTHER_CFLAGS': [
404             '-fno-strict-aliasing',
405           ],
406           'WARNING_CFLAGS': [
407             '-Wall',
408             '-Wendif-labels',
409             '-W',
410             '-Wno-unused-parameter',
411             # Don't warn about the "struct foo f = {0};" initialization pattern.
412             '-Wno-missing-field-initializers',
413           ],
414         },
415         'conditions': [
416           ['werror==""', {
417             'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO'},
418           }, {
419             'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES'},
420           }],
421           ['clang==1', {
422             'xcode_settings': {
423               'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
424               'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x',  # -std=gnu++0x
425             },
426           }],
427         ],
428         'target_conditions': [
429           ['_type!="static_library"', {
430             'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
431           }],
432         ],  # target_conditions
433       },  # target_defaults
434     }],  # OS=="mac"
435   ],
436 }