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