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.
6 use_system_libsrtp = false
9 config("libsrtp_config") {
18 "srtp/crypto/include",
40 "HAVE_BYTESWAP_METHODS_H",
41 # All Windows architectures are this way.
42 "SIZEOF_UNSIGNED_LONG=4",
43 "SIZEOF_UNSIGNED_LONG_LONG=8",
47 if (cpu_arch == "x64" || cpu_arch == "x86" || cpu_arch == "arm") {
49 # TODO(leozwang): CPU_RISC doesn"t work properly on android/arm
50 # platform for unknown reasons, need to investigate the root cause
51 # of it. CPU_RISC is used for optimization only, and CPU_CISC should
52 # just work just fine, it has been tested on android/arm with srtp
53 # test applications and libjingle.
58 if (cpu_arch == "mipsel") {
59 defines += [ "CPU_RISC" ]
63 config("system_libsrtp_config") {
64 defines = [ "USE_SYSTEM_LIBSRTP" ]
65 include_dirs = [ "/usr/include/srtp" ]
68 if (use_system_libsrtp) {
70 direct_dependent_configs = [ ":libsrtp_config", ":system_libsrtp_config" ]
74 static_library("libsrtp") {
75 configs -= [ "//build/config/compiler:chromium_code" ]
76 configs += [ "//build/config/compiler:no_chromium_code" ]
77 configs += [ ":libsrtp_config" ]
82 "srtp/include/getopt_s.h",
84 "srtp/include/rtp_priv.h",
85 "srtp/include/srtp.h",
86 "srtp/include/srtp_priv.h",
87 "srtp/include/ut_sim.h",
90 "srtp/crypto/include/aes_cbc.h",
91 "srtp/crypto/include/aes.h",
92 "srtp/crypto/include/aes_icm.h",
93 "srtp/crypto/include/alloc.h",
94 "srtp/crypto/include/auth.h",
95 "srtp/crypto/include/cipher.h",
96 "srtp/crypto/include/cryptoalg.h",
97 "srtp/crypto/include/crypto.h",
98 "srtp/crypto/include/crypto_kernel.h",
99 "srtp/crypto/include/crypto_math.h",
100 "srtp/crypto/include/crypto_types.h",
101 "srtp/crypto/include/datatypes.h",
102 "srtp/crypto/include/err.h",
103 "srtp/crypto/include/gf2_8.h",
104 "srtp/crypto/include/hmac.h",
105 "srtp/crypto/include/integers.h",
106 "srtp/crypto/include/kernel_compat.h",
107 "srtp/crypto/include/key.h",
108 "srtp/crypto/include/null_auth.h",
109 "srtp/crypto/include/null_cipher.h",
110 "srtp/crypto/include/prng.h",
111 "srtp/crypto/include/rand_source.h",
112 "srtp/crypto/include/rdb.h",
113 "srtp/crypto/include/rdbx.h",
114 "srtp/crypto/include/sha1.h",
115 "srtp/crypto/include/stat.h",
116 "srtp/crypto/include/xfm.h",
122 "srtp/crypto/cipher/aes.c",
123 "srtp/crypto/cipher/aes_cbc.c",
124 "srtp/crypto/cipher/aes_icm.c",
125 "srtp/crypto/cipher/cipher.c",
126 "srtp/crypto/cipher/null_cipher.c",
127 "srtp/crypto/hash/auth.c",
128 "srtp/crypto/hash/hmac.c",
129 "srtp/crypto/hash/null_auth.c",
130 "srtp/crypto/hash/sha1.c",
131 "srtp/crypto/kernel/alloc.c",
132 "srtp/crypto/kernel/crypto_kernel.c",
133 "srtp/crypto/kernel/err.c",
134 "srtp/crypto/kernel/key.c",
135 "srtp/crypto/math/datatypes.c",
136 "srtp/crypto/math/gf2_8.c",
137 "srtp/crypto/math/stat.c",
138 "srtp/crypto/replay/rdb.c",
139 "srtp/crypto/replay/rdbx.c",
140 "srtp/crypto/replay/ut_sim.c",
141 "srtp/crypto/rng/ctr_prng.c",
142 "srtp/crypto/rng/prng.c",
143 "srtp/crypto/rng/rand_source.c",
147 # TODO(GYP): A bunch of these tests don't compile (in gyp either). They're
148 # not very broken, so could probably be made to work if it's useful.
150 executable("rdbx_driver") {
151 configs -= [ "//build/config/compiler:chromium_code" ]
152 configs += [ "//build/config/compiler:no_chromium_code" ]
153 configs += [ ":libsrtp_config" ]
154 deps = [ ":libsrtp" ]
156 "srtp/include/getopt_s.h",
157 "srtp/test/getopt_s.c",
158 "srtp/test/rdbx_driver.c",
162 executable("srtp_driver") {
163 configs -= [ "//build/config/compiler:chromium_code" ]
164 configs += [ "//build/config/compiler:no_chromium_code" ]
165 configs += [ ":libsrtp_config" ]
166 deps = [ ":libsrtp" ]
168 "srtp/include/getopt_s.h",
169 "srtp/include/srtp_priv.h",
170 "srtp/test/getopt_s.c",
171 "srtp/test/srtp_driver.c",
175 executable("roc_driver") {
176 configs -= [ "//build/config/compiler:chromium_code" ]
177 configs += [ "//build/config/compiler:no_chromium_code" ]
178 configs += [ ":libsrtp_config" ]
179 deps = [ ":libsrtp" ]
181 "srtp/crypto/include/rdbx.h",
182 "srtp/include/ut_sim.h",
183 "srtp/test/roc_driver.c",
187 executable("replay_driver") {
188 configs -= [ "//build/config/compiler:chromium_code" ]
189 configs += [ "//build/config/compiler:no_chromium_code" ]
190 configs += [ ":libsrtp_config" ]
191 deps = [ ":libsrtp" ]
193 "srtp/crypto/include/rdbx.h",
194 "srtp/include/ut_sim.h",
195 "srtp/test/replay_driver.c",
200 configs -= [ "//build/config/compiler:chromium_code" ]
201 configs += [ "//build/config/compiler:no_chromium_code" ]
202 configs += [ ":libsrtp_config" ]
203 deps = [ ":libsrtp" ]
205 "srtp/include/getopt_s.h",
206 "srtp/include/rtp.h",
207 "srtp/include/srtp.h",
208 "srtp/crypto/include/datatypes.h",
209 "srtp/test/getopt_s.c",
214 defines = [ "HAVE_SYS_SOCKET_H" ]
218 executable("srtp_test_cipher_driver") {
219 configs -= [ "//build/config/compiler:chromium_code" ]
220 configs += [ "//build/config/compiler:no_chromium_code" ]
221 configs += [ ":libsrtp_config" ]
222 deps = [ ":libsrtp" ]
224 "srtp/crypto/test/cipher_driver.c",
228 executable("srtp_test_datatypes_driver") {
229 configs -= [ "//build/config/compiler:chromium_code" ]
230 configs += [ "//build/config/compiler:no_chromium_code" ]
231 configs += [ ":libsrtp_config" ]
232 deps = [ ":libsrtp" ]
234 "srtp/crypto/test/datatypes_driver.c",
238 executable("srtp_test_stat_driver") {
239 configs -= [ "//build/config/compiler:chromium_code" ]
240 configs += [ "//build/config/compiler:no_chromium_code" ]
241 configs += [ ":libsrtp_config" ]
242 deps = [ ":libsrtp" ]
244 "srtp/crypto/test/stat_driver.c",
248 executable("srtp_test_sha1_driver") {
249 configs -= [ "//build/config/compiler:chromium_code" ]
250 configs += [ "//build/config/compiler:no_chromium_code" ]
251 configs += [ ":libsrtp_config" ]
252 deps = [ ":libsrtp" ]
254 "srtp/crypto/test/sha1_driver.c",
258 executable("srtp_test_kernel_driver") {
259 configs -= [ "//build/config/compiler:chromium_code" ]
260 configs += [ "//build/config/compiler:no_chromium_code" ]
261 configs += [ ":libsrtp_config" ]
262 deps = [ ":libsrtp" ]
264 "srtp/crypto/test/kernel_driver.c",
268 executable("srtp_test_aes_calc") {
269 configs -= [ "//build/config/compiler:chromium_code" ]
270 configs += [ "//build/config/compiler:no_chromium_code" ]
271 configs += [ ":libsrtp_config" ]
272 deps = [ ":libsrtp" ]
274 "srtp/crypto/test/aes_calc.c",
278 executable("srtp_test_rand_gen") {
279 configs -= [ "//build/config/compiler:chromium_code" ]
280 configs += [ "//build/config/compiler:no_chromium_code" ]
281 configs += [ ":libsrtp_config" ]
282 deps = [ ":libsrtp" ]
284 "srtp/crypto/test/rand_gen.c",
288 executable("srtp_test_env") {
289 configs -= [ "//build/config/compiler:chromium_code" ]
290 configs += [ "//build/config/compiler:no_chromium_code" ]
291 configs += [ ":libsrtp_config" ]
292 deps = [ ":libsrtp" ]
294 "srtp/crypto/test/env.c",
298 group("srtp_runtest") {
305 ":srtp_test_cipher_driver",
306 ":srtp_test_datatypes_driver",
307 ":srtp_test_stat_driver",
308 ":srtp_test_sha1_driver",
309 ":srtp_test_kernel_driver",
310 ":srtp_test_aes_calc",
311 ":srtp_test_rand_gen",