summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-01 04:12:25 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-01 04:12:25 +0000
commit75dfa965b9221a99e515df165a1ef2ac46cf6e1b (patch)
tree684e53eef21fb9bf3cdddc4495470d5ac9fa9190 /build
parentacf0b57910e86d7faf15453ea2d87ab3fe4cf493 (diff)
downloadchromium_src-75dfa965b9221a99e515df165a1ef2ac46cf6e1b.zip
chromium_src-75dfa965b9221a99e515df165a1ef2ac46cf6e1b.tar.gz
chromium_src-75dfa965b9221a99e515df165a1ef2ac46cf6e1b.tar.bz2
Steps towards isolating Windows-isms in the construction environment from Linux/Posix/Mac-isms, and fixes:
* Only put Windows settings on the construction environment when PLATFORM == 'win32', and provide a PLATFORM == 'posix' block for necessary settings there. * Don't hard-code C:/ as the location of Microsoft Visual Studio 8, so we can find memset.obj even on buildbot systems that have it installed on D:. * Work around how SCons 0.98.3 fails to handle environment variables imported from Visual Studio that use | to separate diferent architecture types in the (e.g.) PATH. (This is fixed in 0.98.4, after which we can remove the workaround.) * Deep copy the environment we use to build v8_shell.exe so objects therein can't pollute other environments. TBR: evanm,bradnelson git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/SConscript.main73
-rw-r--r--build/SConscript.v83
2 files changed, 49 insertions, 27 deletions
diff --git a/build/SConscript.main b/build/SConscript.main
index 741afdc..484d820 100644
--- a/build/SConscript.main
+++ b/build/SConscript.main
@@ -48,9 +48,6 @@ processors = int(os.environ.get('NUMBER_OF_PROCESSORS', 1))
SetOption('num_jobs', processors + 1)
-msvs_env = Environment(tools=['msvc', 'mslink', 'msvs'])['ENV']
-
-
env = Environment(
BUILD_TYPE = ARGUMENTS.get('BUILD_TYPE', 'Hammer'),
TARGET_ROOT = '#/$BUILD_TYPE',
@@ -60,7 +57,7 @@ env = Environment(
PLATFORMSDK_VISTA_REL = '../third_party/platformsdk_vista_6_0',
PLATFORMSDK_VISTA = '#/$PLATFORMSDK_VISTA_REL',
- VISUAL_STUDIO = 'C:/Program Files/Microsoft Visual Studio 8',
+ VISUAL_STUDIO = '/Program Files/Microsoft Visual Studio 8',
BASE_DIR = '#/$BUILD_TYPE/base',
BREAKPAD_DIR = '#/$BUILD_TYPE/breakpad',
@@ -104,11 +101,18 @@ env = Environment(
THIRD_PARTY_WEBKIT_DIR = '$THIRD_PARTY_DIR/webkit',
+ PYTHON=sys.executable,
+)
+
+
+if env['PLATFORM'] == 'win32':
+
+ msvs_env = Environment(tools=['msvc', 'mslink', 'msvs'])['ENV']
+
+ env.Replace(
CYGWIN_DIR = Dir('#../third_party/cygwin'),
CYGWIN_BIN_DIR = '$CYGWIN_DIR/bin',
- PYTHON=sys.executable,
-
PERL = '$CYGWIN_BIN_DIR/perl.exe',
PERL_INCLUDE_FLAG = '-I ',
PERL_INCLUDE_SUFFIX = '',
@@ -176,14 +180,47 @@ env = Environment(
LIBPATH = [
'$PLATFORMSDK_VISTA/files/Lib',
'$PLATFORMSDK_VISTA/files/VC/LIB',
- 'c:/Program Files/Microsoft Visual Studio 8/VC/atlmfc/lib',
+ '$VISUAL_STUDIO/VC/atlmfc/lib',
],
LINKFLAGS = [
'/nologo',
'/DEBUG',
],
-)
+ )
+
+ # TODO(sgk): remove once we upgrade to SCons 0.98.4
+ for var in ['INCLUDE', 'LIB', 'PATH']:
+ msvs_env[var] = msvs_env[var].split('|', 1)[0]
+ env['ENV'][var] = env['ENV'][var].split('|', 1)[0]
+
+ # Force scons to handle long include lines correctly.
+ pchcom_fixed = env['PCHCOM']
+ pchcom_fixed = pchcom_fixed.replace('${TARGETS[0]}', '$TARGET')
+ pchcom_fixed = pchcom_fixed.replace('${TARGETS[1]}', '$TARGETS1')
+
+ env.Replace(
+ CCCOM = "${TEMPFILE('%s')}" % env['CCCOM'],
+ CXXCOM = "${TEMPFILE('%s')}" % env['CXXCOM'],
+ SHCCCOM = "${TEMPFILE('%s')}" % env['SHCCCOM'],
+ SHCXXCOM = "${TEMPFILE('%s')}" % env['SHCXXCOM'],
+ PCHCOM = "${TEMPFILE('%s')}" % pchcom_fixed,
+ TARGETS1 = '${TARGETS[1]}',
+ )
+
+ env['ENV']['PROGRAMFILES'] = os.environ['PROGRAMFILES']
+ env['ENV']['SystemDrive'] = os.environ['SystemDrive']
+ env['ENV']['USERPROFILE'] = os.environ['USERPROFILE']
+
+elif env['PLATFORM'] == 'posix':
+
+ env.Replace()
+
+else:
+
+ print "Unsupported SCons $PLATFORM value %s" % repr(env['PLATFORM'])
+ Exit(1)
+
if ARGUMENTS.get('VERBOSE') in (None, '0'):
env['CCCOMSTR'] = 'Compiling $TARGET ...'
@@ -206,27 +243,10 @@ AddOption('--clobber', action='store_true', dest='clobber', default=False,
if GetOption('clobber'):
shutil.rmtree(env.Dir('$TARGET_ROOT').abspath, True)
-
-# Force scons to handle long include lines correctly.
-pchcom_fixed = env['PCHCOM']
-pchcom_fixed = pchcom_fixed.replace('${TARGETS[0]}', '$TARGET')
-pchcom_fixed = pchcom_fixed.replace('${TARGETS[1]}', '$TARGETS1')
-env.Replace(
- CCCOM = "${TEMPFILE('%s')}" % env['CCCOM'],
- CXXCOM = "${TEMPFILE('%s')}" % env['CXXCOM'],
- SHCCCOM = "${TEMPFILE('%s')}" % env['SHCCCOM'],
- SHCXXCOM = "${TEMPFILE('%s')}" % env['SHCXXCOM'],
- PCHCOM = "${TEMPFILE('%s')}" % pchcom_fixed,
- TARGETS1 = '${TARGETS[1]}',
-)
-
-env['ENV']['PROGRAMFILES'] = os.environ['PROGRAMFILES']
-env['ENV']['SystemDrive'] = os.environ['SystemDrive']
-env['ENV']['USERPROFILE'] = os.environ['USERPROFILE']
-
# Use timestamps change, followed by MD5 for speed
env.Decider('MD5-timestamp')
+
# Overlay things from a layer below.
env.Dir('$TARGET_ROOT').addRepository(Dir('..'))
@@ -324,6 +344,7 @@ Supported build variables:
PROGRESS=type Display a progress indicator:
name: print each evaluated target name
spinner: print a spinner every 5 targets
+ VERBOSE=1 Display full command lines
"""
if GetOption('help'):
diff --git a/build/SConscript.v8 b/build/SConscript.v8
index d995477..7a8f406 100644
--- a/build/SConscript.v8
+++ b/build/SConscript.v8
@@ -33,8 +33,9 @@ env = env.Clone()
# Grungy environment hackery to satisfy the Visual Studio that we're
# going to execute.
+import copy
import os
-env['ENV'] = os.environ.copy()
+env['ENV'] = copy.deepcopy(os.environ)
env.AppendENVPath('INCLUDE', env['MSVS_ENV']['INCLUDE'])
env.AppendENVPath('LIB', env['MSVS_ENV']['LIB'])