Delete unused downloads page asset.
[chromium-blink-merge.git] / net / net_common.gypi
blob0a1a4edbf1a48a30cbf0942af1c43536c25a33b9
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   # This target is included in both 'net' and 'net_small'.
7   'type': '<(component)',
8   'variables': { 'enable_wexit_time_destructors': 1, },
9   'dependencies': [
10     '../base/base.gyp:base',
11     '../base/base.gyp:base_prefs',
12     '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
13     '../crypto/crypto.gyp:crypto',
14     '../sdch/sdch.gyp:sdch',
15     '../third_party/protobuf/protobuf.gyp:protobuf_lite',
16     '../third_party/zlib/zlib.gyp:zlib',
17     'net_derived_sources',
18     'net_quic_proto',
19     'net_resources',
20   ],
21   'sources': [
22     '<@(net_nacl_common_sources)',
23     '<@(net_non_nacl_sources)',
24   ],
25   'defines': [
26     'NET_IMPLEMENTATION',
27   ],
28   'export_dependent_settings': [
29     '../base/base.gyp:base',
30   ],
31   'conditions': [
32     ['chromeos==1', {
33       'sources!': [
34          'base/network_change_notifier_linux.cc',
35          'base/network_change_notifier_linux.h',
36          'base/network_change_notifier_netlink_linux.cc',
37          'base/network_change_notifier_netlink_linux.h',
38          'proxy/proxy_config_service_linux.cc',
39          'proxy/proxy_config_service_linux.h',
40       ],
41     }],
42     ['use_kerberos==1', {
43       'defines': [
44         'USE_KERBEROS',
45       ],
46       'conditions': [
47         ['OS=="openbsd"', {
48           'include_dirs': [
49             '/usr/include/kerberosV'
50           ],
51         }],
52         ['linux_link_kerberos==1', {
53           'link_settings': {
54             'ldflags': [
55               '<!@(krb5-config --libs gssapi)',
56             ],
57           },
58         }, { # linux_link_kerberos==0
59           'defines': [
60             'DLOPEN_KERBEROS',
61           ],
62         }],
63       ],
64     }, { # use_kerberos == 0
65       'sources!': [
66         'http/http_auth_gssapi_posix.cc',
67         'http/http_auth_gssapi_posix.h',
68         'http/http_auth_handler_negotiate.cc',
69         'http/http_auth_handler_negotiate.h',
70       ],
71     }],
72     ['posix_avoid_mmap==1', {
73       'defines': [
74         'POSIX_AVOID_MMAP',
75       ],
76       'direct_dependent_settings': {
77         'defines': [
78           'POSIX_AVOID_MMAP',
79         ],
80       },
81       'sources!': [
82         'disk_cache/blockfile/mapped_file_posix.cc',
83       ],
84     }, { # else
85       'sources!': [
86         'disk_cache/blockfile/mapped_file_avoid_mmap_posix.cc',
87       ],
88     }],
89     ['disable_file_support==1', {
90       # TODO(mmenke):  Should probably get rid of the dependency on
91       # net_resources in this case (It's used in net_util, to format
92       # directory listings.  Also used outside of net/).
93       'sources!': [
94         'base/directory_lister.cc',
95         'base/directory_lister.h',
96         'url_request/file_protocol_handler.cc',
97         'url_request/file_protocol_handler.h',
98         'url_request/url_request_file_dir_job.cc',
99         'url_request/url_request_file_dir_job.h',
100         'url_request/url_request_file_job.cc',
101         'url_request/url_request_file_job.h',
102       ],
103     }],
104     ['disable_ftp_support==1', {
105       'sources/': [
106         ['exclude', '^ftp/'],
107       ],
108       'sources!': [
109         'url_request/ftp_protocol_handler.cc',
110         'url_request/ftp_protocol_handler.h',
111         'url_request/url_request_ftp_job.cc',
112         'url_request/url_request_ftp_job.h',
113       ],
114     }],
115     ['enable_built_in_dns==1', {
116       'defines': [
117         'ENABLE_BUILT_IN_DNS',
118       ]
119     }, { # else
120       'sources!': [
121         'dns/address_sorter_posix.cc',
122         'dns/address_sorter_posix.h',
123         'dns/dns_client.cc',
124       ],
125     }],
126     ['use_openssl==1', {
127         'sources!': [
128           'base/nss_memio.c',
129           'base/nss_memio.h',
130           'cert/ct_log_verifier_nss.cc',
131           'cert/ct_objects_extractor_nss.cc',
132           'cert/jwk_serializer_nss.cc',
133           'cert/scoped_nss_types.h',
134           'cert/sha256_legacy_support_nss_win.cc',
135           'cert/x509_util_nss.cc',
136           'quic/crypto/aead_base_decrypter_nss.cc',
137           'quic/crypto/aead_base_encrypter_nss.cc',
138           'quic/crypto/aes_128_gcm_12_decrypter_nss.cc',
139           'quic/crypto/aes_128_gcm_12_encrypter_nss.cc',
140           'quic/crypto/chacha20_poly1305_decrypter_nss.cc',
141           'quic/crypto/chacha20_poly1305_encrypter_nss.cc',
142           'quic/crypto/channel_id_nss.cc',
143           'quic/crypto/p256_key_exchange_nss.cc',
144           'socket/nss_ssl_util.cc',
145           'socket/nss_ssl_util.h',
146           'socket/ssl_client_socket_nss.cc',
147           'socket/ssl_client_socket_nss.h',
148           'socket/ssl_server_socket_nss.cc',
149           'socket/ssl_server_socket_nss.h',
150         ],
151         'dependencies': [
152           '../third_party/boringssl/boringssl.gyp:boringssl',
153         ],
154       },
155       {  # else !use_openssl: remove the unneeded files and depend on NSS.
156         'sources!': [
157           'cert/ct_log_verifier_openssl.cc',
158           'cert/ct_objects_extractor_openssl.cc',
159           'cert/jwk_serializer_openssl.cc',
160           'cert/sha256_legacy_support_openssl_win.cc',
161           'cert/x509_util_openssl.cc',
162           'cert/x509_util_openssl.h',
163           'quic/crypto/aead_base_decrypter_openssl.cc',
164           'quic/crypto/aead_base_encrypter_openssl.cc',
165           'quic/crypto/aes_128_gcm_12_decrypter_openssl.cc',
166           'quic/crypto/aes_128_gcm_12_encrypter_openssl.cc',
167           'quic/crypto/chacha20_poly1305_decrypter_openssl.cc',
168           'quic/crypto/chacha20_poly1305_encrypter_openssl.cc',
169           'quic/crypto/channel_id_openssl.cc',
170           'quic/crypto/p256_key_exchange_openssl.cc',
171           'quic/crypto/scoped_evp_aead_ctx.cc',
172           'quic/crypto/scoped_evp_aead_ctx.h',
173           'socket/ssl_client_socket_openssl.cc',
174           'socket/ssl_client_socket_openssl.h',
175           'socket/ssl_server_socket_openssl.cc',
176           'socket/ssl_server_socket_openssl.h',
177           'ssl/client_key_store.cc',
178           'ssl/client_key_store.h',
179           'ssl/openssl_ssl_util.cc',
180           'ssl/openssl_ssl_util.h',
181           'ssl/ssl_client_session_cache_openssl.cc',
182           'ssl/ssl_client_session_cache_openssl.h',
183           'ssl/ssl_platform_key.h',
184           'ssl/ssl_platform_key_nss.cc',
185           'ssl/threaded_ssl_private_key.cc',
186           'ssl/threaded_ssl_private_key.h',
187         ],
188       },
189     ],
190     [ 'use_nss_certs == 1 or OS == "ios" or use_openssl == 0', {
191         'conditions': [
192           # Pull in the bundled or system NSS as appropriate.
193           [ 'desktop_linux == 1 or chromeos == 1', {
194             'dependencies': [
195               '../build/linux/system.gyp:ssl',
196             ],
197           }, {
198             'dependencies': [
199               '../third_party/nss/nss.gyp:nspr',
200               '../third_party/nss/nss.gyp:nss',
201               'third_party/nss/ssl.gyp:libssl',
202             ],
203           }]
204         ],
205       }, {
206         'sources!': [
207           'cert/x509_util_nss.h',
208         ],
209       },
210     ],
211     [ 'use_openssl_certs == 0', {
212         'sources!': [
213           'base/crypto_module_openssl.cc',
214           'base/keygen_handler_openssl.cc',
215           'base/openssl_private_key_store.h',
216           'base/openssl_private_key_store_android.cc',
217           'base/openssl_private_key_store_memory.cc',
218           'cert/cert_database_openssl.cc',
219           'cert/cert_verify_proc_openssl.cc',
220           'cert/cert_verify_proc_openssl.h',
221           'cert/test_root_certs_openssl.cc',
222           'cert/x509_certificate_openssl.cc',
223           'ssl/openssl_client_key_store.cc',
224           'ssl/openssl_client_key_store.h',
225         ],
226     }, {
227         'sources!': [
228           # TODO(davidben): Remove these exclusions when use_openssl_certs
229           # builds also use the SSLPrivateKey machinery.
230           'ssl/threaded_ssl_private_key.cc',
231           'ssl/threaded_ssl_private_key.h',
232         ],
233     }],
234     [ 'use_glib == 1', {
235         'dependencies': [
236           '../build/linux/system.gyp:gconf',
237           '../build/linux/system.gyp:gio',
238         ],
239     }],
240     [ 'desktop_linux == 1 or chromeos == 1', {
241         'conditions': [
242           ['os_bsd==1', {
243             'sources!': [
244               'base/network_change_notifier_linux.cc',
245               'base/network_change_notifier_netlink_linux.cc',
246               'proxy/proxy_config_service_linux.cc',
247             ],
248           },{
249             'dependencies': [
250               '../build/linux/system.gyp:libresolv',
251             ],
252           }],
253           ['OS=="solaris"', {
254             'link_settings': {
255               'ldflags': [
256                 '-R/usr/lib/mps',
257               ],
258             },
259           }],
260         ],
261       },
262     ],
263     [ 'use_nss_certs != 1', {
264         'sources!': [
265           'base/crypto_module_nss.cc',
266           'base/keygen_handler_nss.cc',
267           'cert/cert_database_nss.cc',
268           'cert/cert_verify_proc_nss.cc',
269           'cert/cert_verify_proc_nss.h',
270           'cert/nss_cert_database.cc',
271           'cert/nss_cert_database.h',
272           'cert/nss_cert_database_chromeos.cc',
273           'cert/nss_cert_database_chromeos.h',
274           'cert/nss_profile_filter_chromeos.cc',
275           'cert/nss_profile_filter_chromeos.h',
276           'cert/test_root_certs_nss.cc',
277           'cert/x509_certificate_nss.cc',
278           'cert/x509_util_nss_certs.cc',
279           'cert_net/nss_ocsp.cc',
280           'cert_net/nss_ocsp.h',
281           'ssl/client_cert_store_nss.cc',
282           'ssl/client_cert_store_nss.h',
283           'ssl/client_key_store.cc',
284           'ssl/client_key_store.h',
285           'ssl/ssl_platform_key_nss.cc',
286           'third_party/mozilla_security_manager/nsKeygenHandler.cpp',
287           'third_party/mozilla_security_manager/nsKeygenHandler.h',
288           'third_party/mozilla_security_manager/nsNSSCertificateDB.cpp',
289           'third_party/mozilla_security_manager/nsNSSCertificateDB.h',
290           'third_party/mozilla_security_manager/nsPKCS12Blob.cpp',
291           'third_party/mozilla_security_manager/nsPKCS12Blob.h',
292         ],
293       },
294     ],
295     # client_cert_store_nss.c requires NSS_CmpCertChainWCANames from NSS's
296     # libssl, but our bundled copy is not built in OpenSSL ports. Pull that
297     # file in directly.
298     [ 'use_nss_certs == 1 and use_openssl == 1', {
299         'sources': [
300           'third_party/nss/ssl/cmpcert.c',
301         ],
302     }],
303     [ 'enable_websockets != 1', {
304         'sources/': [
305           ['exclude', '^websockets/'],
306         ],
307     }],
308     [ 'enable_mdns != 1', {
309         'sources!' : [
310           'dns/mdns_cache.cc',
311           'dns/mdns_cache.h',
312           'dns/mdns_client.cc',
313           'dns/mdns_client.h',
314           'dns/mdns_client_impl.cc',
315           'dns/mdns_client_impl.h',
316           'dns/record_parsed.cc',
317           'dns/record_parsed.h',
318           'dns/record_rdata.cc',
319           'dns/record_rdata.h',
320         ]
321     }],
322     [ 'OS == "win"', {
323         'sources!': [
324           'http/http_auth_handler_ntlm_portable.cc',
325           'socket/socket_libevent.cc',
326           'socket/socket_libevent.h',
327           'socket/tcp_socket_libevent.cc',
328           'socket/tcp_socket_libevent.h',
329           'udp/udp_socket_libevent.cc',
330           'udp/udp_socket_libevent.h',
331         ],
332          # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
333         'msvs_disabled_warnings': [4267, ],
334       }, { # else: OS != "win"
335         'sources!': [
336           'base/winsock_init.cc',
337           'base/winsock_init.h',
338           'base/winsock_util.cc',
339           'base/winsock_util.h',
340           'proxy/proxy_resolver_winhttp.cc',
341           'proxy/proxy_resolver_winhttp.h',
342         ],
343       },
344     ],
345     [ 'OS == "mac"', {
346         'link_settings': {
347           'libraries': [
348             '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
349             '$(SDKROOT)/System/Library/Frameworks/Security.framework',
350             '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
351             '$(SDKROOT)/usr/lib/libresolv.dylib',
352           ]
353         },
354       },
355     ],
356     [ 'OS == "ios"', {
357         'sources!': [
358           'disk_cache/blockfile/file_posix.cc',
359         ],
360         'link_settings': {
361           'libraries': [
362             '$(SDKROOT)/System/Library/Frameworks/CFNetwork.framework',
363             '$(SDKROOT)/System/Library/Frameworks/MobileCoreServices.framework',
364             '$(SDKROOT)/System/Library/Frameworks/Security.framework',
365             '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework',
366           ],
367           'xcode_settings': {
368             'OTHER_LDFLAGS': [
369               '-lresolv',
370             ],
371           },
372         },
373       },
374     ],
375     [ 'OS == "ios" or OS == "mac"', {
376         'sources': [
377           '<@(net_base_mac_ios_sources)',
378         ],
379       },
380     ],
381     ['OS=="android" and _toolset=="target"', {
382       'dependencies': [
383          'net_java',
384       ],
385     }],
386     [ 'OS == "android"', {
387         'dependencies': [
388           'net_jni_headers',
389         ],
390         'sources!': [
391           'base/openssl_private_key_store_memory.cc',
392           'cert/cert_database_openssl.cc',
393           'cert/cert_verify_proc_openssl.cc',
394           'cert/test_root_certs_openssl.cc',
395           'http/http_auth_gssapi_posix.cc',
396           'http/http_auth_gssapi_posix.h',
397         ],
398       },
399     ],
400   ],
401   'target_conditions': [
402     # These source files are excluded by default platform rules, but they
403     # are needed in specific cases on other platforms. Re-including them can
404     # only be done in target_conditions as it is evaluated after the
405     # platform rules.
406     ['OS == "android"', {
407       'sources/': [
408         ['include', '^base/platform_mime_util_linux\\.cc$'],
409         ['include', '^base/address_tracker_linux\\.cc$'],
410         ['include', '^base/address_tracker_linux\\.h$'],
411         ['include', '^base/network_interfaces_linux\\.cc$'],
412         ['include', '^base/network_interfaces_linux\\.h$'],
413       ],
414     }],
415     ['OS == "ios"', {
416       'sources/': [
417         ['include', '^base/mac/url_conversions\\.h$'],
418         ['include', '^base/mac/url_conversions\\.mm$'],
419         ['include', '^base/network_change_notifier_mac\\.cc$'],
420         ['include', '^base/network_config_watcher_mac\\.cc$'],
421         ['include', '^base/network_interfaces_mac\\.cc$'],
422         ['include', '^base/network_interfaces_mac\\.h$'],
423         ['include', '^base/platform_mime_util_mac\\.mm$'],
424         # The iOS implementation only partially uses NSS and thus does not
425         # defines |use_nss_certs|. In particular the |USE_NSS_CERTS|
426         # preprocessor definition is not used. The following files are needed
427         # though:
428         ['include', '^cert/cert_verify_proc_nss\\.cc$'],
429         ['include', '^cert/cert_verify_proc_nss\\.h$'],
430         ['include', '^cert/test_root_certs_nss\\.cc$'],
431         ['include', '^cert/x509_util_nss_certs\\.cc$'],
432         ['include', '^cert_net/nss_ocsp\\.cc$'],
433         ['include', '^cert_net/nss_ocsp\\.h$'],
434         ['include', '^proxy/proxy_resolver_mac\\.cc$'],
435         ['include', '^proxy/proxy_server_mac\\.cc$'],
436       ],
437     }],
438   ],