diff options
author | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-21 20:24:56 +0000 |
---|---|---|
committer | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-21 20:24:56 +0000 |
commit | 4c75444536c32d6f57801ab73129e90b93db0605 (patch) | |
tree | cf468f03b60942cbccd8a166713cf39a610f0131 /net | |
parent | ad11a576675dba34fe8f84f2abe6d1fed793b874 (diff) | |
download | chromium_src-4c75444536c32d6f57801ab73129e90b93db0605.zip chromium_src-4c75444536c32d6f57801ab73129e90b93db0605.tar.gz chromium_src-4c75444536c32d6f57801ab73129e90b93db0605.tar.bz2 |
SCons renaming updates for base, net and googleurl:
* Rename SConscript files to {module}.scons or {moduel}_lib.scons,
depending on the primary target involved.
* Separate targets into individual *.scons files, with one
construction environment (named "env") per *.scons file.
* Add using_{module}.scons files (like .vsprops) that will be used
by other modules to add CPPDEFINES, CPPPATH, LIBS and LIBPATH values.
* Update other modules' *.scons files to use the new using_{module}.scons
files (using a temporary one-liner idiom until we have the
ApplySConscript() method from the Hammer modules).
* Use the idiom of removing to-be-ported files from the master list,
so they can be simply deleted from the to-be-ported list as they
get ported in the future, instead of having to shuffle entries
between lists.
* Use $OBJ_ROOT instead of hard-coded '#/$BUILD_TYPE/' for the $*_DIR
variables.
* Add a addRepository() call mapping build/ to $TARGET_ROOT/googleurl,
so its $OBJ_ROOT value can look like the others'.
* Formatting changes, primarily modifying indentation to conform to
style guidelines.
* Fix copyright headers in some third_party/* modules
previously overlooked.
* Add rudimentary __doc__ strings, setting up for a future
ability to generate meaningful documentation.
Review URL: http://codereview.chromium.org/7807
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/SConscript | 356 | ||||
-rw-r--r-- | net/crash_cache.scons | 64 | ||||
-rw-r--r-- | net/net.scons | 39 | ||||
-rw-r--r-- | net/net_lib.scons | 191 | ||||
-rw-r--r-- | net/net_perftests.scons | 76 | ||||
-rw-r--r-- | net/net_resources.scons | 41 | ||||
-rw-r--r-- | net/net_unittests.scons | 125 | ||||
-rw-r--r-- | net/stress_cache.scons | 62 | ||||
-rw-r--r-- | net/tools/tld_cleanup/SConscript | 52 | ||||
-rw-r--r-- | net/tools/tld_cleanup/tld_cleanup.scons | 54 | ||||
-rw-r--r-- | net/using_net.scons | 15 |
11 files changed, 667 insertions, 408 deletions
diff --git a/net/SConscript b/net/SConscript deleted file mode 100644 index 8a0b85c..0000000 --- a/net/SConscript +++ /dev/null @@ -1,356 +0,0 @@ -# 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_res = env.Clone() -env_tests = env.Clone() -env = env.Clone() - -env.Prepend( - CPPPATH = [ - '$ZLIB_DIR', - '$ICU38_DIR/public/common', - '$ICU38_DIR/public/i18n', - '$SDCH_DIR/open-vcdiff/src', - '..', - ], -) - -env.Append( - CPPDEFINES = [ - 'U_STATIC_IMPLEMENTATION', - ], -) - -# These net files work on *all* platforms; files that don't work -# cross-platform live below. -input_files = [ - 'base/address_list.cc', - 'base/auth_cache.cc', - 'base/base64.cc', - 'base/bzip2_filter.cc', - 'base/client_socket_handle.cc', - 'base/client_socket_pool.cc', - 'base/cookie_monster.cc', - 'base/cookie_policy.cc', - 'base/data_url.cc', - 'base/escape.cc', - 'base/ev_root_ca_metadata.cc', - 'base/filter.cc', - 'base/gzip_filter.cc', - 'base/gzip_header.cc', - 'base/host_resolver.cc', - 'base/mime_sniffer.cc', - 'base/mime_util.cc', - 'base/net_errors.cc', - 'base/net_module.cc', - 'base/net_util.cc', - 'base/registry_controlled_domain.cc', - 'base/sdch_filter.cc', - 'base/sdch_manager.cc', - 'base/upload_data.cc', - 'base/x509_certificate.cc', - 'disk_cache/backend_impl.cc', - 'disk_cache/block_files.cc', - 'disk_cache/entry_impl.cc', - 'disk_cache/file_lock.cc', - 'disk_cache/hash.cc', - 'disk_cache/mem_backend_impl.cc', - 'disk_cache/mem_entry_impl.cc', - 'disk_cache/mem_rankings.cc', - 'disk_cache/rankings.cc', - 'disk_cache/stats.cc', - 'disk_cache/stats_histogram.cc', - 'disk_cache/trace.cc', - 'http/cert_status_cache.cc', - 'http/http_auth.cc', - 'http/http_auth_handler.cc', - 'http/http_auth_handler_basic.cc', - 'http/http_auth_handler_digest.cc', - 'http/http_cache.cc', - 'http/http_chunked_decoder.cc', - 'http/http_response_headers.cc', - 'http/http_util.cc', - 'http/http_vary_data.cc', - 'url_request/mime_sniffer_proxy.cc', - 'url_request/url_request.cc', - 'url_request/url_request_about_job.cc', - 'url_request/url_request_error_job.cc', - 'url_request/url_request_file_job.cc', - 'url_request/url_request_http_job.cc', - 'url_request/url_request_job.cc', - 'url_request/url_request_job_metrics.cc', - 'url_request/url_request_job_tracker.cc', - 'url_request/url_request_simple_job.cc', - 'url_request/url_request_test_job.cc', - 'url_request/url_request_view_cache_job.cc', -] - -if env['PLATFORM'] == 'win32': - input_files.extend([ - 'base/client_socket_factory.cc', - 'base/directory_lister.cc', - 'base/dns_resolution_observer.cc', - 'base/listen_socket.cc', - 'base/ssl_client_socket_win.cc', - 'base/ssl_config_service.cc', - 'base/tcp_client_socket.cc', - 'base/telnet_server.cc', - 'base/upload_data_stream.cc', - 'base/wininet_util.cc', - 'base/winsock_init.cc', - 'http/http_network_layer.cc', - 'http/http_network_transaction.cc', - 'http/http_transaction_winhttp.cc', - 'http/winhttp_request_throttle.cc', - 'proxy/proxy_resolver_fixed.cc', - 'proxy/proxy_resolver_winhttp.cc', - 'proxy/proxy_service.cc', - 'url_request/url_request_file_dir_job.cc', - 'url_request/url_request_filter.cc', - 'url_request/url_request_ftp_job.cc', - 'url_request/url_request_inet_job.cc', - 'url_request/url_request_job_manager.cc', - ]) - -if env['PLATFORM'] == 'win32': - input_files.extend([ - 'base/file_input_stream_win.cc', - 'base/net_util_win.cc', - 'base/platform_mime_util_win.cc', - 'base/x509_certificate_win.cc', - 'disk_cache/cache_util_win.cc', - 'disk_cache/file_win.cc', - 'disk_cache/mapped_file_win.cc', - 'disk_cache/os_file_win.cc', - ]) - -if env['PLATFORM'] == 'darwin': - input_files.extend([ - 'base/platform_mime_util_mac.mm', - 'base/x509_certificate_mac.cc', - ]) - -if env['PLATFORM'] == 'posix': - input_files.extend([ - # TODO(tc): gnome-vfs? xdgmime? /etc/mime.types? - 'base/platform_mime_util_linux.cc', - ]) - -if env['PLATFORM'] in ('darwin', 'posix'): - input_files.extend([ - 'base/file_input_stream_posix.cc', - 'base/net_util_posix.cc', - 'base/tcp_client_socket_libevent.cc', - 'disk_cache/cache_util_posix.cc', - 'disk_cache/file_posix.cc', - 'disk_cache/mapped_file_posix.cc', - 'disk_cache/os_file_posix.cc', - ]) - -if env['PLATFORM'] == 'win32': - # TODO(bradnelson): This step generates file precompiled_net.pch.ib_tag - # possibly only on incredibuild, scons doesn't know this. - env_p = env.Clone() - env_p.Append(CCFLAGS='/Ylnet') - pch, obj = env_p.PCH('precompiled_net.pch', 'build/precompiled_net.cc') - env['PCH'] = pch - env['PCHSTOP'] = 'precompiled_net.h' - env.Append(CCPCHFLAGS = ['/FIprecompiled_net.h']) - input_files += [obj] - -env.ChromeStaticLibrary('net', input_files) - - -env_tests.Prepend( - CPPPATH = [ - '..', - ], - CPPDEFINES = [ - 'UNIT_TEST', - ], - LIBS = [ # On Linux, dependencies must follow dependents, so... - 'net', # net must come before base and modp_b64 - 'bzip2', # bzip2 must come before base - 'base', - 'googleurl', - 'gtest', - 'sdch', - env_tests['ICU_LIBS'], # TODO(sgk): '$ICU_LIBS' when scons is fixed - 'modp_b64', - 'zlib', - ] -) - -env_tests.Append( - CPPPATH = [ - '$GTEST_DIR/include', - ], -) - -if env['PLATFORM'] == 'win32': - env_tests.Prepend( - CCFLAGS = [ - '/TP', - '/WX', - ], - CPPDEFINES = [ - '_WIN32_WINNT=0x0600', - 'WINVER=0x0600', - '_HAS_EXCEPTIONS=0', - ], - LINKFLAGS = [ - '/DELAYLOAD:"dwmapi.dll"', - '/DELAYLOAD:"uxtheme.dll"', - '/MACHINE:X86', - '/FIXED:No', - '/safeseh', - '/dynamicbase', - '/ignore:4199', - '/nxcompat', - ], - ) - -if env['PLATFORM'] in ('posix', 'darwin'): - env_tests.Append( - LIBS = [ - 'event', - ], - ) - - -unittest_files = [ - 'base/auth_cache_unittest.cc', - 'base/base64_unittest.cc', - 'base/bzip2_filter_unittest.cc', - 'base/client_socket_pool_unittest.cc', - 'base/cookie_monster_unittest.cc', - 'base/cookie_policy_unittest.cc', - 'base/data_url_unittest.cc', - 'base/escape_unittest.cc', - 'base/file_input_stream_unittest.cc', - 'base/gzip_filter_unittest.cc', - 'base/host_resolver_unittest.cc', - 'base/mime_sniffer_unittest.cc', - 'base/mime_util_unittest.cc', - 'base/net_util_unittest.cc', - 'base/registry_controlled_domain_unittest.cc', - 'base/run_all_unittests.cc', - 'base/tcp_client_socket_unittest.cc', - 'base/test_completion_callback_unittest.cc', - 'disk_cache/addr_unittest.cc', - 'disk_cache/backend_unittest.cc', - 'disk_cache/block_files_unittest.cc', - 'disk_cache/disk_cache_test_base.cc', - 'disk_cache/disk_cache_test_util.cc', - 'disk_cache/entry_unittest.cc', - 'disk_cache/mapped_file_unittest.cc', - 'disk_cache/storage_block_unittest.cc', - 'http/http_auth_unittest.cc', - 'http/http_auth_handler_basic_unittest.cc', - 'http/http_auth_handler_digest_unittest.cc', - 'http/http_chunked_decoder_unittest.cc', - 'http/http_response_headers_unittest.cc', - 'http/http_vary_data_unittest.cc', -] - -if env['PLATFORM'] == 'win32': - unittest_files.extend([ - 'base/directory_lister_unittest.cc', - 'base/sdch_filter_unittest.cc', - 'base/ssl_config_service_unittest.cc', - 'base/ssl_client_socket_unittest.cc', - 'base/wininet_util_unittest.cc', - 'http/http_cache_unittest.cc', - 'http/http_network_layer_unittest.cc', - 'http/http_network_transaction_unittest.cc', - 'http/http_transaction_unittest.cc', - 'http/http_transaction_winhttp_unittest.cc', - 'http/http_util_unittest.cc', - 'http/winhttp_request_throttle_unittest.cc', - 'url_request/url_request_unittest.cc', - ]) - -if env['PLATFORM'] == 'darwin': - unittest_files.extend([ - '../base/platform_test_mac.o', - ]) - -net_unittests = env_tests.ChromeTestProgram('net_unittests', unittest_files) - -install_targets = net_unittests[:] - -if env['PLATFORM'] in ('posix', 'win32'): - - net_perftests = env_tests.ChromeTestProgram( - 'net_perftests', - ['disk_cache/disk_cache_test_util.cc', - 'disk_cache/disk_cache_perftest.cc', - 'base/cookie_monster_perftest.cc', - # TODO(sgk): avoid using .cc from base directly - '$BASE_DIR/run_all_perftests$OBJSUFFIX', - '$BASE_DIR/perftimer$OBJSUFFIX'] - ) - - install_targets.extend([ - net_perftests - ]) - -if env['PLATFORM'] == 'win32': - stress_cache = env_tests.ChromeTestProgram( - 'stress_cache', - ['disk_cache/stress_cache.cc', - 'disk_cache/disk_cache_test_util.cc'] - ) - - crash_cache = env_tests.ChromeTestProgram( - 'crash_cache', - ['tools/crash_cache/crash_cache.cc', - 'disk_cache/disk_cache_test_util.cc'] - ) - - install_targets.extend([ - stress_cache, - crash_cache, - ]) - - -# Create install of tests. -installed_tests = env.Install('$TARGET_ROOT', install_targets) - - -if env['PLATFORM'] == 'win32': - env_res.Append( - CPPPATH = [ - '..', - ], - RCFLAGS = [ - ['/l', '0x409'], - ], - ) - - # TODO: Need to figure out what we're doing with external resources on - # linux. - # This dat file needed by net_resources is generated. - tld_names_clean = env_res.Command('net/effective_tld_names_clean.dat', - ['base/effective_tld_names.dat', - 'tools/tld_cleanup/tld_cleanup.exe'], - '${SOURCES[1]} ${SOURCES[0]} $TARGET') - rc = env_res.Command('net_resources.rc', - 'base/net_resources.rc', - Copy('$TARGET', '$SOURCE')) - net_resources = env_res.RES(rc) - env_res.Depends(rc, tld_names_clean) - - # TODO: We need to port tld_cleanup before this will work on other - # platforms. - sconscript_files = [ - 'tools/tld_cleanup/SConscript', - ] - - SConscript(sconscript_files, exports=['env']) - - -env.Alias('net', ['.', installed_tests]) diff --git a/net/crash_cache.scons b/net/crash_cache.scons new file mode 100644 index 0000000..6ef6860 --- /dev/null +++ b/net/crash_cache.scons @@ -0,0 +1,64 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Configuration the disk_cache{,.exe} executable. +""" + +Import('env') + +env = env.Clone() + +env.SConscript([ + # On Linux, dependencies must follow dependents, so... + # 1) net must come before base and modp_b64. + '$NET_DIR/using_net.scons', + + '$BASE_DIR/using_base.scons', + '$GTEST_DIR/../using_gtest.scons', + '$ICU38_DIR/using_icu38.scons', +], {'env':env}) + +env.Prepend( + CPPPATH = [ + '$ROOT_DIR', + ], +) + +if env['PLATFORM'] == 'win32': + env.Prepend( + CCFLAGS = [ + '/TP', + '/WX', + ], + CPPDEFINES = [ + '_WIN32_WINNT=0x0600', + 'WINVER=0x0600', + '_HAS_EXCEPTIONS=0', + ], + LINKFLAGS = [ + '/DELAYLOAD:"dwmapi.dll"', + '/DELAYLOAD:"uxtheme.dll"', + '/MACHINE:X86', + '/FIXED:No', + '/safeseh', + '/dynamicbase', + '/ignore:4199', + '/nxcompat', + ], + ) + +input_files = [ + 'disk_cache/disk_cache_test_util$OBJSUFFIX', + 'tools/crash_cache/crash_cache.cc', +] + + +if env['PLATFORM'] in ('posix', 'win32'): + + crash_cache = env.ChromeTestProgram('crash_cache', input_files) + + installed_test = env.Install('$TARGET_ROOT', crash_cache) + + env.Alias('net', installed_test) diff --git a/net/net.scons b/net/net.scons new file mode 100644 index 0000000..04a23154 --- /dev/null +++ b/net/net.scons @@ -0,0 +1,39 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Master configuration for building net components. +""" + +Import('env') + +sconscript_files = [ + 'crash_cache.scons', + 'net_lib.scons', + 'net_perftests.scons', + 'net_unittests.scons', + 'stress_cache.scons', +] + +if env['PLATFORM'] in ('posix', 'darwin'): + # Remove *.scons files whose targets still need to be ported. + # TODO(port): delete files from this list as they get ported. + to_be_ported = [ + 'crash_cache.scons', + 'stress_cache.scons', + ] + for remove in to_be_ported: + sconscript_files.remove(remove) + +if env['PLATFORM'] == 'win32': + # TODO: We need to port tld_cleanup before this will work on other + # platforms. + sconscript_files.extend([ + 'net_resources.scons', + 'tools/tld_cleanup/tld_cleanup.scons', + ]) + +SConscript(sconscript_files, exports=['env']) + +env.Alias('net', '.') diff --git a/net/net_lib.scons b/net/net_lib.scons new file mode 100644 index 0000000..ee57964 --- /dev/null +++ b/net/net_lib.scons @@ -0,0 +1,191 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Configuration for building net.lib / libnet.a. +""" + +Import('env') + +env_res = env.Clone() +env_tests = env.Clone() +env = env.Clone() + +env.SConscript([ + '$ICU38_DIR/using_icu38.scons', + '$SDCH_DIR/using_sdch.scons', + '$ZLIB_DIR/using_zlib.scons', +], {'env':env}) + +env.Prepend( + CPPPATH = [ + '$ROOT_DIR', + ], +) + +# These net files work on *all* platforms; files that don't work +# cross-platform live below. +input_files = [ + 'base/address_list.cc', + 'base/auth_cache.cc', + 'base/base64.cc', + 'base/bzip2_filter.cc', + 'base/client_socket_factory.cc', + 'base/client_socket_handle.cc', + 'base/client_socket_pool.cc', + 'base/cookie_monster.cc', + 'base/cookie_policy.cc', + 'base/data_url.cc', + 'base/directory_lister.cc', + 'base/dns_resolution_observer.cc', + 'base/escape.cc', + 'base/ev_root_ca_metadata.cc', + 'base/filter.cc', + 'base/gzip_filter.cc', + 'base/gzip_header.cc', + 'base/host_resolver.cc', + 'base/listen_socket.cc', + 'base/mime_sniffer.cc', + 'base/mime_util.cc', + 'base/net_errors.cc', + 'base/net_module.cc', + 'base/net_util.cc', + 'base/registry_controlled_domain.cc', + 'base/sdch_filter.cc', + 'base/sdch_manager.cc', + 'base/ssl_client_socket_win.cc', + 'base/ssl_config_service.cc', + 'base/tcp_client_socket.cc', + 'base/telnet_server.cc', + 'base/upload_data.cc', + 'base/upload_data_stream.cc', + 'base/wininet_util.cc', + 'base/winsock_init.cc', + 'base/x509_certificate.cc', + 'disk_cache/backend_impl.cc', + 'disk_cache/block_files.cc', + 'disk_cache/entry_impl.cc', + 'disk_cache/file_lock.cc', + 'disk_cache/hash.cc', + 'disk_cache/mem_backend_impl.cc', + 'disk_cache/mem_entry_impl.cc', + 'disk_cache/mem_rankings.cc', + 'disk_cache/rankings.cc', + 'disk_cache/stats.cc', + 'disk_cache/stats_histogram.cc', + 'disk_cache/trace.cc', + 'http/cert_status_cache.cc', + 'http/http_auth.cc', + 'http/http_auth_handler.cc', + 'http/http_auth_handler_basic.cc', + 'http/http_auth_handler_digest.cc', + 'http/http_cache.cc', + 'http/http_chunked_decoder.cc', + 'http/http_network_layer.cc', + 'http/http_network_transaction.cc', + 'http/http_response_headers.cc', + 'http/http_transaction_winhttp.cc', + 'http/http_util.cc', + 'http/http_vary_data.cc', + 'http/winhttp_request_throttle.cc', + 'proxy/proxy_resolver_fixed.cc', + 'proxy/proxy_resolver_winhttp.cc', + 'proxy/proxy_service.cc', + 'url_request/mime_sniffer_proxy.cc', + 'url_request/url_request.cc', + 'url_request/url_request_about_job.cc', + 'url_request/url_request_error_job.cc', + 'url_request/url_request_file_dir_job.cc', + 'url_request/url_request_file_job.cc', + 'url_request/url_request_filter.cc', + 'url_request/url_request_ftp_job.cc', + 'url_request/url_request_http_job.cc', + 'url_request/url_request_inet_job.cc', + 'url_request/url_request_job.cc', + 'url_request/url_request_job_manager.cc', + 'url_request/url_request_job_metrics.cc', + 'url_request/url_request_job_tracker.cc', + 'url_request/url_request_simple_job.cc', + 'url_request/url_request_test_job.cc', + 'url_request/url_request_view_cache_job.cc', +] + +if env['PLATFORM'] in ('posix', 'darwin'): + # 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 = [ + 'base/client_socket_factory.cc', + 'base/directory_lister.cc', + 'base/dns_resolution_observer.cc', + 'base/listen_socket.cc', + 'base/ssl_client_socket_win.cc', + 'base/ssl_config_service.cc', + 'base/tcp_client_socket.cc', + 'base/telnet_server.cc', + 'base/upload_data_stream.cc', + 'base/wininet_util.cc', + 'base/winsock_init.cc', + 'http/http_network_layer.cc', + 'http/http_network_transaction.cc', + 'http/http_transaction_winhttp.cc', + 'http/winhttp_request_throttle.cc', + 'proxy/proxy_resolver_fixed.cc', + 'proxy/proxy_resolver_winhttp.cc', + 'proxy/proxy_service.cc', + 'url_request/url_request_file_dir_job.cc', + 'url_request/url_request_filter.cc', + 'url_request/url_request_ftp_job.cc', + 'url_request/url_request_inet_job.cc', + 'url_request/url_request_job_manager.cc', + ] + for remove in to_be_ported_files: + input_files.remove(remove) + +if env['PLATFORM'] == 'win32': + input_files.extend([ + 'base/file_input_stream_win.cc', + 'base/net_util_win.cc', + 'base/platform_mime_util_win.cc', + 'base/x509_certificate_win.cc', + 'disk_cache/cache_util_win.cc', + 'disk_cache/file_win.cc', + 'disk_cache/mapped_file_win.cc', + 'disk_cache/os_file_win.cc', + ]) + +if env['PLATFORM'] == 'darwin': + input_files.extend([ + 'base/platform_mime_util_mac.mm', + 'base/x509_certificate_mac.cc', + ]) + +if env['PLATFORM'] == 'posix': + input_files.extend([ + # TODO(tc): gnome-vfs? xdgmime? /etc/mime.types? + 'base/platform_mime_util_linux.cc', + ]) + +if env['PLATFORM'] in ('darwin', 'posix'): + input_files.extend([ + 'base/file_input_stream_posix.cc', + 'base/net_util_posix.cc', + 'base/tcp_client_socket_libevent.cc', + 'disk_cache/cache_util_posix.cc', + 'disk_cache/file_posix.cc', + 'disk_cache/mapped_file_posix.cc', + 'disk_cache/os_file_posix.cc', + ]) + +if env['PLATFORM'] == 'win32': + # TODO(bradnelson): This step generates file precompiled_net.pch.ib_tag + # possibly only on incredibuild, scons doesn't know this. + env_p = env.Clone() + env_p.Append(CCFLAGS='/Ylnet') + pch, obj = env_p.PCH('precompiled_net.pch', 'build/precompiled_net.cc') + env['PCH'] = pch + env['PCHSTOP'] = 'precompiled_net.h' + env.Append(CCPCHFLAGS = ['/FIprecompiled_net.h']) + input_files += [obj] + +env.ChromeStaticLibrary('net', input_files) diff --git a/net/net_perftests.scons b/net/net_perftests.scons new file mode 100644 index 0000000..8c25187 --- /dev/null +++ b/net/net_perftests.scons @@ -0,0 +1,76 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Configuration for building the net_perftests{,.exe} executable. +""" + +Import('env') + +env = env.Clone() + +env.SConscript([ + # On Linux, dependencies must follow dependents, so... + # 1) net must come before base and modp_b64. + # 2) bzip2 must come before base. + '$NET_DIR/using_net.scons', + + '$BASE_DIR/using_base.scons', + '#/../build/using_googleurl.scons', + '$GTEST_DIR/../using_gtest.scons', + '$ICU38_DIR/using_icu38.scons', + '$MODP_B64_DIR/using_modp_b64.scons', +], {'env':env}) + +if env['PLATFORM'] in ('posix', 'darwin'): + env.SConscript([ + '$LIBEVENT_DIR/using_libevent.scons', + ], {'env':env}) + +env.Prepend( + CPPPATH = [ + '$ROOT_DIR', + ], +) + +if env['PLATFORM'] == 'win32': + env.Prepend( + CCFLAGS = [ + '/TP', + '/WX', + ], + CPPDEFINES = [ + '_WIN32_WINNT=0x0600', + 'WINVER=0x0600', + '_HAS_EXCEPTIONS=0', + ], + LINKFLAGS = [ + '/DELAYLOAD:"dwmapi.dll"', + '/DELAYLOAD:"uxtheme.dll"', + '/MACHINE:X86', + '/FIXED:No', + '/safeseh', + '/dynamicbase', + '/ignore:4199', + '/nxcompat', + ], + ) + +input_files = [ + 'base/cookie_monster_perftest.cc', + 'disk_cache/disk_cache_perftest.cc', + 'disk_cache/disk_cache_test_util$OBJSUFFIX', + + # TODO(sgk): avoid using .cc from base directly + '$OBJ_ROOT/base/run_all_perftests$OBJSUFFIX', + '$OBJ_ROOT/base/perftimer$OBJSUFFIX', +] + +if env['PLATFORM'] in ('posix', 'win32'): + + net_perftests = env.ChromeTestProgram('net_perftests', input_files) + + installed_test = env.Install('$TARGET_ROOT', net_perftests) + + env.Alias('net', installed_test) diff --git a/net/net_resources.scons b/net/net_resources.scons new file mode 100644 index 0000000..bbce3c4 --- /dev/null +++ b/net/net_resources.scons @@ -0,0 +1,41 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Configuration for building the net_resources.rc resources. +""" + +Import('env') + +env = env.Clone() + +env.Prepend( + CPPPATH = [ + '$ROOT_DIR', + ], + RCFLAGS = [ + ['/l', '0x409'], + ], +) + +input_files = [ + 'base/effective_tld_names.dat', + 'tools/tld_cleanup/tld_cleanup.exe' +] + +# TODO: Need to figure out what to do with external resources on linux. +# This dat file needed by net_resources is generated. +tld_names_clean = env.Command('net/effective_tld_names_clean.dat', + input_files, + '${SOURCES[1]} ${SOURCES[0]} $TARGET') + +rc = env.Command('net_resources.rc', + 'base/net_resources.rc', + Copy('$TARGET', '$SOURCE')) + +env.Depends(rc, tld_names_clean) + +net_resources = env.RES(rc) + +env.Alias('net', net_resources) diff --git a/net/net_unittests.scons b/net/net_unittests.scons new file mode 100644 index 0000000..374f0f1 --- /dev/null +++ b/net/net_unittests.scons @@ -0,0 +1,125 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Configuration for building the net_unittests{,.exe} executable. +""" + +Import('env') + +env = env.Clone() + +env.SConscript([ + # On Linux, dependencies must follow dependents, so... + # 1) net must come before base and modp_b64. + # 2) bzip2 must come before base. + '$NET_DIR/using_net.scons', + '$BZIP2_DIR/using_bzip2.scons', + + '$BASE_DIR/using_base.scons', + '#/../build/using_googleurl.scons', + '$GTEST_DIR/../using_gtest.scons', + '$ICU38_DIR/using_icu38.scons', + '$MODP_B64_DIR/using_modp_b64.scons', + '$SDCH_DIR/using_sdch.scons', + '$ZLIB_DIR/using_zlib.scons', +], {'env':env}) + +if env['PLATFORM'] in ('posix', 'darwin'): + env.SConscript([ + '$LIBEVENT_DIR/using_libevent.scons', + ], {'env':env}) + + +env.Prepend( + CPPPATH = [ + '$ROOT_DIR', + ], +) + +if env['PLATFORM'] == 'win32': + env.Prepend( + CCFLAGS = [ + '/TP', + '/WX', + ], + CPPDEFINES = [ + '_WIN32_WINNT=0x0600', + 'WINVER=0x0600', + '_HAS_EXCEPTIONS=0', + ], + LINKFLAGS = [ + '/DELAYLOAD:"dwmapi.dll"', + '/DELAYLOAD:"uxtheme.dll"', + '/MACHINE:X86', + '/FIXED:No', + '/safeseh', + '/dynamicbase', + '/ignore:4199', + '/nxcompat', + ], + ) + +input_files = [ + 'base/auth_cache_unittest.cc', + 'base/base64_unittest.cc', + 'base/bzip2_filter_unittest.cc', + 'base/client_socket_pool_unittest.cc', + 'base/cookie_monster_unittest.cc', + 'base/cookie_policy_unittest.cc', + 'base/data_url_unittest.cc', + 'base/escape_unittest.cc', + 'base/file_input_stream_unittest.cc', + 'base/gzip_filter_unittest.cc', + 'base/host_resolver_unittest.cc', + 'base/mime_sniffer_unittest.cc', + 'base/mime_util_unittest.cc', + 'base/net_util_unittest.cc', + 'base/registry_controlled_domain_unittest.cc', + 'base/run_all_unittests.cc', + 'base/tcp_client_socket_unittest.cc', + 'base/test_completion_callback_unittest.cc', + 'disk_cache/addr_unittest.cc', + 'disk_cache/backend_unittest.cc', + 'disk_cache/block_files_unittest.cc', + 'disk_cache/disk_cache_test_base.cc', + 'disk_cache/disk_cache_test_util.cc', + 'disk_cache/entry_unittest.cc', + 'disk_cache/mapped_file_unittest.cc', + 'disk_cache/storage_block_unittest.cc', + 'http/http_auth_unittest.cc', + 'http/http_auth_handler_basic_unittest.cc', + 'http/http_auth_handler_digest_unittest.cc', + 'http/http_chunked_decoder_unittest.cc', + 'http/http_response_headers_unittest.cc', + 'http/http_vary_data_unittest.cc', +] + +if env['PLATFORM'] == 'win32': + input_files.extend([ + 'base/directory_lister_unittest.cc', + 'base/sdch_filter_unittest.cc', + 'base/ssl_config_service_unittest.cc', + 'base/ssl_client_socket_unittest.cc', + 'base/wininet_util_unittest.cc', + 'http/http_cache_unittest.cc', + 'http/http_network_layer_unittest.cc', + 'http/http_network_transaction_unittest.cc', + 'http/http_transaction_unittest.cc', + 'http/http_transaction_winhttp_unittest.cc', + 'http/http_util_unittest.cc', + 'http/winhttp_request_throttle_unittest.cc', + 'url_request/url_request_unittest.cc', + ]) + +if env['PLATFORM'] == 'darwin': + input_files.extend([ + '../base/platform_test_mac$OBJSUFFIX', + ]) + +net_unittests = env.ChromeTestProgram('net_unittests', input_files) + +installed_test = env.Install('$TARGET_ROOT', net_unittests) + +env.Alias('net', installed_test) diff --git a/net/stress_cache.scons b/net/stress_cache.scons new file mode 100644 index 0000000..ea8ff17 --- /dev/null +++ b/net/stress_cache.scons @@ -0,0 +1,62 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Configuration for building the stress_cache{,.exe} executable. +""" + +Import('env') + +env = env.Clone() + +env.SConscript([ + # On Linux, dependencies must follow dependents, so... + # 1) net must come before base and modp_b64. + '$NET_DIR/using_net.scons', + + '$BASE_DIR/using_base.scons', + '$GTEST_DIR/../using_gtest.scons', + '$ICU38_DIR/using_icu38.scons', +], {'env':env}) + +env.Prepend( + CPPPATH = [ + '$ROOT_DIR', + ], +) + +if env['PLATFORM'] == 'win32': + env.Prepend( + CCFLAGS = [ + '/TP', + '/WX', + ], + CPPDEFINES = [ + '_WIN32_WINNT=0x0600', + 'WINVER=0x0600', + '_HAS_EXCEPTIONS=0', + ], + LINKFLAGS = [ + '/DELAYLOAD:"dwmapi.dll"', + '/DELAYLOAD:"uxtheme.dll"', + '/MACHINE:X86', + '/FIXED:No', + '/safeseh', + '/dynamicbase', + '/ignore:4199', + '/nxcompat', + ], + ) + +input_files = [ + 'disk_cache/disk_cache_test_util$OBJSUFFIX', + 'disk_cache/stress_cache.cc', +] + +if env['PLATFORM'] == 'win32': + stress_cache = env.ChromeTestProgram('stress_cache', input_files) + + installed_test = env.Install('$TARGET_ROOT', stress_cache) + + env.Alias('net', installed_test) diff --git a/net/tools/tld_cleanup/SConscript b/net/tools/tld_cleanup/SConscript deleted file mode 100644 index 5ab7e82..0000000 --- a/net/tools/tld_cleanup/SConscript +++ /dev/null @@ -1,52 +0,0 @@ -# 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.Prepend( - CPPPATH = [ - '../../..', - ], - LIBS = [ - 'googleurl', - env['ICU_LIBS'], # TODO(sgk): '$ICU_LIBS' when scons is fixed - 'base', - # We only need to link with net due to use precompiled_net.pch. - 'net', - ], -) - -env.Append( - CCFLAGS = [ - '/TP', - ], - - LINKFLAGS = [ - '/INCREMENTAL', - '/MANIFEST', - '/DELAYLOAD:"dwmapi.dll"', - '/DELAYLOAD:"uxtheme.dll"', - '/DEBUG', - '/SUBSYSTEM:CONSOLE', - '/MACHINE:X86', - '/FIXED:No', - '/safeseh', - '/dynamicbase', - '/ignore:4199', - '/nxcompat', - ], -) - -input_files = [ - 'tld_cleanup.cc', -] - -exe_targets = env.ChromeProgram('tld_cleanup', input_files) -i = env.Install('$TARGET_ROOT', exe_targets) -env.Alias('net', i) - -env.Install('$TARGET_ROOT', exe_targets) - diff --git a/net/tools/tld_cleanup/tld_cleanup.scons b/net/tools/tld_cleanup/tld_cleanup.scons new file mode 100644 index 0000000..4819883 --- /dev/null +++ b/net/tools/tld_cleanup/tld_cleanup.scons @@ -0,0 +1,54 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Configuration the tld_cleanup{,.exe} executable. +""" + +Import('env') + +env = env.Clone() + +env.SConscript([ + '$BASE_DIR/using_base.scons', + '#/../build/using_googleurl.scons', + '$ICU38_DIR/using_icu38.scons', + '$NET_DIR/using_net.scons', +], {'env':env}) + +env.Prepend( + CPPPATH = [ + '$ROOT_DIR', + ], +) + +if env['PLATFORM'] == 'win32': + env.Append( + CCFLAGS = [ + '/TP', + ], + + LINKFLAGS = [ + '/INCREMENTAL', + '/MANIFEST', + '/DELAYLOAD:"dwmapi.dll"', + '/DELAYLOAD:"uxtheme.dll"', + '/DEBUG', + '/SUBSYSTEM:CONSOLE', + '/MACHINE:X86', + '/FIXED:No', + '/safeseh', + '/dynamicbase', + '/ignore:4199', + '/nxcompat', + ], + ) + +input_files = [ + 'tld_cleanup.cc', +] + +tld_cleanup = env.ChromeProgram('tld_cleanup', input_files) +i = env.Install('$TARGET_ROOT', tld_cleanup) +env.Alias('net', i) diff --git a/net/using_net.scons b/net/using_net.scons new file mode 100644 index 0000000..f5fed16 --- /dev/null +++ b/net/using_net.scons @@ -0,0 +1,15 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +Settings for other components using the net library. +""" + +Import("env") + +env.Append( + LIBS = [ + 'net', + ], +) |