summaryrefslogtreecommitdiffstats
path: root/net
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 /net
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 'net')
-rw-r--r--net/crash_cache.scons5
-rw-r--r--net/dump_cache.scons4
-rw-r--r--net/net.scons4
-rw-r--r--net/net_lib.scons12
-rw-r--r--net/net_perftests.scons9
-rw-r--r--net/net_unittests.scons10
-rw-r--r--net/stress_cache.scons6
-rw-r--r--net/tools/tld_cleanup/tld_cleanup.scons2
8 files changed, 25 insertions, 27 deletions
diff --git a/net/crash_cache.scons b/net/crash_cache.scons
index e4ec1d9..496f7b0 100644
--- a/net/crash_cache.scons
+++ b/net/crash_cache.scons
@@ -17,7 +17,7 @@ env.ApplySConscript([
'$NET_DIR/using_net.scons',
])
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Prepend(
CCFLAGS = [
'/WX',
@@ -30,6 +30,5 @@ input_files = [
]
-if env['PLATFORM'] in ('posix', 'win32'):
-
+if not env.Bit('mac'):
env.ChromeTestProgram('crash_cache', input_files)
diff --git a/net/dump_cache.scons b/net/dump_cache.scons
index 37099e5..efbfbd5 100644
--- a/net/dump_cache.scons
+++ b/net/dump_cache.scons
@@ -16,7 +16,7 @@ env.ApplySConscript([
'$NET_DIR/using_net.scons',
])
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Prepend(
CCFLAGS = [
'/WX',
@@ -30,6 +30,6 @@ input_files = [
]
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.ChromeTestProgram('dump_cache', input_files)
diff --git a/net/net.scons b/net/net.scons
index cc22d36..7f5f115b 100644
--- a/net/net.scons
+++ b/net/net.scons
@@ -23,7 +23,7 @@ sconscript_files = [
'stress_cache.scons',
]
-if env['PLATFORM'] in ('posix', 'darwin'):
+if env.Bit('posix'):
# Remove *.scons files whose targets still need to be ported.
# TODO(port): delete files from this list as they get ported.
to_be_ported = [
@@ -32,7 +32,7 @@ if env['PLATFORM'] in ('posix', 'darwin'):
for remove in to_be_ported:
sconscript_files.remove(remove)
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
# TODO: We need to port tld_cleanup before this will work on other
# platforms.
sconscript_files.extend([
diff --git a/net/net_lib.scons b/net/net_lib.scons
index 4f96264..0cd3a15 100644
--- a/net/net_lib.scons
+++ b/net/net_lib.scons
@@ -102,7 +102,7 @@ input_files = [
'url_request/url_request_view_cache_job.cc',
]
-if env['PLATFORM'] in ('posix', 'darwin'):
+if env.Bit('posix'):
# Remove files that still need to be ported from the input_files list.
# TODO(port): delete files from this list as they get ported.
to_be_ported_files = [
@@ -114,7 +114,7 @@ if env['PLATFORM'] in ('posix', 'darwin'):
for remove in to_be_ported_files:
input_files.remove(remove)
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
input_files.extend([
'base/file_stream_win.cc',
'base/net_util_win.cc',
@@ -131,7 +131,7 @@ if env['PLATFORM'] == 'win32':
'url_request/url_request_inet_job.cc',
])
-if env['PLATFORM'] == 'darwin':
+if env.Bit('mac'):
input_files.extend([
'base/platform_mime_util_mac.cc',
'base/ssl_client_socket_mac.cc',
@@ -139,7 +139,7 @@ if env['PLATFORM'] == 'darwin':
'proxy/proxy_resolver_mac.cc',
])
-if env['PLATFORM'] == 'posix':
+if env.Bit('linux'):
input_files.extend([
'base/nss_memio.c',
# TODO(tc): gnome-vfs? xdgmime? /etc/mime.types?
@@ -148,7 +148,7 @@ if env['PLATFORM'] == 'posix':
'base/x509_certificate_nss.cc',
])
-if env['PLATFORM'] in ('darwin', 'posix'):
+if env.Bit('posix'):
input_files.extend([
'base/file_stream_posix.cc',
'base/net_util_posix.cc',
@@ -158,7 +158,7 @@ if env['PLATFORM'] in ('darwin', 'posix'):
'disk_cache/mapped_file_posix.cc',
])
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
# TODO(bradnelson): This step generates file precompiled_net.pch.ib_tag
# possibly only on incredibuild, scons doesn't know this.
env_p = env.Clone()
diff --git a/net/net_perftests.scons b/net/net_perftests.scons
index 6c62c99..667090e 100644
--- a/net/net_perftests.scons
+++ b/net/net_perftests.scons
@@ -19,18 +19,18 @@ env.ApplySConscript([
'$NET_DIR/using_net.scons',
])
-if env['PLATFORM'] in ('posix', 'darwin'):
+if env.Bit('posix'):
env.SConscript([
'$LIBEVENT_DIR/using_libevent.scons',
], {'env':env})
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Prepend(
CCFLAGS = [
'/WX',
],
)
-elif env['PLATFORM'] == 'posix':
+elif env.Bit('linux'):
env.Append(
# TODO(port): disk_cache_perftest breaks strict aliasing rules.
CCFLAGS = ['-fno-strict-aliasing'],
@@ -46,6 +46,5 @@ input_files = [
'$OBJ_ROOT/base/perftimer$OBJSUFFIX',
]
-if env['PLATFORM'] in ('posix', 'win32'):
-
+if not env.Bit('mac'):
env.ChromeTestProgram('net_perftests', input_files)
diff --git a/net/net_unittests.scons b/net/net_unittests.scons
index 713505c..f3457be 100644
--- a/net/net_unittests.scons
+++ b/net/net_unittests.scons
@@ -22,12 +22,12 @@ env.ApplySConscript([
'$ZLIB_DIR/using_zlib.scons',
])
-if env['PLATFORM'] in ('posix', 'darwin'):
+if env.Bit('posix'):
env.SConscript([
'$LIBEVENT_DIR/using_libevent.scons',
], {'env':env})
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Prepend(
CCFLAGS = [
'/WX',
@@ -85,14 +85,14 @@ input_files = [
'url_request/url_request_unittest.cc',
]
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
input_files.extend([
'base/wininet_util_unittest.cc',
'http/http_transaction_winhttp_unittest.cc',
'http/winhttp_request_throttle_unittest.cc',
])
-if env['PLATFORM'] == 'posix':
+if env.Bit('linux'):
# TODO(port):
to_be_ported_files = [
'base/x509_certificate_unittest.cc',
@@ -101,7 +101,7 @@ if env['PLATFORM'] == 'posix':
]
input_files = list(set(input_files) - set(to_be_ported_files))
-if env['PLATFORM'] == 'darwin':
+if env.Bit('mac'):
input_files.extend([
'../base/platform_test_mac$OBJSUFFIX',
])
diff --git a/net/stress_cache.scons b/net/stress_cache.scons
index e7dfedf..c4278c9 100644
--- a/net/stress_cache.scons
+++ b/net/stress_cache.scons
@@ -17,7 +17,7 @@ env.ApplySConscript([
'$NET_DIR/using_net.scons',
])
-if env['PLATFORM'] in ('darwin', 'posix'):
+if env.Bit('posix'):
env.ApplySConscript(['$THIRD_PARTY_DIR/libevent/using_libevent.scons'])
env.Prepend(
@@ -26,7 +26,7 @@ env.Prepend(
],
)
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Prepend(
CCFLAGS = [
'/WX',
@@ -38,5 +38,5 @@ input_files = [
'disk_cache/stress_cache.cc',
]
-if env['PLATFORM'] in ('posix', 'win32'):
+if not env.Bit('mac'):
env.ChromeTestProgram('stress_cache', input_files)
diff --git a/net/tools/tld_cleanup/tld_cleanup.scons b/net/tools/tld_cleanup/tld_cleanup.scons
index 6b579f0..de9b0a0 100644
--- a/net/tools/tld_cleanup/tld_cleanup.scons
+++ b/net/tools/tld_cleanup/tld_cleanup.scons
@@ -17,7 +17,7 @@ env.ApplySConscript([
'$NET_DIR/using_net.scons',
])
-if env['PLATFORM'] == 'win32':
+if env.Bit('windows'):
env.Append(
LINKFLAGS = [
'/SUBSYSTEM:CONSOLE',