| OLD | NEW |
| 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 | 6 |
| 7 Import('env') | 7 Import('env') |
| 8 | 8 |
| 9 # Grab the -j flag from the outer environment, if available. | 9 # Grab the -j flag from the outer environment, if available. |
| 10 try: | 10 try: |
| 11 cpus = env.GetOption('num_jobs') | 11 cpus = env.GetOption('num_jobs') |
| 12 cpu_flag = ' -j%d' % cpus | 12 cpu_flag = ' -j%d' % cpus |
| 13 except AttributeError: | 13 except AttributeError: |
| 14 cpu_flag = '' | 14 cpu_flag = '' |
| 15 | 15 |
| 16 env = env.Clone( | 16 env = env.Clone( |
| 17 V8_MODE = 'release', | 17 V8_MODE = 'debug', |
| 18 V8_MODE_DIR = '$V8_DIR/obj/$V8_MODE', | 18 V8_MODE_DIR = '$V8_DIR/obj/$V8_MODE', |
| 19 V8_SCONS_COM = '$PYTHON $SCONS $SCONSFLAGS mode=$V8_MODE', | 19 V8_SCONS_COM = '$PYTHON $SCONS $SCONSFLAGS mode=$V8_MODE', |
| 20 SCONS='$CHROME_SRC_DIR/third_party/scons/scons.py', | 20 SCONS='$CHROME_SRC_DIR/third_party/scons/scons.py', |
| 21 SCONSFLAGS = ('-Q ' | 21 SCONSFLAGS = ('-Q ' |
| 22 '-C $OBJ_ROOT/v8 ' | 22 '-C $OBJ_ROOT/v8 ' |
| 23 '-Y $CHROME_SRC_DIR/v8 ' | 23 '-Y $CHROME_SRC_DIR/v8 ' |
| 24 '--warn=no-deprecated ' | 24 '--warn=no-deprecated ' |
| 25 '--warn=no-no-parallel-support' + cpu_flag), | 25 '--warn=no-no-parallel-support' + cpu_flag), |
| 26 ) | 26 ) |
| 27 | 27 |
| 28 # Rather than build v8 with our own commands, we just shell out to v8's | 28 # Rather than build v8 with our own commands, we just shell out to v8's |
| 29 # own SCons-based build, since their build system is complicated. | 29 # own SCons-based build, since their build system is complicated. |
| 30 # This SConscript just declares dependencies on the outputs of that build. | 30 # This SConscript just declares dependencies on the outputs of that build. |
| 31 # | 31 # |
| 32 # Arrange to make sure the build directory exists, since the subsidiary | 32 # Arrange to make sure the build directory exists, since the subsidiary |
| 33 # SCons we invoke will chdir there of its own accord. | 33 # SCons we invoke will chdir there of its own accord. |
| 34 | 34 |
| 35 if not os.path.exists(env.Dir('$OBJ_ROOT/v8').abspath): | 35 if not os.path.exists(env.Dir('$OBJ_ROOT/v8').abspath): |
| 36 Mkdir(env.Dir('$OBJ_ROOT/v8').abspath) | 36 Mkdir(env.Dir('$OBJ_ROOT/v8').abspath) |
| 37 | 37 |
| 38 | 38 |
| 39 v8_scons_targets_off = [ | 39 v8_scons_targets_off = [ |
| 40 '$V8_DIR/shell${PROGSUFFIX}', | 40 '$V8_DIR/shell_g${PROGSUFFIX}', |
| 41 '$V8_DIR/${LIBPREFIX}v8${LIBSUFFIX}', | 41 '$V8_DIR/${LIBPREFIX}v8_g${LIBSUFFIX}', |
| 42 '$V8_MODE_DIR/mksnapshot${PROGSUFFIX}', | 42 '$V8_MODE_DIR/mksnapshot${PROGSUFFIX}', |
| 43 '$V8_MODE_DIR/libraries${OBJSUFFIX}', | 43 '$V8_MODE_DIR/libraries${OBJSUFFIX}', |
| 44 '$V8_MODE_DIR/snapshot-empty${OBJSUFFIX}', | 44 '$V8_MODE_DIR/snapshot-empty${OBJSUFFIX}', |
| 45 ] | 45 ] |
| 46 | 46 |
| 47 v8_scons_targets_on = [ | 47 v8_scons_targets_on = [ |
| 48 '$V8_MODE_DIR/libraries-empty${OBJSUFFIX}', | 48 '$V8_MODE_DIR/libraries-empty${OBJSUFFIX}', |
| 49 '$V8_MODE_DIR/snapshot${OBJSUFFIX}', | 49 '$V8_MODE_DIR/snapshot${OBJSUFFIX}', |
| 50 ] | 50 ] |
| 51 | 51 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 72 env.Install('$V8_DIR', '$V8_MODE_DIR/snapshot-empty${OBJSUFFIX}') | 72 env.Install('$V8_DIR', '$V8_MODE_DIR/snapshot-empty${OBJSUFFIX}') |
| 73 | 73 |
| 74 # To satisfy tests expecting the following .exe name. | 74 # To satisfy tests expecting the following .exe name. |
| 75 if env['PLATFORM'] == 'win32': | 75 if env['PLATFORM'] == 'win32': |
| 76 # TODO(evanm): this may be necessary on other platforms(?) | 76 # TODO(evanm): this may be necessary on other platforms(?) |
| 77 i = env.InstallAs('$TARGET_ROOT/v8_shell_sample${PROGSUFFIX}', v8[0]) | 77 i = env.InstallAs('$TARGET_ROOT/v8_shell_sample${PROGSUFFIX}', v8[0]) |
| 78 | 78 |
| 79 env.ChromeStaticLibrary('v8_snapshot', | 79 env.ChromeStaticLibrary('v8_snapshot', |
| 80 ['$V8_MODE_DIR/libraries-empty${OBJSUFFIX}', | 80 ['$V8_MODE_DIR/libraries-empty${OBJSUFFIX}', |
| 81 '$V8_MODE_DIR/snapshot${OBJSUFFIX}']) | 81 '$V8_MODE_DIR/snapshot${OBJSUFFIX}']) |
| OLD | NEW |