ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1 | # Copyright 2008 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 |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 30 | import sys |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 31 | import os |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 32 | from os.path import join, dirname, abspath |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 33 | from types import DictType, StringTypes |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 34 | root_dir = dirname(File('SConstruct').rfile().abspath) |
| 35 | sys.path.append(join(root_dir, 'tools')) |
ager@chromium.org | c27e4e7 | 2008-09-04 13:52:27 +0000 | [diff] [blame] | 36 | import js2c, utils |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 37 | |
| 38 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 39 | LIBRARY_FLAGS = { |
| 40 | 'all': { |
| 41 | 'CPPDEFINES': ['ENABLE_LOGGING_AND_PROFILING'] |
| 42 | }, |
| 43 | 'gcc': { |
| 44 | 'all': { |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 45 | 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 46 | 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 47 | }, |
| 48 | 'mode:debug': { |
| 49 | 'CCFLAGS': ['-g', '-O0'], |
| 50 | 'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'] |
| 51 | }, |
| 52 | 'mode:release': { |
ager@chromium.org | ddb913d | 2009-01-27 10:01:48 +0000 | [diff] [blame] | 53 | 'CCFLAGS': ['-O3', '-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 54 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 55 | 'os:linux': { |
| 56 | 'CCFLAGS': ['-ansi'], |
| 57 | }, |
| 58 | 'os:macos': { |
| 59 | 'CCFLAGS': ['-ansi'], |
| 60 | }, |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 61 | 'os:freebsd': { |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 62 | 'CCFLAGS': ['-ansi'], |
| 63 | }, |
| 64 | 'os:win32': { |
| 65 | 'CCFLAGS': ['-DWIN32'], |
| 66 | 'CXXFLAGS': ['-DWIN32'], |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 67 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 68 | 'wordsize:64': { |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 69 | 'CCFLAGS': ['-m32'], |
| 70 | 'LINKFLAGS': ['-m32'] |
| 71 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 72 | }, |
| 73 | 'msvc': { |
| 74 | 'all': { |
| 75 | 'DIALECTFLAGS': ['/nologo'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 76 | 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 77 | 'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'], |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 78 | 'CPPDEFINES': ['WIN32', '_USE_32BIT_TIME_T', 'PCRE_STATIC'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 79 | 'LINKFLAGS': ['/NOLOGO', '/MACHINE:X86', '/INCREMENTAL:NO', |
| 80 | '/NXCOMPAT', '/IGNORE:4221'], |
| 81 | 'ARFLAGS': ['/NOLOGO'], |
| 82 | 'CCPDBFLAGS': ['/Zi'] |
| 83 | }, |
| 84 | 'mode:debug': { |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 85 | 'CCFLAGS': ['/Od', '/Gm'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 86 | 'CPPDEFINES': ['_DEBUG', 'ENABLE_DISASSEMBLER', 'DEBUG'], |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 87 | 'LINKFLAGS': ['/DEBUG'], |
| 88 | 'msvcrt:static': { |
| 89 | 'CCFLAGS': ['/MTd'] |
| 90 | }, |
| 91 | 'msvcrt:shared': { |
| 92 | 'CCFLAGS': ['/MDd'] |
| 93 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 94 | }, |
| 95 | 'mode:release': { |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 96 | 'CCFLAGS': ['/O2', '/GL'], |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 97 | 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF', '/LTCG'], |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 98 | 'ARFLAGS': ['/LTCG'], |
| 99 | 'msvcrt:static': { |
| 100 | 'CCFLAGS': ['/MT'] |
| 101 | }, |
| 102 | 'msvcrt:shared': { |
| 103 | 'CCFLAGS': ['/MD'] |
| 104 | } |
| 105 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 106 | } |
| 107 | } |
| 108 | |
| 109 | |
| 110 | V8_EXTRA_FLAGS = { |
| 111 | 'gcc': { |
| 112 | 'all': { |
| 113 | 'CXXFLAGS': [], #['-fvisibility=hidden'], |
| 114 | 'WARNINGFLAGS': ['-pedantic', '-Wall', '-Werror', '-W', |
| 115 | '-Wno-unused-parameter'] |
| 116 | }, |
| 117 | 'arch:arm': { |
| 118 | 'CPPDEFINES': ['ARM'] |
| 119 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 120 | 'os:win32': { |
| 121 | 'WARNINGFLAGS': ['-Wno-long-long'] |
| 122 | }, |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 123 | 'disassembler:on': { |
| 124 | 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] |
| 125 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 126 | }, |
| 127 | 'msvc': { |
| 128 | 'all': { |
| 129 | 'WARNINGFLAGS': ['/W3', '/WX', '/wd4355', '/wd4800'] |
| 130 | }, |
| 131 | 'library:shared': { |
| 132 | 'CPPDEFINES': ['BUILDING_V8_SHARED'] |
| 133 | }, |
| 134 | 'arch:arm': { |
ager@chromium.org | 3bf7b91 | 2008-11-17 09:09:45 +0000 | [diff] [blame] | 135 | 'CPPDEFINES': ['ARM'], |
| 136 | # /wd4996 is to silence the warning about sscanf |
| 137 | # used by the arm simulator. |
| 138 | 'WARNINGFLAGS': ['/wd4996'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 139 | }, |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 140 | 'disassembler:on': { |
| 141 | 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] |
| 142 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 143 | } |
| 144 | } |
| 145 | |
| 146 | |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 147 | MKSNAPSHOT_EXTRA_FLAGS = { |
| 148 | 'gcc': { |
| 149 | 'os:linux': { |
| 150 | 'LIBS': ['pthread'], |
| 151 | }, |
| 152 | 'os:macos': { |
| 153 | 'LIBS': ['pthread'], |
| 154 | }, |
| 155 | 'os:freebsd': { |
| 156 | 'LIBS': ['pthread'], |
| 157 | }, |
| 158 | 'os:win32': { |
| 159 | 'LIBS': ['winmm'], |
| 160 | }, |
| 161 | }, |
| 162 | 'msvc': { |
| 163 | 'all': { |
| 164 | 'LIBS': ['winmm'] |
| 165 | } |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 170 | JSCRE_EXTRA_FLAGS = { |
| 171 | 'gcc': { |
| 172 | 'all': { |
| 173 | 'CPPDEFINES': ['SUPPORT_UTF8', 'NO_RECURSE', 'SUPPORT_UCP'], |
| 174 | 'WARNINGFLAGS': ['-w'] |
| 175 | }, |
| 176 | }, |
| 177 | 'msvc': { |
| 178 | 'all': { |
| 179 | 'CPPDEFINES': ['SUPPORT_UTF8', 'NO_RECURSE', 'SUPPORT_UCP'], |
| 180 | 'WARNINGFLAGS': ['/W3', '/WX', '/wd4355', '/wd4800'] |
| 181 | }, |
| 182 | 'library:shared': { |
| 183 | 'CPPDEFINES': ['BUILDING_V8_SHARED'] |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | |
| 189 | DTOA_EXTRA_FLAGS = { |
| 190 | 'gcc': { |
| 191 | 'all': { |
| 192 | 'WARNINGFLAGS': ['-Werror'] |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 193 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 194 | }, |
| 195 | 'msvc': { |
| 196 | 'all': { |
| 197 | 'WARNINGFLAGS': ['/WX', '/wd4018', '/wd4244'] |
| 198 | } |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | |
| 203 | CCTEST_EXTRA_FLAGS = { |
| 204 | 'all': { |
| 205 | 'CPPPATH': [join(root_dir, 'src')], |
| 206 | 'LIBS': ['$LIBRARY'] |
| 207 | }, |
| 208 | 'gcc': { |
| 209 | 'all': { |
| 210 | 'LIBPATH': [abspath('.')] |
| 211 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 212 | 'os:linux': { |
| 213 | 'LIBS': ['pthread'], |
| 214 | }, |
| 215 | 'os:macos': { |
| 216 | 'LIBS': ['pthread'], |
| 217 | }, |
| 218 | 'os:freebsd': { |
| 219 | 'LIBS': ['execinfo', 'pthread'] |
| 220 | }, |
| 221 | 'os:win32': { |
| 222 | 'LIBS': ['winmm'] |
| 223 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 224 | 'wordsize:64': { |
| 225 | 'CCFLAGS': ['-m32'], |
| 226 | 'LINKFLAGS': ['-m32'] |
| 227 | }, |
| 228 | }, |
| 229 | 'msvc': { |
| 230 | 'all': { |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 231 | 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], |
| 232 | 'LIBS': ['winmm'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 233 | }, |
| 234 | 'library:shared': { |
| 235 | 'CPPDEFINES': ['USING_V8_SHARED'] |
| 236 | } |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | |
| 241 | SAMPLE_FLAGS = { |
| 242 | 'all': { |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 243 | 'CPPPATH': [join(abspath('.'), 'include')], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 244 | 'LIBS': ['$LIBRARY'], |
| 245 | }, |
| 246 | 'gcc': { |
| 247 | 'all': { |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 248 | 'LIBPATH': ['.'] |
| 249 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 250 | 'os:linux': { |
| 251 | 'LIBS': ['pthread'], |
| 252 | }, |
| 253 | 'os:macos': { |
| 254 | 'LIBS': ['pthread'], |
| 255 | }, |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 256 | 'os:freebsd': { |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 257 | 'LIBS': ['execinfo', 'pthread'] |
| 258 | }, |
| 259 | 'os:win32': { |
| 260 | 'LIBS': ['winmm'] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 261 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 262 | 'wordsize:64': { |
| 263 | 'CCFLAGS': ['-m32'], |
| 264 | 'LINKFLAGS': ['-m32'] |
| 265 | }, |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 266 | 'mode:release': { |
| 267 | 'CCFLAGS': ['-O2'] |
| 268 | }, |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 269 | 'mode:debug': { |
| 270 | 'CCFLAGS': ['-g', '-O0'] |
| 271 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 272 | }, |
| 273 | 'msvc': { |
| 274 | 'all': { |
| 275 | 'CCFLAGS': ['/nologo'], |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 276 | 'LINKFLAGS': ['/nologo'], |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 277 | 'LIBS': ['winmm'] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 278 | }, |
| 279 | 'library:shared': { |
| 280 | 'CPPDEFINES': ['USING_V8_SHARED'] |
| 281 | }, |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 282 | 'prof:on': { |
| 283 | 'LINKFLAGS': ['/MAP'] |
| 284 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 285 | 'mode:release': { |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 286 | 'CCFLAGS': ['/O2'], |
| 287 | 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF', '/LTCG'], |
| 288 | 'msvcrt:static': { |
| 289 | 'CCFLAGS': ['/MT'] |
| 290 | }, |
| 291 | 'msvcrt:shared': { |
| 292 | 'CCFLAGS': ['/MD'] |
| 293 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 294 | }, |
| 295 | 'mode:debug': { |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 296 | 'CCFLAGS': ['/Od'], |
| 297 | 'LINKFLAGS': ['/DEBUG'], |
| 298 | 'msvcrt:static': { |
| 299 | 'CCFLAGS': ['/MTd'] |
| 300 | }, |
| 301 | 'msvcrt:shared': { |
| 302 | 'CCFLAGS': ['/MDd'] |
| 303 | } |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 304 | } |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 309 | D8_FLAGS = { |
| 310 | 'gcc': { |
| 311 | 'console:readline': { |
| 312 | 'LIBS': ['readline'] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 313 | }, |
| 314 | 'os:linux': { |
| 315 | 'LIBS': ['pthread'], |
| 316 | }, |
| 317 | 'os:macos': { |
| 318 | 'LIBS': ['pthread'], |
| 319 | }, |
| 320 | 'os:freebsd': { |
| 321 | 'LIBS': ['pthread'], |
| 322 | }, |
| 323 | 'os:win32': { |
| 324 | 'LIBS': ['winmm'], |
| 325 | }, |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 326 | }, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 327 | 'msvc': { |
| 328 | 'all': { |
| 329 | 'LIBS': ['winmm'] |
| 330 | } |
| 331 | } |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 332 | } |
| 333 | |
| 334 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 335 | SUFFIXES = { |
| 336 | 'release': '', |
| 337 | 'debug': '_g' |
| 338 | } |
| 339 | |
| 340 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 341 | def Abort(message): |
| 342 | print message |
| 343 | sys.exit(1) |
| 344 | |
| 345 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 346 | def GuessToolchain(os): |
| 347 | tools = Environment()['TOOLS'] |
| 348 | if 'gcc' in tools: |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 349 | return 'gcc' |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 350 | elif 'msvc' in tools: |
| 351 | return 'msvc' |
| 352 | else: |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 353 | return None |
| 354 | |
| 355 | |
ager@chromium.org | 870a0b6 | 2008-11-04 11:43:05 +0000 | [diff] [blame] | 356 | OS_GUESS = utils.GuessOS() |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 357 | TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS) |
ager@chromium.org | c27e4e7 | 2008-09-04 13:52:27 +0000 | [diff] [blame] | 358 | ARCH_GUESS = utils.GuessArchitecture() |
ager@chromium.org | 870a0b6 | 2008-11-04 11:43:05 +0000 | [diff] [blame] | 359 | WORDSIZE_GUESS = utils.GuessWordsize() |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 360 | |
| 361 | |
| 362 | SIMPLE_OPTIONS = { |
| 363 | 'toolchain': { |
| 364 | 'values': ['gcc', 'msvc'], |
| 365 | 'default': TOOLCHAIN_GUESS, |
| 366 | 'help': 'the toolchain to use' |
| 367 | }, |
| 368 | 'os': { |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 369 | 'values': ['freebsd', 'linux', 'macos', 'win32'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 370 | 'default': OS_GUESS, |
| 371 | 'help': 'the os to build for' |
| 372 | }, |
| 373 | 'arch': { |
| 374 | 'values':['arm', 'ia32'], |
| 375 | 'default': ARCH_GUESS, |
| 376 | 'help': 'the architecture to build for' |
| 377 | }, |
| 378 | 'snapshot': { |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 379 | 'values': ['on', 'off', 'nobuild'], |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 380 | 'default': 'off', |
| 381 | 'help': 'build using snapshots for faster start-up' |
| 382 | }, |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 383 | 'prof': { |
| 384 | 'values': ['on', 'off'], |
| 385 | 'default': 'off', |
| 386 | 'help': 'enable profiling of build target' |
| 387 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 388 | 'library': { |
| 389 | 'values': ['static', 'shared'], |
| 390 | 'default': 'static', |
| 391 | 'help': 'the type of library to produce' |
| 392 | }, |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 393 | 'msvcrt': { |
| 394 | 'values': ['static', 'shared'], |
| 395 | 'default': 'static', |
| 396 | 'help': 'the type of MSVCRT library to use' |
| 397 | }, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 398 | 'wordsize': { |
| 399 | 'values': ['64', '32'], |
| 400 | 'default': WORDSIZE_GUESS, |
| 401 | 'help': 'the word size' |
| 402 | }, |
| 403 | 'simulator': { |
| 404 | 'values': ['arm', 'none'], |
| 405 | 'default': 'none', |
| 406 | 'help': 'build with simulator' |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 407 | }, |
| 408 | 'disassembler': { |
| 409 | 'values': ['on', 'off'], |
| 410 | 'default': 'off', |
| 411 | 'help': 'enable the disassembler to inspect generated code' |
| 412 | }, |
| 413 | 'sourcesignatures': { |
| 414 | 'values': ['MD5', 'timestamp'], |
| 415 | 'default': 'MD5', |
| 416 | 'help': 'set how the build system detects file changes' |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 417 | }, |
| 418 | 'console': { |
| 419 | 'values': ['dumb', 'readline'], |
| 420 | 'default': 'dumb', |
| 421 | 'help': 'the console to use for the d8 shell' |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 422 | } |
| 423 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 424 | |
| 425 | |
| 426 | def GetOptions(): |
| 427 | result = Options() |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 428 | result.Add('mode', 'compilation mode (debug, release)', 'release') |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 429 | result.Add('sample', 'build sample (shell, process)', '') |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 430 | result.Add('env', 'override environment settings (NAME1:value1,NAME2:value2)', '') |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 431 | for (name, option) in SIMPLE_OPTIONS.iteritems(): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 432 | help = '%s (%s)' % (name, ", ".join(option['values'])) |
| 433 | result.Add(name, help, option.get('default')) |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 434 | return result |
| 435 | |
| 436 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 437 | def SplitList(str): |
| 438 | return [ s for s in str.split(",") if len(s) > 0 ] |
| 439 | |
| 440 | |
| 441 | def IsLegal(env, option, values): |
| 442 | str = env[option] |
| 443 | for s in SplitList(str): |
| 444 | if not s in values: |
| 445 | Abort("Illegal value for option %s '%s'." % (option, s)) |
| 446 | return False |
| 447 | return True |
| 448 | |
| 449 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 450 | def VerifyOptions(env): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 451 | if not IsLegal(env, 'mode', ['debug', 'release']): |
| 452 | return False |
| 453 | if not IsLegal(env, 'sample', ["shell", "process"]): |
| 454 | return False |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 455 | if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on': |
| 456 | Abort("Profiling on windows only supported for static library.") |
| 457 | for (name, option) in SIMPLE_OPTIONS.iteritems(): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 458 | if (not option.get('default')) and (name not in ARGUMENTS): |
| 459 | message = ("A value for option %s must be specified (%s)." % |
| 460 | (name, ", ".join(option['values']))) |
| 461 | Abort(message) |
| 462 | if not env[name] in option['values']: |
| 463 | message = ("Unknown %s value '%s'. Possible values are (%s)." % |
| 464 | (name, env[name], ", ".join(option['values']))) |
| 465 | Abort(message) |
| 466 | |
| 467 | |
| 468 | class BuildContext(object): |
| 469 | |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 470 | def __init__(self, options, env_overrides, samples): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 471 | self.library_targets = [] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 472 | self.mksnapshot_targets = [] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 473 | self.cctest_targets = [] |
| 474 | self.sample_targets = [] |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 475 | self.d8_targets = [] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 476 | self.options = options |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 477 | self.env_overrides = env_overrides |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 478 | self.samples = samples |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 479 | self.use_snapshot = (options['snapshot'] != 'off') |
| 480 | self.build_snapshot = (options['snapshot'] == 'on') |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 481 | self.flags = None |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 482 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 483 | def AddRelevantFlags(self, initial, flags): |
| 484 | result = initial.copy() |
| 485 | self.AppendFlags(result, flags.get('all')) |
| 486 | toolchain = self.options['toolchain'] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 487 | if toolchain in flags: |
| 488 | self.AppendFlags(result, flags[toolchain].get('all')) |
| 489 | for option in sorted(self.options.keys()): |
| 490 | value = self.options[option] |
| 491 | self.AppendFlags(result, flags[toolchain].get(option + ':' + value)) |
| 492 | return result |
| 493 | |
| 494 | def AddRelevantSubFlags(self, options, flags): |
| 495 | self.AppendFlags(options, flags.get('all')) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 496 | for option in sorted(self.options.keys()): |
| 497 | value = self.options[option] |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 498 | self.AppendFlags(options, flags.get(option + ':' + value)) |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 499 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 500 | def GetRelevantSources(self, source): |
| 501 | result = [] |
| 502 | result += source.get('all', []) |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 503 | for (name, value) in self.options.iteritems(): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 504 | result += source.get(name + ':' + value, []) |
| 505 | return sorted(result) |
| 506 | |
| 507 | def AppendFlags(self, options, added): |
| 508 | if not added: |
| 509 | return |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 510 | for (key, value) in added.iteritems(): |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 511 | if key.find(':') != -1: |
| 512 | self.AddRelevantSubFlags(options, { key: value }) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 513 | else: |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 514 | if not key in options: |
| 515 | options[key] = value |
| 516 | else: |
| 517 | prefix = options[key] |
| 518 | if isinstance(prefix, StringTypes): prefix = prefix.split() |
| 519 | options[key] = prefix + value |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 520 | |
| 521 | def ConfigureObject(self, env, input, **kw): |
| 522 | if self.options['library'] == 'static': |
| 523 | return env.StaticObject(input, **kw) |
| 524 | else: |
| 525 | return env.SharedObject(input, **kw) |
| 526 | |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 527 | def ApplyEnvOverrides(self, env): |
| 528 | if not self.env_overrides: |
| 529 | return |
| 530 | if type(env['ENV']) == DictType: |
| 531 | env['ENV'].update(**self.env_overrides) |
| 532 | else: |
| 533 | env['ENV'] = self.env_overrides |
| 534 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 535 | |
| 536 | def PostprocessOptions(options): |
| 537 | # Adjust architecture if the simulator option has been set |
| 538 | if (options['simulator'] != 'none') and (options['arch'] != options['simulator']): |
| 539 | if 'arch' in ARGUMENTS: |
| 540 | # Print a warning if arch has explicitly been set |
| 541 | print "Warning: forcing architecture to match simulator (%s)" % options['simulator'] |
| 542 | options['arch'] = options['simulator'] |
| 543 | |
| 544 | |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 545 | def ParseEnvOverrides(arg): |
| 546 | # The environment overrides are in the format NAME1:value1,NAME2:value2 |
| 547 | overrides = {} |
| 548 | for override in arg.split(','): |
| 549 | pos = override.find(':') |
| 550 | if pos == -1: |
| 551 | continue |
| 552 | overrides[override[:pos].strip()] = override[pos+1:].strip() |
| 553 | return overrides |
| 554 | |
| 555 | |
| 556 | def BuildSpecific(env, mode, env_overrides): |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 557 | options = {'mode': mode} |
| 558 | for option in SIMPLE_OPTIONS: |
| 559 | options[option] = env[option] |
| 560 | PostprocessOptions(options) |
| 561 | |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 562 | context = BuildContext(options, env_overrides, samples=SplitList(env['sample'])) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 563 | |
| 564 | library_flags = context.AddRelevantFlags(os.environ, LIBRARY_FLAGS) |
| 565 | v8_flags = context.AddRelevantFlags(library_flags, V8_EXTRA_FLAGS) |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 566 | mksnapshot_flags = context.AddRelevantFlags(library_flags, MKSNAPSHOT_EXTRA_FLAGS) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 567 | jscre_flags = context.AddRelevantFlags(library_flags, JSCRE_EXTRA_FLAGS) |
| 568 | dtoa_flags = context.AddRelevantFlags(library_flags, DTOA_EXTRA_FLAGS) |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 569 | cctest_flags = context.AddRelevantFlags(v8_flags, CCTEST_EXTRA_FLAGS) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 570 | sample_flags = context.AddRelevantFlags(os.environ, SAMPLE_FLAGS) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 571 | d8_flags = context.AddRelevantFlags(library_flags, D8_FLAGS) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 572 | |
| 573 | context.flags = { |
| 574 | 'v8': v8_flags, |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 575 | 'mksnapshot': mksnapshot_flags, |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 576 | 'jscre': jscre_flags, |
| 577 | 'dtoa': dtoa_flags, |
| 578 | 'cctest': cctest_flags, |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 579 | 'sample': sample_flags, |
| 580 | 'd8': d8_flags |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 581 | } |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 582 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 583 | target_id = mode |
| 584 | suffix = SUFFIXES[target_id] |
| 585 | library_name = 'v8' + suffix |
| 586 | env['LIBRARY'] = library_name |
| 587 | |
| 588 | # Build the object files by invoking SCons recursively. |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 589 | (object_files, shell_files, mksnapshot) = env.SConscript( |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 590 | join('src', 'SConscript'), |
| 591 | build_dir=join('obj', target_id), |
| 592 | exports='context', |
| 593 | duplicate=False |
| 594 | ) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 595 | |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 596 | context.mksnapshot_targets.append(mksnapshot) |
| 597 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 598 | # Link the object files into a library. |
kasperl@chromium.org | b912362 | 2008-09-17 14:05:56 +0000 | [diff] [blame] | 599 | env.Replace(**context.flags['v8']) |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 600 | context.ApplyEnvOverrides(env) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 601 | if context.options['library'] == 'static': |
| 602 | library = env.StaticLibrary(library_name, object_files) |
| 603 | else: |
| 604 | # There seems to be a glitch in the way scons decides where to put |
| 605 | # PDB files when compiling using MSVC so we specify it manually. |
| 606 | # This should not affect any other platforms. |
| 607 | pdb_name = library_name + '.dll.pdb' |
| 608 | library = env.SharedLibrary(library_name, object_files, PDB=pdb_name) |
| 609 | context.library_targets.append(library) |
| 610 | |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 611 | d8_env = Environment() |
| 612 | d8_env.Replace(**context.flags['d8']) |
| 613 | shell = d8_env.Program('d8' + suffix, object_files + shell_files) |
| 614 | context.d8_targets.append(shell) |
| 615 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 616 | for sample in context.samples: |
| 617 | sample_env = Environment(LIBRARY=library_name) |
| 618 | sample_env.Replace(**context.flags['sample']) |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 619 | context.ApplyEnvOverrides(sample_env) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 620 | sample_object = sample_env.SConscript( |
| 621 | join('samples', 'SConscript'), |
| 622 | build_dir=join('obj', 'sample', sample, target_id), |
| 623 | exports='sample context', |
| 624 | duplicate=False |
| 625 | ) |
| 626 | sample_name = sample + suffix |
| 627 | sample_program = sample_env.Program(sample_name, sample_object) |
| 628 | sample_env.Depends(sample_program, library) |
| 629 | context.sample_targets.append(sample_program) |
| 630 | |
| 631 | cctest_program = env.SConscript( |
| 632 | join('test', 'cctest', 'SConscript'), |
| 633 | build_dir=join('obj', 'test', target_id), |
| 634 | exports='context object_files', |
| 635 | duplicate=False |
| 636 | ) |
| 637 | context.cctest_targets.append(cctest_program) |
| 638 | |
| 639 | return context |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 640 | |
| 641 | |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 642 | def Build(): |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 643 | opts = GetOptions() |
| 644 | env = Environment(options=opts) |
| 645 | Help(opts.GenerateHelpText(env)) |
| 646 | VerifyOptions(env) |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 647 | env_overrides = ParseEnvOverrides(env['env']) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 648 | |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 649 | SourceSignatures(env['sourcesignatures']) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 650 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 651 | libraries = [] |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 652 | mksnapshots = [] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 653 | cctests = [] |
| 654 | samples = [] |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 655 | d8s = [] |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 656 | modes = SplitList(env['mode']) |
| 657 | for mode in modes: |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 658 | context = BuildSpecific(env.Copy(), mode, env_overrides) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 659 | libraries += context.library_targets |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 660 | mksnapshots += context.mksnapshot_targets |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 661 | cctests += context.cctest_targets |
| 662 | samples += context.sample_targets |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 663 | d8s += context.d8_targets |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 664 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 665 | env.Alias('library', libraries) |
iposva@chromium.org | 245aa85 | 2009-02-10 00:49:54 +0000 | [diff] [blame^] | 666 | env.Alias('mksnapshot', mksnapshots) |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 667 | env.Alias('cctests', cctests) |
| 668 | env.Alias('sample', samples) |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 669 | env.Alias('d8', d8s) |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 670 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 671 | if env['sample']: |
| 672 | env.Default('sample') |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 673 | else: |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 674 | env.Default('library') |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 675 | |
| 676 | |
v8.team.kasperl | 727e995 | 2008-09-02 14:56:44 +0000 | [diff] [blame] | 677 | # We disable deprecation warnings because we need to be able to use |
| 678 | # env.Copy without getting warnings for compatibility with older |
| 679 | # version of scons. Also, there's a bug in some revisions that |
| 680 | # doesn't allow this flag to be set, so we swallow any exceptions. |
| 681 | # Lovely. |
| 682 | try: |
| 683 | SetOption('warn', 'no-deprecated') |
| 684 | except: |
| 685 | pass |
| 686 | |
| 687 | |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 688 | Build() |