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 config("usrsctp_warnings") {
16 # atomic_init in user_atomic.h is a static function in a header.
17 cflags = [ "-Wno-unused-function" ]
21 static_library("usrsctp") {
23 "usrsctplib/netinet/sctp.h",
24 "usrsctplib/netinet/sctp_asconf.c",
25 "usrsctplib/netinet/sctp_asconf.h",
26 "usrsctplib/netinet/sctp_auth.c",
27 "usrsctplib/netinet/sctp_auth.h",
28 "usrsctplib/netinet/sctp_bsd_addr.c",
29 "usrsctplib/netinet/sctp_bsd_addr.h",
30 "usrsctplib/netinet/sctp_callout.c",
31 "usrsctplib/netinet/sctp_callout.h",
32 "usrsctplib/netinet/sctp_cc_functions.c",
33 "usrsctplib/netinet/sctp_constants.h",
34 "usrsctplib/netinet/sctp_crc32.c",
35 "usrsctplib/netinet/sctp_crc32.h",
36 "usrsctplib/netinet/sctp_header.h",
37 "usrsctplib/netinet/sctp_indata.c",
38 "usrsctplib/netinet/sctp_indata.h",
39 "usrsctplib/netinet/sctp_input.c",
40 "usrsctplib/netinet/sctp_input.h",
41 "usrsctplib/netinet/sctp_lock_userspace.h",
42 "usrsctplib/netinet/sctp_os.h",
43 "usrsctplib/netinet/sctp_os_userspace.h",
44 "usrsctplib/netinet/sctp_output.c",
45 "usrsctplib/netinet/sctp_output.h",
46 "usrsctplib/netinet/sctp_pcb.c",
47 "usrsctplib/netinet/sctp_pcb.h",
48 "usrsctplib/netinet/sctp_peeloff.c",
49 "usrsctplib/netinet/sctp_peeloff.h",
50 "usrsctplib/netinet/sctp_process_lock.h",
51 "usrsctplib/netinet/sctp_sha1.c",
52 "usrsctplib/netinet/sctp_sha1.h",
53 "usrsctplib/netinet/sctp_ss_functions.c",
54 "usrsctplib/netinet/sctp_structs.h",
55 "usrsctplib/netinet/sctp_sysctl.c",
56 "usrsctplib/netinet/sctp_sysctl.h",
57 "usrsctplib/netinet/sctp_timer.c",
58 "usrsctplib/netinet/sctp_timer.h",
59 "usrsctplib/netinet/sctp_uio.h",
60 "usrsctplib/netinet/sctp_userspace.c",
61 "usrsctplib/netinet/sctp_usrreq.c",
62 "usrsctplib/netinet/sctp_var.h",
63 "usrsctplib/netinet/sctputil.c",
64 "usrsctplib/netinet/sctputil.h",
65 "usrsctplib/netinet6/sctp6_usrreq.c",
66 "usrsctplib/netinet6/sctp6_var.h",
67 "usrsctplib/user_atomic.h",
68 "usrsctplib/user_environment.c",
69 "usrsctplib/user_environment.h",
70 "usrsctplib/user_inpcb.h",
71 "usrsctplib/user_ip6_var.h",
72 "usrsctplib/user_ip_icmp.h",
73 "usrsctplib/user_malloc.h",
74 "usrsctplib/user_mbuf.c",
75 "usrsctplib/user_mbuf.h",
76 "usrsctplib/user_queue.h",
77 "usrsctplib/user_recv_thread.c",
78 "usrsctplib/user_recv_thread.h",
79 "usrsctplib/user_route.h",
80 "usrsctplib/user_socket.c",
81 "usrsctplib/user_socketvar.h",
82 "usrsctplib/user_uma.h",
83 "usrsctplib/usrsctp.h",
87 "SCTP_PROCESS_LEVEL_LOCKS",
88 "SCTP_SIMPLE_ALLOCATOR",
91 # "SCTP_DEBUG", # Uncomment for SCTP debugging.
94 configs -= [ "//build/config/compiler:chromium_code" ]
96 "//build/config/compiler:no_chromium_code",
98 # These must be after no_chromium_code for warning flags to be ordered
100 "//build/config/compiler:no_incompatible_pointer_warnings",
104 public_configs = [ ":usrsctp_config" ]
107 defines += [ "SCTP_USE_OPENSSL_SHA1" ]
109 defines += [ "SCTP_USE_NSS_SHA1" ]
112 if (is_linux || is_android) {
113 defines += [ "__Userspace_os_Linux" ]
114 } else if (is_mac || is_ios) {
118 "__APPLE_USE_RFC_2292",
119 "__Userspace_os_Darwin",
125 "__Userspace_os_Windows",
127 # Manually setting WINVER and _WIN32_WINNT is needed because Chrome
128 # sets WINVER to a newer version of windows. But compiling usrsctp
129 # this way would is incompatible with windows XP.
131 "_WIN32_WINNT=0x0502",
133 configs -= [ "//build/config/win:winver" ]
135 defines += [ "NON_WINDOWS_DEFINE" ]