From 683b7bde3b8f4bdfcc3e777cf35f5bbb29516c35 Mon Sep 17 00:00:00 2001
From: "sgk@google.com" <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Thu, 2 Oct 2008 18:34:48 +0000
Subject: Revert r2734 (catch up SCons build with webkit).  It relied on a
 leftover file from previous incremental builds. Review URL:
 http://codereview.chromium.org/6084

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2797 0039d316-1c4b-4281-b951-d872f2087c98
---
 build/SConscript.v8 | 73 +++++++++++++++++++++++------------------------------
 chrome/SConscript   | 24 ++++++++++++++++++
 2 files changed, 55 insertions(+), 42 deletions(-)

diff --git a/build/SConscript.v8 b/build/SConscript.v8
index b89da2a..ddf5cea 100644
--- a/build/SConscript.v8
+++ b/build/SConscript.v8
@@ -4,61 +4,48 @@
 
 Import('env')
 
-# Grab the -j flag from the outer environment, if available.
-try:
-  cpus = env.GetOption('num_jobs')
-  cpu_flag = ' -j%d' % cpus
-except AttributeError:
-  cpu_flag = ''
+env = env.Clone()
 
-env = env.Clone(
-    V8_MODE = 'release',
-    V8_SRC_DIR = '#/../v8',
-    V8_MODE_DIR = '$V8_SRC_DIR/obj/$V8_MODE',
-    SCONS='../third_party/scons/scons.py',
-    SCONSFLAGS = ('-Q '
-                  '--warn=no-deprecated '
-                  '--warn=no-no-parallel-support' + cpu_flag),
-)
-
-# Rather than build v8 with our own commands, we just shell out to v8's
-# own SCons-based build, since their build system is complicated.
+# Rather than build v8 here, we just shell out to v8's own SCons-based
+# build, since their build system is complicated.
 # This SConscript just declares dependencies on the outputs of that build.
 
-mksnapshot_exe = env.File('$V8_MODE_DIR/mksnapshot${PROGSUFFIX}')
-libraries_obj = env.File('$V8_MODE_DIR/libraries${OBJSUFFIX}')
-libraries_empty_obj = env.File('$V8_MODE_DIR/libraries-empty${OBJSUFFIX}')
-snapshot_obj = env.File('$V8_MODE_DIR/snapshot${OBJSUFFIX}')
-snapshot_empty_obj = env.File('$V8_MODE_DIR/snapshot-empty${OBJSUFFIX}')
-v8_bin = env.File('$V8_SRC_DIR/shell${PROGSUFFIX}')
-v8_lib = env.File('$V8_SRC_DIR/${LIBPREFIX}v8${LIBSUFFIX}'),
+mksnapshot_bin = env.File('#/../v8/obj/release/mksnapshot${PROGSUFFIX}')
+v8_bin = env.File('#/../v8/shell${PROGSUFFIX}')
+v8_lib = env.File('#/../v8/${LIBPREFIX}v8${LIBSUFFIX}'),
 
 v8_scons_targets = [
-    mksnapshot_exe,
-    libraries_obj,
-    libraries_empty_obj,
-    snapshot_obj,
-    snapshot_empty_obj,
-    v8_bin,
-    v8_lib,
+  mksnapshot_bin,
+  v8_bin,
+  v8_lib,
 ]
 
 if env['PLATFORM'] == 'win32':
-  v8_scons_targets.extend([
-      env.File('#/../v8/vc80.pdb')
+  v8_scons_targets.append([
+    env.File('#/../v8/obj/release/snapshot-empty.obj'),
+    env.File('#/../v8/vc80.pdb')
   ])
 
+# Grab the -j flag from the outer environment, if available.
+try:
+  cpus = env.GetOption('num_jobs')
+  cpu_flag = ' -j%d' % cpus
+except AttributeError:
+  cpu_flag = ''
+
 v8 = env.Command(v8_scons_targets,
                  [],
-                 'cd ../v8 && $PYTHON $SCONS $SCONSFLAGS $V8FLAGS',
-                 V8FLAGS='mode=$V8_MODE snapshot=off sample=shell')
+                 'cd ../v8 && $PYTHON $SCONS $SCONSFLAGS snapshot=on ' +
+                 'sample=shell',
+                 SCONS='../third_party/scons/scons.py',
+                 SCONSFLAGS=('-Q '
+                             '--warn=no-deprecated '
+                             '--warn=no-no-parallel-support' + cpu_flag))
 env.AlwaysBuild(v8)
 env.Install('$V8_DIR', v8)
 
-# Tell our SCons invocation to *not* delete v8.lib and the other targets
-# before building them, so the subsidiary v8 SCons call doesn't always
-# rebuild them (thereby causing us to always rebuild their dependents).
-env.Precious(v8)
+i = env.Install('$TARGET_ROOT', mksnapshot_bin)
+env.Alias('webkit', i)
 
 i = env.Install('$LIBS_DIR', v8_lib)
 env.Alias('webkit', i)
@@ -72,5 +59,7 @@ if env['PLATFORM'] == 'win32':
   i = env.InstallAs('$TARGET_ROOT/v8_shell_sample${PROGSUFFIX}', v8_bin)
   env.Alias('chrome', i)
 
-env.ChromeStaticLibrary('v8_snapshot',
-                        [libraries_empty_obj, snapshot_obj])
+# Tell our SCons invocation to *not* delete v8.lib and the other targets
+# before building them, so the subsidiary v8 SCons call doesn't always
+# rebuild them (thereby causing us to always rebuild their dependents).
+env.Precious(v8)
diff --git a/chrome/SConscript b/chrome/SConscript
index 69554d8..331b1bd 100644
--- a/chrome/SConscript
+++ b/chrome/SConscript
@@ -359,6 +359,30 @@ if env['PLATFORM'] == 'win32':
   #                  '$PYTHON tools/build/win/dependencies.py $(TargetPath) chrome.exe.deps')
 
 
+  env_snapshot = env.Clone()
+
+  env_snapshot.Prepend(
+      CPPPATH = [
+          '$V8_DIR/src',
+          '$V8_DIR/src/pcre/jscre',
+          '..',
+      ],
+      CPPDEFINES = [
+          'ENABLE_DISASSEMBLER',
+      ],
+      CCFLAGS = [
+          '/wd4099',
+          '/wd4355',
+          '/wd4800',
+      ],
+  )
+
+  env_snapshot.ChromeStaticLibrary('snapshotv8', 'snapshot.cc')
+
+  env_snapshot.Command('snapshot.cc', '#/../v8/bin/debug/mksnapshot.exe',
+                       '$SOURCE $TARGET')
+
+
 
 env_flat = env.Clone(
     BROWSER_RESOURCES = Dir('browser_resources'),
-- 
cgit v1.1