summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-21 06:04:04 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-21 06:04:04 +0000
commit11e020fcd65c415dc46d10ae9dbe6ba63600ee4c (patch)
treecddd284203c70dc51f60da67b71b73ce7ec4aff8
parent140d59c7cfa01e2d6a644091c29dcad9010c0e66 (diff)
downloadchromium_src-11e020fcd65c415dc46d10ae9dbe6ba63600ee4c.zip
chromium_src-11e020fcd65c415dc46d10ae9dbe6ba63600ee4c.tar.gz
chromium_src-11e020fcd65c415dc46d10ae9dbe6ba63600ee4c.tar.bz2
Fix use of LOAD= with WantSystemLib() (we could blow up if a variable
hadn't been added to the config) and extend use of LOAD= into submodules: * Add a ChromeLoadSConscriptModules() method that encapsulates the conditional logic, and makes things more readable by specifying component names as keyword arguments, not hard-coding the logic as a series of if-tests. * Put the ChromeLoadSConscriptModules() logic in a Tool module in site_scons/site_tools, so it doesn't clutter up build/SConscript.main directly. * Move env.WantSystemLib() calls into the individual *.scons files, so we call them each time (or not, based one LOAD=) and the config itself just returns if the system library is requested and we don't need to build anything locally. * Move the settings where a library name changes based on whether or not the system lib is being used into the using_*.scons files, so they're available to clients independently of whether or not the component's *.scons configuration is loaded. * While here: rename the affected third_party SConscript files: third_party/libjpeg/SConscript => third_party/libjpeg/libjpeg.scons third_party/libxml/SConscript => third_party/libxml/libxml.scons third_party/libxslt/SConscript => third_party/libxslt/libxslt.scons * While here: move the Chrome{Program,SharedLibrary}() etc. builder definitions from build/SConscript.main to a new too Ad the ChromeLoadSConscriptModules() logic in a Tool module, to remove more clutter from build/SConscript.main. Review URL: http://codereview.chromium.org/11430 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5820 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/SConscript.main169
-rw-r--r--build/SConscript.v83
-rw-r--r--chrome/chrome.scons74
-rw-r--r--site_scons/site_tools/chromium_builders.py35
-rw-r--r--site_scons/site_tools/chromium_load_component.py81
-rw-r--r--third_party/bzip2/bzip2.scons15
-rw-r--r--third_party/bzip2/using_bzip2.scons9
-rw-r--r--third_party/libjpeg/libjpeg.scons (renamed from third_party/libjpeg/SConscript)3
-rw-r--r--third_party/libpng/libpng.scons7
-rw-r--r--third_party/libxml/libxml.scons (renamed from third_party/libxml/SConscript)6
-rw-r--r--third_party/libxml/using_libxml.scons28
-rw-r--r--third_party/libxslt/libxslt.scons (renamed from third_party/libxslt/SConscript)3
-rw-r--r--third_party/lzma_sdk/lzma_sdk.scons3
-rw-r--r--third_party/zlib/zlib.scons8
-rw-r--r--webkit/SConscript42
-rw-r--r--webkit/tools/test_shell/SConscript4
16 files changed, 262 insertions, 228 deletions
diff --git a/build/SConscript.main b/build/SConscript.main
index be3e5e6..152dc09 100644
--- a/build/SConscript.main
+++ b/build/SConscript.main
@@ -19,15 +19,10 @@ default_warnings = ['no-no-parallel-support']
SetOption('warn', default_warnings + GetOption('warn'))
-load = ARGUMENTS.get('LOAD')
-if load:
- load = load.split(',')
-else:
- load = []
-
-
root_env = Environment(
- tools = ['component_setup'],
+ tools = ['component_setup',
+ 'chromium_builders',
+ 'chromium_load_component'],
# Requested list of system (shared) libraries, from the comma separated
# SYSTEM_LIBS command-line argument
@@ -115,28 +110,6 @@ def WantSystemLib(env, lib):
return (lib in env['req_system_libs'])
root_env.AddMethod(WantSystemLib, "WantSystemLib")
-def ChromeProgram(env, *args, **kw):
- return env.ComponentProgram(*args, **kw)
-root_env.AddMethod(ChromeProgram)
-
-def ChromeTestProgram(env, *args, **kw):
- return env.ComponentTestProgram(*args, **kw)
-root_env.AddMethod(ChromeTestProgram)
-
-def ChromeStaticLibrary(env, *args, **kw):
- kw['COMPONENT_STATIC'] = True
- return env.ComponentLibrary(*args, **kw)
-root_env.AddMethod(ChromeStaticLibrary)
-
-def ChromeSharedLibrary(env, *args, **kw):
- kw['COMPONENT_STATIC'] = False
- return [env.ComponentLibrary(*args, **kw)[0]]
-root_env.AddMethod(ChromeSharedLibrary, "ChromeSharedLibrary")
-
-def ChromeObject(env, *args, **kw):
- return env.ComponentObject(*args, **kw)
-root_env.AddMethod(ChromeObject)
-
# TODO(bradnelson): pull this functionality into hammer.
# Auto select the number of processors
@@ -169,106 +142,42 @@ root_env.ApplySConscript(['$CHROME_SRC_DIR/build/common.scons'])
# The list of all leaf (fully described) environments.
environment_list = []
-
-
-# --------------------------------------------------------------------------
-# Decide which things to load.
-# Don't put anything platform depended here, this is just to gate things
-# in or out for speed.
-
-included = [c for c in load if not c.startswith('-')]
-excluded = [c[1:] for c in load if c.startswith('-')]
-if not included:
- included = ['all']
-
-components = ['all']
-
-def LoadComponent(c):
- components.append(c)
- return (not GetOption('help') and
- c in included or
- ('all' in included and not c in excluded))
-
-sconscripts = []
-
-if LoadComponent('base'):
- sconscripts.append('$BASE_DIR/base.scons')
-
-if LoadComponent('breakpad'):
- sconscripts.append('$BREAKPAD_DIR/SConscript')
-
-if LoadComponent('chrome'):
- sconscripts.append('$CHROME_DIR/chrome.scons')
-
-if LoadComponent('gears'):
- sconscripts.append('$GEARS_DIR/SConscript')
-
-if LoadComponent('google_update'):
- sconscripts.append('$GOOGLE_UPDATE_DIR/SConscript')
-
-if LoadComponent('googleurl'):
- # googleurl comes from a different repository so we provide the SConscript
- # file.
- sconscripts.append('$GOOGLEURL_DIR/googleurl.scons')
-
-if LoadComponent('media'):
- sconscripts.append('$MEDIA_DIR/media.scons')
-
-if LoadComponent('net'):
- sconscripts.append('$NET_DIR/net.scons')
-
-if LoadComponent('rlz'):
- sconscripts.append('$RLZ_DIR/SConscript')
-
-if LoadComponent('sandbox'):
- sconscripts.append('$SANDBOX_DIR/sandbox.scons')
-
-if LoadComponent('sdch'):
- sconscripts.append('$SDCH_DIR/SConscript')
-
-if LoadComponent('skia'):
- sconscripts.append('$SKIA_DIR/SConscript')
-
-if LoadComponent('testing'):
- sconscripts.append('$TESTING_DIR/SConscript.gtest')
-
-if LoadComponent('third_party'):
- if not root_env.WantSystemLib('bzip2'):
- sconscripts.append('$BZIP2_DIR/bzip2.scons')
- root_env.Append(BZIP2_LIB = ['bzip2'])
- else:
- root_env.Append(BZIP2_LIB = ['bz2'])
- if not root_env.WantSystemLib('libpng'):
- sconscripts.append('$LIBPNG_DIR/libpng.scons')
- if not root_env.WantSystemLib('libjpeg'):
- sconscripts.append('$LIBJPEG_DIR/SConscript')
- if not root_env.WantSystemLib('libxml'):
- sconscripts.append('$LIBXML_DIR/SConscript')
- root_env.Append(XML_LIB = ['libxml'])
- else:
- root_env.Append(XML_LIB = ['xml2'])
- if not root_env.WantSystemLib('libxslt'):
- sconscripts.append('$LIBXSLT_DIR/SConscript')
- if not root_env.WantSystemLib('lzma_sdk'):
- sconscripts.append('$LZMA_SDK_DIR/lzma_sdk.scons')
- if not root_env.WantSystemLib('zlib'):
- sconscripts.append('$ZLIB_DIR/zlib.scons')
- root_env.Append(ZLIB_LIB = ['zlib'])
- else:
- root_env.Append(ZLIB_LIB = ['z'])
- sconscripts.extend([
- '$BSDIFF_DIR/bsdiff.scons',
- '$BSPATCH_DIR/bspatch.scons',
- '$ICU38_DIR/icu38.scons',
- '$MODP_B64_DIR/modp_b64.scons',
- ])
-
-if LoadComponent('v8') and root_env.Dir('$CHROME_SRC_DIR/v8').exists():
- sconscripts.append('$OBJ_ROOT/build/SConscript.v8')
-
-if LoadComponent('webkit'):
- sconscripts.append('$WEBKIT_DIR/webkit.scons')
-
+components = []
+
+# Figure out what SConscript files to load based on the user's request.
+# Default is to load all SConscript files for a full-tree build.
+# The keyword arguments in the call below (base, breakpad, etc.) can be
+# specified in the LOAD= argument to cut down on the build.
+sconscripts = root_env.ChromiumLoadComponentSConscripts(
+ base = '$BASE_DIR/base.scons',
+ breakpad = '$BREAKPAD_DIR/SConscript',
+ chrome = '$CHROME_DIR/chrome.scons',
+ gears = '$GEARS_DIR/SConscript',
+ google_update = '$GOOGLE_UPDATE_DIR/SConscript',
+ googleurl = '$GOOGLEURL_DIR/googleurl.scons',
+ media = '$MEDIA_DIR/media.scons',
+ net = '$NET_DIR/net.scons',
+ rlz = '$RLZ_DIR/SConscript',
+ sandbox = '$SANDBOX_DIR/sandbox.scons',
+ sdch = '$SDCH_DIR/SConscript',
+ skia = '$SKIA_DIR/SConscript',
+ testing = '$TESTING_DIR/SConscript.gtest',
+ third_party = [
+ '$BSDIFF_DIR/bsdiff.scons',
+ '$BSPATCH_DIR/bspatch.scons',
+ '$BZIP2_DIR/bzip2.scons',
+ '$ICU38_DIR/icu38.scons',
+ '$LIBJPEG_DIR/libjpeg.scons',
+ '$LIBPNG_DIR/libpng.scons',
+ '$LIBXML_DIR/libxml.scons',
+ '$LIBXSLT_DIR/libxslt.scons',
+ '$LZMA_SDK_DIR/lzma_sdk.scons',
+ '$MODP_B64_DIR/modp_b64.scons',
+ '$ZLIB_DIR/zlib.scons',
+ ],
+ v8 = '$OBJ_ROOT/build/SConscript.v8',
+ webkit = '$WEBKIT_DIR/webkit.scons',
+)
# Add the final list into the root environment to be build in BuildComponents.
root_env.Append(BUILD_SCONSCRIPTS = sconscripts)
diff --git a/build/SConscript.v8 b/build/SConscript.v8
index 22717b8..67f17c4 100644
--- a/build/SConscript.v8
+++ b/build/SConscript.v8
@@ -6,6 +6,9 @@ import os
Import('env')
+if not env.Dir('$CHROME_SRC_DIR/v8').exists():
+ Return()
+
# Grab the -j flag from the outer environment, if available.
try:
cpus = env.GetOption('num_jobs')
diff --git a/chrome/chrome.scons b/chrome/chrome.scons
index d990e37..a012047 100644
--- a/chrome/chrome.scons
+++ b/chrome/chrome.scons
@@ -38,42 +38,45 @@ env.Replace(
)
-sconscript_files = [
+sconscript_files = env.ChromiumLoadComponentSConscripts(
'SConscript',
- 'browser/browser.scons',
- 'browser/debugger/debugger.scons',
- 'common/common.scons',
- 'common/ipc_tests.scons',
- 'installer/mini_installer/installer_unittests.scons',
- 'installer/mini_installer/mini_installer.scons',
- 'installer/setup/setup.scons',
- 'installer/util/util.scons',
- 'plugin/plugin.scons',
- 'renderer/renderer.scons',
- 'test/activex_test_control/activex_test_control.scons',
- 'test/automated_ui_tests/automated_ui_tests.scons',
- 'test/automation/automation.scons',
- 'test/chrome_plugin/test_chrome_plugin.scons',
- 'test/interactive_ui/interactive_ui_tests.scons',
- 'test/memory_test/memory_test.scons',
- 'test/mini_installer_test/mini_installer_test.scons',
- 'test/page_cycler/page_cycler_tests.scons',
- 'test/perf/perftests.scons',
- 'test/plugin/plugin_tests.scons',
- 'test/reliability/reliability_tests.scons',
- 'test/security_tests/security_tests.scons',
- 'test/selenium/selenium_tests.scons',
- 'test/startup/startup_tests.scons',
- 'test/tab_switching/tab_switching_test.scons',
- 'test/ui/ui_tests.scons',
- 'test/unit/unit_tests.scons',
- 'tools/convert_dict/convert_dict.scons',
- 'tools/crash_service/crash_service.scons',
- 'tools/perf/flush_cache/flush_cache.scons',
- 'tools/profiles/generate_profile.scons',
- 'tools/test/image_diff/image_diff.scons',
-]
+ LOAD_NAMES = ['chrome'],
+
+ browser = 'browser/browser.scons',
+ debugger = 'browser/debugger/debugger.scons',
+ common = 'common/common.scons',
+ ipc_tests = 'common/ipc_tests.scons',
+ installer_unittests = 'installer/mini_installer/installer_unittests.scons',
+ mini_installer = 'installer/mini_installer/mini_installer.scons',
+ setup = 'installer/setup/setup.scons',
+ util = 'installer/util/util.scons',
+ plugin = 'plugin/plugin.scons',
+ renderer = 'renderer/renderer.scons',
+ activex_test_controls =
+ 'test/activex_test_control/activex_test_control.scons',
+ automated_ui_tests = 'test/automated_ui_tests/automated_ui_tests.scons',
+ automtion = 'test/automation/automation.scons',
+ test_chrome_plugin = 'test/chrome_plugin/test_chrome_plugin.scons',
+ interactive_ui_tests = 'test/interactive_ui/interactive_ui_tests.scons',
+ memory_test = 'test/memory_test/memory_test.scons',
+ mini_installer_test = 'test/mini_installer_test/mini_installer_test.scons',
+ page_cycler_tests = 'test/page_cycler/page_cycler_tests.scons',
+ perf_tests = 'test/perf/perftests.scons',
+ plugin_tests = 'test/plugin/plugin_tests.scons',
+ reliability_tests = 'test/reliability/reliability_tests.scons',
+ security_tests = 'test/security_tests/security_tests.scons',
+ selenium_tests = 'test/selenium/selenium_tests.scons',
+ startup_tests = 'test/startup/startup_tests.scons',
+ tab_switching_test = 'test/tab_switching/tab_switching_test.scons',
+ ui_tests = 'test/ui/ui_tests.scons',
+ unit_tests = 'test/unit/unit_tests.scons',
+ convert_dict = 'tools/convert_dict/convert_dict.scons',
+ crash_service = 'tools/crash_service/crash_service.scons',
+ flush_cache = 'tools/perf/flush_cache/flush_cache.scons',
+ generate_profile = 'tools/profiles/generate_profile.scons',
+ image_diff = 'tools/test/image_diff/image_diff.scons',
+)
# TODO(port)
if env['PLATFORM'] != 'win32':
@@ -103,7 +106,6 @@ if env['PLATFORM'] != 'win32':
'tools/perf/flush_cache/flush_cache.scons',
'tools/profiles/generate_profile.scons',
]
- for remove in remove_files:
- sconscript_files.remove(remove)
+ sconscript_files = list(set(sconscript_files) - set(remove_files))
SConscript(sconscript_files, exports=['env'])
diff --git a/site_scons/site_tools/chromium_builders.py b/site_scons/site_tools/chromium_builders.py
new file mode 100644
index 0000000..a5c3964
--- /dev/null
+++ b/site_scons/site_tools/chromium_builders.py
@@ -0,0 +1,35 @@
+# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Tool module for adding, to a construction environment, Chromium-specific
+wrappers around Hammer builders. This gives us a central place for any
+customization we need to make to the different things we build.
+"""
+
+def generate(env):
+ def ChromeProgram(env, *args, **kw):
+ return env.ComponentProgram(*args, **kw)
+ env.AddMethod(ChromeProgram)
+
+ def ChromeTestProgram(env, *args, **kw):
+ return env.ComponentTestProgram(*args, **kw)
+ env.AddMethod(ChromeTestProgram)
+
+ def ChromeStaticLibrary(env, *args, **kw):
+ kw['COMPONENT_STATIC'] = True
+ return env.ComponentLibrary(*args, **kw)
+ env.AddMethod(ChromeStaticLibrary)
+
+ def ChromeSharedLibrary(env, *args, **kw):
+ kw['COMPONENT_STATIC'] = False
+ return [env.ComponentLibrary(*args, **kw)[0]]
+ env.AddMethod(ChromeSharedLibrary)
+
+ def ChromeObject(env, *args, **kw):
+ return env.ComponentObject(*args, **kw)
+ env.AddMethod(ChromeObject)
+
+def exists(env):
+ return True
diff --git a/site_scons/site_tools/chromium_load_component.py b/site_scons/site_tools/chromium_load_component.py
new file mode 100644
index 0000000..24c6e03
--- /dev/null
+++ b/site_scons/site_tools/chromium_load_component.py
@@ -0,0 +1,81 @@
+# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Tool module for managing conditional loading of components in a
+Chromium build (i.e., the LOAD= command-line argument).
+"""
+
+from SCons.Script import *
+
+def generate(env):
+
+ class LoadComponent:
+ """
+ Class for deciding if a given component name is to be included
+ based on a list of included names, optionally prefixed with '-'
+ to exclude the name.
+ """
+ def __init__(self, load=[], names=[]):
+ """
+ Initialize a class with a list of names for possible loading.
+
+ Arguments:
+ load: list of elements in the LOAD= specification
+ names: name(s) that represent this global collection
+ """
+ self.included = set([c for c in load if not c.startswith('-')])
+ self.excluded = set([c[1:] for c in load if c.startswith('-')])
+
+ # Remove the global collection name(s) from the included list.
+ # This supports (e.g.) specifying 'webkit' so the top-level of the
+ # hierarchy will read up the subsystem, and then 'test_shell'
+ # as one specific sub-component within 'webkit'.
+ self.included = self.included - set(names)
+
+ if not self.included:
+ self.included = ['all']
+
+ def __call__(self, component):
+ """
+ Returns True if the specified component should be loaded,
+ based on the initialized included and excluded lists.
+ """
+ return (component in self.included or
+ ('all' in self.included and not component in self.excluded))
+
+ def ChromiumLoadComponentSConscripts(env, *args, **kw):
+ """
+ Returns a list of SConscript files to load, based on LOAD=.
+
+ SConscript files specified without keyword arguments are returned
+ unconditionally. SConscript files specified with a keyword arguments
+ (e.g. chrome = 'chrome.scons') are loaded only if the LOAD= line
+ indicates their keyword argument should be included in the load.
+ """
+ try:
+ load = ARGUMENTS.get('LOAD').split(',')
+ except AttributeError:
+ load = []
+
+ try:
+ names = kw['LOAD_NAMES']
+ except KeyError:
+ names = []
+ else:
+ del kw['LOAD_NAMES']
+
+ load_component = LoadComponent(load, names)
+
+ result = list(args)
+ for module, sconscript in kw.items():
+ if load_component(module):
+ result.append(sconscript)
+
+ return Flatten(result)
+
+ env.AddMethod(ChromiumLoadComponentSConscripts)
+
+def exists(env):
+ return True
diff --git a/third_party/bzip2/bzip2.scons b/third_party/bzip2/bzip2.scons
index f1ad082..6089ea1 100644
--- a/third_party/bzip2/bzip2.scons
+++ b/third_party/bzip2/bzip2.scons
@@ -8,8 +8,17 @@ Configuration for building bzip2.lib / libbzip2.a.
Import('env')
+if env.WantSystemLib('bzip2'):
+ Return()
+
env = env.Clone()
+env.Append(
+ CPPDEFINES = [
+ 'BZ_NO_STDIO',
+ ],
+)
+
if env['PLATFORM'] == 'win32':
env.Append(
CCFLAGS = [
@@ -19,12 +28,6 @@ if env['PLATFORM'] == 'win32':
],
)
-env.Append(
- CPPDEFINES = [
- 'BZ_NO_STDIO',
- ],
-)
-
input_files = [
'blocksort.c',
'bzlib.c',
diff --git a/third_party/bzip2/using_bzip2.scons b/third_party/bzip2/using_bzip2.scons
index b41bca2..cbe837c 100644
--- a/third_party/bzip2/using_bzip2.scons
+++ b/third_party/bzip2/using_bzip2.scons
@@ -8,8 +8,7 @@ Settings for other components using the bzip2 library.
Import("env")
-env.Append(
- LIBS = [
- env['BZIP2_LIB'],
- ],
-)
+if env.WantSystemLib('bzip2'):
+ env.Append(LIBS = ['bz2'])
+else:
+ env.Append(LIBS = ['bzip2'])
diff --git a/third_party/libjpeg/SConscript b/third_party/libjpeg/libjpeg.scons
index 381d437..fdb2c2a 100644
--- a/third_party/libjpeg/SConscript
+++ b/third_party/libjpeg/libjpeg.scons
@@ -32,6 +32,9 @@ Import('env')
env = env.Clone()
+if env.WantSystemLib('libjpeg'):
+ Return()
+
env.Prepend(
CPPPATH = [
'$CHROME_SRC_DIR',
diff --git a/third_party/libpng/libpng.scons b/third_party/libpng/libpng.scons
index 0f8bd89..01a932d 100644
--- a/third_party/libpng/libpng.scons
+++ b/third_party/libpng/libpng.scons
@@ -9,11 +9,14 @@ Configuration for building libpng.lib / libpng.a.
Import('env')
+if env.WantSystemLib('libpng'):
+ Return()
+
env = env.Clone()
-env.SConscript([
+env.ApplySConscript([
'$ZLIB_DIR/using_zlib.scons',
-], {'env':env})
+])
env.Prepend(
CPPPATH = [
diff --git a/third_party/libxml/SConscript b/third_party/libxml/libxml.scons
index f952a96..d403cd4 100644
--- a/third_party/libxml/SConscript
+++ b/third_party/libxml/libxml.scons
@@ -29,6 +29,9 @@
Import('env')
+if env.WantSystemLib('libxml'):
+ Return()
+
env = env.Clone()
env.Prepend(
@@ -40,9 +43,6 @@ env.Prepend(
'DerivedSources/include',
'include',
],
-)
-
-env.Append(
CPPDEFINES = [
'U_STATIC_IMPLEMENTATION',
'LIBXML_STATIC',
diff --git a/third_party/libxml/using_libxml.scons b/third_party/libxml/using_libxml.scons
index 4a5c1329..709520f 100644
--- a/third_party/libxml/using_libxml.scons
+++ b/third_party/libxml/using_libxml.scons
@@ -8,27 +8,10 @@ Settings for other components using the libxml library.
Import("env")
-env.Append(
- CPPPATH = [
- '$LIBXML_DIR/include',
- '$LIBXML_DIR/DerivedSources/include',
- ],
- CPPDEFINES = [
- 'LIBXML_STATIC',
- ],
- LIBS = [
- env['XML_LIB'],
- ],
-)
-# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-__doc__ = """
-Settings for other components using the libxml library.
-"""
-
-Import("env")
+if env.WantSystemLib('libxml'):
+ env.Append(LIBS = ['xml2'])
+else:
+ env.Append(LIBS = ['libxml'])
env.Append(
CPPPATH = [
@@ -38,7 +21,4 @@ env.Append(
CPPDEFINES = [
'LIBXML_STATIC',
],
- LIBS = [
- env['XML_LIB'],
- ],
)
diff --git a/third_party/libxslt/SConscript b/third_party/libxslt/libxslt.scons
index d28fb75..9a9ff71 100644
--- a/third_party/libxslt/SConscript
+++ b/third_party/libxslt/libxslt.scons
@@ -31,6 +31,9 @@ Import('env')
env = env.Clone()
+if env.WantSystemLib('libxslt'):
+ Return()
+
env.Prepend(
CPPPATH = [
'$LIBXML_DIR/DerivedSources/include',
diff --git a/third_party/lzma_sdk/lzma_sdk.scons b/third_party/lzma_sdk/lzma_sdk.scons
index b76a2d22..86ea6aa 100644
--- a/third_party/lzma_sdk/lzma_sdk.scons
+++ b/third_party/lzma_sdk/lzma_sdk.scons
@@ -6,6 +6,9 @@ Import('env')
env = env.Clone()
+if env.WantSystemLib('lzma_sdk'):
+ Return()
+
env.Prepend(
CPPPATH = [
'.',
diff --git a/third_party/zlib/zlib.scons b/third_party/zlib/zlib.scons
index a7dcb89..d37fafa 100644
--- a/third_party/zlib/zlib.scons
+++ b/third_party/zlib/zlib.scons
@@ -8,8 +8,16 @@ Configuration for building zlib.lib / libzlib.a.
Import('env')
+if env.WantSystemLib('zlib'):
+ env.Append(ZLIB_LIB = ['z'])
+ Return()
+
env = env.Clone()
+env.Append(
+ ZLIB_LIB = ['zlib'],
+)
+
if env['PLATFORM'] == 'win32':
env.Append(
CCFLAGS = [
diff --git a/webkit/SConscript b/webkit/SConscript
index 08b05fe..237b113 100644
--- a/webkit/SConscript
+++ b/webkit/SConscript
@@ -211,28 +211,31 @@ env.Append(
)
# This list is the SConscripts that work on Windows and Linux.
-sconscript_dirs = [
- 'SConscript.port',
- 'SConscript.javascriptcore_pcre',
- 'build/JSConfig/SConscript',
- 'build/JavaScriptCore/SConscript',
- 'build/localized_strings/SConscript',
- 'build/port/SConscript',
- 'build/V8Bindings/SConscript',
- 'build/WebCore/SConscript',
- 'default_plugin/SConscript',
- 'glue/SConscript',
- 'glue/plugins/test/SConscript',
- 'tools/npapi_layout_test_plugin/SConscript',
- 'tools/test_shell/SConscript',
-]
+sconscript_dirs = env.ChromiumLoadComponentSConscripts(
+ LOAD_NAMES = ['webkit'],
+ port = 'SConscript.port',
+ JavaScriptCore_pcre = 'SConscript.javascriptcore_pcre',
+ WebCore_config_h = 'build/JSConfig/SConscript',
+ JavaScriptCore = 'build/JavaScriptCore/SConscript',
+ webkit_strings = 'build/localized_strings/SConscript',
+ bindings = 'build/port/SConscript',
+ V8Bindings = 'build/V8Bindings/SConscript',
+ WebCore = 'build/WebCore/SConscript',
+ default_plugin = 'default_plugin/SConscript',
+ glue = 'glue/SConscript',
+ npapi_test_plugin = 'glue/plugins/test/SConscript',
+ npapi_layout_test_plugin = 'tools/npapi_layout_test_plugin/SConscript',
+ test_shell = 'tools/test_shell/SConscript',
+)
+
if env['PLATFORM'] == 'win32':
# These extra dirs aren't win32-specific, they're just the dirs that
# haven't yet been made portable.
- sconscript_dirs.extend([
- 'activex_shim/SConscript',
- 'activex_shim_dll/SConscript',
- ])
+ sconscript_dirs.extend(env.ChromiumLoadComponentSConscripts(
+ LOAD_NAMES = ['webkit'],
+ activex_shim = 'activex_shim/SConscript',
+ npaxshim = 'activex_shim_dll/SConscript',
+ ))
env.Append(
CPPDEFINES = [
@@ -272,4 +275,3 @@ version = env.Command('$WEBKIT_DIR/build/WebCore/webkit_version.h',
'$CHROME_SRC_DIR/webkit/build/webkit_version.py'],
"$PYTHON ${SOURCES[1]} ${SOURCES[0]} ${TARGET.dir}")
env.AlwaysBuild(version)
-
diff --git a/webkit/tools/test_shell/SConscript b/webkit/tools/test_shell/SConscript
index 1f07bba..83f9ee9 100644
--- a/webkit/tools/test_shell/SConscript
+++ b/webkit/tools/test_shell/SConscript
@@ -8,6 +8,8 @@ env = env.Clone()
env_res = env_res.Clone()
env.SConscript([
+ '$BZIP2_DIR/using_bzip2.scons',
+ '$LIBXML_DIR/using_libxml.scons',
'$CHROME_SRC_DIR/build/using_v8.scons',
], {'env':env})
@@ -41,14 +43,12 @@ env.Append(
'sdch',
'skia',
'gtest',
- env['BZIP2_LIB'],
'V8Bindings',
'WebCore',
'WTF',
env['ICU_LIBS'], # TODO(sgk): '$ICU_LIBS' when scons is fixed
'libjpeg',
'libpng',
- env['XML_LIB'],
'libxslt',
'modp_b64',
'zlib',