sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 1 | # Copyright 2011 the V8 project authors. All rights reserved. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [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 | |
| 28 | import platform |
kasper.lund | 212ac23 | 2008-07-16 07:07:30 +0000 | [diff] [blame] | 29 | import re |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 30 | import subprocess |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 31 | import sys |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 32 | import os |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 33 | from os.path import join, dirname, abspath |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 34 | from types import DictType, StringTypes |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 35 | root_dir = dirname(File('SConstruct').rfile().abspath) |
ager@chromium.org | 0ee099b | 2011-01-25 14:06:47 +0000 | [diff] [blame] | 36 | sys.path.insert(0, join(root_dir, 'tools')) |
ager@chromium.org | c27e4e7 | 2008-09-04 13:52:27 +0000 | [diff] [blame] | 37 | import js2c, utils |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 38 | |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 39 | # ARM_TARGET_LIB is the path to the dynamic library to use on the target |
whesse@chromium.org | ba5a61b | 2010-07-26 11:44:40 +0000 | [diff] [blame] | 40 | # machine if cross-compiling to an arm machine. You will also need to set |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 41 | # the additional cross-compiling environment variables to the cross compiler. |
| 42 | ARM_TARGET_LIB = os.environ.get('ARM_TARGET_LIB') |
| 43 | if ARM_TARGET_LIB: |
| 44 | ARM_LINK_FLAGS = ['-Wl,-rpath=' + ARM_TARGET_LIB + '/lib:' + |
| 45 | ARM_TARGET_LIB + '/usr/lib', |
| 46 | '-Wl,--dynamic-linker=' + ARM_TARGET_LIB + |
| 47 | '/lib/ld-linux.so.3'] |
| 48 | else: |
| 49 | ARM_LINK_FLAGS = [] |
| 50 | |
ricow@chromium.org | 0b9f850 | 2010-08-18 07:45:01 +0000 | [diff] [blame] | 51 | GCC_EXTRA_CCFLAGS = [] |
| 52 | GCC_DTOA_EXTRA_CCFLAGS = [] |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 53 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 54 | LIBRARY_FLAGS = { |
| 55 | 'all': { |
kasperl@chromium.org | 68ac009 | 2009-07-09 06:00:35 +0000 | [diff] [blame] | 56 | 'CPPPATH': [join(root_dir, 'src')], |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 57 | 'regexp:interpreted': { |
| 58 | 'CPPDEFINES': ['V8_INTERPRETED_REGEXP'] |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 59 | }, |
| 60 | 'mode:debug': { |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 61 | 'CPPDEFINES': ['V8_ENABLE_CHECKS', 'OBJECT_PRINT'] |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 62 | }, |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 63 | 'vmstate:on': { |
| 64 | 'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING'], |
| 65 | }, |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 66 | 'objectprint:on': { |
| 67 | 'CPPDEFINES': ['OBJECT_PRINT'], |
| 68 | }, |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 69 | 'protectheap:on': { |
| 70 | 'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_HEAP_PROTECTION'], |
| 71 | }, |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 72 | 'profilingsupport:on': { |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 73 | 'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_LOGGING_AND_PROFILING'], |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 74 | }, |
| 75 | 'debuggersupport:on': { |
| 76 | 'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'], |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 77 | }, |
| 78 | 'inspector:on': { |
| 79 | 'CPPDEFINES': ['INSPECTOR'], |
vegorov@chromium.org | 0a4e901 | 2011-01-24 12:33:13 +0000 | [diff] [blame] | 80 | }, |
fschneider@chromium.org | 7979bbb | 2011-03-28 10:47:03 +0000 | [diff] [blame] | 81 | 'fasttls:on': { |
| 82 | 'CPPDEFINES': ['V8_FAST_TLS'], |
| 83 | }, |
vegorov@chromium.org | 0a4e901 | 2011-01-24 12:33:13 +0000 | [diff] [blame] | 84 | 'liveobjectlist:on': { |
| 85 | 'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT', 'INSPECTOR', |
| 86 | 'LIVE_OBJECT_LIST', 'OBJECT_PRINT'], |
kasperl@chromium.org | 68ac009 | 2009-07-09 06:00:35 +0000 | [diff] [blame] | 87 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 88 | }, |
| 89 | 'gcc': { |
| 90 | 'all': { |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 91 | 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 92 | 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 93 | }, |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 94 | 'visibility:hidden': { |
| 95 | # Use visibility=default to disable this. |
| 96 | 'CXXFLAGS': ['-fvisibility=hidden'] |
| 97 | }, |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 98 | 'strictaliasing:off': { |
| 99 | 'CCFLAGS': ['-fno-strict-aliasing'] |
| 100 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 101 | 'mode:debug': { |
| 102 | 'CCFLAGS': ['-g', '-O0'], |
ager@chromium.org | 71daaf6 | 2009-04-01 07:22:49 +0000 | [diff] [blame] | 103 | 'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 104 | }, |
| 105 | 'mode:release': { |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 106 | 'CCFLAGS': ['-O3', '-fomit-frame-pointer', '-fdata-sections', |
| 107 | '-ffunction-sections'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 108 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 109 | 'os:linux': { |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 110 | 'CCFLAGS': ['-ansi'] + GCC_EXTRA_CCFLAGS, |
sgjesse@chromium.org | f8c8180 | 2009-03-30 07:19:14 +0000 | [diff] [blame] | 111 | 'library:shared': { |
sgjesse@chromium.org | b9d7da1 | 2009-08-05 08:38:10 +0000 | [diff] [blame] | 112 | 'CPPDEFINES': ['V8_SHARED'], |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 113 | 'LIBS': ['pthread'] |
sgjesse@chromium.org | f8c8180 | 2009-03-30 07:19:14 +0000 | [diff] [blame] | 114 | } |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 115 | }, |
| 116 | 'os:macos': { |
ager@chromium.org | 5aa501c | 2009-06-23 07:57:28 +0000 | [diff] [blame] | 117 | 'CCFLAGS': ['-ansi', '-mmacosx-version-min=10.4'], |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 118 | 'library:shared': { |
| 119 | 'CPPDEFINES': ['V8_SHARED'] |
| 120 | } |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 121 | }, |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 122 | 'os:freebsd': { |
ager@chromium.org | e2902be | 2009-06-08 12:21:35 +0000 | [diff] [blame] | 123 | 'CPPPATH' : ['/usr/local/include'], |
| 124 | 'LIBPATH' : ['/usr/local/lib'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 125 | 'CCFLAGS': ['-ansi'], |
ricow@chromium.org | badaffc | 2011-03-17 12:15:27 +0000 | [diff] [blame] | 126 | 'LIBS': ['execinfo'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 127 | }, |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 128 | 'os:openbsd': { |
| 129 | 'CPPPATH' : ['/usr/local/include'], |
| 130 | 'LIBPATH' : ['/usr/local/lib'], |
| 131 | 'CCFLAGS': ['-ansi'], |
| 132 | }, |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 133 | 'os:solaris': { |
vegorov@chromium.org | dff694e | 2010-05-17 09:10:26 +0000 | [diff] [blame] | 134 | # On Solaris, to get isinf, INFINITY, fpclassify and other macros one |
| 135 | # needs to define __C99FEATURES__. |
| 136 | 'CPPDEFINES': ['__C99FEATURES__'], |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 137 | 'CPPPATH' : ['/usr/local/include'], |
| 138 | 'LIBPATH' : ['/usr/local/lib'], |
| 139 | 'CCFLAGS': ['-ansi'], |
| 140 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 141 | 'os:win32': { |
| 142 | 'CCFLAGS': ['-DWIN32'], |
| 143 | 'CXXFLAGS': ['-DWIN32'], |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 144 | }, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 145 | 'arch:ia32': { |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 146 | 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'], |
| 147 | 'CCFLAGS': ['-m32'], |
| 148 | 'LINKFLAGS': ['-m32'] |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 149 | }, |
| 150 | 'arch:arm': { |
ricow@chromium.org | 30ce411 | 2010-05-31 10:38:25 +0000 | [diff] [blame] | 151 | 'CPPDEFINES': ['V8_TARGET_ARCH_ARM'], |
| 152 | 'unalignedaccesses:on' : { |
| 153 | 'CPPDEFINES' : ['CAN_USE_UNALIGNED_ACCESSES=1'] |
| 154 | }, |
| 155 | 'unalignedaccesses:off' : { |
| 156 | 'CPPDEFINES' : ['CAN_USE_UNALIGNED_ACCESSES=0'] |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 157 | }, |
| 158 | 'armeabi:soft' : { |
| 159 | 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'], |
| 160 | 'simulator:none': { |
| 161 | 'CCFLAGS': ['-mfloat-abi=soft'], |
| 162 | } |
| 163 | }, |
| 164 | 'armeabi:softfp' : { |
fschneider@chromium.org | fb144a0 | 2011-05-04 12:43:48 +0000 | [diff] [blame^] | 165 | 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0', 'CAN_USE_VFP_INSTRUCTIONS'], |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 166 | 'simulator:none': { |
| 167 | 'CCFLAGS': ['-mfloat-abi=softfp'], |
| 168 | } |
| 169 | }, |
| 170 | 'armeabi:hard' : { |
| 171 | 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1', 'CAN_USE_VFP_INSTRUCTIONS'], |
| 172 | 'simulator:none': { |
| 173 | 'CCFLAGS': ['-mfloat-abi=hard'], |
| 174 | } |
ricow@chromium.org | 30ce411 | 2010-05-31 10:38:25 +0000 | [diff] [blame] | 175 | } |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 176 | }, |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 177 | 'simulator:arm': { |
ricow@chromium.org | 30ce411 | 2010-05-31 10:38:25 +0000 | [diff] [blame] | 178 | 'CCFLAGS': ['-m32'], |
vegorov@chromium.org | 4284196 | 2010-10-18 11:18:59 +0000 | [diff] [blame] | 179 | 'LINKFLAGS': ['-m32'], |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 180 | }, |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 181 | 'arch:mips': { |
| 182 | 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 183 | 'mips_arch_variant:mips32r2': { |
| 184 | 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2'] |
| 185 | }, |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 186 | 'simulator:none': { |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 187 | 'CCFLAGS': ['-EL'], |
| 188 | 'LINKFLAGS': ['-EL'], |
| 189 | 'mips_arch_variant:mips32r2': { |
| 190 | 'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2'] |
| 191 | }, |
| 192 | 'mips_arch_variant:mips32r1': { |
| 193 | 'CCFLAGS': ['-mips32', '-Wa,-mips32'] |
| 194 | }, |
| 195 | 'library:static': { |
| 196 | 'LINKFLAGS': ['-static', '-static-libgcc'] |
| 197 | }, |
| 198 | 'mipsabi:softfloat': { |
| 199 | 'CCFLAGS': ['-msoft-float'], |
| 200 | 'LINKFLAGS': ['-msoft-float'] |
| 201 | }, |
| 202 | 'mipsabi:hardfloat': { |
| 203 | 'CCFLAGS': ['-mhard-float'], |
| 204 | 'LINKFLAGS': ['-mhard-float'] |
| 205 | } |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 206 | } |
| 207 | }, |
| 208 | 'simulator:mips': { |
| 209 | 'CCFLAGS': ['-m32'], |
vegorov@chromium.org | 4284196 | 2010-10-18 11:18:59 +0000 | [diff] [blame] | 210 | 'LINKFLAGS': ['-m32'], |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 211 | 'mipsabi:softfloat': { |
| 212 | 'CPPDEFINES': ['__mips_soft_float=1'], |
| 213 | } |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 214 | }, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 215 | 'arch:x64': { |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 216 | 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], |
sgjesse@chromium.org | 911335c | 2009-08-19 12:59:44 +0000 | [diff] [blame] | 217 | 'CCFLAGS': ['-m64'], |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 218 | 'LINKFLAGS': ['-m64'], |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 219 | }, |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 220 | 'gdbjit:on': { |
| 221 | 'CPPDEFINES': ['ENABLE_GDB_JIT_INTERFACE'] |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 222 | }, |
| 223 | 'compress_startup_data:bz2': { |
| 224 | 'CPPDEFINES': ['COMPRESS_STARTUP_DATA_BZ2'] |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 225 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 226 | }, |
| 227 | 'msvc': { |
| 228 | 'all': { |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 229 | 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 230 | 'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'], |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 231 | 'CPPDEFINES': ['WIN32'], |
| 232 | 'LINKFLAGS': ['/INCREMENTAL:NO', '/NXCOMPAT', '/IGNORE:4221'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 233 | 'CCPDBFLAGS': ['/Zi'] |
| 234 | }, |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 235 | 'verbose:off': { |
| 236 | 'DIALECTFLAGS': ['/nologo'], |
| 237 | 'ARFLAGS': ['/NOLOGO'] |
| 238 | }, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 239 | 'arch:ia32': { |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 240 | 'CPPDEFINES': ['V8_TARGET_ARCH_IA32', '_USE_32BIT_TIME_T'], |
| 241 | 'LINKFLAGS': ['/MACHINE:X86'], |
| 242 | 'ARFLAGS': ['/MACHINE:X86'] |
| 243 | }, |
| 244 | 'arch:x64': { |
| 245 | 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], |
| 246 | 'LINKFLAGS': ['/MACHINE:X64'], |
| 247 | 'ARFLAGS': ['/MACHINE:X64'] |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 248 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 249 | 'mode:debug': { |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 250 | 'CCFLAGS': ['/Od', '/Gm'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 251 | 'CPPDEFINES': ['_DEBUG', 'ENABLE_DISASSEMBLER', 'DEBUG'], |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 252 | 'LINKFLAGS': ['/DEBUG'], |
| 253 | 'msvcrt:static': { |
| 254 | 'CCFLAGS': ['/MTd'] |
| 255 | }, |
| 256 | 'msvcrt:shared': { |
| 257 | 'CCFLAGS': ['/MDd'] |
| 258 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 259 | }, |
| 260 | 'mode:release': { |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 261 | 'CCFLAGS': ['/O2'], |
| 262 | 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'], |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 263 | 'msvcrt:static': { |
| 264 | 'CCFLAGS': ['/MT'] |
| 265 | }, |
| 266 | 'msvcrt:shared': { |
| 267 | 'CCFLAGS': ['/MD'] |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 268 | }, |
| 269 | 'msvcltcg:on': { |
| 270 | 'CCFLAGS': ['/GL'], |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 271 | 'ARFLAGS': ['/LTCG'], |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 272 | 'pgo:off': { |
| 273 | 'LINKFLAGS': ['/LTCG'], |
| 274 | }, |
| 275 | 'pgo:instrument': { |
| 276 | 'LINKFLAGS': ['/LTCG:PGI'] |
| 277 | }, |
| 278 | 'pgo:optimize': { |
| 279 | 'LINKFLAGS': ['/LTCG:PGO'] |
| 280 | } |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 281 | } |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 282 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 283 | } |
| 284 | } |
| 285 | |
| 286 | |
| 287 | V8_EXTRA_FLAGS = { |
| 288 | 'gcc': { |
| 289 | 'all': { |
sgjesse@chromium.org | b9d7da1 | 2009-08-05 08:38:10 +0000 | [diff] [blame] | 290 | 'WARNINGFLAGS': ['-Wall', |
| 291 | '-Werror', |
| 292 | '-W', |
| 293 | '-Wno-unused-parameter', |
| 294 | '-Wnon-virtual-dtor'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 295 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 296 | 'os:win32': { |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 297 | 'WARNINGFLAGS': ['-pedantic', '-Wno-long-long'] |
| 298 | }, |
| 299 | 'os:linux': { |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 300 | 'WARNINGFLAGS': ['-pedantic'], |
| 301 | 'library:shared': { |
| 302 | 'soname:on': { |
| 303 | 'LINKFLAGS': ['-Wl,-soname,${SONAME}'] |
| 304 | } |
| 305 | } |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 306 | }, |
| 307 | 'os:macos': { |
| 308 | 'WARNINGFLAGS': ['-pedantic'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 309 | }, |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 310 | 'arch:arm': { |
| 311 | # This is to silence warnings about ABI changes that some versions of the |
| 312 | # CodeSourcery G++ tool chain produce for each occurrence of varargs. |
| 313 | 'WARNINGFLAGS': ['-Wno-abi'] |
| 314 | }, |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 315 | 'disassembler:on': { |
| 316 | 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] |
| 317 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 318 | }, |
| 319 | 'msvc': { |
| 320 | 'all': { |
ager@chromium.org | 0ee099b | 2011-01-25 14:06:47 +0000 | [diff] [blame] | 321 | 'WARNINGFLAGS': ['/W3', '/WX', '/wd4351', '/wd4355', '/wd4800'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 322 | }, |
sgjesse@chromium.org | 4e421f4 | 2009-09-07 07:18:16 +0000 | [diff] [blame] | 323 | 'library:shared': { |
| 324 | 'CPPDEFINES': ['BUILDING_V8_SHARED'], |
| 325 | 'LIBS': ['winmm', 'ws2_32'] |
| 326 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 327 | 'arch:arm': { |
ager@chromium.org | 9085a01 | 2009-05-11 19:22:57 +0000 | [diff] [blame] | 328 | 'CPPDEFINES': ['V8_TARGET_ARCH_ARM'], |
ager@chromium.org | 3bf7b91 | 2008-11-17 09:09:45 +0000 | [diff] [blame] | 329 | # /wd4996 is to silence the warning about sscanf |
| 330 | # used by the arm simulator. |
| 331 | 'WARNINGFLAGS': ['/wd4996'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 332 | }, |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 333 | 'arch:mips': { |
| 334 | 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 335 | 'mips_arch_variant:mips32r2': { |
| 336 | 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2'] |
| 337 | }, |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 338 | }, |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 339 | 'disassembler:on': { |
| 340 | 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] |
| 341 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 342 | } |
| 343 | } |
| 344 | |
| 345 | |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 346 | MKSNAPSHOT_EXTRA_FLAGS = { |
| 347 | 'gcc': { |
| 348 | 'os:linux': { |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 349 | 'LIBS': ['pthread'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 350 | }, |
| 351 | 'os:macos': { |
| 352 | 'LIBS': ['pthread'], |
| 353 | }, |
| 354 | 'os:freebsd': { |
ager@chromium.org | e2902be | 2009-06-08 12:21:35 +0000 | [diff] [blame] | 355 | 'LIBS': ['execinfo', 'pthread'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 356 | }, |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 357 | 'os:solaris': { |
| 358 | 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], |
| 359 | 'LINKFLAGS': ['-mt'] |
| 360 | }, |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 361 | 'os:openbsd': { |
| 362 | 'LIBS': ['execinfo', 'pthread'] |
| 363 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 364 | 'os:win32': { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 365 | 'LIBS': ['winmm', 'ws2_32'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 366 | }, |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 367 | 'compress_startup_data:bz2': { |
| 368 | 'os:linux': { |
| 369 | 'LIBS': ['bz2'] |
| 370 | } |
| 371 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 372 | }, |
| 373 | 'msvc': { |
| 374 | 'all': { |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 375 | 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 376 | 'LIBS': ['winmm', 'ws2_32'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 377 | } |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | |
| 382 | DTOA_EXTRA_FLAGS = { |
| 383 | 'gcc': { |
| 384 | 'all': { |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 385 | 'WARNINGFLAGS': ['-Werror', '-Wno-uninitialized'], |
| 386 | 'CCFLAGS': GCC_DTOA_EXTRA_CCFLAGS |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 387 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 388 | }, |
| 389 | 'msvc': { |
| 390 | 'all': { |
| 391 | 'WARNINGFLAGS': ['/WX', '/wd4018', '/wd4244'] |
| 392 | } |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | |
| 397 | CCTEST_EXTRA_FLAGS = { |
| 398 | 'all': { |
| 399 | 'CPPPATH': [join(root_dir, 'src')], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 400 | }, |
| 401 | 'gcc': { |
| 402 | 'all': { |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 403 | 'LIBPATH': [abspath('.')], |
| 404 | 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
| 405 | 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], |
| 406 | 'LINKFLAGS': ['$CCFLAGS'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 407 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 408 | 'os:linux': { |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 409 | 'LIBS': ['pthread'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 410 | }, |
| 411 | 'os:macos': { |
| 412 | 'LIBS': ['pthread'], |
| 413 | }, |
| 414 | 'os:freebsd': { |
| 415 | 'LIBS': ['execinfo', 'pthread'] |
| 416 | }, |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 417 | 'os:solaris': { |
| 418 | 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], |
| 419 | 'LINKFLAGS': ['-mt'] |
| 420 | }, |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 421 | 'os:openbsd': { |
| 422 | 'LIBS': ['execinfo', 'pthread'] |
| 423 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 424 | 'os:win32': { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 425 | 'LIBS': ['winmm', 'ws2_32'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 426 | }, |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 427 | 'arch:arm': { |
| 428 | 'LINKFLAGS': ARM_LINK_FLAGS |
| 429 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 430 | }, |
| 431 | 'msvc': { |
| 432 | 'all': { |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 433 | 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 434 | 'LIBS': ['winmm', 'ws2_32'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 435 | }, |
| 436 | 'library:shared': { |
| 437 | 'CPPDEFINES': ['USING_V8_SHARED'] |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 438 | }, |
| 439 | 'arch:ia32': { |
ager@chromium.org | 9085a01 | 2009-05-11 19:22:57 +0000 | [diff] [blame] | 440 | 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'] |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 441 | }, |
| 442 | 'arch:x64': { |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 443 | 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], |
| 444 | 'LINKFLAGS': ['/STACK:2091752'] |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 445 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 446 | } |
| 447 | } |
| 448 | |
| 449 | |
| 450 | SAMPLE_FLAGS = { |
| 451 | 'all': { |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 452 | 'CPPPATH': [join(abspath('.'), 'include')], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 453 | }, |
| 454 | 'gcc': { |
| 455 | 'all': { |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 456 | 'LIBPATH': ['.'], |
| 457 | 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
| 458 | 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], |
| 459 | 'LINKFLAGS': ['$CCFLAGS'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 460 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 461 | 'os:linux': { |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 462 | 'LIBS': ['pthread'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 463 | }, |
| 464 | 'os:macos': { |
| 465 | 'LIBS': ['pthread'], |
| 466 | }, |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 467 | 'os:freebsd': { |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 468 | 'LIBPATH' : ['/usr/local/lib'], |
| 469 | 'LIBS': ['execinfo', 'pthread'] |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 470 | }, |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 471 | 'os:solaris': { |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 472 | 'LIBPATH' : ['/usr/local/lib'], |
| 473 | 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], |
| 474 | 'LINKFLAGS': ['-mt'] |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 475 | }, |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 476 | 'os:openbsd': { |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 477 | 'LIBPATH' : ['/usr/local/lib'], |
| 478 | 'LIBS': ['execinfo', 'pthread'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 479 | }, |
| 480 | 'os:win32': { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 481 | 'LIBS': ['winmm', 'ws2_32'] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 482 | }, |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 483 | 'arch:arm': { |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 484 | 'LINKFLAGS': ARM_LINK_FLAGS, |
| 485 | 'armeabi:soft' : { |
| 486 | 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'], |
| 487 | 'simulator:none': { |
| 488 | 'CCFLAGS': ['-mfloat-abi=soft'], |
| 489 | } |
| 490 | }, |
| 491 | 'armeabi:softfp' : { |
| 492 | 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'], |
| 493 | 'simulator:none': { |
| 494 | 'CCFLAGS': ['-mfloat-abi=softfp'], |
| 495 | } |
| 496 | }, |
| 497 | 'armeabi:hard' : { |
| 498 | 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1', 'CAN_USE_VFP_INSTRUCTIONS'], |
| 499 | 'simulator:none': { |
| 500 | 'CCFLAGS': ['-mfloat-abi=hard'], |
| 501 | } |
| 502 | } |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 503 | }, |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 504 | 'arch:ia32': { |
| 505 | 'CCFLAGS': ['-m32'], |
| 506 | 'LINKFLAGS': ['-m32'] |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 507 | }, |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 508 | 'arch:x64': { |
| 509 | 'CCFLAGS': ['-m64'], |
| 510 | 'LINKFLAGS': ['-m64'] |
| 511 | }, |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 512 | 'arch:mips': { |
| 513 | 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], |
| 514 | 'simulator:none': { |
| 515 | 'CCFLAGS': ['-EL', '-mips32r2', '-Wa,-mips32r2', '-fno-inline'], |
| 516 | 'LINKFLAGS': ['-EL'], |
| 517 | 'LDFLAGS': ['-EL'] |
| 518 | } |
| 519 | }, |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 520 | 'simulator:arm': { |
| 521 | 'CCFLAGS': ['-m32'], |
| 522 | 'LINKFLAGS': ['-m32'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 523 | }, |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 524 | 'simulator:mips': { |
| 525 | 'CCFLAGS': ['-m32'], |
| 526 | 'LINKFLAGS': ['-m32'] |
| 527 | }, |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 528 | 'mode:release': { |
| 529 | 'CCFLAGS': ['-O2'] |
| 530 | }, |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 531 | 'mode:debug': { |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 532 | 'CCFLAGS': ['-g', '-O0'], |
| 533 | 'CPPDEFINES': ['DEBUG'] |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 534 | }, |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 535 | 'compress_startup_data:bz2': { |
| 536 | 'CPPDEFINES': ['COMPRESS_STARTUP_DATA_BZ2'], |
| 537 | 'os:linux': { |
| 538 | 'LIBS': ['bz2'] |
| 539 | } |
| 540 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 541 | }, |
| 542 | 'msvc': { |
| 543 | 'all': { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 544 | 'LIBS': ['winmm', 'ws2_32'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 545 | }, |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 546 | 'verbose:off': { |
| 547 | 'CCFLAGS': ['/nologo'], |
| 548 | 'LINKFLAGS': ['/NOLOGO'] |
| 549 | }, |
| 550 | 'verbose:on': { |
| 551 | 'LINKFLAGS': ['/VERBOSE'] |
| 552 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 553 | 'library:shared': { |
| 554 | 'CPPDEFINES': ['USING_V8_SHARED'] |
| 555 | }, |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 556 | 'prof:on': { |
| 557 | 'LINKFLAGS': ['/MAP'] |
| 558 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 559 | 'mode:release': { |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 560 | 'CCFLAGS': ['/O2'], |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 561 | 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'], |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 562 | 'msvcrt:static': { |
| 563 | 'CCFLAGS': ['/MT'] |
| 564 | }, |
| 565 | 'msvcrt:shared': { |
| 566 | 'CCFLAGS': ['/MD'] |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 567 | }, |
| 568 | 'msvcltcg:on': { |
| 569 | 'CCFLAGS': ['/GL'], |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 570 | 'pgo:off': { |
| 571 | 'LINKFLAGS': ['/LTCG'], |
| 572 | }, |
| 573 | }, |
| 574 | 'pgo:instrument': { |
| 575 | 'LINKFLAGS': ['/LTCG:PGI'] |
| 576 | }, |
| 577 | 'pgo:optimize': { |
| 578 | 'LINKFLAGS': ['/LTCG:PGO'] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 579 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 580 | }, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 581 | 'arch:ia32': { |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 582 | 'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'], |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 583 | 'LINKFLAGS': ['/MACHINE:X86'] |
| 584 | }, |
| 585 | 'arch:x64': { |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 586 | 'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'], |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 587 | 'LINKFLAGS': ['/MACHINE:X64', '/STACK:2091752'] |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 588 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 589 | 'mode:debug': { |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 590 | 'CCFLAGS': ['/Od'], |
| 591 | 'LINKFLAGS': ['/DEBUG'], |
| 592 | 'CPPDEFINES': ['DEBUG'], |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 593 | 'msvcrt:static': { |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 594 | 'CCFLAGS': ['/MTd'] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 595 | }, |
| 596 | 'msvcrt:shared': { |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 597 | 'CCFLAGS': ['/MDd'] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 598 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 599 | } |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 604 | PREPARSER_FLAGS = { |
| 605 | 'all': { |
| 606 | 'CPPPATH': [join(abspath('.'), 'include'), join(abspath('.'), 'src')] |
| 607 | }, |
| 608 | 'gcc': { |
| 609 | 'all': { |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 610 | 'LIBPATH': ['.'], |
| 611 | 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
| 612 | 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], |
| 613 | 'LINKFLAGS': ['$CCFLAGS'], |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 614 | }, |
| 615 | 'os:win32': { |
| 616 | 'LIBS': ['winmm', 'ws2_32'] |
| 617 | }, |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 618 | 'arch:arm': { |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 619 | 'LINKFLAGS': ARM_LINK_FLAGS, |
| 620 | 'armeabi:soft' : { |
| 621 | 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'], |
| 622 | 'simulator:none': { |
| 623 | 'CCFLAGS': ['-mfloat-abi=soft'], |
| 624 | } |
| 625 | }, |
| 626 | 'armeabi:softfp' : { |
| 627 | 'simulator:none': { |
| 628 | 'CCFLAGS': ['-mfloat-abi=softfp'], |
| 629 | } |
| 630 | }, |
| 631 | 'armeabi:hard' : { |
| 632 | 'simulator:none': { |
| 633 | 'CCFLAGS': ['-mfloat-abi=hard'], |
| 634 | } |
| 635 | } |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 636 | }, |
| 637 | 'arch:ia32': { |
| 638 | 'CCFLAGS': ['-m32'], |
| 639 | 'LINKFLAGS': ['-m32'] |
| 640 | }, |
| 641 | 'arch:x64': { |
| 642 | 'CCFLAGS': ['-m64'], |
| 643 | 'LINKFLAGS': ['-m64'] |
| 644 | }, |
| 645 | 'arch:mips': { |
| 646 | 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], |
| 647 | 'mips_arch_variant:mips32r2': { |
| 648 | 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2'] |
| 649 | }, |
| 650 | 'simulator:none': { |
| 651 | 'CCFLAGS': ['-EL'], |
| 652 | 'LINKFLAGS': ['-EL'], |
| 653 | 'mips_arch_variant:mips32r2': { |
| 654 | 'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2'] |
| 655 | }, |
| 656 | 'mips_arch_variant:mips32r1': { |
| 657 | 'CCFLAGS': ['-mips32', '-Wa,-mips32'] |
| 658 | }, |
| 659 | 'library:static': { |
| 660 | 'LINKFLAGS': ['-static', '-static-libgcc'] |
| 661 | }, |
| 662 | 'mipsabi:softfloat': { |
| 663 | 'CCFLAGS': ['-msoft-float'], |
| 664 | 'LINKFLAGS': ['-msoft-float'] |
| 665 | }, |
| 666 | 'mipsabi:hardfloat': { |
| 667 | 'CCFLAGS': ['-mhard-float'], |
| 668 | 'LINKFLAGS': ['-mhard-float'] |
| 669 | } |
| 670 | } |
| 671 | }, |
| 672 | 'simulator:arm': { |
| 673 | 'CCFLAGS': ['-m32'], |
| 674 | 'LINKFLAGS': ['-m32'] |
| 675 | }, |
| 676 | 'simulator:mips': { |
| 677 | 'CCFLAGS': ['-m32'], |
| 678 | 'LINKFLAGS': ['-m32'], |
| 679 | 'mipsabi:softfloat': { |
| 680 | 'CPPDEFINES': ['__mips_soft_float=1'], |
| 681 | } |
| 682 | }, |
| 683 | 'mode:release': { |
| 684 | 'CCFLAGS': ['-O2'] |
| 685 | }, |
| 686 | 'mode:debug': { |
| 687 | 'CCFLAGS': ['-g', '-O0'], |
| 688 | 'CPPDEFINES': ['DEBUG'] |
| 689 | }, |
| 690 | }, |
| 691 | 'msvc': { |
| 692 | 'all': { |
| 693 | 'LIBS': ['winmm', 'ws2_32'] |
| 694 | }, |
| 695 | 'verbose:off': { |
| 696 | 'CCFLAGS': ['/nologo'], |
| 697 | 'LINKFLAGS': ['/NOLOGO'] |
| 698 | }, |
| 699 | 'verbose:on': { |
| 700 | 'LINKFLAGS': ['/VERBOSE'] |
| 701 | }, |
| 702 | 'library:shared': { |
| 703 | 'CPPDEFINES': ['USING_V8_SHARED'] |
| 704 | }, |
| 705 | 'prof:on': { |
| 706 | 'LINKFLAGS': ['/MAP'] |
| 707 | }, |
| 708 | 'mode:release': { |
| 709 | 'CCFLAGS': ['/O2'], |
| 710 | 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'], |
| 711 | 'msvcrt:static': { |
| 712 | 'CCFLAGS': ['/MT'] |
| 713 | }, |
| 714 | 'msvcrt:shared': { |
| 715 | 'CCFLAGS': ['/MD'] |
| 716 | }, |
| 717 | 'msvcltcg:on': { |
| 718 | 'CCFLAGS': ['/GL'], |
| 719 | 'pgo:off': { |
| 720 | 'LINKFLAGS': ['/LTCG'], |
| 721 | }, |
| 722 | }, |
| 723 | 'pgo:instrument': { |
| 724 | 'LINKFLAGS': ['/LTCG:PGI'] |
| 725 | }, |
| 726 | 'pgo:optimize': { |
| 727 | 'LINKFLAGS': ['/LTCG:PGO'] |
| 728 | } |
| 729 | }, |
| 730 | 'arch:ia32': { |
| 731 | 'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'], |
| 732 | 'LINKFLAGS': ['/MACHINE:X86'] |
| 733 | }, |
| 734 | 'arch:x64': { |
| 735 | 'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'], |
| 736 | 'LINKFLAGS': ['/MACHINE:X64', '/STACK:2091752'] |
| 737 | }, |
| 738 | 'mode:debug': { |
| 739 | 'CCFLAGS': ['/Od'], |
| 740 | 'LINKFLAGS': ['/DEBUG'], |
| 741 | 'CPPDEFINES': ['DEBUG'], |
| 742 | 'msvcrt:static': { |
| 743 | 'CCFLAGS': ['/MTd'] |
| 744 | }, |
| 745 | 'msvcrt:shared': { |
| 746 | 'CCFLAGS': ['/MDd'] |
| 747 | } |
| 748 | } |
| 749 | } |
| 750 | } |
| 751 | |
| 752 | |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 753 | D8_FLAGS = { |
| 754 | 'gcc': { |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 755 | 'all': { |
| 756 | 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
| 757 | 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], |
| 758 | 'LINKFLAGS': ['$CCFLAGS'], |
| 759 | }, |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 760 | 'console:readline': { |
| 761 | 'LIBS': ['readline'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 762 | }, |
| 763 | 'os:linux': { |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 764 | 'LIBS': ['pthread'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 765 | }, |
| 766 | 'os:macos': { |
| 767 | 'LIBS': ['pthread'], |
| 768 | }, |
| 769 | 'os:freebsd': { |
| 770 | 'LIBS': ['pthread'], |
| 771 | }, |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 772 | 'os:solaris': { |
| 773 | 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], |
| 774 | 'LINKFLAGS': ['-mt'] |
| 775 | }, |
sgjesse@chromium.org | ac6aa17 | 2009-12-04 12:29:05 +0000 | [diff] [blame] | 776 | 'os:openbsd': { |
| 777 | 'LIBS': ['pthread'], |
| 778 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 779 | 'os:win32': { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 780 | 'LIBS': ['winmm', 'ws2_32'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 781 | }, |
whesse@chromium.org | ba5a61b | 2010-07-26 11:44:40 +0000 | [diff] [blame] | 782 | 'arch:arm': { |
| 783 | 'LINKFLAGS': ARM_LINK_FLAGS |
| 784 | }, |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 785 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 786 | 'msvc': { |
| 787 | 'all': { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 788 | 'LIBS': ['winmm', 'ws2_32'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 789 | } |
| 790 | } |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 791 | } |
| 792 | |
| 793 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 794 | SUFFIXES = { |
| 795 | 'release': '', |
| 796 | 'debug': '_g' |
| 797 | } |
| 798 | |
| 799 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 800 | def Abort(message): |
| 801 | print message |
| 802 | sys.exit(1) |
| 803 | |
| 804 | |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 805 | def GuessOS(env): |
| 806 | return utils.GuessOS() |
| 807 | |
| 808 | |
| 809 | def GuessArch(env): |
| 810 | return utils.GuessArchitecture() |
| 811 | |
| 812 | |
| 813 | def GuessToolchain(env): |
| 814 | tools = env['TOOLS'] |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 815 | if 'gcc' in tools: |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 816 | return 'gcc' |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 817 | elif 'msvc' in tools: |
| 818 | return 'msvc' |
| 819 | else: |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 820 | return None |
| 821 | |
| 822 | |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 823 | def GuessVisibility(env): |
| 824 | os = env['os'] |
| 825 | toolchain = env['toolchain']; |
fschneider@chromium.org | 3a5fd78 | 2011-02-24 10:10:44 +0000 | [diff] [blame] | 826 | if (os == 'win32' or os == 'cygwin') and toolchain == 'gcc': |
| 827 | # MinGW / Cygwin can't do it. |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 828 | return 'default' |
sgjesse@chromium.org | c6c5718 | 2011-01-17 12:24:25 +0000 | [diff] [blame] | 829 | elif os == 'solaris': |
| 830 | return 'default' |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 831 | else: |
| 832 | return 'hidden' |
| 833 | |
| 834 | |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 835 | def GuessStrictAliasing(env): |
| 836 | # There seems to be a problem with gcc 4.5.x. |
| 837 | # See http://code.google.com/p/v8/issues/detail?id=884 |
| 838 | # It can be worked around by disabling strict aliasing. |
| 839 | toolchain = env['toolchain']; |
| 840 | if toolchain == 'gcc': |
| 841 | env = Environment(tools=['gcc']) |
| 842 | # The gcc version should be available in env['CCVERSION'], |
| 843 | # but when scons detects msvc this value is not set. |
| 844 | version = subprocess.Popen([env['CC'], '-dumpversion'], |
| 845 | stdout=subprocess.PIPE).communicate()[0] |
| 846 | if version.find('4.5') == 0: |
| 847 | return 'off' |
| 848 | return 'default' |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 849 | |
| 850 | |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 851 | PLATFORM_OPTIONS = { |
| 852 | 'arch': { |
| 853 | 'values': ['arm', 'ia32', 'x64', 'mips'], |
| 854 | 'guess': GuessArch, |
| 855 | 'help': 'the architecture to build for' |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 856 | }, |
| 857 | 'os': { |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 858 | 'values': ['freebsd', 'linux', 'macos', 'win32', 'openbsd', 'solaris', 'cygwin'], |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 859 | 'guess': GuessOS, |
| 860 | 'help': 'the os to build for' |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 861 | }, |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 862 | 'toolchain': { |
| 863 | 'values': ['gcc', 'msvc'], |
| 864 | 'guess': GuessToolchain, |
| 865 | 'help': 'the toolchain to use' |
| 866 | } |
| 867 | } |
| 868 | |
| 869 | SIMPLE_OPTIONS = { |
kasperl@chromium.org | 68ac009 | 2009-07-09 06:00:35 +0000 | [diff] [blame] | 870 | 'regexp': { |
| 871 | 'values': ['native', 'interpreted'], |
| 872 | 'default': 'native', |
| 873 | 'help': 'Whether to use native or interpreted regexp implementation' |
| 874 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 875 | 'snapshot': { |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 876 | 'values': ['on', 'off', 'nobuild'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 877 | 'default': 'off', |
| 878 | 'help': 'build using snapshots for faster start-up' |
| 879 | }, |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 880 | 'prof': { |
sgjesse@chromium.org | 496c03a | 2011-02-14 12:05:43 +0000 | [diff] [blame] | 881 | 'values': ['on', 'off'], |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 882 | 'default': 'off', |
| 883 | 'help': 'enable profiling of build target' |
| 884 | }, |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 885 | 'gdbjit': { |
| 886 | 'values': ['on', 'off'], |
| 887 | 'default': 'off', |
| 888 | 'help': 'enable GDB JIT interface' |
| 889 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 890 | 'library': { |
| 891 | 'values': ['static', 'shared'], |
| 892 | 'default': 'static', |
| 893 | 'help': 'the type of library to produce' |
| 894 | }, |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 895 | 'vmstate': { |
| 896 | 'values': ['on', 'off'], |
| 897 | 'default': 'off', |
| 898 | 'help': 'enable VM state tracking' |
| 899 | }, |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 900 | 'objectprint': { |
| 901 | 'values': ['on', 'off'], |
| 902 | 'default': 'off', |
| 903 | 'help': 'enable object printing' |
| 904 | }, |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 905 | 'protectheap': { |
| 906 | 'values': ['on', 'off'], |
| 907 | 'default': 'off', |
| 908 | 'help': 'enable heap protection' |
| 909 | }, |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 910 | 'profilingsupport': { |
| 911 | 'values': ['on', 'off'], |
| 912 | 'default': 'on', |
| 913 | 'help': 'enable profiling of JavaScript code' |
| 914 | }, |
| 915 | 'debuggersupport': { |
| 916 | 'values': ['on', 'off'], |
| 917 | 'default': 'on', |
| 918 | 'help': 'enable debugging of JavaScript code' |
| 919 | }, |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 920 | 'inspector': { |
| 921 | 'values': ['on', 'off'], |
| 922 | 'default': 'off', |
| 923 | 'help': 'enable inspector features' |
| 924 | }, |
vegorov@chromium.org | 0a4e901 | 2011-01-24 12:33:13 +0000 | [diff] [blame] | 925 | 'liveobjectlist': { |
| 926 | 'values': ['on', 'off'], |
| 927 | 'default': 'off', |
| 928 | 'help': 'enable live object list features in the debugger' |
| 929 | }, |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 930 | 'soname': { |
| 931 | 'values': ['on', 'off'], |
| 932 | 'default': 'off', |
| 933 | 'help': 'turn on setting soname for Linux shared library' |
| 934 | }, |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 935 | 'msvcrt': { |
| 936 | 'values': ['static', 'shared'], |
| 937 | 'default': 'static', |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 938 | 'help': 'the type of Microsoft Visual C++ runtime library to use' |
| 939 | }, |
| 940 | 'msvcltcg': { |
| 941 | 'values': ['on', 'off'], |
| 942 | 'default': 'on', |
| 943 | 'help': 'use Microsoft Visual C++ link-time code generation' |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 944 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 945 | 'simulator': { |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 946 | 'values': ['arm', 'mips', 'none'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 947 | 'default': 'none', |
| 948 | 'help': 'build with simulator' |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 949 | }, |
ricow@chromium.org | 30ce411 | 2010-05-31 10:38:25 +0000 | [diff] [blame] | 950 | 'unalignedaccesses': { |
| 951 | 'values': ['default', 'on', 'off'], |
| 952 | 'default': 'default', |
| 953 | 'help': 'set whether the ARM target supports unaligned accesses' |
| 954 | }, |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 955 | 'disassembler': { |
| 956 | 'values': ['on', 'off'], |
| 957 | 'default': 'off', |
| 958 | 'help': 'enable the disassembler to inspect generated code' |
| 959 | }, |
fschneider@chromium.org | 7979bbb | 2011-03-28 10:47:03 +0000 | [diff] [blame] | 960 | 'fasttls': { |
| 961 | 'values': ['on', 'off'], |
| 962 | 'default': 'on', |
| 963 | 'help': 'enable fast thread local storage support ' |
| 964 | '(if available on the current architecture/platform)' |
| 965 | }, |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 966 | 'sourcesignatures': { |
| 967 | 'values': ['MD5', 'timestamp'], |
| 968 | 'default': 'MD5', |
| 969 | 'help': 'set how the build system detects file changes' |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 970 | }, |
| 971 | 'console': { |
| 972 | 'values': ['dumb', 'readline'], |
| 973 | 'default': 'dumb', |
| 974 | 'help': 'the console to use for the d8 shell' |
ager@chromium.org | 18ad94b | 2009-09-02 08:22:29 +0000 | [diff] [blame] | 975 | }, |
| 976 | 'verbose': { |
| 977 | 'values': ['on', 'off'], |
| 978 | 'default': 'off', |
| 979 | 'help': 'more output from compiler and linker' |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 980 | }, |
| 981 | 'visibility': { |
| 982 | 'values': ['default', 'hidden'], |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 983 | 'guess': GuessVisibility, |
| 984 | 'help': 'shared library symbol visibility' |
| 985 | }, |
| 986 | 'strictaliasing': { |
| 987 | 'values': ['default', 'off'], |
| 988 | 'guess': GuessStrictAliasing, |
| 989 | 'help': 'assume strict aliasing while optimizing' |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 990 | }, |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 991 | 'pgo': { |
| 992 | 'values': ['off', 'instrument', 'optimize'], |
| 993 | 'default': 'off', |
| 994 | 'help': 'select profile guided optimization variant', |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 995 | }, |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 996 | 'armeabi': { |
| 997 | 'values': ['hard', 'softfp', 'soft'], |
| 998 | 'default': 'softfp', |
| 999 | 'help': 'generate calling conventiont according to selected ARM EABI variant' |
| 1000 | }, |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1001 | 'mipsabi': { |
| 1002 | 'values': ['hardfloat', 'softfloat', 'none'], |
| 1003 | 'default': 'hardfloat', |
| 1004 | 'help': 'generate calling conventiont according to selected mips ABI' |
| 1005 | }, |
| 1006 | 'mips_arch_variant': { |
| 1007 | 'values': ['mips32r2', 'mips32r1'], |
| 1008 | 'default': 'mips32r2', |
| 1009 | 'help': 'mips variant' |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 1010 | }, |
| 1011 | 'compress_startup_data': { |
| 1012 | 'values': ['off', 'bz2'], |
| 1013 | 'default': 'off', |
| 1014 | 'help': 'compress startup data (snapshot) [Linux only]' |
| 1015 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1016 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1017 | |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1018 | ALL_OPTIONS = dict(PLATFORM_OPTIONS, **SIMPLE_OPTIONS) |
| 1019 | |
| 1020 | |
| 1021 | def AddOptions(options, result): |
| 1022 | guess_env = Environment(options=result) |
| 1023 | for (name, option) in options.iteritems(): |
| 1024 | if 'guess' in option: |
| 1025 | # Option has a guess function |
| 1026 | guess = option.get('guess') |
| 1027 | default = guess(guess_env) |
| 1028 | else: |
| 1029 | # Option has a fixed default |
| 1030 | default = option.get('default') |
| 1031 | help = '%s (%s)' % (option.get('help'), ", ".join(option['values'])) |
| 1032 | result.Add(name, help, default) |
| 1033 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1034 | |
| 1035 | def GetOptions(): |
| 1036 | result = Options() |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 1037 | result.Add('mode', 'compilation mode (debug, release)', 'release') |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 1038 | result.Add('sample', 'build sample (shell, process, lineprocessor)', '') |
ager@chromium.org | 2cc82ae | 2010-06-14 07:35:38 +0000 | [diff] [blame] | 1039 | result.Add('cache', 'directory to use for scons build cache', '') |
kasperl@chromium.org | 8ccb0be | 2009-04-07 07:21:39 +0000 | [diff] [blame] | 1040 | result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,...)', '') |
| 1041 | result.Add('importenv', 'import environment settings (NAME0,NAME1,...)', '') |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1042 | AddOptions(PLATFORM_OPTIONS, result) |
| 1043 | AddOptions(SIMPLE_OPTIONS, result) |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1044 | return result |
| 1045 | |
| 1046 | |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1047 | def GetTools(opts): |
| 1048 | env = Environment(options=opts) |
| 1049 | os = env['os'] |
| 1050 | toolchain = env['toolchain'] |
| 1051 | if os == 'win32' and toolchain == 'gcc': |
| 1052 | return ['mingw'] |
| 1053 | elif os == 'win32' and toolchain == 'msvc': |
| 1054 | return ['msvc', 'mslink', 'mslib', 'msvs'] |
| 1055 | else: |
| 1056 | return ['default'] |
| 1057 | |
| 1058 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 1059 | def GetVersionComponents(): |
| 1060 | MAJOR_VERSION_PATTERN = re.compile(r"#define\s+MAJOR_VERSION\s+(.*)") |
| 1061 | MINOR_VERSION_PATTERN = re.compile(r"#define\s+MINOR_VERSION\s+(.*)") |
| 1062 | BUILD_NUMBER_PATTERN = re.compile(r"#define\s+BUILD_NUMBER\s+(.*)") |
| 1063 | PATCH_LEVEL_PATTERN = re.compile(r"#define\s+PATCH_LEVEL\s+(.*)") |
| 1064 | |
| 1065 | patterns = [MAJOR_VERSION_PATTERN, |
| 1066 | MINOR_VERSION_PATTERN, |
| 1067 | BUILD_NUMBER_PATTERN, |
| 1068 | PATCH_LEVEL_PATTERN] |
| 1069 | |
| 1070 | source = open(join(root_dir, 'src', 'version.cc')).read() |
| 1071 | version_components = [] |
| 1072 | for pattern in patterns: |
| 1073 | match = pattern.search(source) |
| 1074 | if match: |
| 1075 | version_components.append(match.group(1).strip()) |
| 1076 | else: |
| 1077 | version_components.append('0') |
| 1078 | |
| 1079 | return version_components |
| 1080 | |
| 1081 | |
| 1082 | def GetVersion(): |
| 1083 | version_components = GetVersionComponents() |
ager@chromium.org | 5aa501c | 2009-06-23 07:57:28 +0000 | [diff] [blame] | 1084 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 1085 | if version_components[len(version_components) - 1] == '0': |
| 1086 | version_components.pop() |
| 1087 | return '.'.join(version_components) |
| 1088 | |
| 1089 | |
| 1090 | def GetSpecificSONAME(): |
| 1091 | SONAME_PATTERN = re.compile(r"#define\s+SONAME\s+\"(.*)\"") |
ager@chromium.org | 5aa501c | 2009-06-23 07:57:28 +0000 | [diff] [blame] | 1092 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 1093 | source = open(join(root_dir, 'src', 'version.cc')).read() |
| 1094 | match = SONAME_PATTERN.search(source) |
ager@chromium.org | 5aa501c | 2009-06-23 07:57:28 +0000 | [diff] [blame] | 1095 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 1096 | if match: |
| 1097 | return match.group(1).strip() |
| 1098 | else: |
| 1099 | return '' |
| 1100 | |
| 1101 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1102 | def SplitList(str): |
| 1103 | return [ s for s in str.split(",") if len(s) > 0 ] |
| 1104 | |
| 1105 | |
| 1106 | def IsLegal(env, option, values): |
| 1107 | str = env[option] |
| 1108 | for s in SplitList(str): |
| 1109 | if not s in values: |
| 1110 | Abort("Illegal value for option %s '%s'." % (option, s)) |
| 1111 | return False |
| 1112 | return True |
| 1113 | |
| 1114 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1115 | def VerifyOptions(env): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1116 | if not IsLegal(env, 'mode', ['debug', 'release']): |
| 1117 | return False |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 1118 | if not IsLegal(env, 'sample', ["shell", "process", "lineprocessor"]): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1119 | return False |
kasperl@chromium.org | 68ac009 | 2009-07-09 06:00:35 +0000 | [diff] [blame] | 1120 | if not IsLegal(env, 'regexp', ["native", "interpreted"]): |
| 1121 | return False |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 1122 | if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on': |
| 1123 | Abort("Profiling on windows only supported for static library.") |
kmillikin@chromium.org | 49edbdf | 2011-02-16 12:32:18 +0000 | [diff] [blame] | 1124 | if env['gdbjit'] == 'on' and (env['os'] != 'linux' or (env['arch'] != 'ia32' and env['arch'] != 'x64' and env['arch'] != 'arm')): |
erik.corry@gmail.com | 0511e24 | 2011-01-19 11:11:08 +0000 | [diff] [blame] | 1125 | Abort("GDBJIT interface is supported only for Intel-compatible (ia32 or x64) Linux target.") |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 1126 | if env['os'] == 'win32' and env['soname'] == 'on': |
| 1127 | Abort("Shared Object soname not applicable for Windows.") |
| 1128 | if env['soname'] == 'on' and env['library'] == 'static': |
| 1129 | Abort("Shared Object soname not applicable for static library.") |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 1130 | if env['os'] != 'win32' and env['pgo'] != 'off': |
| 1131 | Abort("Profile guided optimization only supported on Windows.") |
ager@chromium.org | 2cc82ae | 2010-06-14 07:35:38 +0000 | [diff] [blame] | 1132 | if env['cache'] and not os.path.isdir(env['cache']): |
| 1133 | Abort("The specified cache directory does not exist.") |
ricow@chromium.org | 30ce411 | 2010-05-31 10:38:25 +0000 | [diff] [blame] | 1134 | if not (env['arch'] == 'arm' or env['simulator'] == 'arm') and ('unalignedaccesses' in ARGUMENTS): |
| 1135 | print env['arch'] |
| 1136 | print env['simulator'] |
| 1137 | Abort("Option unalignedaccesses only supported for the ARM architecture.") |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 1138 | if env['os'] != 'linux' and env['compress_startup_data'] != 'off': |
| 1139 | Abort("Startup data compression is only available on Linux") |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1140 | for (name, option) in ALL_OPTIONS.iteritems(): |
| 1141 | if (not name in env): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1142 | message = ("A value for option %s must be specified (%s)." % |
| 1143 | (name, ", ".join(option['values']))) |
| 1144 | Abort(message) |
| 1145 | if not env[name] in option['values']: |
| 1146 | message = ("Unknown %s value '%s'. Possible values are (%s)." % |
| 1147 | (name, env[name], ", ".join(option['values']))) |
| 1148 | Abort(message) |
| 1149 | |
| 1150 | |
| 1151 | class BuildContext(object): |
| 1152 | |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 1153 | def __init__(self, options, env_overrides, samples): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1154 | self.library_targets = [] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1155 | self.mksnapshot_targets = [] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1156 | self.cctest_targets = [] |
| 1157 | self.sample_targets = [] |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1158 | self.d8_targets = [] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1159 | self.options = options |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 1160 | self.env_overrides = env_overrides |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1161 | self.samples = samples |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1162 | self.preparser_targets = [] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1163 | self.use_snapshot = (options['snapshot'] != 'off') |
| 1164 | self.build_snapshot = (options['snapshot'] == 'on') |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1165 | self.flags = None |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 1166 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1167 | def AddRelevantFlags(self, initial, flags): |
| 1168 | result = initial.copy() |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1169 | toolchain = self.options['toolchain'] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 1170 | if toolchain in flags: |
| 1171 | self.AppendFlags(result, flags[toolchain].get('all')) |
| 1172 | for option in sorted(self.options.keys()): |
| 1173 | value = self.options[option] |
| 1174 | self.AppendFlags(result, flags[toolchain].get(option + ':' + value)) |
ager@chromium.org | 3a37e9b | 2009-04-27 09:26:21 +0000 | [diff] [blame] | 1175 | self.AppendFlags(result, flags.get('all')) |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 1176 | return result |
| 1177 | |
| 1178 | def AddRelevantSubFlags(self, options, flags): |
| 1179 | self.AppendFlags(options, flags.get('all')) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1180 | for option in sorted(self.options.keys()): |
| 1181 | value = self.options[option] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 1182 | self.AppendFlags(options, flags.get(option + ':' + value)) |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 1183 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1184 | def GetRelevantSources(self, source): |
| 1185 | result = [] |
| 1186 | result += source.get('all', []) |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 1187 | for (name, value) in self.options.iteritems(): |
sgjesse@chromium.org | 911335c | 2009-08-19 12:59:44 +0000 | [diff] [blame] | 1188 | source_value = source.get(name + ':' + value, []) |
| 1189 | if type(source_value) == dict: |
| 1190 | result += self.GetRelevantSources(source_value) |
| 1191 | else: |
| 1192 | result += source_value |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1193 | return sorted(result) |
| 1194 | |
| 1195 | def AppendFlags(self, options, added): |
| 1196 | if not added: |
| 1197 | return |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 1198 | for (key, value) in added.iteritems(): |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 1199 | if key.find(':') != -1: |
| 1200 | self.AddRelevantSubFlags(options, { key: value }) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1201 | else: |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 1202 | if not key in options: |
| 1203 | options[key] = value |
| 1204 | else: |
| 1205 | prefix = options[key] |
| 1206 | if isinstance(prefix, StringTypes): prefix = prefix.split() |
| 1207 | options[key] = prefix + value |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1208 | |
| 1209 | def ConfigureObject(self, env, input, **kw): |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 1210 | if (kw.has_key('CPPPATH') and env.has_key('CPPPATH')): |
| 1211 | kw['CPPPATH'] += env['CPPPATH'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1212 | if self.options['library'] == 'static': |
| 1213 | return env.StaticObject(input, **kw) |
| 1214 | else: |
| 1215 | return env.SharedObject(input, **kw) |
| 1216 | |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1217 | def ApplyEnvOverrides(self, env): |
| 1218 | if not self.env_overrides: |
| 1219 | return |
| 1220 | if type(env['ENV']) == DictType: |
| 1221 | env['ENV'].update(**self.env_overrides) |
| 1222 | else: |
| 1223 | env['ENV'] = self.env_overrides |
| 1224 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1225 | |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 1226 | def PostprocessOptions(options, os): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1227 | # Adjust architecture if the simulator option has been set |
| 1228 | if (options['simulator'] != 'none') and (options['arch'] != options['simulator']): |
| 1229 | if 'arch' in ARGUMENTS: |
| 1230 | # Print a warning if arch has explicitly been set |
| 1231 | print "Warning: forcing architecture to match simulator (%s)" % options['simulator'] |
| 1232 | options['arch'] = options['simulator'] |
ager@chromium.org | 4af710e | 2009-09-15 12:20:11 +0000 | [diff] [blame] | 1233 | if (options['prof'] != 'off') and (options['profilingsupport'] == 'off'): |
| 1234 | # Print a warning if profiling is enabled without profiling support |
| 1235 | print "Warning: forcing profilingsupport on when prof is on" |
| 1236 | options['profilingsupport'] = 'on' |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 1237 | if os == 'win32' and options['pgo'] != 'off' and options['msvcltcg'] == 'off': |
| 1238 | if 'msvcltcg' in ARGUMENTS: |
| 1239 | print "Warning: forcing msvcltcg on as it is required for pgo (%s)" % options['pgo'] |
| 1240 | options['msvcltcg'] = 'on' |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1241 | if (options['simulator'] == 'mips' and options['mipsabi'] != 'softfloat'): |
| 1242 | # Print a warning if soft-float ABI is not selected for mips simulator |
| 1243 | print "Warning: forcing soft-float mips ABI when running on simulator" |
| 1244 | options['mipsabi'] = 'softfloat' |
| 1245 | if (options['mipsabi'] != 'none') and (options['arch'] != 'mips') and (options['simulator'] != 'mips'): |
| 1246 | options['mipsabi'] = 'none' |
vegorov@chromium.org | 0a4e901 | 2011-01-24 12:33:13 +0000 | [diff] [blame] | 1247 | if options['liveobjectlist'] == 'on': |
| 1248 | if (options['debuggersupport'] != 'on') or (options['mode'] == 'release'): |
| 1249 | # Print a warning that liveobjectlist will implicitly enable the debugger |
| 1250 | print "Warning: forcing debuggersupport on for liveobjectlist" |
| 1251 | options['debuggersupport'] = 'on' |
ager@chromium.org | 0ee099b | 2011-01-25 14:06:47 +0000 | [diff] [blame] | 1252 | options['inspector'] = 'on' |
| 1253 | options['objectprint'] = 'on' |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1254 | |
| 1255 | |
kasperl@chromium.org | 8ccb0be | 2009-04-07 07:21:39 +0000 | [diff] [blame] | 1256 | def ParseEnvOverrides(arg, imports): |
| 1257 | # The environment overrides are in the format NAME0:value0,NAME1:value1,... |
| 1258 | # The environment imports are in the format NAME0,NAME1,... |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 1259 | overrides = {} |
kasperl@chromium.org | 8ccb0be | 2009-04-07 07:21:39 +0000 | [diff] [blame] | 1260 | for var in imports.split(','): |
| 1261 | if var in os.environ: |
| 1262 | overrides[var] = os.environ[var] |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 1263 | for override in arg.split(','): |
| 1264 | pos = override.find(':') |
| 1265 | if pos == -1: |
| 1266 | continue |
| 1267 | overrides[override[:pos].strip()] = override[pos+1:].strip() |
| 1268 | return overrides |
| 1269 | |
| 1270 | |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1271 | def BuildSpecific(env, mode, env_overrides, tools): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1272 | options = {'mode': mode} |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1273 | for option in ALL_OPTIONS: |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1274 | options[option] = env[option] |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 1275 | PostprocessOptions(options, env['os']) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1276 | |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 1277 | context = BuildContext(options, env_overrides, samples=SplitList(env['sample'])) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1278 | |
ager@chromium.org | ab99eea | 2009-08-25 07:05:41 +0000 | [diff] [blame] | 1279 | # Remove variables which can't be imported from the user's external |
| 1280 | # environment into a construction environment. |
| 1281 | user_environ = os.environ.copy() |
| 1282 | try: |
| 1283 | del user_environ['ENV'] |
| 1284 | except KeyError: |
| 1285 | pass |
| 1286 | |
| 1287 | library_flags = context.AddRelevantFlags(user_environ, LIBRARY_FLAGS) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1288 | v8_flags = context.AddRelevantFlags(library_flags, V8_EXTRA_FLAGS) |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1289 | mksnapshot_flags = context.AddRelevantFlags(library_flags, MKSNAPSHOT_EXTRA_FLAGS) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1290 | dtoa_flags = context.AddRelevantFlags(library_flags, DTOA_EXTRA_FLAGS) |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 1291 | cctest_flags = context.AddRelevantFlags(v8_flags, CCTEST_EXTRA_FLAGS) |
ager@chromium.org | ab99eea | 2009-08-25 07:05:41 +0000 | [diff] [blame] | 1292 | sample_flags = context.AddRelevantFlags(user_environ, SAMPLE_FLAGS) |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1293 | preparser_flags = context.AddRelevantFlags(user_environ, PREPARSER_FLAGS) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1294 | d8_flags = context.AddRelevantFlags(library_flags, D8_FLAGS) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1295 | |
| 1296 | context.flags = { |
| 1297 | 'v8': v8_flags, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1298 | 'mksnapshot': mksnapshot_flags, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1299 | 'dtoa': dtoa_flags, |
| 1300 | 'cctest': cctest_flags, |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1301 | 'sample': sample_flags, |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1302 | 'd8': d8_flags, |
| 1303 | 'preparser': preparser_flags |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1304 | } |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 1305 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 1306 | # Generate library base name. |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1307 | target_id = mode |
| 1308 | suffix = SUFFIXES[target_id] |
| 1309 | library_name = 'v8' + suffix |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1310 | preparser_library_name = 'v8preparser' + suffix |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 1311 | version = GetVersion() |
| 1312 | if context.options['soname'] == 'on': |
| 1313 | # When building shared object with SONAME version the library name. |
| 1314 | library_name += '-' + version |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1315 | |
ager@chromium.org | 5ec4892 | 2009-05-05 07:25:34 +0000 | [diff] [blame] | 1316 | # Generate library SONAME if required by the build. |
| 1317 | if context.options['soname'] == 'on': |
| 1318 | soname = GetSpecificSONAME() |
| 1319 | if soname == '': |
| 1320 | soname = 'lib' + library_name + '.so' |
| 1321 | env['SONAME'] = soname |
| 1322 | |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 1323 | # Build the object files by invoking SCons recursively. |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1324 | (object_files, shell_files, mksnapshot, preparser_files) = env.SConscript( |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1325 | join('src', 'SConscript'), |
| 1326 | build_dir=join('obj', target_id), |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1327 | exports='context tools', |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1328 | duplicate=False |
| 1329 | ) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1330 | |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1331 | context.mksnapshot_targets.append(mksnapshot) |
| 1332 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1333 | # Link the object files into a library. |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 1334 | env.Replace(**context.flags['v8']) |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 1335 | |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1336 | context.ApplyEnvOverrides(env) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1337 | if context.options['library'] == 'static': |
| 1338 | library = env.StaticLibrary(library_name, object_files) |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1339 | preparser_library = env.StaticLibrary(preparser_library_name, |
| 1340 | preparser_files) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1341 | else: |
| 1342 | # There seems to be a glitch in the way scons decides where to put |
| 1343 | # PDB files when compiling using MSVC so we specify it manually. |
| 1344 | # This should not affect any other platforms. |
| 1345 | pdb_name = library_name + '.dll.pdb' |
| 1346 | library = env.SharedLibrary(library_name, object_files, PDB=pdb_name) |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1347 | preparser_pdb_name = preparser_library_name + '.dll.pdb'; |
| 1348 | preparser_library = env.SharedLibrary(preparser_library_name, |
| 1349 | preparser_files, |
| 1350 | PDB=preparser_pdb_name) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1351 | context.library_targets.append(library) |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1352 | context.library_targets.append(preparser_library) |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 1353 | |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1354 | d8_env = Environment(tools=tools) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1355 | d8_env.Replace(**context.flags['d8']) |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 1356 | context.ApplyEnvOverrides(d8_env) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1357 | shell = d8_env.Program('d8' + suffix, object_files + shell_files) |
| 1358 | context.d8_targets.append(shell) |
| 1359 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1360 | for sample in context.samples: |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1361 | sample_env = Environment(tools=tools) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1362 | sample_env.Replace(**context.flags['sample']) |
sgjesse@chromium.org | df7a284 | 2010-03-25 14:34:15 +0000 | [diff] [blame] | 1363 | sample_env.Prepend(LIBS=[library_name]) |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1364 | context.ApplyEnvOverrides(sample_env) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1365 | sample_object = sample_env.SConscript( |
| 1366 | join('samples', 'SConscript'), |
| 1367 | build_dir=join('obj', 'sample', sample, target_id), |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1368 | exports='sample context tools', |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1369 | duplicate=False |
| 1370 | ) |
| 1371 | sample_name = sample + suffix |
| 1372 | sample_program = sample_env.Program(sample_name, sample_object) |
| 1373 | sample_env.Depends(sample_program, library) |
| 1374 | context.sample_targets.append(sample_program) |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 1375 | |
ager@chromium.org | b26c50a | 2010-03-26 09:27:16 +0000 | [diff] [blame] | 1376 | cctest_env = env.Copy() |
| 1377 | cctest_env.Prepend(LIBS=[library_name]) |
| 1378 | cctest_program = cctest_env.SConscript( |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1379 | join('test', 'cctest', 'SConscript'), |
| 1380 | build_dir=join('obj', 'test', target_id), |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1381 | exports='context object_files tools', |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1382 | duplicate=False |
| 1383 | ) |
| 1384 | context.cctest_targets.append(cctest_program) |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 1385 | |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1386 | preparser_env = env.Copy() |
| 1387 | preparser_env.Replace(**context.flags['preparser']) |
| 1388 | preparser_env.Prepend(LIBS=[preparser_library_name]) |
| 1389 | context.ApplyEnvOverrides(preparser_env) |
| 1390 | preparser_object = preparser_env.SConscript( |
| 1391 | join('preparser', 'SConscript'), |
| 1392 | build_dir=join('obj', 'preparser', target_id), |
| 1393 | exports='context', |
| 1394 | duplicate=False |
| 1395 | ) |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1396 | preparser_name = join('obj', 'preparser', target_id, 'preparser') |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1397 | preparser_program = preparser_env.Program(preparser_name, preparser_object); |
| 1398 | preparser_env.Depends(preparser_program, preparser_library) |
| 1399 | context.preparser_targets.append(preparser_program) |
| 1400 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1401 | return context |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1402 | |
| 1403 | |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 1404 | def Build(): |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1405 | opts = GetOptions() |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1406 | tools = GetTools(opts) |
| 1407 | env = Environment(options=opts, tools=tools) |
| 1408 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1409 | Help(opts.GenerateHelpText(env)) |
| 1410 | VerifyOptions(env) |
kasperl@chromium.org | 8ccb0be | 2009-04-07 07:21:39 +0000 | [diff] [blame] | 1411 | env_overrides = ParseEnvOverrides(env['env'], env['importenv']) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1412 | |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1413 | SourceSignatures(env['sourcesignatures']) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1414 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1415 | libraries = [] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1416 | mksnapshots = [] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1417 | cctests = [] |
| 1418 | samples = [] |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1419 | preparsers = [] |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1420 | d8s = [] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1421 | modes = SplitList(env['mode']) |
| 1422 | for mode in modes: |
kmillikin@chromium.org | c36ce6e | 2011-04-04 08:25:31 +0000 | [diff] [blame] | 1423 | context = BuildSpecific(env.Copy(), mode, env_overrides, tools) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1424 | libraries += context.library_targets |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1425 | mksnapshots += context.mksnapshot_targets |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1426 | cctests += context.cctest_targets |
| 1427 | samples += context.sample_targets |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1428 | preparsers += context.preparser_targets |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1429 | d8s += context.d8_targets |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1430 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1431 | env.Alias('library', libraries) |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame] | 1432 | env.Alias('mksnapshot', mksnapshots) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1433 | env.Alias('cctests', cctests) |
| 1434 | env.Alias('sample', samples) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 1435 | env.Alias('d8', d8s) |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 1436 | env.Alias('preparser', preparsers) |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 1437 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1438 | if env['sample']: |
| 1439 | env.Default('sample') |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 1440 | else: |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 1441 | env.Default('library') |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 1442 | |
ager@chromium.org | 2cc82ae | 2010-06-14 07:35:38 +0000 | [diff] [blame] | 1443 | if env['cache']: |
| 1444 | CacheDir(env['cache']) |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 1445 | |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 1446 | # We disable deprecation warnings because we need to be able to use |
| 1447 | # env.Copy without getting warnings for compatibility with older |
| 1448 | # version of scons. Also, there's a bug in some revisions that |
| 1449 | # doesn't allow this flag to be set, so we swallow any exceptions. |
| 1450 | # Lovely. |
| 1451 | try: |
| 1452 | SetOption('warn', 'no-deprecated') |
| 1453 | except: |
| 1454 | pass |
| 1455 | |
| 1456 | |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 1457 | Build() |