Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / usrsctp / BUILD.gn
1 # Copyright 2014 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 import("//build/config/crypto.gni")
6
7 config("usrsctp_config") {
8   include_dirs = [
9     "usrsctplib",
10     "usrsctplib/netinet",
11   ]
12 }
13
14 static_library("usrsctp") {
15   sources = [
16     "usrsctplib/netinet/sctp.h",
17     "usrsctplib/netinet/sctp_asconf.c",
18     "usrsctplib/netinet/sctp_asconf.h",
19     "usrsctplib/netinet/sctp_auth.c",
20     "usrsctplib/netinet/sctp_auth.h",
21     "usrsctplib/netinet/sctp_bsd_addr.c",
22     "usrsctplib/netinet/sctp_bsd_addr.h",
23     "usrsctplib/netinet/sctp_callout.c",
24     "usrsctplib/netinet/sctp_callout.h",
25     "usrsctplib/netinet/sctp_cc_functions.c",
26     "usrsctplib/netinet/sctp_constants.h",
27     "usrsctplib/netinet/sctp_crc32.c",
28     "usrsctplib/netinet/sctp_crc32.h",
29     "usrsctplib/netinet/sctp_header.h",
30     "usrsctplib/netinet/sctp_indata.c",
31     "usrsctplib/netinet/sctp_indata.h",
32     "usrsctplib/netinet/sctp_input.c",
33     "usrsctplib/netinet/sctp_input.h",
34     "usrsctplib/netinet/sctp_lock_userspace.h",
35     "usrsctplib/netinet/sctp_os.h",
36     "usrsctplib/netinet/sctp_os_userspace.h",
37     "usrsctplib/netinet/sctp_output.c",
38     "usrsctplib/netinet/sctp_output.h",
39     "usrsctplib/netinet/sctp_pcb.c",
40     "usrsctplib/netinet/sctp_pcb.h",
41     "usrsctplib/netinet/sctp_peeloff.c",
42     "usrsctplib/netinet/sctp_peeloff.h",
43     "usrsctplib/netinet/sctp_process_lock.h",
44     "usrsctplib/netinet/sctp_sha1.c",
45     "usrsctplib/netinet/sctp_sha1.h",
46     "usrsctplib/netinet/sctp_ss_functions.c",
47     "usrsctplib/netinet/sctp_structs.h",
48     "usrsctplib/netinet/sctp_sysctl.c",
49     "usrsctplib/netinet/sctp_sysctl.h",
50     "usrsctplib/netinet/sctp_timer.c",
51     "usrsctplib/netinet/sctp_timer.h",
52     "usrsctplib/netinet/sctp_uio.h",
53     "usrsctplib/netinet/sctp_userspace.c",
54     "usrsctplib/netinet/sctp_usrreq.c",
55     "usrsctplib/netinet/sctp_var.h",
56     "usrsctplib/netinet/sctputil.c",
57     "usrsctplib/netinet/sctputil.h",
58     "usrsctplib/netinet6/sctp6_usrreq.c",
59     "usrsctplib/netinet6/sctp6_var.h",
60     "usrsctplib/user_atomic.h",
61     "usrsctplib/user_environment.c",
62     "usrsctplib/user_environment.h",
63     "usrsctplib/user_inpcb.h",
64     "usrsctplib/user_ip6_var.h",
65     "usrsctplib/user_ip_icmp.h",
66     "usrsctplib/user_malloc.h",
67     "usrsctplib/user_mbuf.c",
68     "usrsctplib/user_mbuf.h",
69     "usrsctplib/user_queue.h",
70     "usrsctplib/user_recv_thread.c",
71     "usrsctplib/user_recv_thread.h",
72     "usrsctplib/user_route.h",
73     "usrsctplib/user_socket.c",
74     "usrsctplib/user_socketvar.h",
75     "usrsctplib/user_uma.h",
76     "usrsctplib/usrsctp.h"
77   ]
78
79   defines = [
80     "SCTP_PROCESS_LEVEL_LOCKS",
81     "SCTP_SIMPLE_ALLOCATOR",
82     "__Userspace__",
83     # "SCTP_DEBUG", # Uncomment for SCTP debugging.
84   ]
85
86   configs -= [ "//build/config/compiler:chromium_code" ]
87   configs += [ "//build/config/compiler:no_chromium_code" ]
88
89   public_configs = [ ":usrsctp_config" ]
90
91   if (use_openssl) {
92     defines += [ "SCTP_USE_OPENSSL_SHA1" ]
93   } else {
94     defines += [ "SCTP_USE_NSS_SHA1" ]
95   }
96
97   if (is_linux || is_android) {
98     defines += [ "__Userspace_os_Linux" ]
99   } else if (is_mac || is_ios) {
100     defines += [
101       "HAVE_SA_LEN",
102       "HAVE_SCONN_LEN",
103       "__APPLE_USE_RFC_2292",
104       "__Userspace_os_Darwin",
105     ]
106   }
107
108   if (is_win) {
109     defines += [
110       "__Userspace_os_Windows",
111       # Manually setting WINVER and _WIN32_WINNT is needed because Chrome
112       # sets WINVER to a newer version of  windows. But compiling usrsctp
113       # this way would is incompatible  with windows XP.
114       "WINVER=0x0502",
115       "_WIN32_WINNT=0x0502",
116     ]
117   } else {
118     defines += [ "NON_WINDOWS_DEFINE" ]
119   }
120
121   if (is_clang) {
122     cflags = [ "-Wno-incompatible-pointer-types" ]
123   }
124
125   deps = [
126     "//crypto:platform",
127   ]
128 }