OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 import("flags.gni") | 5 import("flags.gni") |
| 6 import("//build/config/linux/pkg_config.gni") |
6 | 7 |
7 config("ssl_preprocessor_flags") { | 8 config("ssl_preprocessor_flags") { |
8 if (use_openssl) { | 9 if (use_openssl) { |
9 defines = [ "USE_OPENSSL" ] | 10 defines = [ "USE_OPENSSL" ] |
10 } else if (use_nss) { | 11 } else if (use_nss) { |
11 defines = [ "USE_NSS" ] | 12 defines = [ "USE_NSS" ] |
12 } | 13 } |
13 } | 14 } |
14 | 15 |
15 # Config for system SSL on Linux. | 16 # Config for system SSL on Linux. |
16 if (is_linux && use_system_ssl) { | 17 if (is_linux && use_system_ssl) { |
17 pkg_script = "//build/config/linux/pkg-config.py" | 18 pkg_config("system_ssl_config") { |
18 config("system_ssl_config") { | 19 packages = [ "nss" ] |
19 defines = [ "USE_SYSTEM_SSL" ] | 20 defines = [ "USE_SYSTEM_SSL" ] |
20 pkgresult = exec_script(pkg_script, [ "nss" ], "value") | |
21 include_dirs = pkgresult[0] | |
22 cflags = pkgresult[1] | |
23 libs = pkgresult[2] | |
24 lib_dirs = pkgresult[3] | |
25 } | 21 } |
26 } | 22 } |
27 | 23 |
28 # This meta-target will include the SSL library according to the build flags. | 24 # This meta-target will include the SSL library according to the build flags. |
29 group("metassl") { | 25 group("metassl") { |
30 direct_dependent_configs = [ ":ssl_preprocessor_flags" ] | 26 direct_dependent_configs = [ ":ssl_preprocessor_flags" ] |
31 | 27 |
32 if (use_openssl) { | 28 if (use_openssl) { |
33 assert(is_linux) | 29 assert(is_linux) |
34 deps = "//third_party/openssl" | 30 deps = "//third_party/openssl" |
35 use_openssl = false | 31 use_openssl = false |
36 } else if (use_system_ssl) { | 32 } else if (use_system_ssl) { |
37 assert(is_linux) | 33 assert(is_linux) |
38 direct_dependent_configs = ":system_ssl_config" | 34 direct_dependent_configs = ":system_ssl_config" |
39 } else { | 35 } else { |
40 deps = [ "//net/third_party/nss:ssl" ] | 36 deps = [ "//net/third_party/nss:ssl" ] |
41 } | 37 } |
42 | 38 |
43 forward_dependent_configs_from = deps | 39 forward_dependent_configs_from = deps |
44 } | 40 } |
OLD | NEW |