blob: 42de36bc86417ad392f4fc7a5a074e313a4a3104 [file] [log] [blame]
Ben Murdoch086aeea2011-05-13 15:57:08 +01001# Copyright 2011 the V8 project authors. All rights reserved.
Steve Blocka7e24c12009-10-30 11:49:00 +00002# 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
28import sys
29from os.path import join, dirname, abspath
30root_dir = dirname(File('SConstruct').rfile().abspath)
31sys.path.append(join(root_dir, 'tools'))
32import js2c
33Import('context')
Ben Murdoch8b112d22011-06-08 16:22:53 +010034Import('tools')
Ben Murdoch69a99ed2011-11-30 16:03:39 +000035Import('d8_env')
Steve Blocka7e24c12009-10-30 11:49:00 +000036
37
38SOURCES = {
Steve Block3ce2e202009-11-05 08:53:23 +000039 'all': Split("""
40 accessors.cc
41 allocation.cc
42 api.cc
43 assembler.cc
44 ast.cc
Ben Murdochb0fe1622011-05-05 13:52:32 +010045 atomicops_internals_x86_gcc.cc
Russell Brenner90bac252010-11-18 13:33:46 -080046 bignum.cc
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -080047 bignum-dtoa.cc
Steve Block3ce2e202009-11-05 08:53:23 +000048 bootstrapper.cc
49 builtins.cc
Ben Murdochf87a2032010-10-22 12:50:53 +010050 cached-powers.cc
Steve Block3ce2e202009-11-05 08:53:23 +000051 checks.cc
Steve Block6ded16b2010-05-10 14:33:55 +010052 circular-queue.cc
Steve Block3ce2e202009-11-05 08:53:23 +000053 code-stubs.cc
54 codegen.cc
55 compilation-cache.cc
56 compiler.cc
57 contexts.cc
58 conversions.cc
59 counters.cc
Steve Block6ded16b2010-05-10 14:33:55 +010060 cpu-profiler.cc
Leon Clarke4515c472010-02-03 11:58:03 +000061 data-flow.cc
Steve Block3ce2e202009-11-05 08:53:23 +000062 dateparser.cc
63 debug-agent.cc
64 debug.cc
Ben Murdochb0fe1622011-05-05 13:52:32 +010065 deoptimizer.cc
Steve Block3ce2e202009-11-05 08:53:23 +000066 disassembler.cc
Steve Block6ded16b2010-05-10 14:33:55 +010067 diy-fp.cc
Kristian Monsen25f61362010-05-21 11:50:48 +010068 dtoa.cc
Ben Murdoch69a99ed2011-11-30 16:03:39 +000069 elements.cc
Steve Block3ce2e202009-11-05 08:53:23 +000070 execution.cc
71 factory.cc
Steve Block3ce2e202009-11-05 08:53:23 +000072 flags.cc
Steve Block3ce2e202009-11-05 08:53:23 +000073 frames.cc
Leon Clarked91b9f72010-01-27 17:25:45 +000074 full-codegen.cc
Steve Block3ce2e202009-11-05 08:53:23 +000075 func-name-inferrer.cc
Ben Murdochb8e0da22011-05-16 14:20:40 +010076 gdb-jit.cc
Steve Block3ce2e202009-11-05 08:53:23 +000077 global-handles.cc
Steve Block6ded16b2010-05-10 14:33:55 +010078 fast-dtoa.cc
Kristian Monsen25f61362010-05-21 11:50:48 +010079 fixed-dtoa.cc
Steve Block3ce2e202009-11-05 08:53:23 +000080 handles.cc
81 hashmap.cc
82 heap-profiler.cc
83 heap.cc
Ben Murdochb0fe1622011-05-05 13:52:32 +010084 hydrogen.cc
85 hydrogen-instructions.cc
Steve Block3ce2e202009-11-05 08:53:23 +000086 ic.cc
Ben Murdoch592a9fc2012-03-05 11:04:45 +000087 incremental-marking.cc
Ben Murdochb8e0da22011-05-16 14:20:40 +010088 inspector.cc
Steve Block3ce2e202009-11-05 08:53:23 +000089 interpreter-irregexp.cc
Steve Block44f0eee2011-05-26 01:26:41 +010090 isolate.cc
Steve Block3ce2e202009-11-05 08:53:23 +000091 jsregexp.cc
Ben Murdochb0fe1622011-05-05 13:52:32 +010092 lithium-allocator.cc
Ben Murdoch086aeea2011-05-13 15:57:08 +010093 lithium.cc
Andrei Popescu402d9372010-02-26 13:31:12 +000094 liveedit.cc
Steve Block1e0659c2011-05-24 12:43:12 +010095 liveobjectlist.cc
Steve Block3ce2e202009-11-05 08:53:23 +000096 log-utils.cc
97 log.cc
98 mark-compact.cc
99 messages.cc
100 objects.cc
Steve Block1e0659c2011-05-24 12:43:12 +0100101 objects-printer.cc
Iain Merrick75681382010-08-19 15:07:18 +0100102 objects-visiting.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000103 parser.cc
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -0800104 preparser.cc
105 preparse-data.cc
Steve Block6ded16b2010-05-10 14:33:55 +0100106 profile-generator.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000107 property.cc
108 regexp-macro-assembler-irregexp.cc
109 regexp-macro-assembler.cc
110 regexp-stack.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000111 rewriter.cc
112 runtime.cc
Ben Murdochb0fe1622011-05-05 13:52:32 +0100113 runtime-profiler.cc
114 safepoint-table.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000115 scanner.cc
Ben Murdoch589d6972011-11-30 16:04:58 +0000116 scanner-character-streams.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000117 scopeinfo.cc
118 scopes.cc
119 serialize.cc
120 snapshot-common.cc
121 spaces.cc
Ben Murdochf87a2032010-10-22 12:50:53 +0100122 string-search.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000123 string-stream.cc
Ben Murdochf87a2032010-10-22 12:50:53 +0100124 strtod.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000125 stub-cache.cc
126 token.cc
Steve Block6ded16b2010-05-10 14:33:55 +0100127 type-info.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000128 unicode.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000129 utils.cc
130 v8-counters.cc
131 v8.cc
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000132 v8conversions.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000133 v8threads.cc
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000134 v8utils.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000135 variables.cc
136 version.cc
Ben Murdoch592a9fc2012-03-05 11:04:45 +0000137 store-buffer.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000138 zone.cc
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -0800139 extensions/gc-extension.cc
140 extensions/externalize-string-extension.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000141 """),
142 'arch:arm': Split("""
Steve Block3ce2e202009-11-05 08:53:23 +0000143 arm/builtins-arm.cc
Kristian Monsen80d68ea2010-09-08 11:05:35 +0100144 arm/code-stubs-arm.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000145 arm/codegen-arm.cc
146 arm/constants-arm.cc
147 arm/cpu-arm.cc
148 arm/debug-arm.cc
Ben Murdochb0fe1622011-05-05 13:52:32 +0100149 arm/deoptimizer-arm.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000150 arm/disasm-arm.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000151 arm/frames-arm.cc
Leon Clarked91b9f72010-01-27 17:25:45 +0000152 arm/full-codegen-arm.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000153 arm/ic-arm.cc
Ben Murdochb0fe1622011-05-05 13:52:32 +0100154 arm/lithium-arm.cc
155 arm/lithium-codegen-arm.cc
Ben Murdoche0cee9b2011-05-25 10:26:03 +0100156 arm/lithium-gap-resolver-arm.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000157 arm/macro-assembler-arm.cc
158 arm/regexp-macro-assembler-arm.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000159 arm/stub-cache-arm.cc
Leon Clarkee46be812010-01-19 14:06:41 +0000160 arm/assembler-arm.cc
161 """),
Andrei Popescu31002712010-02-23 13:46:05 +0000162 'arch:mips': Split("""
163 mips/assembler-mips.cc
164 mips/builtins-mips.cc
Steve Block44f0eee2011-05-26 01:26:41 +0100165 mips/code-stubs-mips.cc
Andrei Popescu31002712010-02-23 13:46:05 +0000166 mips/codegen-mips.cc
167 mips/constants-mips.cc
168 mips/cpu-mips.cc
169 mips/debug-mips.cc
Steve Block44f0eee2011-05-26 01:26:41 +0100170 mips/deoptimizer-mips.cc
Andrei Popescu31002712010-02-23 13:46:05 +0000171 mips/disasm-mips.cc
Andrei Popescu31002712010-02-23 13:46:05 +0000172 mips/frames-mips.cc
Steve Block44f0eee2011-05-26 01:26:41 +0100173 mips/full-codegen-mips.cc
Andrei Popescu31002712010-02-23 13:46:05 +0000174 mips/ic-mips.cc
Ben Murdoch592a9fc2012-03-05 11:04:45 +0000175 mips/lithium-codegen-mips.cc
176 mips/lithium-gap-resolver-mips.cc
177 mips/lithium-mips.cc
Andrei Popescu31002712010-02-23 13:46:05 +0000178 mips/macro-assembler-mips.cc
Steve Block44f0eee2011-05-26 01:26:41 +0100179 mips/regexp-macro-assembler-mips.cc
Andrei Popescu31002712010-02-23 13:46:05 +0000180 mips/stub-cache-mips.cc
Andrei Popescu31002712010-02-23 13:46:05 +0000181 """),
Steve Block3ce2e202009-11-05 08:53:23 +0000182 'arch:ia32': Split("""
183 ia32/assembler-ia32.cc
184 ia32/builtins-ia32.cc
Kristian Monsen80d68ea2010-09-08 11:05:35 +0100185 ia32/code-stubs-ia32.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000186 ia32/codegen-ia32.cc
187 ia32/cpu-ia32.cc
188 ia32/debug-ia32.cc
Ben Murdochb0fe1622011-05-05 13:52:32 +0100189 ia32/deoptimizer-ia32.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000190 ia32/disasm-ia32.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000191 ia32/frames-ia32.cc
Leon Clarked91b9f72010-01-27 17:25:45 +0000192 ia32/full-codegen-ia32.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000193 ia32/ic-ia32.cc
Ben Murdochb0fe1622011-05-05 13:52:32 +0100194 ia32/lithium-codegen-ia32.cc
Ben Murdochb8e0da22011-05-16 14:20:40 +0100195 ia32/lithium-gap-resolver-ia32.cc
Ben Murdochb0fe1622011-05-05 13:52:32 +0100196 ia32/lithium-ia32.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000197 ia32/macro-assembler-ia32.cc
198 ia32/regexp-macro-assembler-ia32.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000199 ia32/stub-cache-ia32.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000200 """),
201 'arch:x64': Split("""
202 x64/assembler-x64.cc
203 x64/builtins-x64.cc
Kristian Monsen80d68ea2010-09-08 11:05:35 +0100204 x64/code-stubs-x64.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000205 x64/codegen-x64.cc
206 x64/cpu-x64.cc
207 x64/debug-x64.cc
Ben Murdochb0fe1622011-05-05 13:52:32 +0100208 x64/deoptimizer-x64.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000209 x64/disasm-x64.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000210 x64/frames-x64.cc
Leon Clarked91b9f72010-01-27 17:25:45 +0000211 x64/full-codegen-x64.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000212 x64/ic-x64.cc
Ben Murdochb8e0da22011-05-16 14:20:40 +0100213 x64/lithium-codegen-x64.cc
Steve Block1e0659c2011-05-24 12:43:12 +0100214 x64/lithium-gap-resolver-x64.cc
215 x64/lithium-x64.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000216 x64/macro-assembler-x64.cc
217 x64/regexp-macro-assembler-x64.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000218 x64/stub-cache-x64.cc
Steve Block3ce2e202009-11-05 08:53:23 +0000219 """),
Steve Blocka7e24c12009-10-30 11:49:00 +0000220 'simulator:arm': ['arm/simulator-arm.cc'],
Andrei Popescu31002712010-02-23 13:46:05 +0000221 'simulator:mips': ['mips/simulator-mips.cc'],
Steve Blocka7e24c12009-10-30 11:49:00 +0000222 'os:freebsd': ['platform-freebsd.cc', 'platform-posix.cc'],
Steve Blockd0582a62009-12-15 09:54:21 +0000223 'os:openbsd': ['platform-openbsd.cc', 'platform-posix.cc'],
Steve Blocka7e24c12009-10-30 11:49:00 +0000224 'os:linux': ['platform-linux.cc', 'platform-posix.cc'],
225 'os:android': ['platform-linux.cc', 'platform-posix.cc'],
226 'os:macos': ['platform-macos.cc', 'platform-posix.cc'],
Leon Clarked91b9f72010-01-27 17:25:45 +0000227 'os:solaris': ['platform-solaris.cc', 'platform-posix.cc'],
Ben Murdoche0cee9b2011-05-25 10:26:03 +0100228 'os:cygwin': ['platform-cygwin.cc', 'platform-posix.cc'],
Steve Blocka7e24c12009-10-30 11:49:00 +0000229 'os:nullos': ['platform-nullos.cc'],
Ben Murdoch589d6972011-11-30 16:04:58 +0000230 'os:win32': ['platform-win32.cc', 'win32-math.cc'],
Steve Blocka7e24c12009-10-30 11:49:00 +0000231 'mode:release': [],
232 'mode:debug': [
Steve Block1e0659c2011-05-24 12:43:12 +0100233 'objects-debug.cc', 'prettyprinter.cc', 'regexp-macro-assembler-tracer.cc'
234 ]
Steve Blocka7e24c12009-10-30 11:49:00 +0000235}
236
237
Steve Block44f0eee2011-05-26 01:26:41 +0100238PREPARSER_SOURCES = {
239 'all': Split("""
240 allocation.cc
Ben Murdoch589d6972011-11-30 16:04:58 +0000241 bignum.cc
242 bignum-dtoa.cc
243 cached-powers.cc
244 conversions.cc
245 diy-fp.cc
246 dtoa.cc
247 fast-dtoa.cc
248 fixed-dtoa.cc
Steve Block44f0eee2011-05-26 01:26:41 +0100249 hashmap.cc
250 preparse-data.cc
251 preparser.cc
252 preparser-api.cc
Ben Murdoch589d6972011-11-30 16:04:58 +0000253 scanner.cc
254 strtod.cc
Steve Block44f0eee2011-05-26 01:26:41 +0100255 token.cc
256 unicode.cc
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000257 utils.cc
Ben Murdoch589d6972011-11-30 16:04:58 +0000258 """),
259 'os:win32': ['win32-math.cc']
Steve Block44f0eee2011-05-26 01:26:41 +0100260}
261
262
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000263D8_LIGHT_FILES = {
264 'all': [
265 'd8.cc'
266 ]
267}
268
269
270D8_FULL_FILES = {
Steve Blocka7e24c12009-10-30 11:49:00 +0000271 'all': [
272 'd8.cc', 'd8-debug.cc'
273 ],
274 'os:linux': [
275 'd8-posix.cc'
276 ],
277 'os:macos': [
278 'd8-posix.cc'
279 ],
280 'os:android': [
281 'd8-posix.cc'
282 ],
283 'os:freebsd': [
284 'd8-posix.cc'
285 ],
Steve Blockd0582a62009-12-15 09:54:21 +0000286 'os:openbsd': [
287 'd8-posix.cc'
288 ],
Leon Clarked91b9f72010-01-27 17:25:45 +0000289 'os:solaris': [
290 'd8-posix.cc'
291 ],
Ben Murdoche0cee9b2011-05-25 10:26:03 +0100292 'os:cygwin': [
293 'd8-posix.cc'
294 ],
Steve Blocka7e24c12009-10-30 11:49:00 +0000295 'os:win32': [
296 'd8-windows.cc'
297 ],
298 'os:nullos': [
299 'd8-windows.cc' # Empty implementation at the moment.
300 ],
301 'console:readline': [
302 'd8-readline.cc'
303 ]
304}
305
306
307LIBRARY_FILES = '''
308runtime.js
309v8natives.js
310array.js
311string.js
312uri.js
313math.js
314messages.js
315apinatives.js
Andrei Popescu31002712010-02-23 13:46:05 +0000316date.js
317regexp.js
318json.js
Steve Block6ded16b2010-05-10 14:33:55 +0100319liveedit-debugger.js
Andrei Popescu31002712010-02-23 13:46:05 +0000320mirror-debugger.js
321debug-debugger.js
Steve Blocka7e24c12009-10-30 11:49:00 +0000322'''.split()
323
324
Ben Murdoch257744e2011-11-30 15:57:28 +0000325EXPERIMENTAL_LIBRARY_FILES = '''
326proxy.js
Ben Murdoch592a9fc2012-03-05 11:04:45 +0000327collection.js
Ben Murdoch257744e2011-11-30 15:57:28 +0000328'''.split()
329
330
Steve Blocka7e24c12009-10-30 11:49:00 +0000331def Abort(message):
332 print message
333 sys.exit(1)
334
335
336def ConfigureObjectFiles():
Ben Murdoch8b112d22011-06-08 16:22:53 +0100337 env = Environment(tools=tools)
Steve Blocka7e24c12009-10-30 11:49:00 +0000338 env.Replace(**context.flags['v8'])
339 context.ApplyEnvOverrides(env)
340 env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C)
Ben Murdoch6d7cb002011-08-04 19:25:22 +0100341 env['BUILDERS']['Snapshot'] = Builder(action='$SOURCE $TARGET --logfile "$LOGFILE" --log-snapshot-positions')
Steve Blocka7e24c12009-10-30 11:49:00 +0000342
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000343 def BuildJS2CEnv(type):
344 js2c_env = { 'TYPE': type, 'COMPRESSION': 'off' }
345 if 'COMPRESS_STARTUP_DATA_BZ2' in env['CPPDEFINES']:
346 js2c_env['COMPRESSION'] = 'bz2'
347 return js2c_env
348
Steve Blocka7e24c12009-10-30 11:49:00 +0000349 # Build the standard platform-independent source files.
350 source_files = context.GetRelevantSources(SOURCES)
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000351 d8_js = env.JS2C('d8-js.cc', 'd8.js', **{'TYPE': 'D8', 'COMPRESSION': 'off'})
Steve Blocka7e24c12009-10-30 11:49:00 +0000352 d8_js_obj = context.ConfigureObject(env, d8_js, CPPPATH=['.'])
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000353 if context.options['library'] == 'shared':
354 d8_files = context.GetRelevantSources(D8_LIGHT_FILES)
355 d8_objs = []
356 else:
357 d8_files = context.GetRelevantSources(D8_FULL_FILES)
358 d8_objs = [d8_js_obj]
Ben Murdoch69a99ed2011-11-30 16:03:39 +0000359 d8_objs.append(context.ConfigureObject(d8_env, [d8_files]))
Steve Blocka7e24c12009-10-30 11:49:00 +0000360
361 # Combine the JavaScript library files into a single C++ file and
362 # compile it.
363 library_files = [s for s in LIBRARY_FILES]
364 library_files.append('macros.py')
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000365 libraries_src = env.JS2C(
366 ['libraries.cc'], library_files, **BuildJS2CEnv('CORE'))
Steve Blocka7e24c12009-10-30 11:49:00 +0000367 libraries_obj = context.ConfigureObject(env, libraries_src, CPPPATH=['.'])
368
Ben Murdoch257744e2011-11-30 15:57:28 +0000369 # Combine the experimental JavaScript library files into a C++ file
370 # and compile it.
371 experimental_library_files = [ s for s in EXPERIMENTAL_LIBRARY_FILES ]
372 experimental_library_files.append('macros.py')
Ben Murdoch3fb3ca82011-12-02 17:19:32 +0000373 experimental_libraries_src = env.JS2C(['experimental-libraries.cc'],
374 experimental_library_files,
375 **BuildJS2CEnv('EXPERIMENTAL'))
Ben Murdoch257744e2011-11-30 15:57:28 +0000376 experimental_libraries_obj = context.ConfigureObject(env, experimental_libraries_src, CPPPATH=['.'])
377
Steve Blocka7e24c12009-10-30 11:49:00 +0000378 source_objs = context.ConfigureObject(env, source_files)
Shimeng (Simon) Wang8a31eba2010-12-06 19:01:33 -0800379 non_snapshot_files = [source_objs]
Steve Blocka7e24c12009-10-30 11:49:00 +0000380
Steve Block44f0eee2011-05-26 01:26:41 +0100381 preparser_source_files = context.GetRelevantSources(PREPARSER_SOURCES)
382 preparser_objs = context.ConfigureObject(env, preparser_source_files)
383
Steve Block6ded16b2010-05-10 14:33:55 +0100384 # Create snapshot if necessary. For cross compilation you should either
385 # do without snapshots and take the performance hit or you should build a
386 # host VM with the simulator=arm and snapshot=on options and then take the
387 # resulting snapshot.cc file from obj/release and put it in the src
388 # directory. Then rebuild the VM with the cross compiler and specify
389 # snapshot=nobuild on the scons command line.
Steve Blocka7e24c12009-10-30 11:49:00 +0000390 empty_snapshot_obj = context.ConfigureObject(env, 'snapshot-empty.cc')
391 mksnapshot_env = env.Copy()
392 mksnapshot_env.Replace(**context.flags['mksnapshot'])
393 mksnapshot_src = 'mksnapshot.cc'
Ben Murdoch257744e2011-11-30 15:57:28 +0000394 mksnapshot = mksnapshot_env.Program('mksnapshot', [mksnapshot_src, libraries_obj, experimental_libraries_obj, non_snapshot_files, empty_snapshot_obj], PDB='mksnapshot.exe.pdb')
Steve Blocka7e24c12009-10-30 11:49:00 +0000395 if context.use_snapshot:
396 if context.build_snapshot:
397 snapshot_cc = env.Snapshot('snapshot.cc', mksnapshot, LOGFILE=File('snapshot.log').abspath)
398 else:
Steve Block6ded16b2010-05-10 14:33:55 +0100399 snapshot_cc = 'snapshot.cc'
Steve Blocka7e24c12009-10-30 11:49:00 +0000400 snapshot_obj = context.ConfigureObject(env, snapshot_cc, CPPPATH=['.'])
Steve Blocka7e24c12009-10-30 11:49:00 +0000401 else:
402 snapshot_obj = empty_snapshot_obj
Ben Murdoch257744e2011-11-30 15:57:28 +0000403 library_objs = [non_snapshot_files, libraries_obj, experimental_libraries_obj, snapshot_obj]
Steve Block44f0eee2011-05-26 01:26:41 +0100404 return (library_objs, d8_objs, [mksnapshot], preparser_objs)
Steve Blocka7e24c12009-10-30 11:49:00 +0000405
406
Steve Block44f0eee2011-05-26 01:26:41 +0100407(library_objs, d8_objs, mksnapshot, preparser_objs) = ConfigureObjectFiles()
408Return('library_objs d8_objs mksnapshot preparser_objs')