summaryrefslogtreecommitdiffstats
path: root/gears
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-22 21:15:54 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-22 21:15:54 +0000
commit7ef840ffc387eb1c1f3e3fd8a41840caf51d3628 (patch)
treec414954f2a8db0d2f75ae05d3497c6a0d142241c /gears
parent941722bd1df5a1bf9c2e0474ac096cf8eac0f32f (diff)
downloadchromium_src-7ef840ffc387eb1c1f3e3fd8a41840caf51d3628.zip
chromium_src-7ef840ffc387eb1c1f3e3fd8a41840caf51d3628.tar.gz
chromium_src-7ef840ffc387eb1c1f3e3fd8a41840caf51d3628.tar.bz2
Use a variant_dir when building gears.dll so building the different ports
don't clobber each other. Also added FF2 and FF3 support. Review URL: http://codereview.chromium.org/2913 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gears')
-rw-r--r--gears/SConscript1122
-rw-r--r--gears/SConscript.dll1218
-rw-r--r--gears/SConscript.googleurl85
-rw-r--r--gears/SConscript.sqlite18
4 files changed, 1377 insertions, 1066 deletions
diff --git a/gears/SConscript b/gears/SConscript
index 3072ba1..508ca0d 100644
--- a/gears/SConscript
+++ b/gears/SConscript
@@ -2,41 +2,16 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import os
-import re
-
Import('env')
env = env.Clone(
+ GEARS_DIR = ".",
OPEN_DIR = "$GEARS_DIR/googleclient/gears/opensource/gears",
THIRD_PARTY_DIR = "$GEARS_DIR/googleclient/gears/opensource/third_party",
GENFILES_DIR = "$GEARS_DIR/genfiles",
PRIVATE_THIRD_PARTY_DIR = "$GEARS_DIR/googleclient/third_party",
)
-# Notes:
-# This assumes you have a working gears checkout from p4 in the current dir.
-# Steps for this:
-# > echo %USER%-chromegears > p4config
-# > g4 client -p //depot/googleclient/gears/p4_depot_paths
-# > g4 sync
-#
-# This is a work-in-progress conversion of the current Gears set of Makefiles.
-# A lot of the stuff doesn't translate to SCons-land well, and I'm not sure
-# how faithful we want to be to the original.
-#
-# Questions:
-# Should we flatten the output directory into
-# Hammer/gears/platform/browser/*.obj like Gears does now? If so, how?
-#
-# TODO: split into env_common, env_browser, etc?
-# common_* stuff will be built once, and object reused for all browser builds.
-# browser_* stuff will be rebuilt for each different type of BROWSER define.
-# - How do we do this? We want browser_ stuff under a different dir so
-# BROWSER=NPAPI doesn't overwrite BROWSER=FF3's object files.
-# Maybe put all the browser stuff in a separate .lib, and use variant_dir
-# on a SConscript.browser?
-
# Argument switches
vars = Variables(None, ARGUMENTS)
vars.AddVariables(
@@ -51,12 +26,12 @@ vars.AddVariables(
)
vars.Update(env)
-env.Prepend(
+env.Append(
USING_CCTESTS = (env['MODE'] == 'dbg' or not env['OFFICIAL_BUILD'])
)
# Version
-env.Prepend(
+env.Append(
MAJOR = '0',
MINOR = '4',
BUILD = '17',
@@ -68,214 +43,17 @@ env.Prepend(
)
# Platform
-env.Prepend(
+env.Append(
OS = '$PLATFORM',
ARCH = 'i386',
)
-
-# Building M4 files
-
-env.Tool('m4')
-
-# Add GNU tools to the PATH.
-# TODO: Figure out the right way to do this. On first invocation, PATH
-# is relative to '.'. On repeated invocations (when Hammer/gears exists),
-# PATH is relative to './Hammer/gears'.
-# TODO: Also it would be nice to use $THIRD_PARTY_DIR instead of hardcoding
-# it here.
-env.PrependENVPath('PATH', os.path.abspath(
- 'googleclient/third_party/gnu/files'))
-env.PrependENVPath('PATH', os.path.abspath(
- '../../googleclient/third_party/gnu/files'))
-env.PrependENVPath('PATH', os.path.abspath(
- 'googleclient/third_party/python_24'))
-env.PrependENVPath('PATH', os.path.abspath(
- '../../googleclient/third_party/python_24'))
-
-i18n_langs = [
- 'en-US',
- 'ar',
- 'bg',
- 'ca',
- 'cs',
- 'da',
- 'de',
- 'el',
- 'en-GB',
- 'es',
- 'et',
- 'fa',
- 'fi',
- 'fil',
- 'fr',
- 'he',
- 'hi',
- 'hr',
- 'hu',
- 'id',
- 'is',
- 'it',
- 'ja',
- 'ko',
- 'lt',
- 'lv',
- 'ms',
- 'nl',
- 'no',
- 'pl',
- 'pt-BR',
- 'pt-PT',
- 'ro',
- 'ru',
- 'sk',
- 'sl',
- 'sr',
- 'sv',
- 'th',
- 'tr',
- 'uk',
- 'ur',
- 'vi',
- 'zh-CN',
- 'zh-TW',
- 'ml',
- 'te',
- 'gu',
- 'kn',
- 'or',
- 'bn',
- 'ta',
- 'mr',
-]
-
-# TODO: switch over to Chrome's SDK.
-env.Replace(
- CPPPATH = [
- '$PRIVATE_THIRD_PARTY_DIR/platformsdk_vc80/files/include',
- '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80/files/include',
- ],
-)
-
-# TODO: DEBUG, OFFICIAL_BUILD, CCTESTS, I18N_LANGUAGES
-env.Prepend(
- M4FLAGS = [
- '--prefix-builtins',
- '-DDEBUG=1',
- '-DPRODUCT_VERSION=$VERSION',
- '-DPRODUCT_VERSION_MAJOR=$MAJOR',
- '-DPRODUCT_VERSION_MINOR=$MINOR',
- '-DPRODUCT_VERSION_BUILD=$BUILD',
- '-DPRODUCT_VERSION_PATCH=$PATCH',
- '-DPRODUCT_OS=$OS',
- '-DPRODUCT_ARCH=$ARCH',
- '-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',
- '$GEARS_DIR',
- ],
-)
-
-# SCons magic to make M4PATH work.
-env['M4INCPREFIX'] = '-I'
-env['M4INCSUFFIX'] = ''
-env['_M4INCFLAGS'] = ('${_concat(M4INCPREFIX, M4PATH, M4INCSUFFIX, ' +
- '__env__, RDirs, TARGET, SOURCE)}')
-env['M4COM'] = '$M4 $M4FLAGS ${_M4INCFLAGS} $SOURCE > $TARGET'
-
-# TODO: Dependency scanner for m4 files - doesn't work.
-#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)
-
-
-# Building .stab files, using M4FLAGS.
-
-# TODO: I want to just use $OPEN_DIR/tools/parse_stab.py. I need a way to
-# convert from build dir to src dir. ${OPEN_DIR.srcdir} doesn't work.
-env['STAB'] = 'python googleclient/gears/opensource/gears/tools/parse_stab.py'
-env['STRIPPED_GEARS_DIR'] = env.Dir('$GEARS_DIR')
-env['I18N_INPUTS_BASEDIR'] = '$STRIPPED_GEARS_DIR/ui/generated'
-env['STABCOM'] = \
- '$STAB $M4FLAGS ${_M4INCFLAGS} $TARGET $SOURCE $I18N_INPUTS_BASEDIR'
-stab_builder = Builder(action = '$STABCOM', src_suffix = '.stab')
-env.Append(BUILDERS = {'Stab': stab_builder})
-
-# Building .from_bin.cc files.
-
-# Must be run from within the gears dir.
-# TODO: ${SOURCE[36:]} - is this the best way to strip off the dir I cd'ed to?
-env['BIN2CPP'] = \
- 'cd googleclient/gears/opensource/gears && python tools/bin2cpp.py'
-env['BIN2CPPCOM'] = '$BIN2CPP ${str(SOURCE)[36:]} > ${TARGET.abspath}'
-bin2cpp_builder = Builder(action = '$BIN2CPPCOM')
-env.Append(BUILDERS = {'Bin2cpp': bin2cpp_builder})
-
-
-# Building .idl files.
-# This is a total mess. MIDL needs to be run from $OPEN_DIR because it's too
-# stupid to apply its include paths to a relative path like "ui/ie/bla.idl"
-# (it only looks in the current dir). So we have to jump through hoops to fix
-# up our relative include paths and output files.
-
-env['IDLOUTPUTDIR'] = env.Dir('$GENFILES_DIR')
-env['IDLINCPREFIX'] = '/I../../../../'
-env['IDLINCSUFFIX'] = ''
-env['_IDLINCFLAGS'] = ('${_concat(IDLINCPREFIX, CPPPATH, IDLINCSUFFIX, ' +
- '__env__, RDirs, TARGET, SOURCE)}')
-env['MIDLCOM'] = (
- 'cd googleclient/gears/opensource/gears && $MIDL $CPPFLAGS ' +
- '${_IDLINCFLAGS} -env win32 -Oicf ' +
- '/tlb ../../../../$IDLOUTPUTDIR/${TARGET.filebase}.tlb ' +
- '/h ../../../../$IDLOUTPUTDIR/${TARGET.filebase}.h ' +
- '/iid ../../../../$IDLOUTPUTDIR/${TARGET.filebase}_i.c ' +
- '/proxy ../../../../$IDLOUTPUTDIR/${TARGET.filebase}_p.c ' +
- '/dlldata ../../../../$IDLOUTPUTDIR/${TARGET.filebase}_data.c ' +
- '../../../../$SOURCE'
-)
-
-# Here's a quick hack to remove the .tlb file from the list of targets. Some
-# of our IDL compiles don't generate one, so we don't a false dependency.
-# TODO(sgk): clean up this mess!
-import SCons.Builder
-def MyIdlEmitter(target, source, env):
- # HACK to remove .tlb file unilaterally - note that some IDLs generate a
- # .tlb file, but not all.
- t = target[1:]
- # Write the output to the right directory. This is mostly because
- # the generated html_dialog_host.h conflicts with the real
- # html_dialog_host.h in the same directory (otherwise we could just use
- # Install()).
- t = [os.path.join(str(env.Dir('$IDLOUTPUTDIR')), os.path.basename(x))
- for x in t]
- return (t, source)
-b = env['BUILDERS']['TypeLibrary']
-emitter_list = [b.emitter, MyIdlEmitter]
-b.emitter = SCons.Builder.ListEmitter(emitter_list)
-
-# C++ defines
+# C++ build flags.
# TODO: fix Gears to not require this removal.
env['CPPDEFINES'].remove('WIN32_LEAN_AND_MEAN')
-env.Prepend(
+env.Replace(
CPPPATH = [
'$OPEN_DIR',
'$OPEN_DIR/..',
@@ -286,18 +64,24 @@ env.Prepend(
'$THIRD_PARTY_DIR/zlib',
'$THIRD_PARTY_DIR/v8/bindings_local',
'$GEARS_DIR',
- ],
-)
-env.Append(
- CPPDEFINES = [
- 'DEBUG=1',
- '_DEBUG=1',
- 'USING_CCTESTS=1',
+ # TODO: switch over to Chrome's SDK.
+ # Note: these must come last because we want our own npapi.h to take
+ # precedence.
+ '$PRIVATE_THIRD_PARTY_DIR/platformsdk_vc80/files/include',
+ '$PRIVATE_THIRD_PARTY_DIR/atlmfc_vc80/files/include',
],
-
+ CCFLAGS = [],
)
+if env['MODE'] == 'dbg':
+ env['CPPDEFINES'] += ['DEBUG=1']
+ env['CPPDEFINES'] += ['_DEBUG=1']
+if env['USING_CCTESTS']:
+ env['CPPDEFINES'] += ['USING_CCTESTS=1']
+if env['OFFICIAL_BUILD']:
+ env['CPPDEFINES'] += ['OFFICIAL_BUILD=1']
+
# TODO: if USING_PNG
env.Append(
CPPDEFINES = [
@@ -329,776 +113,47 @@ if env['PLATFORM'] == 'win32':
'_MERGE_PROXYSTUB',
'BREAKPAD_AVOID_STREAMS', # TODO: move to breakpad env
'XP_WIN',
+
+# In VC8, the way to disable exceptions is to remove all /EH* flags, and to
+# define _HAS_EXCEPTIONS=0 (for C++ headers) and _ATL_NO_EXCEPTIONS (for ATL).
+ '_HAS_EXCEPTIONS=0',
+ '_ATL_NO_EXCEPTIONS',
+# Do not export UTF functions.
+ 'U_STATIC_IMPLEMENTATION',
+
],
LINKFLAGS = [
+ '/NOLOGO',
+ '/DEBUG',
+ '/RELEASE',
+ '/NODEFAULTLIB:msvcrt',
# Set the preferred base address. This value was chosen because (a) it's near
# the top of the valid address range, and (b) it doesn't conflict with other
# DLLs loaded by Chrome in either the browser or plugin process.
'/BASE:0x65000000',
+# Flags for security hardening (only available for win32, not wince).
+ '/DYNAMICBASE',
+ '/SAFESEH',
],
- )
-
-env.Append(
- CPPFLAGS = [
- '/wd4018'
- ]
-)
-
-env_common = env.Clone()
-env_common.Prepend(
-)
-
-env_browser = env.Clone()
-env_browser.Prepend(
- CPPDEFINES = [
- 'BROWSER_${BROWSER}=1',
- ],
-)
-
-env_browser.Append(
- CPPPATH = [
-# '$LIBPNG_DIR',
-# '$SKIA_DIR/include',
-# '$SKIA_DIR/include/corecg',
-# '$SKIA_DIR/platform',
- ],
- LIBS = [
- 'base',
- 'gd',
- 'googleurl',
- 'icuuc',
- 'jpeg',
- 'modp_b64',
- 'png',
- 'portaudio',
- 'sqlite-gears',
-# 'skia',
- 'zlib-gears',
- ],
-)
-
-if env['BROWSER'] == 'IE':
- env_browser.Append(
- LIBS = [
- 'kernel32.lib',
- 'user32.lib',
- 'gdi32.lib',
- 'uuid.lib',
- 'sensapi.lib',
- 'shlwapi.lib',
- 'shell32.lib',
- 'advapi32.lib',
- 'wininet.lib',
- 'comdlg32.lib',
- 'user32.lib',
+ CPPFLAGS = [
+ '/MTd', # TODO: release mode
+ '/Zi', # TODO: Chrome defines /Z7, no idea what these are.
+ '/Zc:wchar_t-',
+ '/c',
+ '/W3',
+ '/WX',
+ '/GR-',
],
- )
-
-# Building resources.
-env_res = env_browser.Clone()
-env_res.Append(
- CPPDEFINES = [
- 'DEBUG=1',
- '_UNICODE',
- 'UNICODE',
- ],
- CPPPATH = [
- '$GENFILES_DIR',
- ],
-)
-
-if env['PLATFORM'] == 'win32':
- env.Append(
- RCFLAGS = [
- ['/l', '0x409'],
+ CXXFLAGS = [
+ '/TP',
+ '/J',
],
)
-
-# Input file lists
-
-def NewInputs():
- """Returns a new dictionary of input file lists.
-
- Browser-specific inputs are referenced by the browser name. All browsers
- include inputs from the 'all' list. 'common' inputs are built using
- env_common."""
-
- return {
- 'all': [],
- 'common': [],
- 'IE': [],
- 'FF2': [],
- 'FF3': [],
- 'NPAPI': [],
- 'SAFARI': [],
- }
-
-srcs = NewInputs()
-m4srcs = NewInputs()
-html_m4srcs = NewInputs()
-stabsrcs = NewInputs()
-idlsrcs = NewInputs()
-binsrcs = NewInputs()
-
-#-----------------------------------------------------------------------------
-# third_party/breakpad
-
-srcs['NPAPI'] += [
- '$THIRD_PARTY_DIR/breakpad/src/client/exception_handler_stub.cc',
-]
-
-srcs['IE'] += [
- '$THIRD_PARTY_DIR/breakpad/src/client/windows/handler/exception_handler.cc',
- '$THIRD_PARTY_DIR/breakpad/src/common/windows/guid_string.cc',
- '$OPEN_DIR/base/common/exception_handler_win32.cc',
-]
-
-#-----------------------------------------------------------------------------
-# third_party/v8/bindings
-
-srcs['NPAPI'] += [
- '$THIRD_PARTY_DIR/v8/bindings_local/npruntime.cc',
- '$THIRD_PARTY_DIR/v8/bindings_local/np_v8object.cc',
- '$THIRD_PARTY_DIR/v8/bindings_local/v8_helpers.cc',
- '$THIRD_PARTY_DIR/v8/bindings_local/v8_np_utils.cc',
- '$THIRD_PARTY_DIR/v8/bindings_local/v8_npobject.cc',
-]
-
-#-----------------------------------------------------------------------------
-# third_party/convert_utf
-
-srcs['all'] += [
- '$THIRD_PARTY_DIR/convert_utf/ConvertUTF.c'
-]
-
-#-----------------------------------------------------------------------------
-# third_party/jsoncpp
-
-srcs['all'] += [
- '$THIRD_PARTY_DIR/jsoncpp/json_reader.cc',
- '$THIRD_PARTY_DIR/jsoncpp/json_value.cc',
- '$THIRD_PARTY_DIR/jsoncpp/json_writer.cc',
-]
-
-#-----------------------------------------------------------------------------
-# third_party/modp_b64
-
-# We're using Chrome's version. Uncomment if that doesn't work.
-srcs['all'] += [
-# '$THIRD_PARTY_DIR/modp_b64/modp_b64.cc',
-]
-
-#-----------------------------------------------------------------------------
-# base/common
-
-m4srcs['common'] = [
- '$OPEN_DIR/base/common/product_constants.h.m4',
-]
-
-m4srcs['all'] = [
- '$OPEN_DIR/base/common/product_version.rc.m4'
-]
-
-srcs['all'] += [
- '$OPEN_DIR/base/common/async_router.cc',
- '$OPEN_DIR/base/common/base_class.cc',
- '$OPEN_DIR/base/common/base64.cc',
- '$OPEN_DIR/base/common/byte_store.cc',
- '$OPEN_DIR/base/common/byte_store_test.cc',
- '$OPEN_DIR/base/common/circular_buffer_test.cc',
- '$OPEN_DIR/base/common/database_name_table.cc',
- '$OPEN_DIR/base/common/event.cc',
- '$OPEN_DIR/base/common/event_test.cc',
- '$OPEN_DIR/base/common/file.cc',
- '$OPEN_DIR/base/common/file_test.cc',
- '$OPEN_DIR/base/common/html_event_monitor.cc',
- '$OPEN_DIR/base/common/http_utils.cc',
- '$OPEN_DIR/base/common/js_dom_element.cc',
- '$OPEN_DIR/base/common/js_marshal.cc',
- '$OPEN_DIR/base/common/js_runner_utils.cc',
- '$OPEN_DIR/base/common/js_types.cc',
- '$OPEN_DIR/base/common/leak_counter.cc',
- '$OPEN_DIR/base/common/memory_buffer.cc',
- '$OPEN_DIR/base/common/memory_buffer_test.cc',
- '$OPEN_DIR/base/common/message_queue.cc',
- '$OPEN_DIR/base/common/message_service.cc',
- '$OPEN_DIR/base/common/message_service_test.cc',
- '$OPEN_DIR/base/common/mime_detect.cc',
- '$OPEN_DIR/base/common/mutex.cc',
- '$OPEN_DIR/base/common/mutex_posix.cc',
- '$OPEN_DIR/base/common/mutex_test.cc',
- '$OPEN_DIR/base/common/mutex_win32.cc',
- '$OPEN_DIR/base/common/name_value_table.cc',
- '$OPEN_DIR/base/common/name_value_table_test.cc',
- '$OPEN_DIR/base/common/paths.cc',
- '$OPEN_DIR/base/common/permissions_db.cc',
- '$OPEN_DIR/base/common/permissions_db_test.cc',
- '$OPEN_DIR/base/common/permissions_manager.cc',
- '$OPEN_DIR/base/common/position_table.cc',
- '$OPEN_DIR/base/common/process_utils_win32.cc',
- '$OPEN_DIR/base/common/png_utils.cc',
- '$OPEN_DIR/base/common/scoped_refptr_test.cc',
- '$OPEN_DIR/base/common/security_model.cc',
- '$OPEN_DIR/base/common/security_model_test.cc',
- '$OPEN_DIR/base/common/serialization.cc',
- '$OPEN_DIR/base/common/serialization_test.cc',
- '$OPEN_DIR/base/common/shortcut_table.cc',
- '$OPEN_DIR/base/common/sqlite_wrapper.cc',
- '$OPEN_DIR/base/common/sqlite_wrapper_test.cc',
- '$OPEN_DIR/base/common/stopwatch.cc',
- '$OPEN_DIR/base/common/stopwatch_posix.cc',
- '$OPEN_DIR/base/common/stopwatch_win32.cc',
- '$OPEN_DIR/base/common/string16.cc',
- '$OPEN_DIR/base/common/string_utils.cc',
- '$OPEN_DIR/base/common/string_utils_osx.cc',
- '$OPEN_DIR/base/common/string_utils_test.cc',
- '$OPEN_DIR/base/common/thread.cc',
- '$OPEN_DIR/base/common/thread_locals.cc',
- '$OPEN_DIR/base/common/thread_posix.cc',
- '$OPEN_DIR/base/common/thread_win32.cc',
- '$OPEN_DIR/base/common/timed_call.cc',
- '$OPEN_DIR/base/common/timed_call_test.cc',
- '$OPEN_DIR/base/common/url_utils.cc',
- '$OPEN_DIR/base/common/url_utils_test.cc',
-]
-
-#-----------------------------------------------------------------------------
-# base/ie
-
-m4srcs['IE'] += [
- '$OPEN_DIR/base/ie/bho.rgs.m4',
- '$OPEN_DIR/base/ie/interfaces.idl.m4',
- '$OPEN_DIR/base/ie/module.rgs.m4',
-]
-
-idlsrcs['IE'] += [
- '$OPEN_DIR/base/ie/interfaces.idl',
-]
-
-srcs['IE'] += [
- '$OPEN_DIR/base/ie/activex_utils.cc',
- '$OPEN_DIR/base/ie/bho.cc',
- '$OPEN_DIR/base/common/detect_version_collision_win32.cc',
- '$OPEN_DIR/base/ie/dispatcher_to_idispatch.cc',
- '$OPEN_DIR/base/common/ipc_message_queue_null.cc',
- '$OPEN_DIR/base/common/ipc_message_queue_test.cc',
- '$OPEN_DIR/base/common/ipc_message_queue_test_win32.cc',
- '$OPEN_DIR/base/common/ipc_message_queue_win32.cc',
- '$OPEN_DIR/base/common/js_runner_ie.cc',
- '$OPEN_DIR/base/common/message_queue_ie.cc',
- '$OPEN_DIR/base/ie/module.cc',
- '$OPEN_DIR/base/ie/module_wrapper.cc',
- '$OPEN_DIR/base/common/paths_ie.cc',
- '$OPEN_DIR/base/common/time_utils_win32.cc',
- '$OPEN_DIR/base/common/vista_utils.cc',
-]
-
-if env['PLATFORM'] == 'win32':
- srcs['IE'] += [
- '$OPEN_DIR/base/common/file_win32.cc',
- '$OPEN_DIR/base/common/html_event_monitor_ie.cc',
- '$OPEN_DIR/base/ie/ie_version.cc',
- ]
-elif env['PLATFORM'] == 'wince':
- srcs['IE'] += [
- '$OPEN_DIR/base/common/common_ie.cc',
- '$OPEN_DIR/base/common/file_wince.cc',
- '$OPEN_DIR/base/common/wince_compatibility.cc',
- ]
-
-
-#-----------------------------------------------------------------------------
-# base/chrome + npapi
-
-srcs['NPAPI'] += [
- '$OPEN_DIR/base/chrome/module_cr.cc',
- '$OPEN_DIR/base/common/js_runner_cr.cc',
- '$OPEN_DIR/base/common/html_event_monitor_np.cc',
- '$OPEN_DIR/base/common/ipc_message_queue_linux.cc',
- '$OPEN_DIR/base/common/ipc_message_queue_null.cc',
- '$OPEN_DIR/base/common/ipc_message_queue_test.cc',
- '$OPEN_DIR/base/common/ipc_message_queue_test_linux.cc',
- '$OPEN_DIR/base/common/ipc_message_queue_test_win32.cc',
- '$OPEN_DIR/base/common/ipc_message_queue_win32.cc',
- '$OPEN_DIR/base/common/paths_cr.cc',
- '$OPEN_DIR/base/npapi/browser_utils.cc',
- '$OPEN_DIR/base/npapi/module.cc',
- '$OPEN_DIR/base/npapi/np_utils.cc',
- '$OPEN_DIR/base/npapi/npn_bindings.cc',
- '$OPEN_DIR/base/npapi/npp_bindings.cc',
- '$OPEN_DIR/base/npapi/plugin.cc',
-]
-
-if env['PLATFORM'] == 'win32':
- srcs['NPAPI'] += [
- '$OPEN_DIR/base/common/detect_version_collision_win32.cc',
- '$OPEN_DIR/base/common/file_win32.cc',
- '$OPEN_DIR/base/common/message_queue_ie.cc',
- '$OPEN_DIR/base/common/time_utils_win32.cc',
- '$OPEN_DIR/base/common/vista_utils.cc',
- '$OPEN_DIR/base/ie/ie_version.cc',
- ]
-
-#-----------------------------------------------------------------------------
-# console
-
-srcs['all'] += [
- '$OPEN_DIR/console/console.cc',
- '$OPEN_DIR/console/js_callback_logging_backend.cc',
-]
-
-#-----------------------------------------------------------------------------
-# canvas
-
-# The Canvas API is not yet enabled in official builds.
-if not env['OFFICIAL_BUILD'] and env['PLATFORM'] in ['win32', 'osx']:
- srcs['all'] += [
- '$OPEN_DIR/canvas/blob_backed_skia_input_stream.cc',
- '$OPEN_DIR/canvas/blob_backed_skia_output_stream.cc',
- '$OPEN_DIR/canvas/canvas.cc',
- '$OPEN_DIR/canvas/canvas_rendering_context_2d.cc',
- ]
-
-#-----------------------------------------------------------------------------
-# database
-
-srcs['all'] += [
- '$OPEN_DIR/database/database.cc',
- '$OPEN_DIR/database/database_utils.cc',
- '$OPEN_DIR/database/database_utils_test.cc',
- '$OPEN_DIR/database/result_set.cc',
-]
-
-#-----------------------------------------------------------------------------
-# database2
-
-srcs['all'] += [
- '$OPEN_DIR/database2/connection.cc',
- '$OPEN_DIR/database2/commands.cc',
- '$OPEN_DIR/database2/database2.cc',
- '$OPEN_DIR/database2/database2_common.cc',
- '$OPEN_DIR/database2/database2_metadata.cc',
- '$OPEN_DIR/database2/interpreter.cc',
- '$OPEN_DIR/database2/manager.cc',
- '$OPEN_DIR/database2/result_set2.cc',
- '$OPEN_DIR/database2/statement.cc',
- '$OPEN_DIR/database2/transaction.cc',
-]
-
-#-----------------------------------------------------------------------------
-# desktop
-
-srcs['all'] += [
- '$OPEN_DIR/desktop/desktop.cc',
- '$OPEN_DIR/desktop/desktop_linux.cc',
- '$OPEN_DIR/desktop/desktop_osx.cc',
- '$OPEN_DIR/desktop/desktop_test.cc',
- '$OPEN_DIR/desktop/desktop_win32.cc',
- '$OPEN_DIR/desktop/dll_data_wince.cc',
- '$OPEN_DIR/desktop/drag_and_drop_registry.cc',
- '$OPEN_DIR/desktop/notification_message_orderer.cc',
- '$OPEN_DIR/desktop/shortcut_utils_win32.cc',
-]
-
-srcs['NPAPI'] += [
- '$OPEN_DIR/desktop/desktop_cr.cc',
-]
-
-srcs['all'] += [
- '$OPEN_DIR/desktop/file_dialog.cc',
- '$OPEN_DIR/desktop/file_dialog_gtk.cc',
- '$OPEN_DIR/desktop/file_dialog_osx.cc',
- '$OPEN_DIR/desktop/file_dialog_win32.cc',
-]
-
-# The browser module also needs these files, to communicate with the notifier.
-srcs['all'] += [
- '$OPEN_DIR/notifier/const_notifier.cc',
- '$OPEN_DIR/notifier/notifier_process_linux.cc',
- '$OPEN_DIR/notifier/notifier_process_posix.cc',
- '$OPEN_DIR/notifier/notifier_process_win32.cc',
- '$OPEN_DIR/notifier/notifier_proxy.cc',
- '$OPEN_DIR/notifier/notifier_utils_win32.cc',
- '$OPEN_DIR/notifier/notification.cc',
-]
-
-srcs['FF3'] += [
- '$OPEN_DIR/desktop/drop_target_ff.cc',
-]
-
-srcs['IE'] += [
- '$OPEN_DIR/desktop/drop_target_ie.cc',
-]
-
-#-----------------------------------------------------------------------------
-# localserver/common
-
-srcs['all'] += [
- '$OPEN_DIR/localserver/common/blob_store.cc',
- '$OPEN_DIR/localserver/common/capture_task.cc',
- '$OPEN_DIR/localserver/common/file_store.cc',
- '$OPEN_DIR/localserver/common/http_constants.cc',
- '$OPEN_DIR/localserver/common/localserver.cc',
- '$OPEN_DIR/localserver/common/localserver_db.cc',
- '$OPEN_DIR/localserver/common/localserver_perf_test.cc',
- '$OPEN_DIR/localserver/common/managed_resource_store.cc',
- '$OPEN_DIR/localserver/common/manifest.cc',
- '$OPEN_DIR/localserver/common/resource_store.cc',
- '$OPEN_DIR/localserver/common/update_task.cc',
- '$OPEN_DIR/localserver/file_submitter.cc',
- '$OPEN_DIR/localserver/localserver_module.cc',
- '$OPEN_DIR/localserver/managed_resource_store_module.cc',
- '$OPEN_DIR/localserver/resource_store_module.cc',
-]
-
-srcs['IE'] += [
- '$OPEN_DIR/localserver/common/http_cookies.cc',
-]
-
-#-----------------------------------------------------------------------------
-# localserver/chrome + npapi
-# TODO: ie/ff/safari
-
-srcs['NPAPI'] += [
- '$OPEN_DIR/localserver/chrome/gears_protocol_handler.cc',
- '$OPEN_DIR/localserver/chrome/network_intercept_cr.cc',
- '$OPEN_DIR/localserver/chrome/http_cookies_cr.cc',
- '$OPEN_DIR/localserver/chrome/http_request_cr.cc',
- '$OPEN_DIR/localserver/chrome/update_task_cr.cc',
- '$OPEN_DIR/localserver/common/safe_http_request.cc',
- '$OPEN_DIR/localserver/npapi/async_task_np.cc',
-]
-
-#-----------------------------------------------------------------------------
-# localserver/ie
-
-srcs['IE'] += [
- '$OPEN_DIR/localserver/ie/async_task_ie.cc',
- '$OPEN_DIR/localserver/ie/file_submit_behavior.cc',
- '$OPEN_DIR/localserver/ie/http_handler_ie.cc',
- '$OPEN_DIR/localserver/ie/http_request_ie.cc',
- '$OPEN_DIR/localserver/common/progress_event.cc',
- '$OPEN_DIR/localserver/ie/progress_input_stream.cc',
- '$OPEN_DIR/localserver/ie/update_task_ie.cc',
- '$OPEN_DIR/localserver/ie/urlmon_utils.cc',
-]
-
-#-----------------------------------------------------------------------------
-# ui/chrome
-
-srcs['NPAPI'] += [
- '$OPEN_DIR/ui/chrome/settings_dialog_cr.cc',
- '$OPEN_DIR/ui/chrome/html_dialog_cr.cc',
-]
-
-#-----------------------------------------------------------------------------
-# installer
-
-m4srcs['common'] += [
- '$OPEN_DIR/installer/npapi_msi.wxs.m4',
-]
-
-#-----------------------------------------------------------------------------
-# dummy_module
-
-srcs['all'] += [
- '$OPEN_DIR/dummy/dummy_module.cc',
-]
-
-
-#-----------------------------------------------------------------------------
-# test
-
-srcs['all'] += [
- '$OPEN_DIR/cctests/test.cc',
-]
-
-#-----------------------------------------------------------------------------
-# ui/generated
-#
-# Anything with the _I18N suffix will be expanded for each language in
-# I18N_LANGS
-
-html_m4srcs['all'] += [
- '$OPEN_DIR/ui/common/permissions_dialog.html_m4',
- '$OPEN_DIR/ui/common/settings_dialog.html_m4',
- '$OPEN_DIR/ui/common/shortcuts_dialog.html_m4',
-]
-
-#TODO: $(IE_OUTDIR)/string_table.res
-
-#-----------------------------------------------------------------------------
-# ui/common (built for all browsers)
-
-srcs['all'] += [
- '$OPEN_DIR/ui/common/html_dialog.cc',
- '$OPEN_DIR/ui/common/i18n_strings.cc',
- '$OPEN_DIR/ui/common/permissions_dialog.cc',
- '$OPEN_DIR/ui/common/window_utils.cc',
-]
-
-srcs['IE'] += [
- '$OPEN_DIR/ui/common/settings_dialog.cc',
-]
-
-stabsrcs['all'] = [
- '$OPEN_DIR/ui/common/permissions_dialog.js.stab',
- '$OPEN_DIR/ui/common/settings_dialog.js.stab',
- '$OPEN_DIR/ui/common/shortcuts_dialog.js.stab',
-]
-
-#-----------------------------------------------------------------------------
-# ui/npapi
-# TODO: ie/ff/safari
-
-m4srcs['all'] += [
- '$OPEN_DIR/ui/ie/ui_resources.rc.m4',
-]
-
-#-----------------------------------------------------------------------------
-# ui/ie
-
-m4srcs['IE'] += [
- '$OPEN_DIR/ui/ie/tools_menu_item.rgs.m4',
- '$OPEN_DIR/ui/ie/ui_resources.rc.m4',
-]
-
-idlsrcs['IE'] += [
- '$OPEN_DIR/ui/ie/html_dialog_host.idl',
-]
-
-srcs['IE'] += [
- '$OPEN_DIR/ui/ie/html_dialog_ie.cc',
- '$OPEN_DIR/ui/ie/tools_menu_item.cc',
-]
-
-stabsrcs['IE'] += [
- '$OPEN_DIR/ui/ie/string_table.rc.stab',
-]
-
-# Additional files specific to Win32 or WinCE.
-if env['PLATFORM'] == 'win32':
- srcs['IE'] += [
- '$OPEN_DIR/ui/ie/html_dialog_host.cc',
- ]
-elif env['PLATFORM'] == 'wince':
- m4srcs['IE'] += [
- '$OPEN_DIR/ui/ie/html_dialog_bridge_iemobile.rgs.m4',
- ]
-
- idlsrcs['IE'] += [
- '$OPEN_DIR/ui/ie/html_dialog_host_iemobile.idl',
- '$OPEN_DIR/ui/ie/html_dialog_bridge_iemobile.idl',
- ]
-
- srcs['IE'] += [
- '$OPEN_DIR/ui/ie/html_dialog_host_iemobile.cc',
- '$OPEN_DIR/ui/ie/html_dialog_bridge_iemobile.cc',
- ]
-
-#-----------------------------------------------------------------------------
-# workerpool/npapi
-# TODO: ff/safari
-
-srcs['NPAPI'] += [
- '$OPEN_DIR/workerpool/common/workerpool_utils.cc',
- '$OPEN_DIR/workerpool/npapi/pool_threads_manager.cc',
- '$OPEN_DIR/workerpool/workerpool.cc',
-]
-
-#-----------------------------------------------------------------------------
-# workerpool/ie
-# TODO: ie/ff/safari
-
-srcs['IE'] += [
- '$OPEN_DIR/workerpool/common/workerpool_utils.cc',
- '$OPEN_DIR/workerpool/ie/pool_threads_manager.cc',
- '$OPEN_DIR/workerpool/workerpool.cc',
-]
-
-#-----------------------------------------------------------------------------
-# timer
-
-srcs['all'] += [
- '$OPEN_DIR/timer/timer.cc',
-]
-
-#-----------------------------------------------------------------------------
-# httprequest
-
-srcs['all'] += [
- '$OPEN_DIR/httprequest/httprequest.cc',
- '$OPEN_DIR/httprequest/httprequest_upload.cc',
-]
-
-#-----------------------------------------------------------------------------
-# blob
-
-srcs['all'] += [
- '$OPEN_DIR/blob/blob.cc',
- '$OPEN_DIR/blob/blob_builder.cc',
- '$OPEN_DIR/blob/blob_builder_module.cc',
- '$OPEN_DIR/blob/blob_interface.cc',
- '$OPEN_DIR/blob/blob_test.cc',
- '$OPEN_DIR/blob/blob_utils.cc',
- '$OPEN_DIR/blob/buffer_blob.cc',
- '$OPEN_DIR/blob/fail_blob.cc',
- '$OPEN_DIR/blob/file_blob.cc',
- '$OPEN_DIR/blob/join_blob.cc',
- '$OPEN_DIR/blob/slice_blob.cc',
-]
-
-# TODO(bpm): Make this cross-browser, not Firefox- or Safari-specific.
-#srcs['all'] += [
-# '$OPEN_DIR/blob/blob_input_stream_ff.cc',
-# '$OPEN_DIR/blob/blob_input_stream_ff_test.cc',
-#]
-#
-#srcs['all'] += [
-# '$OPEN_DIR/blob/blob_input_stream_sf.mm',
-# '$OPEN_DIR/blob/blob_input_stream_sf_test.mm',
-#]
-
-#-----------------------------------------------------------------------------
-# TODO: inspector
-
-if not env['OFFICIAL_BUILD']:
- srcs['all'] += [
- '$OPEN_DIR/inspector/inspector_resources.cc',
- ]
-
- binsrcs['common'] += [
- '$OPEN_DIR/inspector/console.html',
- '$OPEN_DIR/inspector/database.html',
- '$OPEN_DIR/inspector/index.html',
- '$OPEN_DIR/inspector/localserver.html',
- '$OPEN_DIR/inspector/common/alert-35.png',
- '$OPEN_DIR/inspector/common/database.gif',
- '$OPEN_DIR/inspector/common/error-35.png',
- '$OPEN_DIR/inspector/common/ie6hacks.css',
- '$OPEN_DIR/inspector/common/inspector_links.js',
- '$OPEN_DIR/inspector/common/lightbulb-35.png',
- '$OPEN_DIR/inspector/common/localserver.gif',
- '$OPEN_DIR/inspector/common/question-35.png',
- '$OPEN_DIR/inspector/common/styles.css',
- '$OPEN_DIR/inspector/common/workerpool.gif',
- '$OPEN_DIR/sdk/gears_init.js',
- '$OPEN_DIR/ui/common/base.js',
- '$OPEN_DIR/ui/common/dom.js',
- '$OPEN_DIR/ui/common/icon_32x32.png',
- ]
-
-#-----------------------------------------------------------------------------
-# image
-
-# The Image API is not yet enabled in official builds.
-if not env['OFFICIAL_BUILD'] and env['PLATFORM'] != 'wince':
- srcs['all'] += [
- '$OPEN_DIR/image/backing_image.cc',
- '$OPEN_DIR/image/image.cc',
- '$OPEN_DIR/image/image_loader.cc',
- ]
-
-#-----------------------------------------------------------------------------
-# factory/npapi
-# TODO: ff
-
-srcs['NPAPI'] += [
- '$OPEN_DIR/factory/factory_impl.cc',
- '$OPEN_DIR/factory/factory_np.cc',
- '$OPEN_DIR/factory/factory_utils.cc',
-]
-
-#-----------------------------------------------------------------------------
-# factory/ie
-
-m4srcs['IE'] += [
- '$OPEN_DIR/factory/factory_ie.rgs.m4',
-]
-
-srcs['IE'] += [
- '$OPEN_DIR/factory/factory_impl.cc',
- '$OPEN_DIR/factory/factory_ie.cc',
- '$OPEN_DIR/factory/factory_utils.cc',
-]
-
-#-----------------------------------------------------------------------------
-# geolocation
-
-srcs['all'] += [
- '$OPEN_DIR/geolocation/empty_device_data_provider.cc',
- '$OPEN_DIR/geolocation/geolocation.cc',
- '$OPEN_DIR/geolocation/geolocation_db.cc',
- '$OPEN_DIR/geolocation/geolocation_db_test.cc',
- '$OPEN_DIR/geolocation/geolocation_test.cc',
- '$OPEN_DIR/geolocation/gps_location_provider_wince.cc',
- '$OPEN_DIR/geolocation/location_provider.cc',
- '$OPEN_DIR/geolocation/location_provider_pool.cc',
- '$OPEN_DIR/geolocation/network_location_provider.cc',
- '$OPEN_DIR/geolocation/network_location_request.cc',
- '$OPEN_DIR/geolocation/radio_data_provider_wince.cc',
- '$OPEN_DIR/geolocation/timed_callback.cc',
- '$OPEN_DIR/geolocation/wifi_data_provider_android.cc',
- '$OPEN_DIR/geolocation/wifi_data_provider_common.cc',
- '$OPEN_DIR/geolocation/wifi_data_provider_linux.cc',
- '$OPEN_DIR/geolocation/wifi_data_provider_osx.cc',
- '$OPEN_DIR/geolocation/wifi_data_provider_win32.cc',
- '$OPEN_DIR/geolocation/wifi_data_provider_wince.cc',
- '$OPEN_DIR/geolocation/wifi_data_provider_windows_common.cc',
-]
-
-#-----------------------------------------------------------------------------
-# media
-
-# The Audio API has not been finalized for official builds.
-if not env['OFFICIAL_BUILD']:
- srcs['all'] += [
- '$OPEN_DIR/media/audio.cc',
- '$OPEN_DIR/media/audio_recorder.cc',
- '$OPEN_DIR/media/audio_recorder_test.cc',
- '$OPEN_DIR/media/base_audio_recorder.cc',
- '$OPEN_DIR/media/media.cc',
- '$OPEN_DIR/media/media_data.cc',
- '$OPEN_DIR/media/mock_audio_recorder.cc',
- '$OPEN_DIR/media/pa_audio_recorder.cc',
- '$OPEN_DIR/media/time_ranges.cc',
- ]
-
-#-----------------------------------------------------------------------------
-# resources
-
-dll_resources = [
- env_res.RES('$GENFILES_DIR/ui_resources.rc'),
-]
-
-if env['BROWSER'] == 'NPAPI':
- dll_resources += [env_res.RES('$OPEN_DIR/base/npapi/module.rc'),]
-elif env['BROWSER'] == 'IE':
- dll_resources += [env_res.RES('$OPEN_DIR/base/ie/module.rc'),]
-
-stabsrcs['all'] += [
- '$OPEN_DIR/ui/common/permissions_dialog.js.stab',
- '$OPEN_DIR/ui/common/settings_dialog.js.stab',
- '$OPEN_DIR/ui/common/shortcuts_dialog.js.stab',
-]
-
-#-----------------------------------------------------------------------------
-# libs
-
-libs = [
- '$THIRD_PARTY_DIR/v8/bin-dbg/libv8core.lib',
- '$THIRD_PARTY_DIR/v8/bin-dbg/no_snapshotv8.lib',
- '$THIRD_PARTY_DIR/v8/bin-dbg/libjscre.lib',
- '$THIRD_PARTY_DIR/skia/skia-dbg-win32-i386.lib',
-]
-
-if env['BROWSER'] == 'NPAPI':
- libs += ['$OPEN_DIR/base/chrome/module.def',]
-elif env['BROWSER'] == 'IE':
- libs += ['$OPEN_DIR/tools/mscom.def',]
+# Load all the components
sconscripts = [
+ 'SConscript.googleurl',
'SConscript.libgd',
'SConscript.libjpeg',
'SConscript.libpng',
@@ -1107,76 +162,13 @@ sconscripts = [
'SConscript.zlib',
]
-# TODO: all the other ports, including third-party libs
-# - IE, FF[23], SAFARI, android, symbian
-# - breakpad[_osx]
-# - glint
-# - growl
-# - spidermonkey
-# - libspeex
-# - libtremor
-# - vista broker
-# TODO: other targets
-# - installer
-# - notifier
-# - ipc_tests
-
-
-# Now build the dependency tree.
-
-# Add the target browser's inputs to the list files to build.
-srcs['all'] += srcs[env['BROWSER']]
-m4srcs['all'] += m4srcs[env['BROWSER']]
-html_m4srcs['all'] += html_m4srcs[env['BROWSER']]
-stabsrcs['all'] += stabsrcs[env['BROWSER']]
-idlsrcs['all'] += idlsrcs[env['BROWSER']]
-binsrcs['all'] += binsrcs[env['BROWSER']]
-
-# TODO: Is there a better way than this to do a make-style rule like
-# genfiles/%.html: %.html_m4
-m4s = []
-m4s += [env_common.M4(src) for src in m4srcs['common']]
-m4s += [env_browser.M4(src) for src in m4srcs['all']]
-installed_m4s = env_browser.Install('$GENFILES_DIR', m4s)
-
-html_m4s = [env_browser.M4(os.path.splitext(src)[0] + '.html', src)
- for src in html_m4srcs['all']]
-installed_html_m4s = env_browser.Install('$GENFILES_DIR', html_m4s)
-
-# genfiles/%.js: %.js.stab
-stabs = [env_browser.Stab(src) for src in stabsrcs['all']]
-installed_stabs = env_browser.Install('$GENFILES_DIR', stabs)
-
-# TODO: What's an elegant way to say "FOO.html_m4 depends on FOO.js" ?
-def IsSameBasename(a, b):
- return (os.path.basename(os.path.splitext(a)[0]) ==
- os.path.basename(os.path.splitext(b)[0]))
-
-for html_m4 in html_m4s:
- for stab in installed_stabs:
- if IsSameBasename(str(stab), str(html_m4[0])):
- env_browser.Depends(html_m4, stab)
-
-# genfiles/%.from_bin.cc: %
-bins = [env_common.Bin2cpp(src + '.from_bin.cc', src)
- for src in binsrcs['common']]
-installed_bins = env_common.Install('$GENFILES_DIR', bins)
-srcs['all'] += installed_bins
-
-# genfiles/%.h: %.idl
-# Note: the emitter fixes the targets to be put in genfiles.
-if idlsrcs['all']:
- idls = [env_browser.TypeLibrary(src)
- for src in idlsrcs['all']]
- installed_idls = idls
- srcs['all'] += [x for x in installed_idls[0] if str(x).endswith('_i.c')]
-
-# TODO: figure out why the .rc scanner doesn't notice these dependencies.
-env_browser.Depends(dll_resources[0], installed_html_m4s)
-env_browser.Depends(dll_resources[1], installed_m4s)
-
-env_browser.SConscript(sconscripts, exports=['env'])
+for each in sconscripts:
+ env.SConscript(each,
+ exports=['env'],
+ variant_dir=env.subst('$MODE/common').lower(),
+ duplicate=0)
-lib = env_browser.ChromeSharedLibrary('gears',
- srcs['all'] + libs + dll_resources)
-env_browser.Alias('gears', lib)
+env.SConscript('SConscript.dll',
+ exports=['env'],
+ variant_dir=env.subst('$MODE/$BROWSER').lower(),
+ duplicate=0)
diff --git a/gears/SConscript.dll b/gears/SConscript.dll
new file mode 100644
index 0000000..699b0ae
--- /dev/null
+++ b/gears/SConscript.dll
@@ -0,0 +1,1218 @@
+# Copyright (c) 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.
+
+import os
+import re
+
+Import('env')
+
+env = env.Clone()
+
+# Notes:
+# This assumes you have a working gears checkout from p4 in the current dir.
+# Steps for this:
+# > echo %USER%-chromegears > p4config
+# > g4 client -p //depot/googleclient/gears/p4_depot_paths
+# > g4 sync
+#
+# This is a work-in-progress conversion of the current Gears set of Makefiles.
+# A lot of the stuff doesn't translate to SCons-land well, and I'm not sure
+# how faithful we want to be to the original.
+#
+# Questions:
+# Should we flatten the output directory into
+# Hammer/gears/platform/browser/*.obj like Gears does now? If so, how?
+
+# TODO: move all these builders out to site_scons or somesuch.
+# Building M4 files
+
+env.Tool('m4')
+
+# Add GNU tools to the PATH.
+# TODO: Figure out the right way to do this. On first invocation, PATH
+# is relative to '.'. On repeated invocations (when Hammer/gears exists),
+# PATH is relative to './Hammer/gears'.
+# TODO: Also it would be nice to use $THIRD_PARTY_DIR instead of hardcoding
+# it here.
+env.PrependENVPath('PATH', os.path.abspath(
+ 'googleclient/third_party/gnu/files'))
+env.PrependENVPath('PATH', os.path.abspath(
+ '../../../../googleclient/third_party/gnu/files'))
+env.PrependENVPath('PATH', os.path.abspath(
+ 'googleclient/third_party/python_24'))
+env.PrependENVPath('PATH', os.path.abspath(
+ '../../../../googleclient/third_party/python_24'))
+
+i18n_langs = [
+ 'en-US',
+ 'ar',
+ 'bg',
+ 'ca',
+ 'cs',
+ 'da',
+ 'de',
+ 'el',
+ 'en-GB',
+ 'es',
+ 'et',
+ 'fa',
+ 'fi',
+ 'fil',
+ 'fr',
+ 'he',
+ 'hi',
+ 'hr',
+ 'hu',
+ 'id',
+ 'is',
+ 'it',
+ 'ja',
+ 'ko',
+ 'lt',
+ 'lv',
+ 'ms',
+ 'nl',
+ 'no',
+ 'pl',
+ 'pt-BR',
+ 'pt-PT',
+ 'ro',
+ 'ru',
+ 'sk',
+ 'sl',
+ 'sr',
+ 'sv',
+ 'th',
+ 'tr',
+ 'uk',
+ 'ur',
+ 'vi',
+ 'zh-CN',
+ 'zh-TW',
+ 'ml',
+ 'te',
+ 'gu',
+ 'kn',
+ 'or',
+ 'bn',
+ 'ta',
+ 'mr',
+]
+
+# TODO: DEBUG, OFFICIAL_BUILD, CCTESTS, I18N_LANGUAGES
+env.Prepend(
+ M4FLAGS = [
+ '--prefix-builtins',
+ '-DDEBUG=1',
+ '-DPRODUCT_VERSION=$VERSION',
+ '-DPRODUCT_VERSION_MAJOR=$MAJOR',
+ '-DPRODUCT_VERSION_MINOR=$MINOR',
+ '-DPRODUCT_VERSION_BUILD=$BUILD',
+ '-DPRODUCT_VERSION_PATCH=$PATCH',
+ '-DPRODUCT_OS=$OS',
+ '-DPRODUCT_ARCH=$ARCH',
+ '-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',
+ '$GEARS_DIR',
+ ],
+)
+
+# SCons magic to make M4PATH work.
+env['M4INCPREFIX'] = '-I'
+env['M4INCSUFFIX'] = ''
+env['_M4INCFLAGS'] = ('${_concat(M4INCPREFIX, M4PATH, M4INCSUFFIX, ' +
+ '__env__, RDirs, TARGET, SOURCE)}')
+env['M4COM'] = '$M4 $M4FLAGS ${_M4INCFLAGS} $SOURCE > $TARGET'
+
+# TODO: Dependency scanner for m4 files - doesn't work.
+#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)
+
+
+# Building .stab files, using M4FLAGS.
+
+# TODO: I want to just use $OPEN_DIR/tools/parse_stab.py. I need a way to
+# convert from build dir to src dir. ${OPEN_DIR.srcdir} doesn't work.
+env['STAB'] = 'python googleclient/gears/opensource/gears/tools/parse_stab.py'
+env['STRIPPED_GEARS_DIR'] = env.Dir('$GEARS_DIR')
+env['I18N_INPUTS_BASEDIR'] = '$STRIPPED_GEARS_DIR/ui/generated'
+env['STABCOM'] = \
+ '$STAB $M4FLAGS ${_M4INCFLAGS} $TARGET $SOURCE $I18N_INPUTS_BASEDIR'
+stab_builder = Builder(action = '$STABCOM', src_suffix = '.stab')
+env.Append(BUILDERS = {'Stab': stab_builder})
+
+# Building .from_bin.cc files.
+
+# Must be run from within the gears dir.
+# TODO: ${SOURCE[36:]} - is this the best way to strip off the dir I cd'ed to?
+env['BIN2CPP'] = \
+ 'cd googleclient/gears/opensource/gears && python tools/bin2cpp.py'
+env['BIN2CPPCOM'] = '$BIN2CPP ${str(SOURCE)[36:]} > ${TARGET.abspath}'
+bin2cpp_builder = Builder(action = '$BIN2CPPCOM')
+env.Append(BUILDERS = {'Bin2cpp': bin2cpp_builder})
+
+
+# Building .idl files.
+# This is a total mess. MIDL needs to be run from $OPEN_DIR because it's too
+# stupid to apply its include paths to a relative path like "ui/ie/bla.idl"
+# (it only looks in the current dir). So we have to jump through hoops to fix
+# up our relative include paths and output files.
+
+if env['BROWSER'] == 'IE':
+ env['IDLOUTPUTDIR'] = env.Dir('$GENFILES_DIR')
+ env['IDLINCPREFIX'] = '/I../../../../'
+ env['IDLINCSUFFIX'] = ''
+ env['_IDLINCFLAGS'] = ('${_concat(IDLINCPREFIX, CPPPATH, IDLINCSUFFIX, ' +
+ '__env__, RDirs, TARGET, SOURCE)}')
+ env['IDLDEFPREFIX'] = '/D'
+ env['IDLDEFSUFFIX'] = ''
+ env['_IDLDEFFLAGS'] = ('${_defines(IDLDEFPREFIX, CPPDEFINES, ' +
+ 'IDLDEFSUFFIX, __env__)}')
+ env['MIDLCOM'] = (
+ 'cd googleclient/gears/opensource/gears && $MIDL ' +
+ '${_IDLDEFFLAGS} ${_IDLINCFLAGS} -env win32 -Oicf ' +
+ '/tlb ../../../../$IDLOUTPUTDIR/${TARGET.filebase}.tlb ' +
+ '/h ../../../../$IDLOUTPUTDIR/${TARGET.filebase}.h ' +
+ '/iid ../../../../$IDLOUTPUTDIR/${TARGET.filebase}_i.c ' +
+ '/proxy ../../../../$IDLOUTPUTDIR/${TARGET.filebase}_p.c ' +
+ '/dlldata ../../../../$IDLOUTPUTDIR/${TARGET.filebase}_data.c ' +
+ '../../../../$SOURCE'
+ )
+elif env['BROWSER'] in ['FF2', 'FF3']:
+ env['IDLOUTPUTDIR'] = env.Dir('$GENFILES_DIR')
+ if env['BROWSER'] == 'FF2':
+ env['GECKO_BASE'] = '$THIRD_PARTY_DIR/gecko_1.8'
+ else:
+ env['GECKO_BASE'] = '$THIRD_PARTY_DIR/gecko_1.9'
+ env['GECKO_SDK'] = '$GECKO_BASE/$OS'
+ env['GECKO_BIN'] = '$GECKO_SDK/gecko_sdk/bin'
+ env['GECKO_LIB'] = '$GECKO_SDK/gecko_sdk/lib'
+
+ env.PrependENVPath('PATH', os.path.abspath(
+ env.subst('../../../../$GECKO_BIN')))
+ env['MIDLCOM'] = (
+ 'xpidl -I $GECKO_SDK/gecko_sdk/idl -I $GECKO_BASE ' +
+ '-m header -o $IDLOUTPUTDIR/${TARGET.filebase} $SOURCE && '
+ 'xpidl -I $GECKO_SDK/gecko_sdk/idl -I $GECKO_BASE ' +
+ '-m typelib -o $IDLOUTPUTDIR/${TARGET.filebase} $SOURCE'
+ )
+
+# Here's a quick hack to remove the .tlb file from the list of targets. Some
+# of our IDL compiles don't generate one, so we don't a false dependency.
+# TODO(sgk): clean up this mess!
+import SCons.Builder
+def MyIdlEmitter(target, source, env):
+ if 'xpidl' in env['MIDLCOM']:
+ # Firefox's IDL compiler only generates .h and .xpt files.
+ t = [target[1], os.path.splitext(str(target[1]))[0] + '.xpt']
+ else:
+ # HACK to remove .tlb file unilaterally - note that some IDLs generate a
+ # .tlb file, but not all.
+ t = target[1:]
+ # Write the output to the right directory. This is mostly because
+ # the generated html_dialog_host.h conflicts with the real
+ # html_dialog_host.h in the same directory (otherwise we could just use
+ # Install()).
+ t = [os.path.join(str(env.Dir('$IDLOUTPUTDIR')), os.path.basename(x))
+ for x in t]
+ return (t, source)
+b = env['BUILDERS']['TypeLibrary']
+emitter_list = [b.emitter, MyIdlEmitter]
+b.emitter = SCons.Builder.ListEmitter(emitter_list)
+
+# C++ defines
+
+env_common = env.Clone()
+env_common.Prepend(
+)
+
+env_browser = env.Clone()
+env_browser.Prepend(
+ CPPDEFINES = [
+ 'BROWSER_${BROWSER}=1',
+ ],
+)
+
+if env['BROWSER'] in ['FF2', 'FF3']:
+ env_browser['CPPDEFINES'] += ['BROWSER_FF=1']
+ env_browser.Prepend(
+ CPPDEFINES = [
+# TODO(cprince): Update source files so we don't need this compatibility define?
+ 'BROWSER_FF=1',
+ 'MOZILLA_STRICT_API',
+# SpiderMonkey (the Firefox JS engine)'s JS_GET_CLASS macro in jsapi.h needs
+# this defined to work with the gecko SDK that we've built.
+# The definition of JS_THREADSAFE must be kept in sync with MOZJS_CPPFLAGS.
+ 'JS_THREADSAFE',
+ ],
+ CPPPATH = [
+ '$GECKO_BASE',
+ '$GECKO_SDK',
+ '$GECKO_SDK/gecko_sdk/include',
+ ],
+ )
+
+env_browser.Append(
+ CPPPATH = [
+# '$LIBPNG_DIR',
+# '$SKIA_DIR/include',
+# '$SKIA_DIR/include/corecg',
+# '$SKIA_DIR/platform',
+ ],
+ LIBS = [
+ 'base',
+ 'gd',
+ 'googleurl-gears',
+ 'icuuc',
+ 'jpeg',
+ 'modp_b64',
+ 'png',
+ 'portaudio',
+ 'sqlite-gears',
+# 'skia',
+ 'zlib-gears',
+ ],
+)
+
+if env['BROWSER'] == 'IE':
+ env_browser.Append(
+ LIBS = [
+ 'kernel32.lib',
+ 'user32.lib',
+ 'gdi32.lib',
+ 'uuid.lib',
+ 'sensapi.lib',
+ 'shlwapi.lib',
+ 'shell32.lib',
+ 'advapi32.lib',
+ 'wininet.lib',
+ 'comdlg32.lib',
+ 'user32.lib',
+ ],
+ )
+elif env['BROWSER'] in ['FF2', 'FF3']:
+ env_browser.Append(
+ LIBS = [
+ '$GECKO_LIB/xpcom.lib',
+ '$GECKO_LIB/xpcomglue_s.lib',
+ '$GECKO_LIB/nspr4.lib',
+ '$GECKO_LIB/js3250.lib',
+ 'ole32.lib',
+ 'shell32.lib',
+ 'shlwapi.lib',
+ 'advapi32.lib',
+ 'wininet.lib',
+ 'comdlg32.lib',
+ 'user32.lib',
+ ],
+ )
+
+env_browser.Append(
+)
+
+# Building resources.
+env_res = env_browser.Clone()
+env_res.Append(
+ CPPDEFINES = [
+ 'DEBUG=1',
+ '_UNICODE',
+ 'UNICODE',
+ ],
+ CPPPATH = [
+ '$GENFILES_DIR',
+ ],
+)
+
+if env['PLATFORM'] == 'win32':
+ env.Append(
+ RCFLAGS = [
+ ['/l', '0x409'],
+ ],
+ )
+
+if env['PLATFORM'] == 'win32':
+ env_browser.Append(
+ CPPFLAGS = [
+ '/wd4018' # TODO: move to breakpad
+ ],
+ )
+
+# Input file lists
+
+def NewInputs():
+ """Returns a new dictionary of input file lists.
+
+ Browser-specific inputs are referenced by the browser name. All browsers
+ include inputs from the 'all' list. 'common' inputs are built using
+ env_common."""
+
+ return {
+ 'all': [],
+ 'common': [],
+ 'IE': [],
+ 'FF2': [],
+ 'FF3': [],
+ 'NPAPI': [],
+ 'SF': [],
+ }
+
+srcs = NewInputs()
+m4srcs = NewInputs()
+html_m4srcs = NewInputs()
+stabsrcs = NewInputs()
+idlsrcs = NewInputs()
+binsrcs = NewInputs()
+
+#-----------------------------------------------------------------------------
+# third_party/breakpad
+
+srcs['NPAPI'] += [
+ '$THIRD_PARTY_DIR/breakpad/src/client/exception_handler_stub.cc',
+]
+
+srcs['IE'] += [
+ '$THIRD_PARTY_DIR/breakpad/src/client/windows/handler/exception_handler.cc',
+ '$THIRD_PARTY_DIR/breakpad/src/common/windows/guid_string.cc',
+ '$OPEN_DIR/base/common/exception_handler_win32.cc',
+]
+
+srcs['FF3'] += [
+ '$THIRD_PARTY_DIR/breakpad/src/client/windows/handler/exception_handler.cc',
+ '$THIRD_PARTY_DIR/breakpad/src/common/windows/guid_string.cc',
+ '$OPEN_DIR/base/common/exception_handler_win32.cc',
+]
+
+#-----------------------------------------------------------------------------
+# third_party/v8/bindings
+
+srcs['NPAPI'] += [
+ '$THIRD_PARTY_DIR/v8/bindings_local/npruntime.cc',
+ '$THIRD_PARTY_DIR/v8/bindings_local/np_v8object.cc',
+ '$THIRD_PARTY_DIR/v8/bindings_local/v8_helpers.cc',
+ '$THIRD_PARTY_DIR/v8/bindings_local/v8_np_utils.cc',
+ '$THIRD_PARTY_DIR/v8/bindings_local/v8_npobject.cc',
+]
+
+#-----------------------------------------------------------------------------
+# third_party/convert_utf
+
+srcs['all'] += [
+ '$THIRD_PARTY_DIR/convert_utf/ConvertUTF.c'
+]
+
+#-----------------------------------------------------------------------------
+# third_party/jsoncpp
+
+srcs['all'] += [
+ '$THIRD_PARTY_DIR/jsoncpp/json_reader.cc',
+ '$THIRD_PARTY_DIR/jsoncpp/json_value.cc',
+ '$THIRD_PARTY_DIR/jsoncpp/json_writer.cc',
+]
+
+#-----------------------------------------------------------------------------
+# third_party/modp_b64
+
+# We're using Chrome's version. Uncomment if that doesn't work.
+srcs['all'] += [
+# '$THIRD_PARTY_DIR/modp_b64/modp_b64.cc',
+]
+
+#-----------------------------------------------------------------------------
+# base/common
+
+m4srcs['common'] = [
+ '$OPEN_DIR/base/common/product_constants.h.m4',
+]
+
+m4srcs['all'] = [
+ '$OPEN_DIR/base/common/product_version.rc.m4'
+]
+
+srcs['all'] += [
+ '$OPEN_DIR/base/common/async_router.cc',
+ '$OPEN_DIR/base/common/base_class.cc',
+ '$OPEN_DIR/base/common/base64.cc',
+ '$OPEN_DIR/base/common/byte_store.cc',
+ '$OPEN_DIR/base/common/byte_store_test.cc',
+ '$OPEN_DIR/base/common/circular_buffer_test.cc',
+ '$OPEN_DIR/base/common/database_name_table.cc',
+ '$OPEN_DIR/base/common/event.cc',
+ '$OPEN_DIR/base/common/event_test.cc',
+ '$OPEN_DIR/base/common/file.cc',
+ '$OPEN_DIR/base/common/file_test.cc',
+ '$OPEN_DIR/base/common/html_event_monitor.cc',
+ '$OPEN_DIR/base/common/http_utils.cc',
+ '$OPEN_DIR/base/common/js_dom_element.cc',
+ '$OPEN_DIR/base/common/js_marshal.cc',
+ '$OPEN_DIR/base/common/js_runner_utils.cc',
+ '$OPEN_DIR/base/common/js_types.cc',
+ '$OPEN_DIR/base/common/leak_counter.cc',
+ '$OPEN_DIR/base/common/memory_buffer.cc',
+ '$OPEN_DIR/base/common/memory_buffer_test.cc',
+ '$OPEN_DIR/base/common/message_queue.cc',
+ '$OPEN_DIR/base/common/message_service.cc',
+ '$OPEN_DIR/base/common/message_service_test.cc',
+ '$OPEN_DIR/base/common/mime_detect.cc',
+ '$OPEN_DIR/base/common/mutex.cc',
+ '$OPEN_DIR/base/common/mutex_posix.cc',
+ '$OPEN_DIR/base/common/mutex_test.cc',
+ '$OPEN_DIR/base/common/mutex_win32.cc',
+ '$OPEN_DIR/base/common/name_value_table.cc',
+ '$OPEN_DIR/base/common/name_value_table_test.cc',
+ '$OPEN_DIR/base/common/paths.cc',
+ '$OPEN_DIR/base/common/permissions_db.cc',
+ '$OPEN_DIR/base/common/permissions_db_test.cc',
+ '$OPEN_DIR/base/common/permissions_manager.cc',
+ '$OPEN_DIR/base/common/position_table.cc',
+ '$OPEN_DIR/base/common/process_utils_win32.cc',
+ '$OPEN_DIR/base/common/png_utils.cc',
+ '$OPEN_DIR/base/common/scoped_refptr_test.cc',
+ '$OPEN_DIR/base/common/security_model.cc',
+ '$OPEN_DIR/base/common/security_model_test.cc',
+ '$OPEN_DIR/base/common/serialization.cc',
+ '$OPEN_DIR/base/common/serialization_test.cc',
+ '$OPEN_DIR/base/common/shortcut_table.cc',
+ '$OPEN_DIR/base/common/sqlite_wrapper.cc',
+ '$OPEN_DIR/base/common/sqlite_wrapper_test.cc',
+ '$OPEN_DIR/base/common/stopwatch.cc',
+ '$OPEN_DIR/base/common/stopwatch_posix.cc',
+ '$OPEN_DIR/base/common/stopwatch_win32.cc',
+ '$OPEN_DIR/base/common/string16.cc',
+ '$OPEN_DIR/base/common/string_utils.cc',
+ '$OPEN_DIR/base/common/string_utils_osx.cc',
+ '$OPEN_DIR/base/common/string_utils_test.cc',
+ '$OPEN_DIR/base/common/thread.cc',
+ '$OPEN_DIR/base/common/thread_locals.cc',
+ '$OPEN_DIR/base/common/thread_posix.cc',
+ '$OPEN_DIR/base/common/thread_win32.cc',
+ '$OPEN_DIR/base/common/timed_call.cc',
+ '$OPEN_DIR/base/common/timed_call_test.cc',
+ '$OPEN_DIR/base/common/url_utils.cc',
+ '$OPEN_DIR/base/common/url_utils_test.cc',
+]
+
+#-----------------------------------------------------------------------------
+# base/firefox
+
+m4srcs['FF3'] += [
+ '$OPEN_DIR/base/firefox/install.rdf.m4',
+]
+
+idlsrcs['FF3'] += [
+ '$OPEN_DIR/base/firefox/interfaces.idl',
+]
+
+srcs['FF3'] += [
+ '$OPEN_DIR/base/common/file_posix.cc',
+ '$OPEN_DIR/base/common/file_win32.cc',
+ '$OPEN_DIR/base/common/html_event_monitor_ff.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_linux.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_null.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_test.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_test_linux.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_test_win32.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_win32.cc',
+ '$OPEN_DIR/base/common/js_runner_ff.cc',
+ '$OPEN_DIR/base/common/js_runner_ff_marshaling.cc',
+ '$OPEN_DIR/base/common/message_queue_ff.cc',
+ '$OPEN_DIR/base/common/paths_ff.cc',
+ '$OPEN_DIR/base/common/time_utils_win32.cc',
+ '$OPEN_DIR/base/firefox/dom_utils.cc',
+ '$OPEN_DIR/base/firefox/module.cc',
+ '$OPEN_DIR/base/firefox/ns_file_utils.cc',
+ '$OPEN_DIR/base/firefox/xpcom_dynamic_load.cc',
+]
+
+#-----------------------------------------------------------------------------
+# base/ie
+
+m4srcs['IE'] += [
+ '$OPEN_DIR/base/ie/bho.rgs.m4',
+ '$OPEN_DIR/base/ie/interfaces.idl.m4',
+ '$OPEN_DIR/base/ie/module.rgs.m4',
+]
+
+idlsrcs['IE'] += [
+ '$OPEN_DIR/base/ie/interfaces.idl',
+]
+
+srcs['IE'] += [
+ '$OPEN_DIR/base/ie/activex_utils.cc',
+ '$OPEN_DIR/base/ie/bho.cc',
+ '$OPEN_DIR/base/common/detect_version_collision_win32.cc',
+ '$OPEN_DIR/base/ie/dispatcher_to_idispatch.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_null.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_test.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_test_win32.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_win32.cc',
+ '$OPEN_DIR/base/common/js_runner_ie.cc',
+ '$OPEN_DIR/base/common/message_queue_ie.cc',
+ '$OPEN_DIR/base/ie/module.cc',
+ '$OPEN_DIR/base/ie/module_wrapper.cc',
+ '$OPEN_DIR/base/common/paths_ie.cc',
+ '$OPEN_DIR/base/common/time_utils_win32.cc',
+ '$OPEN_DIR/base/common/vista_utils.cc',
+]
+
+if env['PLATFORM'] == 'win32':
+ srcs['IE'] += [
+ '$OPEN_DIR/base/common/file_win32.cc',
+ '$OPEN_DIR/base/common/html_event_monitor_ie.cc',
+ '$OPEN_DIR/base/ie/ie_version.cc',
+ ]
+elif env['PLATFORM'] == 'wince':
+ srcs['IE'] += [
+ '$OPEN_DIR/base/common/common_ie.cc',
+ '$OPEN_DIR/base/common/file_wince.cc',
+ '$OPEN_DIR/base/common/wince_compatibility.cc',
+ ]
+
+#-----------------------------------------------------------------------------
+# base/chrome + npapi
+
+srcs['NPAPI'] += [
+ '$OPEN_DIR/base/chrome/module_cr.cc',
+ '$OPEN_DIR/base/common/js_runner_cr.cc',
+ '$OPEN_DIR/base/common/html_event_monitor_np.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_linux.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_null.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_test.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_test_linux.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_test_win32.cc',
+ '$OPEN_DIR/base/common/ipc_message_queue_win32.cc',
+ '$OPEN_DIR/base/common/paths_cr.cc',
+ '$OPEN_DIR/base/npapi/browser_utils.cc',
+ '$OPEN_DIR/base/npapi/module.cc',
+ '$OPEN_DIR/base/npapi/np_utils.cc',
+ '$OPEN_DIR/base/npapi/npn_bindings.cc',
+ '$OPEN_DIR/base/npapi/npp_bindings.cc',
+ '$OPEN_DIR/base/npapi/plugin.cc',
+]
+
+if env['PLATFORM'] == 'win32':
+ srcs['NPAPI'] += [
+ '$OPEN_DIR/base/common/detect_version_collision_win32.cc',
+ '$OPEN_DIR/base/common/file_win32.cc',
+ '$OPEN_DIR/base/common/message_queue_ie.cc',
+ '$OPEN_DIR/base/common/time_utils_win32.cc',
+ '$OPEN_DIR/base/common/vista_utils.cc',
+ '$OPEN_DIR/base/ie/ie_version.cc',
+ ]
+
+#-----------------------------------------------------------------------------
+# console
+
+srcs['all'] += [
+ '$OPEN_DIR/console/console.cc',
+ '$OPEN_DIR/console/js_callback_logging_backend.cc',
+]
+
+#-----------------------------------------------------------------------------
+# canvas
+
+# The Canvas API is not yet enabled in official builds.
+if not env['OFFICIAL_BUILD'] and env['PLATFORM'] in ['win32', 'osx']:
+ srcs['all'] += [
+ '$OPEN_DIR/canvas/blob_backed_skia_input_stream.cc',
+ '$OPEN_DIR/canvas/blob_backed_skia_output_stream.cc',
+ '$OPEN_DIR/canvas/canvas.cc',
+ '$OPEN_DIR/canvas/canvas_rendering_context_2d.cc',
+ ]
+
+#-----------------------------------------------------------------------------
+# database
+
+srcs['all'] += [
+ '$OPEN_DIR/database/database.cc',
+ '$OPEN_DIR/database/database_utils.cc',
+ '$OPEN_DIR/database/database_utils_test.cc',
+ '$OPEN_DIR/database/result_set.cc',
+]
+
+#-----------------------------------------------------------------------------
+# database2
+
+srcs['all'] += [
+ '$OPEN_DIR/database2/connection.cc',
+ '$OPEN_DIR/database2/commands.cc',
+ '$OPEN_DIR/database2/database2.cc',
+ '$OPEN_DIR/database2/database2_common.cc',
+ '$OPEN_DIR/database2/database2_metadata.cc',
+ '$OPEN_DIR/database2/interpreter.cc',
+ '$OPEN_DIR/database2/manager.cc',
+ '$OPEN_DIR/database2/result_set2.cc',
+ '$OPEN_DIR/database2/statement.cc',
+ '$OPEN_DIR/database2/transaction.cc',
+]
+
+#-----------------------------------------------------------------------------
+# desktop
+
+srcs['all'] += [
+ '$OPEN_DIR/desktop/desktop.cc',
+ '$OPEN_DIR/desktop/desktop_linux.cc',
+ '$OPEN_DIR/desktop/desktop_osx.cc',
+ '$OPEN_DIR/desktop/desktop_test.cc',
+ '$OPEN_DIR/desktop/desktop_win32.cc',
+ '$OPEN_DIR/desktop/dll_data_wince.cc',
+ '$OPEN_DIR/desktop/drag_and_drop_registry.cc',
+ '$OPEN_DIR/desktop/notification_message_orderer.cc',
+ '$OPEN_DIR/desktop/shortcut_utils_win32.cc',
+]
+
+srcs['NPAPI'] += [
+ '$OPEN_DIR/desktop/desktop_cr.cc',
+]
+
+srcs['all'] += [
+ '$OPEN_DIR/desktop/file_dialog.cc',
+ '$OPEN_DIR/desktop/file_dialog_gtk.cc',
+ '$OPEN_DIR/desktop/file_dialog_osx.cc',
+ '$OPEN_DIR/desktop/file_dialog_win32.cc',
+]
+
+# The browser module also needs these files, to communicate with the notifier.
+srcs['all'] += [
+ '$OPEN_DIR/notifier/const_notifier.cc',
+ '$OPEN_DIR/notifier/notifier_process_linux.cc',
+ '$OPEN_DIR/notifier/notifier_process_posix.cc',
+ '$OPEN_DIR/notifier/notifier_process_win32.cc',
+ '$OPEN_DIR/notifier/notifier_proxy.cc',
+ '$OPEN_DIR/notifier/notifier_utils_win32.cc',
+ '$OPEN_DIR/notifier/notification.cc',
+]
+
+srcs['FF3'] += [
+ '$OPEN_DIR/desktop/drop_target_ff.cc',
+]
+
+srcs['IE'] += [
+ '$OPEN_DIR/desktop/drop_target_ie.cc',
+]
+
+#-----------------------------------------------------------------------------
+# localserver/common
+
+srcs['all'] += [
+ '$OPEN_DIR/localserver/common/blob_store.cc',
+ '$OPEN_DIR/localserver/common/capture_task.cc',
+ '$OPEN_DIR/localserver/common/file_store.cc',
+ '$OPEN_DIR/localserver/common/http_constants.cc',
+ '$OPEN_DIR/localserver/common/localserver.cc',
+ '$OPEN_DIR/localserver/common/localserver_db.cc',
+ '$OPEN_DIR/localserver/common/localserver_perf_test.cc',
+ '$OPEN_DIR/localserver/common/managed_resource_store.cc',
+ '$OPEN_DIR/localserver/common/manifest.cc',
+ '$OPEN_DIR/localserver/common/resource_store.cc',
+ '$OPEN_DIR/localserver/common/update_task.cc',
+ '$OPEN_DIR/localserver/common/update_task_single_process.cc',
+ '$OPEN_DIR/localserver/file_submitter.cc',
+ '$OPEN_DIR/localserver/localserver_module.cc',
+ '$OPEN_DIR/localserver/managed_resource_store_module.cc',
+ '$OPEN_DIR/localserver/resource_store_module.cc',
+]
+
+srcs['IE'] += [
+ '$OPEN_DIR/localserver/common/http_cookies.cc',
+]
+
+srcs['FF3'] += [
+ '$OPEN_DIR/localserver/common/http_cookies.cc',
+]
+
+#-----------------------------------------------------------------------------
+# localserver/chrome + npapi
+# TODO: ie/ff/safari
+
+srcs['NPAPI'] += [
+ '$OPEN_DIR/localserver/chrome/gears_protocol_handler.cc',
+ '$OPEN_DIR/localserver/chrome/network_intercept_cr.cc',
+ '$OPEN_DIR/localserver/chrome/http_cookies_cr.cc',
+ '$OPEN_DIR/localserver/chrome/http_request_cr.cc',
+ '$OPEN_DIR/localserver/chrome/update_task_cr.cc',
+ '$OPEN_DIR/localserver/common/safe_http_request.cc',
+ '$OPEN_DIR/localserver/npapi/async_task_np.cc',
+]
+
+#-----------------------------------------------------------------------------
+# localserver/firefox
+
+srcs['FF3'] += [
+ '$OPEN_DIR/localserver/common/progress_event.cc',
+ '$OPEN_DIR/localserver/common/safe_http_request.cc',
+ '$OPEN_DIR/localserver/firefox/async_task_ff.cc',
+ '$OPEN_DIR/localserver/firefox/cache_intercept.cc',
+ '$OPEN_DIR/localserver/firefox/http_request_ff.cc',
+ '$OPEN_DIR/localserver/firefox/progress_input_stream.cc',
+]
+
+#-----------------------------------------------------------------------------
+# localserver/ie
+
+srcs['IE'] += [
+ '$OPEN_DIR/localserver/ie/async_task_ie.cc',
+ '$OPEN_DIR/localserver/ie/file_submit_behavior.cc',
+ '$OPEN_DIR/localserver/ie/http_handler_ie.cc',
+ '$OPEN_DIR/localserver/ie/http_request_ie.cc',
+ '$OPEN_DIR/localserver/common/progress_event.cc',
+ '$OPEN_DIR/localserver/ie/progress_input_stream.cc',
+ '$OPEN_DIR/localserver/ie/update_task_ie.cc',
+ '$OPEN_DIR/localserver/ie/urlmon_utils.cc',
+]
+
+#-----------------------------------------------------------------------------
+# installer
+
+m4srcs['common'] += [
+ '$OPEN_DIR/installer/npapi_msi.wxs.m4',
+]
+
+#-----------------------------------------------------------------------------
+# dummy_module
+
+srcs['all'] += [
+ '$OPEN_DIR/dummy/dummy_module.cc',
+]
+
+
+#-----------------------------------------------------------------------------
+# test
+
+srcs['all'] += [
+ '$OPEN_DIR/cctests/test.cc',
+]
+
+#-----------------------------------------------------------------------------
+# ui/generated
+#
+# Anything with the _I18N suffix will be expanded for each language in
+# I18N_LANGS
+
+html_m4srcs['all'] += [
+ '$OPEN_DIR/ui/common/permissions_dialog.html_m4',
+ '$OPEN_DIR/ui/common/settings_dialog.html_m4',
+ '$OPEN_DIR/ui/common/shortcuts_dialog.html_m4',
+]
+
+#TODO: $(IE_OUTDIR)/string_table.res
+
+#-----------------------------------------------------------------------------
+# ui/common (built for all browsers)
+
+srcs['all'] += [
+ '$OPEN_DIR/ui/common/html_dialog.cc',
+ '$OPEN_DIR/ui/common/i18n_strings.cc',
+ '$OPEN_DIR/ui/common/permissions_dialog.cc',
+ '$OPEN_DIR/ui/common/window_utils.cc',
+]
+
+srcs['IE'] += [
+ '$OPEN_DIR/ui/common/settings_dialog.cc',
+]
+
+srcs['FF3'] += [
+ '$OPEN_DIR/ui/common/settings_dialog.cc',
+]
+
+stabsrcs['all'] = [
+ '$OPEN_DIR/ui/common/permissions_dialog.js.stab',
+ '$OPEN_DIR/ui/common/settings_dialog.js.stab',
+ '$OPEN_DIR/ui/common/shortcuts_dialog.js.stab',
+]
+
+#-----------------------------------------------------------------------------
+# ui/npapi
+# TODO: ie/ff/safari
+
+m4srcs['all'] += [
+ '$OPEN_DIR/ui/ie/ui_resources.rc.m4',
+]
+
+#-----------------------------------------------------------------------------
+# ui/chrome
+
+srcs['NPAPI'] += [
+ '$OPEN_DIR/ui/chrome/settings_dialog_cr.cc',
+ '$OPEN_DIR/ui/chrome/html_dialog_cr.cc',
+]
+
+#-----------------------------------------------------------------------------
+# ui/factory
+
+m4srcs['FF3'] += [
+ '$OPEN_DIR/ui/firefox/browser-overlay.js.m4',
+ '$OPEN_DIR/ui/firefox/browser-overlay.xul.m4',
+ '$OPEN_DIR/ui/firefox/chrome.manifest.m4',
+]
+
+idlsrcs['FF3'] += [
+ '$OPEN_DIR/ui/firefox/ui_utils.idl',
+]
+
+srcs['FF3'] += [
+ '$OPEN_DIR/ui/firefox/html_dialog_ff.cc',
+ '$OPEN_DIR/ui/firefox/ui_utils.cc',
+]
+
+#-----------------------------------------------------------------------------
+# ui/ie
+
+m4srcs['IE'] += [
+ '$OPEN_DIR/ui/ie/tools_menu_item.rgs.m4',
+ '$OPEN_DIR/ui/ie/ui_resources.rc.m4',
+]
+
+idlsrcs['IE'] += [
+ '$OPEN_DIR/ui/ie/html_dialog_host.idl',
+]
+
+srcs['IE'] += [
+ '$OPEN_DIR/ui/ie/html_dialog_ie.cc',
+ '$OPEN_DIR/ui/ie/tools_menu_item.cc',
+]
+
+stabsrcs['IE'] += [
+ '$OPEN_DIR/ui/ie/string_table.rc.stab',
+]
+
+# Additional files specific to Win32 or WinCE.
+if env['PLATFORM'] == 'win32':
+ srcs['IE'] += [
+ '$OPEN_DIR/ui/ie/html_dialog_host.cc',
+ ]
+elif env['PLATFORM'] == 'wince':
+ m4srcs['IE'] += [
+ '$OPEN_DIR/ui/ie/html_dialog_bridge_iemobile.rgs.m4',
+ ]
+
+ idlsrcs['IE'] += [
+ '$OPEN_DIR/ui/ie/html_dialog_host_iemobile.idl',
+ '$OPEN_DIR/ui/ie/html_dialog_bridge_iemobile.idl',
+ ]
+
+ srcs['IE'] += [
+ '$OPEN_DIR/ui/ie/html_dialog_host_iemobile.cc',
+ '$OPEN_DIR/ui/ie/html_dialog_bridge_iemobile.cc',
+ ]
+
+#-----------------------------------------------------------------------------
+# workerpool/npapi
+# TODO: safari
+
+srcs['NPAPI'] += [
+ '$OPEN_DIR/workerpool/common/workerpool_utils.cc',
+ '$OPEN_DIR/workerpool/npapi/pool_threads_manager.cc',
+ '$OPEN_DIR/workerpool/workerpool.cc',
+]
+
+#-----------------------------------------------------------------------------
+# workerpool/firefox
+
+srcs['FF3'] += [
+ '$OPEN_DIR/workerpool/common/workerpool_utils.cc',
+ '$OPEN_DIR/workerpool/firefox/pool_threads_manager.cc',
+ '$OPEN_DIR/workerpool/workerpool.cc',
+]
+
+#-----------------------------------------------------------------------------
+# workerpool/ie
+
+srcs['IE'] += [
+ '$OPEN_DIR/workerpool/common/workerpool_utils.cc',
+ '$OPEN_DIR/workerpool/ie/pool_threads_manager.cc',
+ '$OPEN_DIR/workerpool/workerpool.cc',
+]
+
+#-----------------------------------------------------------------------------
+# timer
+
+srcs['all'] += [
+ '$OPEN_DIR/timer/timer.cc',
+]
+
+#-----------------------------------------------------------------------------
+# httprequest
+
+srcs['all'] += [
+ '$OPEN_DIR/httprequest/httprequest.cc',
+ '$OPEN_DIR/httprequest/httprequest_upload.cc',
+]
+
+#-----------------------------------------------------------------------------
+# blob
+
+srcs['all'] += [
+ '$OPEN_DIR/blob/blob.cc',
+ '$OPEN_DIR/blob/blob_builder.cc',
+ '$OPEN_DIR/blob/blob_builder_module.cc',
+ '$OPEN_DIR/blob/blob_interface.cc',
+ '$OPEN_DIR/blob/blob_test.cc',
+ '$OPEN_DIR/blob/blob_utils.cc',
+ '$OPEN_DIR/blob/buffer_blob.cc',
+ '$OPEN_DIR/blob/fail_blob.cc',
+ '$OPEN_DIR/blob/file_blob.cc',
+ '$OPEN_DIR/blob/join_blob.cc',
+ '$OPEN_DIR/blob/slice_blob.cc',
+]
+
+# TODO(bpm): Make this cross-browser, not Firefox- or Safari-specific.
+srcs['FF3'] += [
+ '$OPEN_DIR/blob/blob_input_stream_ff.cc',
+ '$OPEN_DIR/blob/blob_input_stream_ff_test.cc',
+]
+
+srcs['SF'] += [
+ '$OPEN_DIR/blob/blob_input_stream_sf.mm',
+ '$OPEN_DIR/blob/blob_input_stream_sf_test.mm',
+]
+
+#-----------------------------------------------------------------------------
+# TODO: inspector
+
+if not env['OFFICIAL_BUILD']:
+ srcs['all'] += [
+ '$OPEN_DIR/inspector/inspector_resources.cc',
+ ]
+
+ binsrcs['common'] += [
+ '$OPEN_DIR/inspector/console.html',
+ '$OPEN_DIR/inspector/database.html',
+ '$OPEN_DIR/inspector/index.html',
+ '$OPEN_DIR/inspector/localserver.html',
+ '$OPEN_DIR/inspector/common/alert-35.png',
+ '$OPEN_DIR/inspector/common/database.gif',
+ '$OPEN_DIR/inspector/common/error-35.png',
+ '$OPEN_DIR/inspector/common/ie6hacks.css',
+ '$OPEN_DIR/inspector/common/inspector_links.js',
+ '$OPEN_DIR/inspector/common/lightbulb-35.png',
+ '$OPEN_DIR/inspector/common/localserver.gif',
+ '$OPEN_DIR/inspector/common/question-35.png',
+ '$OPEN_DIR/inspector/common/styles.css',
+ '$OPEN_DIR/inspector/common/workerpool.gif',
+ '$OPEN_DIR/sdk/gears_init.js',
+ '$OPEN_DIR/ui/common/base.js',
+ '$OPEN_DIR/ui/common/dom.js',
+ '$OPEN_DIR/ui/common/icon_32x32.png',
+ ]
+
+#-----------------------------------------------------------------------------
+# image
+
+# The Image API is not yet enabled in official builds.
+if not env['OFFICIAL_BUILD'] and env['PLATFORM'] != 'wince':
+ srcs['all'] += [
+ '$OPEN_DIR/image/backing_image.cc',
+ '$OPEN_DIR/image/image.cc',
+ '$OPEN_DIR/image/image_loader.cc',
+ ]
+
+#-----------------------------------------------------------------------------
+# factory/npapi
+
+srcs['NPAPI'] += [
+ '$OPEN_DIR/factory/factory_impl.cc',
+ '$OPEN_DIR/factory/factory_np.cc',
+ '$OPEN_DIR/factory/factory_utils.cc',
+]
+
+#-----------------------------------------------------------------------------
+# factory/firefox
+
+srcs['FF3'] += [
+ '$OPEN_DIR/factory/factory_impl.cc',
+ '$OPEN_DIR/factory/factory_ff.cc',
+ '$OPEN_DIR/factory/factory_utils.cc',
+]
+
+#-----------------------------------------------------------------------------
+# factory/ie
+
+m4srcs['IE'] += [
+ '$OPEN_DIR/factory/factory_ie.rgs.m4',
+]
+
+srcs['IE'] += [
+ '$OPEN_DIR/factory/factory_impl.cc',
+ '$OPEN_DIR/factory/factory_ie.cc',
+ '$OPEN_DIR/factory/factory_utils.cc',
+]
+
+#-----------------------------------------------------------------------------
+# geolocation
+
+srcs['all'] += [
+ '$OPEN_DIR/geolocation/empty_device_data_provider.cc',
+ '$OPEN_DIR/geolocation/geolocation.cc',
+ '$OPEN_DIR/geolocation/geolocation_db.cc',
+ '$OPEN_DIR/geolocation/geolocation_db_test.cc',
+ '$OPEN_DIR/geolocation/geolocation_test.cc',
+ '$OPEN_DIR/geolocation/gps_location_provider_wince.cc',
+ '$OPEN_DIR/geolocation/location_provider.cc',
+ '$OPEN_DIR/geolocation/location_provider_pool.cc',
+ '$OPEN_DIR/geolocation/network_location_provider.cc',
+ '$OPEN_DIR/geolocation/network_location_request.cc',
+ '$OPEN_DIR/geolocation/radio_data_provider_wince.cc',
+ '$OPEN_DIR/geolocation/timed_callback.cc',
+ '$OPEN_DIR/geolocation/wifi_data_provider_android.cc',
+ '$OPEN_DIR/geolocation/wifi_data_provider_common.cc',
+ '$OPEN_DIR/geolocation/wifi_data_provider_linux.cc',
+ '$OPEN_DIR/geolocation/wifi_data_provider_osx.cc',
+ '$OPEN_DIR/geolocation/wifi_data_provider_win32.cc',
+ '$OPEN_DIR/geolocation/wifi_data_provider_wince.cc',
+ '$OPEN_DIR/geolocation/wifi_data_provider_windows_common.cc',
+]
+
+#-----------------------------------------------------------------------------
+# media
+
+# The Audio API has not been finalized for official builds.
+if not env['OFFICIAL_BUILD']:
+ srcs['all'] += [
+ '$OPEN_DIR/media/audio.cc',
+ '$OPEN_DIR/media/audio_recorder.cc',
+ '$OPEN_DIR/media/audio_recorder_test.cc',
+ '$OPEN_DIR/media/base_audio_recorder.cc',
+ '$OPEN_DIR/media/media.cc',
+ '$OPEN_DIR/media/media_data.cc',
+ '$OPEN_DIR/media/mock_audio_recorder.cc',
+ '$OPEN_DIR/media/pa_audio_recorder.cc',
+ '$OPEN_DIR/media/time_ranges.cc',
+ ]
+
+#-----------------------------------------------------------------------------
+# resources
+
+ui_res = env_res.RES('$GENFILES_DIR/ui_resources.rc'),
+
+module_res = None
+if env['BROWSER'] == 'NPAPI':
+ module_res = env_res.RES('$OPEN_DIR/base/npapi/module.rc')
+elif env['BROWSER'] == 'IE':
+ module_res = env_res.RES('$OPEN_DIR/base/ie/module.rc')
+
+dll_resources = [
+ ui_res,
+]
+if module_res:
+ dll_resources += [module_res]
+
+stabsrcs['all'] += [
+ '$OPEN_DIR/ui/common/permissions_dialog.js.stab',
+ '$OPEN_DIR/ui/common/settings_dialog.js.stab',
+ '$OPEN_DIR/ui/common/shortcuts_dialog.js.stab',
+]
+
+#-----------------------------------------------------------------------------
+# libs
+
+libs = [
+ '$THIRD_PARTY_DIR/v8/bin-dbg/libv8core.lib',
+ '$THIRD_PARTY_DIR/v8/bin-dbg/no_snapshotv8.lib',
+ '$THIRD_PARTY_DIR/v8/bin-dbg/libjscre.lib',
+ '$THIRD_PARTY_DIR/skia/skia-dbg-win32-i386.lib',
+]
+
+if env['BROWSER'] == 'NPAPI':
+ libs += ['$OPEN_DIR/base/chrome/module.def',]
+elif env['BROWSER'] == 'IE':
+ libs += ['$OPEN_DIR/tools/mscom.def',]
+
+# TODO: all the other ports, including third-party libs
+# - IE, FF[23], SAFARI, android, symbian
+# - breakpad[_osx]
+# - glint
+# - growl
+# - spidermonkey
+# - libspeex
+# - libtremor
+# - vista broker
+# TODO: other targets
+# - installer
+# - notifier
+# - ipc_tests
+
+
+# Now build the dependency tree.
+
+# Add any hard-coded "FF3_" sources to the FF2_ sources.
+srcs['FF2'] += srcs['FF3']
+m4srcs['FF2'] += m4srcs['FF3']
+html_m4srcs['FF2'] += html_m4srcs['FF3']
+stabsrcs['FF2'] += stabsrcs['FF3']
+idlsrcs['FF2'] += idlsrcs['FF3']
+binsrcs['FF2'] += binsrcs['FF3']
+
+# Add the target browser's inputs to the list files to build.
+srcs['all'] += srcs[env['BROWSER']]
+m4srcs['all'] += m4srcs[env['BROWSER']]
+html_m4srcs['all'] += html_m4srcs[env['BROWSER']]
+stabsrcs['all'] += stabsrcs[env['BROWSER']]
+idlsrcs['all'] += idlsrcs[env['BROWSER']]
+binsrcs['all'] += binsrcs[env['BROWSER']]
+
+# TODO: Is there a better way than this to do a make-style rule like
+# genfiles/%.html: %.html_m4
+m4s = []
+m4s += [env_common.M4(src) for src in m4srcs['common']]
+m4s += [env_browser.M4(src) for src in m4srcs['all']]
+installed_m4s = env_browser.Install('$GENFILES_DIR', m4s)
+
+html_m4s = [env_browser.M4(os.path.splitext(src)[0] + '.html', src)
+ for src in html_m4srcs['all']]
+installed_html_m4s = env_browser.Install('$GENFILES_DIR', html_m4s)
+
+# genfiles/%.js: %.js.stab
+stabs = [env_browser.Stab(src) for src in stabsrcs['all']]
+installed_stabs = env_browser.Install('$GENFILES_DIR', stabs)
+
+# TODO: What's an elegant way to say "FOO.html_m4 depends on FOO.js" ?
+def IsSameBasename(a, b):
+ return (os.path.basename(os.path.splitext(a)[0]) ==
+ os.path.basename(os.path.splitext(b)[0]))
+
+for html_m4 in html_m4s:
+ for stab in installed_stabs:
+ if IsSameBasename(str(stab), str(html_m4[0])):
+ env_browser.Depends(html_m4, stab)
+
+# genfiles/%.from_bin.cc: %
+bins = [env_common.Bin2cpp(src + '.from_bin.cc', src)
+ for src in binsrcs['common']]
+installed_bins = env_common.Install('$GENFILES_DIR', bins)
+srcs['all'] += installed_bins
+
+# genfiles/%.h: %.idl
+# Note: the emitter fixes the targets to be put in genfiles.
+if idlsrcs['all']:
+ idls = [env_browser.TypeLibrary(src)
+ for src in idlsrcs['all']]
+ installed_idls = idls
+ srcs['all'] += [x for x in installed_idls[0] if str(x).endswith('_i.c')]
+
+# TODO: figure out why the .rc scanner doesn't notice these dependencies.
+env_browser.Depends(ui_res, installed_html_m4s)
+env_browser.Depends(module_res, installed_m4s)
+
+lib = env_browser.ChromeSharedLibrary('gears',
+ srcs['all'] + libs + dll_resources)
+env_browser.Alias('gears', lib)
diff --git a/gears/SConscript.googleurl b/gears/SConscript.googleurl
new file mode 100644
index 0000000..a8aef1a
--- /dev/null
+++ b/gears/SConscript.googleurl
@@ -0,0 +1,85 @@
+# 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.
+
+Import('env')
+
+env = env.Clone()
+
+env.Replace(
+ GURL_DIR = '$THIRD_PARTY_DIR/googleurl',
+ CPPPATH = [
+ '$GURL_DIR',
+ '$GURL_DIR/..',
+# '#/..',
+ '$ICU38_DIR/public/common',
+ '$ICU38_DIR/public/i18n',
+ ],
+)
+
+env.Append(
+ CPPDEFINES = [
+ 'U_STATIC_IMPLEMENTATION',
+ ],
+)
+
+if env['PLATFORM'] == 'win32':
+ env.Append(
+ CCFLAGS = [
+# '/TP',
+# '/J',
+ ],
+ )
+
+input_files = [
+ '$GURL_DIR/src/gurl.cc',
+ '$GURL_DIR/src/url_canon_etc.cc',
+ '$GURL_DIR/src/url_canon_fileurl.cc',
+ '$GURL_DIR/src/url_canon_host.cc',
+ '$GURL_DIR/src/url_canon_icu.cc',
+ '$GURL_DIR/src/url_canon_internal.cc',
+ '$GURL_DIR/src/url_canon_ip.cc',
+# '$GURL_DIR/src/url_canon_mailtourl.cc',
+ '$GURL_DIR/src/url_canon_path.cc',
+ '$GURL_DIR/src/url_canon_pathurl.cc',
+ '$GURL_DIR/src/url_canon_query.cc',
+ '$GURL_DIR/src/url_canon_relative.cc',
+ '$GURL_DIR/src/url_canon_stdurl.cc',
+ '$GURL_DIR/src/url_parse.cc',
+ '$GURL_DIR/src/url_parse_file.cc',
+ '$GURL_DIR/src/url_util.cc',
+]
+
+env.ChromeStaticLibrary('googleurl-gears', input_files)
+
+#env_tests = env.Clone()
+#
+#env_tests.Append(
+# CPPPATH = [
+# '$GTEST_DIR/include',
+# ],
+# CPPDEFINES = [
+# 'UNIT_TEST',
+# ],
+# LIBS = [
+# 'googleurl',
+# 'base',
+# 'icuuc',
+# 'gtest',
+# ]
+#)
+#
+#test_files = [
+# 'src/gurl_unittest.cc',
+# 'src/url_canon_unittest.cc',
+# 'src/url_parse_unittest.cc',
+# 'src/url_util_unittest.cc',
+#
+# # The version of gtest that googleurl uses provides a main() function; ours
+# # doesn't so include our own main function.
+# '#/../base/run_all_unittests.cc'
+#]
+#
+#gurl_unittests = env_tests.ChromeTestProgram('googleurl_unittests', test_files)
+#
+#installed_gurl_unittests = env.Install('$TARGET_ROOT', gurl_unittests)
diff --git a/gears/SConscript.sqlite b/gears/SConscript.sqlite
index 66a0367..f1917dc 100644
--- a/gears/SConscript.sqlite
+++ b/gears/SConscript.sqlite
@@ -67,13 +67,18 @@ input_files = [
'$SQLITE_DIR/src/analyze.c',
'$SQLITE_DIR/src/attach.c',
'$SQLITE_DIR/src/auth.c',
+ '$SQLITE_DIR/src/bitvec.c',
'$SQLITE_DIR/src/btree.c',
+ '$SQLITE_DIR/src/btmutex.c',
'$SQLITE_DIR/src/build.c',
'$SQLITE_DIR/src/callback.c',
'$SQLITE_DIR/src/complete.c',
'$SQLITE_DIR/src/date.c',
'$SQLITE_DIR/src/delete.c',
'$SQLITE_DIR/src/expr.c',
+ '$SQLITE_DIR/src/fault.c',
+ '$SQLITE_DIR/src/global.c',
+ '$SQLITE_DIR/src/journal.c',
'$SQLITE_DIR/ext/fts1/fts1.c',
'$SQLITE_DIR/ext/fts1/fts1_hash.c',
# '$SQLITE_DIR/ext/fts1/fts1_icu.c',
@@ -84,7 +89,7 @@ input_files = [
'$SQLITE_DIR/ext/fts2/fts2_hash.c',
# '$SQLITE_DIR/ext/fts2/fts2_icu.c',
'$SQLITE_DIR/ext/fts2/fts2_porter.c',
-# '$SQLITE_DIR/ext/fts2/fts2_tokenizer.c',
+ '$SQLITE_DIR/ext/fts2/fts2_tokenizer.c',
'$SQLITE_DIR/ext/fts2/fts2_tokenizer1.c',
'$SQLITE_DIR/src/func.c',
'$SQLITE_DIR/src/hash.c',
@@ -93,6 +98,16 @@ input_files = [
'$SQLITE_DIR/src/loadext.c',
'$SQLITE_DIR/src/main.c',
'$SQLITE_DIR/src/malloc.c',
+ '$SQLITE_DIR/src/mem1.c',
+ '$SQLITE_DIR/src/mem2.c',
+ '$SQLITE_DIR/src/mem3.c',
+ '$SQLITE_DIR/src/mem4.c',
+ '$SQLITE_DIR/src/mem5.c',
+ '$SQLITE_DIR/src/mem6.c',
+ '$SQLITE_DIR/src/sqlite_mutex.c',
+ '$SQLITE_DIR/src/mutex_os2.c',
+ '$SQLITE_DIR/src/mutex_unix.c',
+ '$SQLITE_DIR/src/mutex_w32.c',
'$SQLITE_DIR/preprocessed/opcodes.c',
'$SQLITE_DIR/src/os.c',
'$SQLITE_DIR/src/os_win.c',
@@ -103,6 +118,7 @@ input_files = [
'$SQLITE_DIR/src/printf.c',
'$SQLITE_DIR/src/random.c',
'$SQLITE_DIR/src/select.c',
+ '$SQLITE_DIR/src/status.c',
# '$SQLITE_DIR/src/shell.c',
'$SQLITE_DIR/src/table.c',
'$SQLITE_DIR/src/tokenize.c',