| 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("//build/config/crypto.gni") |
| 6 |
| 5 config("ssl_config") { | 7 config("ssl_config") { |
| 6 include_dirs = [ "." ] | 8 include_dirs = [ "." ] |
| 7 | 9 |
| 8 if (is_mac || is_win) { | 10 if (is_mac || is_win) { |
| 9 defines = [ "NSS_PLATFORM_CLIENT_AUTH" ] | 11 defines = [ "NSS_PLATFORM_CLIENT_AUTH" ] |
| 10 } | 12 } |
| 11 } | 13 } |
| 12 | 14 |
| 13 component("libssl") { | 15 if (!use_openssl) { |
| 14 output_name = "crssl" | 16 component("libssl") { |
| 17 output_name = "crssl" |
| 15 | 18 |
| 16 sources = [ | 19 sources = [ |
| 17 "SSLerrs.h", | 20 "SSLerrs.h", |
| 18 "authcert.c", | 21 "authcert.c", |
| 19 "bodge/secitem_array.c", | 22 "bodge/secitem_array.c", |
| 20 "cmpcert.c", | 23 "cmpcert.c", |
| 21 "derive.c", | 24 "derive.c", |
| 22 "dtlscon.c", | 25 "dtlscon.c", |
| 23 "preenc.h", | 26 "preenc.h", |
| 24 "prelib.c", | 27 "prelib.c", |
| 25 "ssl.h", | 28 "ssl.h", |
| 26 "ssl3con.c", | 29 "ssl3con.c", |
| 27 "ssl3ecc.c", | 30 "ssl3ecc.c", |
| 28 "ssl3ext.c", | 31 "ssl3ext.c", |
| 29 "ssl3gthr.c", | 32 "ssl3gthr.c", |
| 30 "ssl3prot.h", | 33 "ssl3prot.h", |
| 31 "sslauth.c", | 34 "sslauth.c", |
| 32 "sslcon.c", | 35 "sslcon.c", |
| 33 "ssldef.c", | 36 "ssldef.c", |
| 34 "sslenum.c", | 37 "sslenum.c", |
| 35 "sslerr.c", | 38 "sslerr.c", |
| 36 "sslerr.h", | 39 "sslerr.h", |
| 37 "sslerrstrs.c", | 40 "sslerrstrs.c", |
| 38 "sslgathr.c", | 41 "sslgathr.c", |
| 39 "sslimpl.h", | 42 "sslimpl.h", |
| 40 "sslinfo.c", | 43 "sslinfo.c", |
| 41 "sslinit.c", | 44 "sslinit.c", |
| 42 "sslmutex.c", | 45 "sslmutex.c", |
| 43 "sslmutex.h", | 46 "sslmutex.h", |
| 44 "sslnonce.c", | 47 "sslnonce.c", |
| 45 "sslplatf.c", | 48 "sslplatf.c", |
| 46 "sslproto.h", | 49 "sslproto.h", |
| 47 "sslreveal.c", | 50 "sslreveal.c", |
| 48 "sslsecur.c", | 51 "sslsecur.c", |
| 49 "sslsnce.c", | 52 "sslsnce.c", |
| 50 "sslsock.c", | 53 "sslsock.c", |
| 51 "sslt.h", | 54 "sslt.h", |
| 52 "ssltrace.c", | 55 "ssltrace.c", |
| 53 "sslver.c", | 56 "sslver.c", |
| 54 "unix_err.c", | |
| 55 "unix_err.h", | |
| 56 "win32err.c", | |
| 57 "win32err.h", | |
| 58 ] | |
| 59 | |
| 60 public_configs = [ ":ssl_config" ] | |
| 61 | |
| 62 cflags = [] | |
| 63 defines = [ | |
| 64 "NO_PKCS11_BYPASS", | |
| 65 "NSS_ENABLE_ECC", | |
| 66 "USE_UTIL_DIRECTLY", | |
| 67 ] | |
| 68 | |
| 69 configs -= [ "//build/config/compiler:chromium_code" ] | |
| 70 configs += [ "//build/config/compiler:no_chromium_code" ] | |
| 71 | |
| 72 if (is_win) { | |
| 73 sources -= [ | |
| 74 "unix_err.c", | 57 "unix_err.c", |
| 75 "unix_err.h", | 58 "unix_err.h", |
| 76 ] | |
| 77 if (is_component_build) { | |
| 78 ldflags = [ "/DEF:" + rebase_path("exports_win.def", root_build_dir) ] | |
| 79 } | |
| 80 } else if (is_linux) { | |
| 81 if (is_component_build) { | |
| 82 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] | |
| 83 } | |
| 84 | |
| 85 libs = [ "dl" ] | |
| 86 | |
| 87 include_dirs = [ "bodge" ] | |
| 88 | |
| 89 # Must be after ssl_config since we want our SSL headers to take | |
| 90 # precedence. | |
| 91 public_configs += [ "//third_party/nss:system_nss_no_ssl_config" ] | |
| 92 } else if (is_mac) { | |
| 93 libs = [ "Security.framework" ] | |
| 94 } | |
| 95 | |
| 96 if (is_clang) { | |
| 97 # SSL triggers some of these Clang warnings. | |
| 98 configs -= [ "//build/config/clang:extra_warnings" ] | |
| 99 | |
| 100 # There is a broken header guard in /usr/include/nss/secmod.h: | |
| 101 # https://bugzilla.mozilla.org/show_bug.cgi?id=884072 | |
| 102 cflags = [ "-Wno-header-guard" ] | |
| 103 | |
| 104 if (is_ios) { | |
| 105 # libssl uses routines deprecated on iOS (sem_init/sem_destroy). | |
| 106 # https://bugzilla.mozilla.org/show_bug.cgi?id=1192500 | |
| 107 cflags += [ "-Wno-deprecated-declarations" ] | |
| 108 } | |
| 109 } | |
| 110 | |
| 111 if (is_posix) { | |
| 112 sources -= [ | |
| 113 "win32err.c", | 59 "win32err.c", |
| 114 "win32err.h", | 60 "win32err.h", |
| 115 ] | 61 ] |
| 116 } | |
| 117 | 62 |
| 118 if (is_mac || is_ios) { | 63 public_configs = [ ":ssl_config" ] |
| 119 defines += [ | 64 |
| 120 "XP_UNIX", | 65 cflags = [] |
| 121 "DARWIN", | 66 defines = [ |
| 122 "XP_MACOSX", | 67 "NO_PKCS11_BYPASS", |
| 68 "NSS_ENABLE_ECC", |
| 69 "USE_UTIL_DIRECTLY", |
| 123 ] | 70 ] |
| 124 } | |
| 125 | 71 |
| 126 if (is_mac || is_ios || is_win) { | 72 configs -= [ "//build/config/compiler:chromium_code" ] |
| 127 sources -= [ "bodge/secitem_array.c" ] | 73 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 128 public_deps = [ | |
| 129 "//third_party/nss:nspr", | |
| 130 "//third_party/nss:nss", | |
| 131 ] | |
| 132 } | |
| 133 | 74 |
| 134 if (is_debug) { | 75 if (is_win) { |
| 135 defines += [ "DEBUG" ] | 76 sources -= [ |
| 77 "unix_err.c", |
| 78 "unix_err.h", |
| 79 ] |
| 80 if (is_component_build) { |
| 81 ldflags = [ "/DEF:" + rebase_path("exports_win.def", root_build_dir) ] |
| 82 } |
| 83 } else if (is_linux) { |
| 84 if (is_component_build) { |
| 85 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] |
| 86 } |
| 87 |
| 88 libs = [ "dl" ] |
| 89 |
| 90 include_dirs = [ "bodge" ] |
| 91 |
| 92 # Must be after ssl_config since we want our SSL headers to take |
| 93 # precedence. |
| 94 public_configs += [ "//third_party/nss:system_nss_no_ssl_config" ] |
| 95 } else if (is_mac) { |
| 96 libs = [ "Security.framework" ] |
| 97 } |
| 98 |
| 99 if (is_clang) { |
| 100 # SSL triggers some of these Clang warnings. |
| 101 configs -= [ "//build/config/clang:extra_warnings" ] |
| 102 |
| 103 # There is a broken header guard in /usr/include/nss/secmod.h: |
| 104 # https://bugzilla.mozilla.org/show_bug.cgi?id=884072 |
| 105 cflags = [ "-Wno-header-guard" ] |
| 106 |
| 107 if (is_ios) { |
| 108 # libssl uses routines deprecated on iOS (sem_init/sem_destroy). |
| 109 # https://bugzilla.mozilla.org/show_bug.cgi?id=1192500 |
| 110 cflags += [ "-Wno-deprecated-declarations" ] |
| 111 } |
| 112 } |
| 113 |
| 114 if (is_posix) { |
| 115 sources -= [ |
| 116 "win32err.c", |
| 117 "win32err.h", |
| 118 ] |
| 119 } |
| 120 |
| 121 if (is_mac || is_ios) { |
| 122 defines += [ |
| 123 "XP_UNIX", |
| 124 "DARWIN", |
| 125 "XP_MACOSX", |
| 126 ] |
| 127 } |
| 128 |
| 129 if (is_mac || is_ios || is_win) { |
| 130 sources -= [ "bodge/secitem_array.c" ] |
| 131 public_deps = [ |
| 132 "//third_party/nss:nspr", |
| 133 "//third_party/nss:nss", |
| 134 ] |
| 135 } |
| 136 |
| 137 if (is_debug) { |
| 138 defines += [ "DEBUG" ] |
| 139 } |
| 136 } | 140 } |
| 137 } | 141 } |
| OLD | NEW |