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