summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-18 23:26:29 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-18 23:26:29 +0000
commitb96fc5dc177d311db220dc4039e74a9c0d871558 (patch)
tree9bbc6ea3af7c0da75d4b6025d4b475dd62eec0b2 /webkit
parentdb8635032b1f83436a072be14e425076a7bd8164 (diff)
downloadchromium_src-b96fc5dc177d311db220dc4039e74a9c0d871558.zip
chromium_src-b96fc5dc177d311db220dc4039e74a9c0d871558.tar.gz
chromium_src-b96fc5dc177d311db220dc4039e74a9c0d871558.tar.bz2
Convert from using env['PLATFORM'] directly to using the more flexible
and better-thought-out Hammer env.Bits() idioms: * env['PLATFORM'] == 'win32' => env.Bit('windows') * env['PLATFORM'] == 'posix' => env.Bit('linux') * env['PLATFORM'] == 'darwin' => env.Bit('mac') New idioms: * env.Bit('posix') => really does mean "any POSIX platform" * env.AnyBits('mac', 'linux') => specifically mac or linux, excluding other POSIX platforms Where we were using compound conditionals (e.g., "env['PLATFORM'] in ('posix', 'darwin')") I tried to take my best shot at translating the intent (i.e., "env.Bits('posix')" for something POSIX, "not env.Bits('mac')" for something not yet ported to Mac, etc.) Review URL: http://codereview.chromium.org/15051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7270 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/SConscript12
-rw-r--r--webkit/SConscript.javascriptcore_pcre2
-rw-r--r--webkit/SConscript.port12
-rw-r--r--webkit/build/JavaScriptCore/SConscript6
-rw-r--r--webkit/build/V8Bindings/SConscript4
-rw-r--r--webkit/build/WebCore/SConscript10
-rw-r--r--webkit/build/localized_strings/SConscript4
-rw-r--r--webkit/build/port/SConscript2
-rw-r--r--webkit/default_plugin/SConscript4
-rw-r--r--webkit/glue/SConscript14
-rw-r--r--webkit/glue/plugins/test/SConscript4
-rw-r--r--webkit/tools/npapi_layout_test_plugin/SConscript2
-rw-r--r--webkit/tools/test_shell/SConscript20
13 files changed, 49 insertions, 47 deletions
diff --git a/webkit/SConscript b/webkit/SConscript
index 5867657..2cb73e7 100644
--- a/webkit/SConscript
+++ b/webkit/SConscript
@@ -40,9 +40,9 @@ port_dir = env.Dir('$WEBKIT_DIR/port')
port_dir.addRepository(env.Dir('$CHROME_SRC_DIR/webkit/port'))
port_dir.addRepository(env.Dir('$CHROME_SRC_DIR/third_party/WebKit/WebCore'))
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env['WEBKIT_PLATFORM_SUBDIR'] = 'win'
-elif env['PLATFORM'] == 'darwin':
+elif env.Bit('mac'):
env['WEBKIT_PLATFORM_SUBDIR'] = 'mac'
env.Append(
CCFLAGS = [
@@ -56,7 +56,7 @@ elif env['PLATFORM'] == 'darwin':
'$CHROME_SRC_DIR/third_party/WebKit/WebCore/loader/archive/cf',
]]
)
-elif env['PLATFORM'] == 'posix':
+elif env.Bit('linux'):
env.Append(
CPPDEFINES = [
# We want webkit to use pthreads rather than gthread.
@@ -64,7 +64,7 @@ elif env['PLATFORM'] == 'posix':
],
)
-if env['PLATFORM'] in ('darwin', 'posix'):
+if env.Bit('posix'):
env.Append(
CCFLAGS = [
'-Wno-parentheses',
@@ -234,7 +234,7 @@ sconscript_dirs = env.ChromiumLoadComponentSConscripts(
test_shell = 'tools/test_shell/SConscript',
)
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
# These extra dirs aren't win32-specific, they're just the dirs that
# haven't yet been made portable.
sconscript_dirs.extend(env.ChromiumLoadComponentSConscripts(
@@ -272,7 +272,7 @@ env.SConscript(sconscript_dirs, exports=['env', 'env_res'])
# Instead we're going to let all the subsidiary SConscript files
# add their own individual targets to the 'webkit' Alias.
#env.Alias('webkit', ['.', '$DESTINATION_ROOT/icudt38.dll'])
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Alias('webkit', ['$DESTINATION_ROOT/icudt38.dll'])
version = env.Command('$WEBKIT_DIR/build/WebCore/webkit_version.h',
diff --git a/webkit/SConscript.javascriptcore_pcre b/webkit/SConscript.javascriptcore_pcre
index eecfa11..61ff502 100644
--- a/webkit/SConscript.javascriptcore_pcre
+++ b/webkit/SConscript.javascriptcore_pcre
@@ -15,7 +15,7 @@ env.Prepend(
'$WEBKIT_DIR/build/JSConfig/WebCore/v8',
])
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Prepend(
CCFLAGS = [
'/TP',
diff --git a/webkit/SConscript.port b/webkit/SConscript.port
index 37c24f2..73a7d92 100644
--- a/webkit/SConscript.port
+++ b/webkit/SConscript.port
@@ -6,7 +6,7 @@ Import('env')
env = env.Clone()
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Prepend(
CCFLAGS = [
'/TP',
@@ -17,7 +17,7 @@ if env['PLATFORM'] == 'win32':
'/wd4521',
'/wd4800',
],)
-elif env['PLATFORM'] == 'posix':
+elif env.Bit('linux'):
env.Append(
# For the image readers and decoders:
CXXFLAGS = ["-Wno-sign-compare"],
@@ -110,7 +110,7 @@ input_files = [
'$PORT_DIR/plugins/chromium/PluginDataChromium.cpp',
]
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
# Windows specific implementations.
input_files.extend([
'$PORT_DIR/platform/chromium/FileSystemChromiumWin.cpp',
@@ -131,7 +131,7 @@ if env['PLATFORM'] == 'win32':
'$PORT_DIR/rendering/RenderThemeWin.cpp',
])
-if env['PLATFORM'] == 'posix':
+if env.Bit('linux'):
# Linux specific implementations.
input_files.extend([
'$PORT_DIR/platform/chromium/FileSystemChromiumLinux.cpp',
@@ -157,7 +157,7 @@ if env['PLATFORM'] == 'posix':
]
input_files = list(set(input_files) - set(to_be_ported_files))
-if env['PLATFORM'] == 'darwin':
+if env.Bit('mac'):
# Mac specific implementations.
input_files.extend([
'$PORT_DIR/bridge/mac/FrameMac.mm',
@@ -167,6 +167,8 @@ if env['PLATFORM'] == 'darwin':
'$PORT_DIR/platform/PluginStubsMac.cpp',
'$PORT_DIR/platform/mac/DragDataMac.mm',
'$PORT_DIR/platform/graphics/mac/FontCacheMacPending.cpp',
+ '$PORT_DIR/platform/graphics/skia/public/PlatformCanvasMac.cpp',
+ '$PORT_DIR/platform/graphics/skia/public/PlatformDeviceMac.cpp',
'$PORT_DIR/rendering/RenderThemeMac.mm',
])
diff --git a/webkit/build/JavaScriptCore/SConscript b/webkit/build/JavaScriptCore/SConscript
index b4f3596..9a3f119 100644
--- a/webkit/build/JavaScriptCore/SConscript
+++ b/webkit/build/JavaScriptCore/SConscript
@@ -120,7 +120,7 @@ env.Append(
],
)
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Append(
CPPPATH = [
# Windows workarounds to not having pthread.h and sched.h
@@ -157,11 +157,11 @@ wtf_inputs = [
'$WTF_DIR/unicode/icu/CollatorICU.cpp',
]
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
wtf_inputs.extend([
'$WTF_DIR/ThreadingWin.cpp',
])
-elif env['PLATFORM'] == 'posix':
+elif env.Bit('linux'):
wtf_inputs.extend([
'$WTF_DIR/gtk/MainThreadGtk.cpp',
'$WTF_DIR/ThreadingPthreads.cpp',
diff --git a/webkit/build/V8Bindings/SConscript b/webkit/build/V8Bindings/SConscript
index 8f3aa71..60e38aa 100644
--- a/webkit/build/V8Bindings/SConscript
+++ b/webkit/build/V8Bindings/SConscript
@@ -6,7 +6,7 @@ Import('env')
env = env.Clone()
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Prepend(
CPPDEFINES = [
'NOGDI',
@@ -344,7 +344,7 @@ inputs = [
'$PORT_DIR/page/inspector/InspectorController.cpp',
]
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
inputs.append('precompiled_v8bindings.cpp')
env.ChromeStaticLibrary('V8Bindings', inputs)
diff --git a/webkit/build/WebCore/SConscript b/webkit/build/WebCore/SConscript
index fdab0a5..869f493 100644
--- a/webkit/build/WebCore/SConscript
+++ b/webkit/build/WebCore/SConscript
@@ -6,7 +6,7 @@ Import('env')
env = env.Clone()
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Append(
CCFLAGS = [
'/TP',
@@ -24,7 +24,7 @@ if env['PLATFORM'] == 'win32':
],
)
-if env['PLATFORM'] in ('darwin', 'posix'):
+if env.Bit('posix'):
if '-Wall' in env['CXXFLAGS'] and '-Werror' in env['CXXFLAGS']:
# It'd be nice to fix these warnings upstream, but we're not going to
# block on it.
@@ -803,7 +803,7 @@ input_files = [
]
# These files don't compile yet on linux or mac.
-if env['PLATFORM'] in ('darwin'):
+if env.Bit('mac'):
remove_files = [
# includes platform specific FontCustomPlatformData.h
'$WEBCORE_DIR/css/CSSFontFaceSource.cpp',
@@ -813,7 +813,7 @@ if env['PLATFORM'] in ('darwin'):
input_files.remove(remove)
# These files don't compile on the mac
-if env['PLATFORM'] in ('darwin'):
+if env.Bit('mac'):
remove_files = [
# Missing WebCore::FrameView::printPanScrollIcon
'$WEBCORE_DIR/page/EventHandler.cpp',
@@ -822,7 +822,7 @@ if env['PLATFORM'] in ('darwin'):
input_files.remove(remove)
# Precompiled headers only work under MSVC in scons.
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env_p = env.Clone()
env_p.Append(CCFLAGS='/Ylwebcore')
pch, obj = env_p.PCH('$OBJ_ROOT/webkit/build/precompiled_webkit.cc')
diff --git a/webkit/build/localized_strings/SConscript b/webkit/build/localized_strings/SConscript
index 5d7cef2..7e99dc7 100644
--- a/webkit/build/localized_strings/SConscript
+++ b/webkit/build/localized_strings/SConscript
@@ -16,7 +16,7 @@ env_res.Append(
],
)
-if env_res['PLATFORM'] == 'win32':
+if env_res.Bit('windows'):
env_res.Append(
RCFLAGS = [
["/l", "0x409"],
@@ -34,6 +34,6 @@ generated = env_grd.GRIT(
'$TARGET_ROOT/grit_derived_sources/fake_generated_target',
'$CHROME_SRC_DIR/webkit/glue/webkit_strings.grd')
-if env_res['PLATFORM'] == 'win32':
+if env_res.Bit('windows'):
for g in [g for g in generated if str(g).endswith('.rc')]:
env_res.RES(g)
diff --git a/webkit/build/port/SConscript b/webkit/build/port/SConscript
index 6b63e84..f374253 100644
--- a/webkit/build/port/SConscript
+++ b/webkit/build/port/SConscript
@@ -125,7 +125,7 @@ env.Replace(
'${SOURCES[0].posix}',
)
-if env['PLATFORM'] == 'mac': # Mac OS X
+if env.Bit('mac'): # Mac OS X
env['BINDINGSPREFIX'] = 'DOM'
env['BINDINGS_GENERATOR_ARG'] = 'ObjC'
env['BINDINGS_LANGUAGE'] = 'LANGUAGE_OBJECTIVE_C'
diff --git a/webkit/default_plugin/SConscript b/webkit/default_plugin/SConscript
index 5561bc1..ee48344 100644
--- a/webkit/default_plugin/SConscript
+++ b/webkit/default_plugin/SConscript
@@ -24,7 +24,7 @@ env.Append(
],
)
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Append(
CCFLAGS = [
'/TP',
@@ -39,7 +39,7 @@ input_files = [
]
# TODO: Quarantine files -- need porting to platform-specific blocks above.
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
input_files.extend([
'activex_installer.cc',
'default_plugin.cc',
diff --git a/webkit/glue/SConscript b/webkit/glue/SConscript
index 68e16bd..81669fb 100644
--- a/webkit/glue/SConscript
+++ b/webkit/glue/SConscript
@@ -12,7 +12,7 @@ env.Append(
]
)
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Append(
CCFLAGS = [
'/TP',
@@ -81,7 +81,7 @@ input_files = [
'webview_impl.cc',
]
-if env['PLATFORM'] == 'posix':
+if env.Bit('linux'):
# TODO(port): until we have plugin support for Linux, these files aren't
# built.
remove_files = [
@@ -94,7 +94,7 @@ if env['PLATFORM'] == 'posix':
for file in remove_files:
input_files.remove(file)
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
# TODO(port): These extra files aren't win32-specific, they've just not been
# tested on other platforms yet.
input_files.extend([
@@ -108,25 +108,25 @@ if env['PLATFORM'] == 'win32':
'webdropdata.cc',
])
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
input_files.extend([
'plugins/plugin_stream_win.cc',
'webcursor_win.cc',
'webinputevent_win.cc',
'webkit_glue_win.cc',
])
-elif env['PLATFORM'] == 'posix':
+elif env.Bit('linux'):
input_files.extend([
'webcursor_gtk.cc',
'webinputevent_linux.cc',
'webkit_glue_gtk.cc',
])
-elif env['PLATFORM'] == 'darwin':
+elif env.Bit('mac'):
input_files.extend([
'webcursor_mac.mm',
])
-if env['PLATFORM'] in ('posix', 'darwin'):
+if env.Bit('posix'):
input_files.extend([
'plugins/plugin_stream_posix.cc',
])
diff --git a/webkit/glue/plugins/test/SConscript b/webkit/glue/plugins/test/SConscript
index be4207c..6551a0d 100644
--- a/webkit/glue/plugins/test/SConscript
+++ b/webkit/glue/plugins/test/SConscript
@@ -19,7 +19,7 @@ input_files = [
'plugin_test.cc'
]
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
# TODO(port): Port these.
input_files.extend([
'plugin_execute_script_delete_test.cc',
@@ -36,7 +36,7 @@ env.Append(
],
)
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
input_files.extend([
env_res.RES('npapi_test.rc'),
'npapi_test.def'
diff --git a/webkit/tools/npapi_layout_test_plugin/SConscript b/webkit/tools/npapi_layout_test_plugin/SConscript
index b4568b8..339643d 100644
--- a/webkit/tools/npapi_layout_test_plugin/SConscript
+++ b/webkit/tools/npapi_layout_test_plugin/SConscript
@@ -13,7 +13,7 @@ input_files = [
'TestObject.cpp'
]
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
input_files.extend([
env_res.RES('npapi_layout_test_plugin.rc'),
'npapi_layout_test_plugin.def'
diff --git a/webkit/tools/test_shell/SConscript b/webkit/tools/test_shell/SConscript
index 85ffe48..f335a46 100644
--- a/webkit/tools/test_shell/SConscript
+++ b/webkit/tools/test_shell/SConscript
@@ -13,7 +13,7 @@ env.SConscript([
'$CHROME_SRC_DIR/build/using_v8.scons',
], {'env':env})
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env_res.Append(
CPPPATH = [
'.',
@@ -58,7 +58,7 @@ env.Append(
],
)
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
# TODO(port): put portable libs in above declaration.
env.Append(
LIBS = [
@@ -67,7 +67,7 @@ if env['PLATFORM'] == 'win32':
]
)
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Append(
LIBS = [
'comctl32.lib',
@@ -90,14 +90,14 @@ if env['PLATFORM'] == 'win32':
'/nxcompat',
],
)
-elif env['PLATFORM'] in ('posix', 'darwin'):
+elif env.Bit('posix'):
env.Append(
LIBS = [
'event',
]
)
-if env['PLATFORM'] == 'darwin':
+if env.Bit('mac'):
env.Append(
CPPPATH = [
'$THIRD_PARTY_DIR/WebKit/WebKit/mac/WebCoreSupport',
@@ -115,7 +115,7 @@ input_files = [
'test_webview_delegate.cc',
'text_input_controller.cc',
]
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
# TODO(port): Consider porting drag_delegate.cc and drop_delecate.cc.
input_files.extend([
'drag_delegate.cc',
@@ -125,7 +125,7 @@ if env['PLATFORM'] == 'win32':
'webview_host_win.cc',
'webwidget_host_win.cc',
])
-elif env['PLATFORM'] == 'posix':
+elif env.Bit('linux'):
input_files.extend([
'webview_host_gtk.cc',
'webwidget_host_gtk.cc',
@@ -140,7 +140,7 @@ exe_input_files = [
'test_shell_main.cc',
]
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
# TODO(port): figure out what to do with resources.
resources = [
env_res.RES('resources/test_shell.rc'),
@@ -157,7 +157,7 @@ test_shell = env.ChromeProgram('test_shell', resources + exe_input_files)
i = env.Install('$TARGET_ROOT', test_shell)
env.Alias('webkit', i)
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Depends(test_shell, '$V8_DIR/vc80.pdb')
test_files = [
@@ -189,7 +189,7 @@ test_files = [
'$V8_DIR/snapshot-empty$OBJSUFFIX',
]
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
# TODO(port): put portable files in above test_files declaration.
test_files.extend([
'plugin_tests.cc',