diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-10 00:01:37 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-10 00:01:37 +0000 |
commit | 6b3531280db5c7a6080dee26a0637553ca4af642 (patch) | |
tree | e724570c5bc35a7fa5315b7245f2b695683fdb8c /gears/SConscript | |
parent | 32cda29d0266751c764b043d8aaec6dccc646e29 (diff) | |
download | chromium_src-6b3531280db5c7a6080dee26a0637553ca4af642.zip chromium_src-6b3531280db5c7a6080dee26a0637553ca4af642.tar.gz chromium_src-6b3531280db5c7a6080dee26a0637553ca4af642.tar.bz2 |
Pull 'common' outputs out into their own SConscript so they have their own
variant dir. Add ipc_test as a common output.
Also fixed up some hackery around manipulating OUTDIRs.
Review URL: http://codereview.chromium.org/7037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3158 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gears/SConscript')
-rw-r--r-- | gears/SConscript | 73 |
1 files changed, 66 insertions, 7 deletions
diff --git a/gears/SConscript b/gears/SConscript index 55a0bff..c3b53c35 100644 --- a/gears/SConscript +++ b/gears/SConscript @@ -28,7 +28,6 @@ # - entry.path gives the path relative to toplevel_dir. # - entry.abspath gives the absolute path. -import sys import os Import('env') @@ -36,7 +35,6 @@ Import('env') env = env.Clone( OPEN_DIR = "googleclient/gears/opensource/gears", THIRD_PARTY_DIR = "googleclient/gears/opensource/third_party", - GENFILES_DIR = "genfiles", PRIVATE_THIRD_PARTY_DIR = "googleclient/third_party", ) @@ -104,13 +102,17 @@ env.Replace(ARCH = 'i386') # Output dirs env.Replace( - BASE_OUTDIR = env.subst('$MODE').lower(), + BASE_OUTDIR = '$GEARS_DIR/$MODE', COMMON_OUTDIR = '$BASE_OUTDIR/common', + BROWSER_OUTDIR = '$BASE_OUTDIR/${BROWSER.lower()}', IE_OUTDIR = '$BASE_OUTDIR/ie', FF2_OUTDIR = '$BASE_OUTDIR/ff2', FF3_OUTDIR = '$BASE_OUTDIR/ff3', NPAPI_OUTDIR = '$BASE_OUTDIR/npapi', SF_OUTDIR = '$BASE_OUTDIR/sf', + + GENFILES_DIR = "$BROWSER_OUTDIR/genfiles", + COMMON_GENFILES_DIR = "$COMMON_OUTDIR/genfiles", ) # Add our tools to the PATH. @@ -122,8 +124,60 @@ if env['OS'] in ['win32', 'wince']: env.PrependENVPath('PATH', env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/wix/v3_0_2925/files').abspath) +# Building M4 files env.Tool('m4') +env.Append( + M4ARCH = (env['ARCH'] == 'i386' and 'x86' or '$ARCH'), + M4FLAGS = [ + '--prefix-builtins', + '-DPRODUCT_VERSION=$VERSION', + '-DPRODUCT_VERSION_MAJOR=$MAJOR', + '-DPRODUCT_VERSION_MINOR=$MINOR', + '-DPRODUCT_VERSION_BUILD=$BUILD', + '-DPRODUCT_VERSION_PATCH=$PATCH', + '-DPRODUCT_OS=$OS', + '-DPRODUCT_ARCH="$M4ARCH"', + '-DPRODUCT_GCC_VERSION="gcc3"', + '-DPRODUCT_MAINTAINER="google"', + '-DPRODUCT_FRIENDLY_NAME_UQ="$FRIENDLY_NAME"', + '-DPRODUCT_SHORT_NAME_UQ="$SHORT_NAME"', + '-DI18N_LANGUAGES="(${",".join(I18N_LANGS)})"', + ], + M4PATH = [ + '$OPEN_DIR', + '.', + ], +) + +# SCons magic to make M4PATH work. +env.Replace( + M4INCPREFIX = '-I', + M4INCSUFFIX = '', + _M4INCFLAGS = ('${_concat(M4INCPREFIX, M4PATH, M4INCSUFFIX, ' + '__env__, RDirs, TARGET, SOURCE)}'), + M4COM = '$M4 $M4FLAGS ${_M4INCFLAGS} $SOURCE > $TARGET', +) + +# TODO: Dependency scanner for m4 files - doesn't work. It can't detect files +# that don't exist! +#m4_include_re = re.compile(r'm4_include\((.*)\)', re.M) +#def m4_scan(node, env, path): +# contents = node.get_contents() +# includes = m4_include_re.findall(contents) +# ret_includes = [] +# for include in includes: +# for dir in path: +# file = os.path.join(dir, include) +# if os.path.exists(file): +# ret_includes.append(file) +# break +# return ret_includes +# +#m4_scanner = Scanner(function = m4_scan, skeys = ['.m4', '.html_m4']) +#env.Append(SCANNERS = m4_scanner) + + # C++ build flags. # Clear out the inherited defines from Chrome's build. I want to match Gears' @@ -140,6 +194,7 @@ env.Replace( '$THIRD_PARTY_DIR/zlib', '$THIRD_PARTY_DIR/v8/bindings_local', '.', + '$COMMON_OUTDIR', ], LIBPATH = [ '$LIBS_DIR', @@ -431,16 +486,20 @@ for each in sconscripts: variant_dir='$COMMON_OUTDIR', duplicate=0) +# Must come before SConscript.dll because it Imports targets from this +# SConscript. +env.SConscript('SConscript.common', + exports=['env'], + variant_dir='$COMMON_OUTDIR', + duplicate=0) + browsers = [env['BROWSER']] if browsers[0] == 'all': browsers = env['VALID_BROWSERS'] print 'Building:', browsers for each in browsers: - env.Replace( - BROWSER = each, - BROWSER_OUTDIR = env.subst('$MODE/' + each).lower(), - ) + env.Replace(BROWSER = each) env.SConscript('SConscript.dll', exports=['env'], variant_dir='$BROWSER_OUTDIR', |