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.
5 import("//build/config/crypto.gni")
7 config("usrsctp_config") {
14 static_library("usrsctp") {
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",
80 "SCTP_PROCESS_LEVEL_LOCKS",
81 "SCTP_SIMPLE_ALLOCATOR",
84 # "SCTP_DEBUG", # Uncomment for SCTP debugging.
87 configs -= [ "//build/config/compiler:chromium_code" ]
88 configs += [ "//build/config/compiler:no_chromium_code" ]
90 public_configs = [ ":usrsctp_config" ]
93 defines += [ "SCTP_USE_OPENSSL_SHA1" ]
95 defines += [ "SCTP_USE_NSS_SHA1" ]
98 if (is_linux || is_android) {
99 defines += [ "__Userspace_os_Linux" ]
100 } else if (is_mac || is_ios) {
104 "__APPLE_USE_RFC_2292",
105 "__Userspace_os_Darwin",
111 "__Userspace_os_Windows",
113 # Manually setting WINVER and _WIN32_WINNT is needed because Chrome
114 # sets WINVER to a newer version of windows. But compiling usrsctp
115 # this way would is incompatible with windows XP.
117 "_WIN32_WINNT=0x0502",
120 defines += [ "NON_WINDOWS_DEFINE" ]
124 cflags = [ "-Wno-incompatible-pointer-types" ]
125 } else if (target_cpu == "mipsel") {
126 # mipsel is still using gcc (4.9),
127 # which does not support "-Wno-incompatible-pointer-types"
128 # so let's disable all warnings for this module.