| OLD | NEW |
| 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 __doc__ = """ |
| 6 Configuration for building net.lib / libnet.a. |
| 7 """ |
| 8 |
| 5 Import('env') | 9 Import('env') |
| 6 | 10 |
| 7 env_res = env.Clone() | 11 env_res = env.Clone() |
| 8 env_tests = env.Clone() | 12 env_tests = env.Clone() |
| 9 env = env.Clone() | 13 env = env.Clone() |
| 10 | 14 |
| 15 env.SConscript([ |
| 16 '$ICU38_DIR/using_icu38.scons', |
| 17 '$SDCH_DIR/using_sdch.scons', |
| 18 '$ZLIB_DIR/using_zlib.scons', |
| 19 ], {'env':env}) |
| 20 |
| 11 env.Prepend( | 21 env.Prepend( |
| 12 CPPPATH = [ | 22 CPPPATH = [ |
| 13 '$ZLIB_DIR', | 23 '$ROOT_DIR', |
| 14 '$ICU38_DIR/public/common', | |
| 15 '$ICU38_DIR/public/i18n', | |
| 16 '$SDCH_DIR/open-vcdiff/src', | |
| 17 '..', | |
| 18 ], | |
| 19 ) | |
| 20 | |
| 21 env.Append( | |
| 22 CPPDEFINES = [ | |
| 23 'U_STATIC_IMPLEMENTATION', | |
| 24 ], | 24 ], |
| 25 ) | 25 ) |
| 26 | 26 |
| 27 # These net files work on *all* platforms; files that don't work | 27 # These net files work on *all* platforms; files that don't work |
| 28 # cross-platform live below. | 28 # cross-platform live below. |
| 29 input_files = [ | 29 input_files = [ |
| 30 'base/address_list.cc', | 30 'base/address_list.cc', |
| 31 'base/auth_cache.cc', | 31 'base/auth_cache.cc', |
| 32 'base/base64.cc', | 32 'base/base64.cc', |
| 33 'base/bzip2_filter.cc', | 33 'base/bzip2_filter.cc', |
| 34 'base/client_socket_factory.cc', |
| 34 'base/client_socket_handle.cc', | 35 'base/client_socket_handle.cc', |
| 35 'base/client_socket_pool.cc', | 36 'base/client_socket_pool.cc', |
| 36 'base/cookie_monster.cc', | 37 'base/cookie_monster.cc', |
| 37 'base/cookie_policy.cc', | 38 'base/cookie_policy.cc', |
| 38 'base/data_url.cc', | 39 'base/data_url.cc', |
| 40 'base/directory_lister.cc', |
| 41 'base/dns_resolution_observer.cc', |
| 39 'base/escape.cc', | 42 'base/escape.cc', |
| 40 'base/ev_root_ca_metadata.cc', | 43 'base/ev_root_ca_metadata.cc', |
| 41 'base/filter.cc', | 44 'base/filter.cc', |
| 42 'base/gzip_filter.cc', | 45 'base/gzip_filter.cc', |
| 43 'base/gzip_header.cc', | 46 'base/gzip_header.cc', |
| 44 'base/host_resolver.cc', | 47 'base/host_resolver.cc', |
| 48 'base/listen_socket.cc', |
| 45 'base/mime_sniffer.cc', | 49 'base/mime_sniffer.cc', |
| 46 'base/mime_util.cc', | 50 'base/mime_util.cc', |
| 47 'base/net_errors.cc', | 51 'base/net_errors.cc', |
| 48 'base/net_module.cc', | 52 'base/net_module.cc', |
| 49 'base/net_util.cc', | 53 'base/net_util.cc', |
| 50 'base/registry_controlled_domain.cc', | 54 'base/registry_controlled_domain.cc', |
| 51 'base/sdch_filter.cc', | 55 'base/sdch_filter.cc', |
| 52 'base/sdch_manager.cc', | 56 'base/sdch_manager.cc', |
| 57 'base/ssl_client_socket_win.cc', |
| 58 'base/ssl_config_service.cc', |
| 59 'base/tcp_client_socket.cc', |
| 60 'base/telnet_server.cc', |
| 53 'base/upload_data.cc', | 61 'base/upload_data.cc', |
| 62 'base/upload_data_stream.cc', |
| 63 'base/wininet_util.cc', |
| 64 'base/winsock_init.cc', |
| 54 'base/x509_certificate.cc', | 65 'base/x509_certificate.cc', |
| 55 'disk_cache/backend_impl.cc', | 66 'disk_cache/backend_impl.cc', |
| 56 'disk_cache/block_files.cc', | 67 'disk_cache/block_files.cc', |
| 57 'disk_cache/entry_impl.cc', | 68 'disk_cache/entry_impl.cc', |
| 58 'disk_cache/file_lock.cc', | 69 'disk_cache/file_lock.cc', |
| 59 'disk_cache/hash.cc', | 70 'disk_cache/hash.cc', |
| 60 'disk_cache/mem_backend_impl.cc', | 71 'disk_cache/mem_backend_impl.cc', |
| 61 'disk_cache/mem_entry_impl.cc', | 72 'disk_cache/mem_entry_impl.cc', |
| 62 'disk_cache/mem_rankings.cc', | 73 'disk_cache/mem_rankings.cc', |
| 63 'disk_cache/rankings.cc', | 74 'disk_cache/rankings.cc', |
| 64 'disk_cache/stats.cc', | 75 'disk_cache/stats.cc', |
| 65 'disk_cache/stats_histogram.cc', | 76 'disk_cache/stats_histogram.cc', |
| 66 'disk_cache/trace.cc', | 77 'disk_cache/trace.cc', |
| 67 'http/cert_status_cache.cc', | 78 'http/cert_status_cache.cc', |
| 68 'http/http_auth.cc', | 79 'http/http_auth.cc', |
| 69 'http/http_auth_handler.cc', | 80 'http/http_auth_handler.cc', |
| 70 'http/http_auth_handler_basic.cc', | 81 'http/http_auth_handler_basic.cc', |
| 71 'http/http_auth_handler_digest.cc', | 82 'http/http_auth_handler_digest.cc', |
| 72 'http/http_cache.cc', | 83 'http/http_cache.cc', |
| 73 'http/http_chunked_decoder.cc', | 84 'http/http_chunked_decoder.cc', |
| 85 'http/http_network_layer.cc', |
| 86 'http/http_network_transaction.cc', |
| 74 'http/http_response_headers.cc', | 87 'http/http_response_headers.cc', |
| 88 'http/http_transaction_winhttp.cc', |
| 75 'http/http_util.cc', | 89 'http/http_util.cc', |
| 76 'http/http_vary_data.cc', | 90 'http/http_vary_data.cc', |
| 91 'http/winhttp_request_throttle.cc', |
| 92 'proxy/proxy_resolver_fixed.cc', |
| 93 'proxy/proxy_resolver_winhttp.cc', |
| 94 'proxy/proxy_service.cc', |
| 77 'url_request/mime_sniffer_proxy.cc', | 95 'url_request/mime_sniffer_proxy.cc', |
| 78 'url_request/url_request.cc', | 96 'url_request/url_request.cc', |
| 79 'url_request/url_request_about_job.cc', | 97 'url_request/url_request_about_job.cc', |
| 80 'url_request/url_request_error_job.cc', | 98 'url_request/url_request_error_job.cc', |
| 99 'url_request/url_request_file_dir_job.cc', |
| 81 'url_request/url_request_file_job.cc', | 100 'url_request/url_request_file_job.cc', |
| 101 'url_request/url_request_filter.cc', |
| 102 'url_request/url_request_ftp_job.cc', |
| 82 'url_request/url_request_http_job.cc', | 103 'url_request/url_request_http_job.cc', |
| 104 'url_request/url_request_inet_job.cc', |
| 83 'url_request/url_request_job.cc', | 105 'url_request/url_request_job.cc', |
| 106 'url_request/url_request_job_manager.cc', |
| 84 'url_request/url_request_job_metrics.cc', | 107 'url_request/url_request_job_metrics.cc', |
| 85 'url_request/url_request_job_tracker.cc', | 108 'url_request/url_request_job_tracker.cc', |
| 86 'url_request/url_request_simple_job.cc', | 109 'url_request/url_request_simple_job.cc', |
| 87 'url_request/url_request_test_job.cc', | 110 'url_request/url_request_test_job.cc', |
| 88 'url_request/url_request_view_cache_job.cc', | 111 'url_request/url_request_view_cache_job.cc', |
| 89 ] | 112 ] |
| 90 | 113 |
| 91 if env['PLATFORM'] == 'win32': | 114 if env['PLATFORM'] in ('posix', 'darwin'): |
| 92 input_files.extend([ | 115 # Remove files that still need to be ported from the input_files list. |
| 116 # TODO(port): delete files from this list as they get ported. |
| 117 to_be_ported_files = [ |
| 93 'base/client_socket_factory.cc', | 118 'base/client_socket_factory.cc', |
| 94 'base/directory_lister.cc', | 119 'base/directory_lister.cc', |
| 95 'base/dns_resolution_observer.cc', | 120 'base/dns_resolution_observer.cc', |
| 96 'base/listen_socket.cc', | 121 'base/listen_socket.cc', |
| 97 'base/ssl_client_socket_win.cc', | 122 'base/ssl_client_socket_win.cc', |
| 98 'base/ssl_config_service.cc', | 123 'base/ssl_config_service.cc', |
| 99 'base/tcp_client_socket.cc', | 124 'base/tcp_client_socket.cc', |
| 100 'base/telnet_server.cc', | 125 'base/telnet_server.cc', |
| 101 'base/upload_data_stream.cc', | 126 'base/upload_data_stream.cc', |
| 102 'base/wininet_util.cc', | 127 'base/wininet_util.cc', |
| 103 'base/winsock_init.cc', | 128 'base/winsock_init.cc', |
| 104 'http/http_network_layer.cc', | 129 'http/http_network_layer.cc', |
| 105 'http/http_network_transaction.cc', | 130 'http/http_network_transaction.cc', |
| 106 'http/http_transaction_winhttp.cc', | 131 'http/http_transaction_winhttp.cc', |
| 107 'http/winhttp_request_throttle.cc', | 132 'http/winhttp_request_throttle.cc', |
| 108 'proxy/proxy_resolver_fixed.cc', | 133 'proxy/proxy_resolver_fixed.cc', |
| 109 'proxy/proxy_resolver_winhttp.cc', | 134 'proxy/proxy_resolver_winhttp.cc', |
| 110 'proxy/proxy_service.cc', | 135 'proxy/proxy_service.cc', |
| 111 'url_request/url_request_file_dir_job.cc', | 136 'url_request/url_request_file_dir_job.cc', |
| 112 'url_request/url_request_filter.cc', | 137 'url_request/url_request_filter.cc', |
| 113 'url_request/url_request_ftp_job.cc', | 138 'url_request/url_request_ftp_job.cc', |
| 114 'url_request/url_request_inet_job.cc', | 139 'url_request/url_request_inet_job.cc', |
| 115 'url_request/url_request_job_manager.cc', | 140 'url_request/url_request_job_manager.cc', |
| 116 ]) | 141 ] |
| 142 for remove in to_be_ported_files: |
| 143 input_files.remove(remove) |
| 117 | 144 |
| 118 if env['PLATFORM'] == 'win32': | 145 if env['PLATFORM'] == 'win32': |
| 119 input_files.extend([ | 146 input_files.extend([ |
| 120 'base/file_input_stream_win.cc', | 147 'base/file_input_stream_win.cc', |
| 121 'base/net_util_win.cc', | 148 'base/net_util_win.cc', |
| 122 'base/platform_mime_util_win.cc', | 149 'base/platform_mime_util_win.cc', |
| 123 'base/x509_certificate_win.cc', | 150 'base/x509_certificate_win.cc', |
| 124 'disk_cache/cache_util_win.cc', | 151 'disk_cache/cache_util_win.cc', |
| 125 'disk_cache/file_win.cc', | 152 'disk_cache/file_win.cc', |
| 126 'disk_cache/mapped_file_win.cc', | 153 'disk_cache/mapped_file_win.cc', |
| (...skipping 28 matching lines...) Expand all Loading... |
| 155 # possibly only on incredibuild, scons doesn't know this. | 182 # possibly only on incredibuild, scons doesn't know this. |
| 156 env_p = env.Clone() | 183 env_p = env.Clone() |
| 157 env_p.Append(CCFLAGS='/Ylnet') | 184 env_p.Append(CCFLAGS='/Ylnet') |
| 158 pch, obj = env_p.PCH('precompiled_net.pch', 'build/precompiled_net.cc') | 185 pch, obj = env_p.PCH('precompiled_net.pch', 'build/precompiled_net.cc') |
| 159 env['PCH'] = pch | 186 env['PCH'] = pch |
| 160 env['PCHSTOP'] = 'precompiled_net.h' | 187 env['PCHSTOP'] = 'precompiled_net.h' |
| 161 env.Append(CCPCHFLAGS = ['/FIprecompiled_net.h']) | 188 env.Append(CCPCHFLAGS = ['/FIprecompiled_net.h']) |
| 162 input_files += [obj] | 189 input_files += [obj] |
| 163 | 190 |
| 164 env.ChromeStaticLibrary('net', input_files) | 191 env.ChromeStaticLibrary('net', input_files) |
| 165 | |
| 166 | |
| 167 env_tests.Prepend( | |
| 168 CPPPATH = [ | |
| 169 '..', | |
| 170 ], | |
| 171 CPPDEFINES = [ | |
| 172 'UNIT_TEST', | |
| 173 ], | |
| 174 LIBS = [ # On Linux, dependencies must follow dependents, so... | |
| 175 'net', # net must come before base and modp_b64 | |
| 176 'bzip2', # bzip2 must come before base | |
| 177 'base', | |
| 178 'googleurl', | |
| 179 'gtest', | |
| 180 'sdch', | |
| 181 env_tests['ICU_LIBS'], # TODO(sgk): '$ICU_LIBS' when scons is fixed | |
| 182 'modp_b64', | |
| 183 'zlib', | |
| 184 ] | |
| 185 ) | |
| 186 | |
| 187 env_tests.Append( | |
| 188 CPPPATH = [ | |
| 189 '$GTEST_DIR/include', | |
| 190 ], | |
| 191 ) | |
| 192 | |
| 193 if env['PLATFORM'] == 'win32': | |
| 194 env_tests.Prepend( | |
| 195 CCFLAGS = [ | |
| 196 '/TP', | |
| 197 '/WX', | |
| 198 ], | |
| 199 CPPDEFINES = [ | |
| 200 '_WIN32_WINNT=0x0600', | |
| 201 'WINVER=0x0600', | |
| 202 '_HAS_EXCEPTIONS=0', | |
| 203 ], | |
| 204 LINKFLAGS = [ | |
| 205 '/DELAYLOAD:"dwmapi.dll"', | |
| 206 '/DELAYLOAD:"uxtheme.dll"', | |
| 207 '/MACHINE:X86', | |
| 208 '/FIXED:No', | |
| 209 '/safeseh', | |
| 210 '/dynamicbase', | |
| 211 '/ignore:4199', | |
| 212 '/nxcompat', | |
| 213 ], | |
| 214 ) | |
| 215 | |
| 216 if env['PLATFORM'] in ('posix', 'darwin'): | |
| 217 env_tests.Append( | |
| 218 LIBS = [ | |
| 219 'event', | |
| 220 ], | |
| 221 ) | |
| 222 | |
| 223 | |
| 224 unittest_files = [ | |
| 225 'base/auth_cache_unittest.cc', | |
| 226 'base/base64_unittest.cc', | |
| 227 'base/bzip2_filter_unittest.cc', | |
| 228 'base/client_socket_pool_unittest.cc', | |
| 229 'base/cookie_monster_unittest.cc', | |
| 230 'base/cookie_policy_unittest.cc', | |
| 231 'base/data_url_unittest.cc', | |
| 232 'base/escape_unittest.cc', | |
| 233 'base/file_input_stream_unittest.cc', | |
| 234 'base/gzip_filter_unittest.cc', | |
| 235 'base/host_resolver_unittest.cc', | |
| 236 'base/mime_sniffer_unittest.cc', | |
| 237 'base/mime_util_unittest.cc', | |
| 238 'base/net_util_unittest.cc', | |
| 239 'base/registry_controlled_domain_unittest.cc', | |
| 240 'base/run_all_unittests.cc', | |
| 241 'base/tcp_client_socket_unittest.cc', | |
| 242 'base/test_completion_callback_unittest.cc', | |
| 243 'disk_cache/addr_unittest.cc', | |
| 244 'disk_cache/backend_unittest.cc', | |
| 245 'disk_cache/block_files_unittest.cc', | |
| 246 'disk_cache/disk_cache_test_base.cc', | |
| 247 'disk_cache/disk_cache_test_util.cc', | |
| 248 'disk_cache/entry_unittest.cc', | |
| 249 'disk_cache/mapped_file_unittest.cc', | |
| 250 'disk_cache/storage_block_unittest.cc', | |
| 251 'http/http_auth_unittest.cc', | |
| 252 'http/http_auth_handler_basic_unittest.cc', | |
| 253 'http/http_auth_handler_digest_unittest.cc', | |
| 254 'http/http_chunked_decoder_unittest.cc', | |
| 255 'http/http_response_headers_unittest.cc', | |
| 256 'http/http_vary_data_unittest.cc', | |
| 257 ] | |
| 258 | |
| 259 if env['PLATFORM'] == 'win32': | |
| 260 unittest_files.extend([ | |
| 261 'base/directory_lister_unittest.cc', | |
| 262 'base/sdch_filter_unittest.cc', | |
| 263 'base/ssl_config_service_unittest.cc', | |
| 264 'base/ssl_client_socket_unittest.cc', | |
| 265 'base/wininet_util_unittest.cc', | |
| 266 'http/http_cache_unittest.cc', | |
| 267 'http/http_network_layer_unittest.cc', | |
| 268 'http/http_network_transaction_unittest.cc', | |
| 269 'http/http_transaction_unittest.cc', | |
| 270 'http/http_transaction_winhttp_unittest.cc', | |
| 271 'http/http_util_unittest.cc', | |
| 272 'http/winhttp_request_throttle_unittest.cc', | |
| 273 'url_request/url_request_unittest.cc', | |
| 274 ]) | |
| 275 | |
| 276 if env['PLATFORM'] == 'darwin': | |
| 277 unittest_files.extend([ | |
| 278 '../base/platform_test_mac.o', | |
| 279 ]) | |
| 280 | |
| 281 net_unittests = env_tests.ChromeTestProgram('net_unittests', unittest_files) | |
| 282 | |
| 283 install_targets = net_unittests[:] | |
| 284 | |
| 285 if env['PLATFORM'] in ('posix', 'win32'): | |
| 286 | |
| 287 net_perftests = env_tests.ChromeTestProgram( | |
| 288 'net_perftests', | |
| 289 ['disk_cache/disk_cache_test_util.cc', | |
| 290 'disk_cache/disk_cache_perftest.cc', | |
| 291 'base/cookie_monster_perftest.cc', | |
| 292 # TODO(sgk): avoid using .cc from base directly | |
| 293 '$BASE_DIR/run_all_perftests$OBJSUFFIX', | |
| 294 '$BASE_DIR/perftimer$OBJSUFFIX'] | |
| 295 ) | |
| 296 | |
| 297 install_targets.extend([ | |
| 298 net_perftests | |
| 299 ]) | |
| 300 | |
| 301 if env['PLATFORM'] == 'win32': | |
| 302 stress_cache = env_tests.ChromeTestProgram( | |
| 303 'stress_cache', | |
| 304 ['disk_cache/stress_cache.cc', | |
| 305 'disk_cache/disk_cache_test_util.cc'] | |
| 306 ) | |
| 307 | |
| 308 crash_cache = env_tests.ChromeTestProgram( | |
| 309 'crash_cache', | |
| 310 ['tools/crash_cache/crash_cache.cc', | |
| 311 'disk_cache/disk_cache_test_util.cc'] | |
| 312 ) | |
| 313 | |
| 314 install_targets.extend([ | |
| 315 stress_cache, | |
| 316 crash_cache, | |
| 317 ]) | |
| 318 | |
| 319 | |
| 320 # Create install of tests. | |
| 321 installed_tests = env.Install('$TARGET_ROOT', install_targets) | |
| 322 | |
| 323 | |
| 324 if env['PLATFORM'] == 'win32': | |
| 325 env_res.Append( | |
| 326 CPPPATH = [ | |
| 327 '..', | |
| 328 ], | |
| 329 RCFLAGS = [ | |
| 330 ['/l', '0x409'], | |
| 331 ], | |
| 332 ) | |
| 333 | |
| 334 # TODO: Need to figure out what we're doing with external resources on | |
| 335 # linux. | |
| 336 # This dat file needed by net_resources is generated. | |
| 337 tld_names_clean = env_res.Command('net/effective_tld_names_clean.dat', | |
| 338 ['base/effective_tld_names.dat', | |
| 339 'tools/tld_cleanup/tld_cleanup.exe'], | |
| 340 '${SOURCES[1]} ${SOURCES[0]} $TARGET') | |
| 341 rc = env_res.Command('net_resources.rc', | |
| 342 'base/net_resources.rc', | |
| 343 Copy('$TARGET', '$SOURCE')) | |
| 344 net_resources = env_res.RES(rc) | |
| 345 env_res.Depends(rc, tld_names_clean) | |
| 346 | |
| 347 # TODO: We need to port tld_cleanup before this will work on other | |
| 348 # platforms. | |
| 349 sconscript_files = [ | |
| 350 'tools/tld_cleanup/SConscript', | |
| 351 ] | |
| 352 | |
| 353 SConscript(sconscript_files, exports=['env']) | |
| 354 | |
| 355 | |
| 356 env.Alias('net', ['.', installed_tests]) | |
| OLD | NEW |