summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-13 20:32:25 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-13 20:32:25 +0000
commit6799ef0ac57bb5c206d0e2d4106cd4b41de1fe7a (patch)
tree9d82d80dc0332a406d1faf0f937db9ee7ed89484
parentda8765903e7d3addd573aca2559b57cd0052d667 (diff)
downloadchromium_src-6799ef0ac57bb5c206d0e2d4106cd4b41de1fe7a.zip
chromium_src-6799ef0ac57bb5c206d0e2d4106cd4b41de1fe7a.tar.gz
chromium_src-6799ef0ac57bb5c206d0e2d4106cd4b41de1fe7a.tar.bz2
Add builder for Safari resource files. Had to restructure some input files.
I also moved GetInputs into the utils file. Review URL: http://codereview.chromium.org/10671 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5370 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--gears/SConscript14
-rw-r--r--gears/SConscript.browser60
-rw-r--r--gears/SConscript.common6
-rwxr-xr-xgears/SConscript.inputs19
-rw-r--r--gears/SConscript.installers23
-rw-r--r--gears/site_scons/utils.py5
6 files changed, 83 insertions, 44 deletions
diff --git a/gears/SConscript b/gears/SConscript
index cf48cdc..f300de3 100644
--- a/gears/SConscript
+++ b/gears/SConscript
@@ -717,19 +717,11 @@ sconscripts = [
'SConscript.libmozjs',
'SConscript.sqlite',
'SConscript.zlib',
+ 'SConscript.libbreakpad_osx',
+ 'SConscript.libgd',
+ 'SConscript.portaudio',
]
-if env['OS'] == 'osx':
- sconscripts += [
- 'SConscript.libbreakpad_osx',
- ]
-
-if env['OS'] != 'osx':
- sconscripts += [
- 'SConscript.libgd',
- 'SConscript.portaudio',
- ]
-
for each in sconscripts:
env.SConscript(each,
exports=['env'],
diff --git a/gears/SConscript.browser b/gears/SConscript.browser
index e8ab132..6fcc775 100644
--- a/gears/SConscript.browser
+++ b/gears/SConscript.browser
@@ -220,12 +220,23 @@ if env['OS'] == 'osx':
# Add in libraries for in-development APIs for non-official builds.
if not env['OFFICIAL_BUILD']:
- if env['OS'] != 'wince':
- env.Append(LIBS = [
+ env.Append(LIBS = [
+ 'jpeg-gears',
+ 'portaudio',
'gd',
- 'jpeg-gears'
+ ])
+
+ # Except on these platforms.
+ if env['OS'] == 'wince':
+ env.FilterOut(LIBS = [
+ 'jpeg-gears',
+ 'portaudio',
+ ])
+ elif env['OS'] == 'osx':
+ env.FilterOut(LIBS = [
+ 'gd',
+ 'portaudio',
])
- env.Append(LIBS = 'portaudio')
if env['BROWSER'] == 'IE':
if env['OS'] == 'win32':
@@ -374,11 +385,7 @@ env = env_inputs
# Generate the dependency tree.
def PatternRule(t, s): return utils.PatternRule(t, s, env)
-
-def GetInputs(var):
- """Expands an env substitution variable and returns it as a list of
- strings."""
- return [str(v) for v in env.subst_list(var)[0]]
+def GetInputs(var): return utils.GetInputs(var, env)
# Include the common targets generated by SConscript.common.
Import('common_targets')
@@ -433,6 +440,41 @@ if env.has_key('UI_RES'):
env.Depends('$UI_RES', html_m4s)
env.Depends('$MODULE_RES', m4s)
+# Safari resources
+if env['BROWSER'] == 'SF':
+ env.Replace(
+ WEBARCHIVER = '$OPEN_DIR/tools/osx/webarchiver/webarchiver',
+ GEN_RESOURCE_LIST = 'python $OPEN_DIR/tools/osx/gen_resource_list.py',
+ GEN_RESOURCES = ['$GENFILES_DIR/resource_list.h'],
+ )
+ def WebArchiver(src):
+ src_basename = os.path.basename(os.path.splitext(src)[0])
+ return ('$WEBARCHIVER "$GENFILES_DIR/%s.webarchive" "%s" '
+ ' $COMMON_RESOURCES' % (src_basename, src))
+ def XXD(src):
+ src_basename = os.path.basename(os.path.splitext(src)[0])
+ env.Append(GEN_RESOURCES = ['$GENFILES_DIR/%s.h' % src_basename])
+ return 'xxd -i "%s" > "$GENFILES_DIR/%s.h"' % (src, src_basename)
+ resource_list_h = env.Command(
+ '$GENFILES_DIR/resource_list.h',
+ GetInputs('$COMMON_RESOURCES') + html_m4s,
+ [WebArchiver('$GENFILES_DIR/permissions_dialog.html'),
+ WebArchiver('$GENFILES_DIR/shortcuts_dialog.html'),
+ WebArchiver('$GENFILES_DIR/settings_dialog.html'),
+ XXD('$GENFILES_DIR/permissions_dialog.webarchive'),
+ XXD('$GENFILES_DIR/shortcuts_dialog.webarchive'),
+ XXD('$GENFILES_DIR/settings_dialog.webarchive'),
+ XXD('$OPEN_DIR/ui/common/location_data.png'),
+ XXD('$OPEN_DIR/ui/common/local_data.png'),
+ '$GEN_RESOURCE_LIST $GEN_RESOURCES'],
+ )
+ resource_obj = env.SharedObject(
+ '$GENFILES_DIR/resources',
+ '$OPEN_DIR/base/safari/resource_archive.cc')
+ env.Depends(resource_obj, resource_list_h)
+ env.Append(BROWSER_LINKSRCS = resource_obj)
+
+
# HACK: gears, vista_broker, and wince_setup share some inputs, but the
# Chrome* helpers muck with the environment, so SCons complains if we try to
# compile those inputs differently. So we try to precompile them before
diff --git a/gears/SConscript.common b/gears/SConscript.common
index a440868..2500e39 100644
--- a/gears/SConscript.common
+++ b/gears/SConscript.common
@@ -47,11 +47,7 @@ env = env_inputs
common_targets = {}
def PatternRule(t, s): return utils.PatternRule(t, s, env)
-
-def GetInputs(var):
- """Expands an env substitution variable and returns it as a list of
- strings."""
- return [str(v) for v in env.subst_list(var)[0]]
+def GetInputs(var): return utils.GetInputs(var, env)
# genfiles/%: %.m4
common_targets['m4'] = \
diff --git a/gears/SConscript.inputs b/gears/SConscript.inputs
index 2071252..09c78a6 100755
--- a/gears/SConscript.inputs
+++ b/gears/SConscript.inputs
@@ -956,6 +956,25 @@ if env_res and env['OS'] in ['win32', 'wince']:
env['STRING_RES'] = env_res.RES('$GENFILES_DIR/string_table.rc')
env.Append(IE_LINKSRCS = ['$MODULE_RES', '$STRING_RES'])
+env.Append(FF3_RESOURCES = [
+ '$FF3_OUTDIR/genfiles/browser-overlay.js',
+ '$FF3_OUTDIR/genfiles/browser-overlay.xul',
+ '$FF3_OUTDIR/genfiles/permissions_dialog.html',
+ '$FF3_OUTDIR/genfiles/settings_dialog.html',
+ '$FF3_OUTDIR/genfiles/shortcuts_dialog.html',
+])
+
+env.Append(COMMON_RESOURCES = [
+ '$OPEN_DIR/ui/common/blank.gif',
+ '$OPEN_DIR/ui/common/button_bg.gif',
+ '$OPEN_DIR/ui/common/button_corner_black.gif',
+ '$OPEN_DIR/ui/common/button_corner_blue.gif',
+ '$OPEN_DIR/ui/common/button_corner_grey.gif',
+ '$OPEN_DIR/ui/common/icon_32x32.png',
+ '$OPEN_DIR/ui/common/local_data.png',
+ '$OPEN_DIR/ui/common/location_data.png',
+])
+
#-----------------------------------------------------------------------------
# libs
diff --git a/gears/SConscript.installers b/gears/SConscript.installers
index f755420..665c4ec 100644
--- a/gears/SConscript.installers
+++ b/gears/SConscript.installers
@@ -5,6 +5,7 @@
import os
import re
import subprocess
+import utils
Import('env')
@@ -23,24 +24,7 @@ env = env.Clone(
BASE_OUTDIR = env.Entry('$BASE_OUTDIR').path,
)
-ff3_resources = [
- '$FF3_OUTDIR/genfiles/browser-overlay.js',
- '$FF3_OUTDIR/genfiles/browser-overlay.xul',
- '$FF3_OUTDIR/genfiles/permissions_dialog.html',
- '$FF3_OUTDIR/genfiles/settings_dialog.html',
- '$FF3_OUTDIR/genfiles/shortcuts_dialog.html',
-]
-
-common_resources = [
- '$OPEN_DIR/ui/common/blank.gif',
- '$OPEN_DIR/ui/common/button_bg.gif',
- '$OPEN_DIR/ui/common/button_corner_black.gif',
- '$OPEN_DIR/ui/common/button_corner_blue.gif',
- '$OPEN_DIR/ui/common/button_corner_grey.gif',
- '$OPEN_DIR/ui/common/icon_32x32.png',
- '$OPEN_DIR/ui/common/local_data.png',
- '$OPEN_DIR/ui/common/location_data.png',
-]
+def GetInputs(var): return utils.GetInputs(var, env)
def Shell(cmd):
"""Execute a shell command and return the output."""
@@ -172,7 +156,8 @@ def FirefoxInstaller(env):
('/', ['$FF3_OUTDIR/genfiles/install.rdf',
'$FF3_OUTDIR/genfiles/chrome.manifest']),
('lib/', ['$OPEN_DIR/base/firefox/static_files/lib/updater.js']),
- ('chrome/chromeFiles/content/', ff3_resources + common_resources),
+ ('chrome/chromeFiles/content/',
+ GetInputs('$FF3_RESOURCES $COMMON_RESOURCES')),
('chrome/chromeFiles/locale', ['$FF3_OUTDIR/genfiles/i18n']),
('components/',
['$FF3_OUTDIR/gears.xpt',
diff --git a/gears/site_scons/utils.py b/gears/site_scons/utils.py
index 4bd4f93..d33b705 100644
--- a/gears/site_scons/utils.py
+++ b/gears/site_scons/utils.py
@@ -7,3 +7,8 @@ def PatternRule(target, source, env):
containing the new target and source to pass to a builder."""
target_sub = env.subst(target, source=env.File(source))
return [target_sub, source]
+
+def GetInputs(var, env):
+ """Expands an env substitution variable and returns it as a list of
+ strings."""
+ return [str(v) for v in env.subst_list(var)[0]]