Commit dd2051ca authored by olehougaard's avatar olehougaard

Enabling splitting building with snapshots in to building the mksnapshot...

Enabling splitting building with snapshots in to building the mksnapshot executable and building with a snapshot to facilitate building for ARM with a crosstool compiler.
Review URL: http://codereview.chromium.org/19014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1188 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 75037cbd
...@@ -303,7 +303,7 @@ SIMPLE_OPTIONS = { ...@@ -303,7 +303,7 @@ SIMPLE_OPTIONS = {
'help': 'the architecture to build for' 'help': 'the architecture to build for'
}, },
'snapshot': { 'snapshot': {
'values': ['on', 'off'], 'values': ['on', 'off', 'nobuild'],
'default': 'off', 'default': 'off',
'help': 'build using snapshots for faster start-up' 'help': 'build using snapshots for faster start-up'
}, },
...@@ -396,13 +396,15 @@ class BuildContext(object): ...@@ -396,13 +396,15 @@ class BuildContext(object):
def __init__(self, options, env_overrides, samples): def __init__(self, options, env_overrides, samples):
self.library_targets = [] self.library_targets = []
self.mksnapshot_targets = []
self.cctest_targets = [] self.cctest_targets = []
self.sample_targets = [] self.sample_targets = []
self.d8_targets = [] self.d8_targets = []
self.options = options self.options = options
self.env_overrides = env_overrides self.env_overrides = env_overrides
self.samples = samples self.samples = samples
self.use_snapshot = (options['snapshot'] == 'on') self.use_snapshot = (options['snapshot'] != 'off')
self.build_snapshot = (options['snapshot'] == 'on')
self.flags = None self.flags = None
def AddRelevantFlags(self, initial, flags): def AddRelevantFlags(self, initial, flags):
...@@ -496,6 +498,7 @@ def BuildSpecific(env, mode, env_overrides): ...@@ -496,6 +498,7 @@ def BuildSpecific(env, mode, env_overrides):
context.flags = { context.flags = {
'v8': v8_flags, 'v8': v8_flags,
'mksnapshot': v8_flags,
'jscre': jscre_flags, 'jscre': jscre_flags,
'dtoa': dtoa_flags, 'dtoa': dtoa_flags,
'cctest': cctest_flags, 'cctest': cctest_flags,
...@@ -509,13 +512,15 @@ def BuildSpecific(env, mode, env_overrides): ...@@ -509,13 +512,15 @@ def BuildSpecific(env, mode, env_overrides):
env['LIBRARY'] = library_name env['LIBRARY'] = library_name
# Build the object files by invoking SCons recursively. # Build the object files by invoking SCons recursively.
(object_files, shell_files) = env.SConscript( (object_files, shell_files, mksnapshot) = env.SConscript(
join('src', 'SConscript'), join('src', 'SConscript'),
build_dir=join('obj', target_id), build_dir=join('obj', target_id),
exports='context', exports='context',
duplicate=False duplicate=False
) )
context.mksnapshot_targets.append(mksnapshot)
# Link the object files into a library. # Link the object files into a library.
env.Replace(**context.flags['v8']) env.Replace(**context.flags['v8'])
context.ApplyEnvOverrides(env) context.ApplyEnvOverrides(env)
...@@ -570,6 +575,7 @@ def Build(): ...@@ -570,6 +575,7 @@ def Build():
SourceSignatures(env['sourcesignatures']) SourceSignatures(env['sourcesignatures'])
libraries = [] libraries = []
mksnapshots = []
cctests = [] cctests = []
samples = [] samples = []
d8s = [] d8s = []
...@@ -577,11 +583,13 @@ def Build(): ...@@ -577,11 +583,13 @@ def Build():
for mode in modes: for mode in modes:
context = BuildSpecific(env.Copy(), mode, env_overrides) context = BuildSpecific(env.Copy(), mode, env_overrides)
libraries += context.library_targets libraries += context.library_targets
mksnapshots += context.mksnapshot_targets
cctests += context.cctest_targets cctests += context.cctest_targets
samples += context.sample_targets samples += context.sample_targets
d8s += context.d8_targets d8s += context.d8_targets
env.Alias('library', libraries) env.Alias('library', libraries)
env.Alias('mksnapshot', mksnapshots)
env.Alias('cctests', cctests) env.Alias('cctests', cctests)
env.Alias('sample', samples) env.Alias('sample', samples)
env.Alias('d8', d8s) env.Alias('d8', d8s)
......
...@@ -150,18 +150,20 @@ def ConfigureObjectFiles(): ...@@ -150,18 +150,20 @@ def ConfigureObjectFiles():
# Create snapshot if necessary. # Create snapshot if necessary.
empty_snapshot_obj = context.ConfigureObject(env, 'snapshot-empty.cc') empty_snapshot_obj = context.ConfigureObject(env, 'snapshot-empty.cc')
mksnapshot_src = 'mksnapshot.cc'
mksnapshot = env.Program('mksnapshot', [mksnapshot_src, libraries_obj, non_snapshot_files, empty_snapshot_obj], PDB='mksnapshot.exe.pdb')
if context.use_snapshot: if context.use_snapshot:
mksnapshot_src = 'mksnapshot.cc' if context.build_snapshot:
mksnapshot = env.Program('mksnapshot', [mksnapshot_src, libraries_obj, non_snapshot_files, empty_snapshot_obj], PDB='mksnapshot.exe.pdb') snapshot_cc = env.Snapshot('snapshot.cc', mksnapshot, LOGFILE=File('snapshot.log').abspath)
snapshot_cc = env.Snapshot('snapshot.cc', mksnapshot, LOGFILE=File('snapshot.log').abspath) else:
snapshot_cc = Command('snapshot.cc', [], [])
snapshot_obj = context.ConfigureObject(env, snapshot_cc, CPPPATH=['.']) snapshot_obj = context.ConfigureObject(env, snapshot_cc, CPPPATH=['.'])
libraries_obj = context.ConfigureObject(env, libraries_empty_src, CPPPATH=['.']) libraries_obj = context.ConfigureObject(env, libraries_empty_src, CPPPATH=['.'])
else: else:
snapshot_obj = empty_snapshot_obj snapshot_obj = empty_snapshot_obj
library_objs = [non_snapshot_files, libraries_obj, snapshot_obj] library_objs = [non_snapshot_files, libraries_obj, snapshot_obj]
return (library_objs, d8_objs) return (library_objs, d8_objs, [mksnapshot])
(library_objs, d8_objs) = ConfigureObjectFiles() (library_objs, d8_objs, mksnapshot) = ConfigureObjectFiles()
Return('library_objs d8_objs') Return('library_objs d8_objs mksnapshot')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment