OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 declare_args() { | 5 declare_args() { |
6 use_system_libsrtp = false | 6 use_system_libsrtp = false |
7 use_srtp_openssl = true | |
Nico
2015/03/26 23:59:16
Does anything ever set this to false? Should it be
| |
7 } | 8 } |
8 | 9 |
9 config("libsrtp_config") { | 10 config("libsrtp_config") { |
10 defines = [ | 11 defines = [ |
12 "HAVE_CONFIG_H", | |
11 "HAVE_STDLIB_H", | 13 "HAVE_STDLIB_H", |
12 "HAVE_STRING_H", | 14 "HAVE_STRING_H", |
15 "TESTAPP_SOURCE", | |
13 ] | 16 ] |
14 | 17 |
15 include_dirs = [ | 18 include_dirs = [ |
16 "config", | 19 "config", |
17 "srtp/include", | 20 "srtp/include", |
18 "srtp/crypto/include", | 21 "srtp/crypto/include", |
19 ] | 22 ] |
20 | 23 |
24 if (use_srtp_openssl) { | |
25 defines += [ "OPENSSL" ] | |
26 } | |
27 | |
21 if (is_posix) { | 28 if (is_posix) { |
22 defines += [ | 29 defines += [ |
23 "HAVE_INT16_T", | 30 "HAVE_INT16_T", |
24 "HAVE_INT32_T", | 31 "HAVE_INT32_T", |
25 "HAVE_INT8_T", | 32 "HAVE_INT8_T", |
26 "HAVE_UINT16_T", | 33 "HAVE_UINT16_T", |
27 "HAVE_UINT32_T", | 34 "HAVE_UINT32_T", |
28 "HAVE_UINT64_T", | 35 "HAVE_UINT64_T", |
29 "HAVE_UINT8_T", | 36 "HAVE_UINT8_T", |
30 "HAVE_STDINT_H", | 37 "HAVE_STDINT_H", |
31 "HAVE_INTTYPES_H", | 38 "HAVE_INTTYPES_H", |
32 "HAVE_NETINET_IN_H", | 39 "HAVE_NETINET_IN_H", |
33 "INLINE=inline", | 40 "HAVE_ARPA_INET_H", |
41 "HAVE_UNISTD_H", | |
34 ] | 42 ] |
43 cflags = [ "-Wno-unused-variable" ] | |
35 } | 44 } |
36 | 45 |
37 if (is_win) { | 46 if (is_win) { |
38 defines += [ | 47 defines += [ |
39 "INLINE=__inline", | |
40 "HAVE_BYTESWAP_METHODS_H", | 48 "HAVE_BYTESWAP_METHODS_H", |
41 | 49 |
42 # All Windows architectures are this way. | 50 # All Windows architectures are this way. |
43 "SIZEOF_UNSIGNED_LONG=4", | 51 "SIZEOF_UNSIGNED_LONG=4", |
44 "SIZEOF_UNSIGNED_LONG_LONG=8", | 52 "SIZEOF_UNSIGNED_LONG_LONG=8", |
45 ] | 53 ] |
46 } | 54 } |
47 | 55 |
48 if (current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm") { | 56 if (current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm") { |
49 defines += [ | 57 defines += [ |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 "srtp/crypto/rng/ctr_prng.c", | 150 "srtp/crypto/rng/ctr_prng.c", |
143 "srtp/crypto/rng/prng.c", | 151 "srtp/crypto/rng/prng.c", |
144 "srtp/crypto/rng/rand_source.c", | 152 "srtp/crypto/rng/rand_source.c", |
145 "srtp/srtp/ekt.c", | 153 "srtp/srtp/ekt.c", |
146 "srtp/srtp/srtp.c", | 154 "srtp/srtp/srtp.c", |
147 ] | 155 ] |
148 | 156 |
149 if (is_clang) { | 157 if (is_clang) { |
150 cflags = [ "-Wno-implicit-function-declaration" ] | 158 cflags = [ "-Wno-implicit-function-declaration" ] |
151 } | 159 } |
160 | |
161 if (use_srtp_openssl) { | |
162 deps = [ | |
163 "//third_party/boringssl:boringssl", | |
164 ] | |
165 sources -= [ | |
166 "srtp/crypto/cipher/aes_cbc.c", | |
167 "srtp/crypto/cipher/aes_icm.c", | |
168 "srtp/crypto/hash/hmac.c", | |
169 "srtp/crypto/hash/sha1.c", | |
170 "srtp/crypto/rng/ctr_prng.c", | |
171 "srtp/crypto/rng/prng.c", | |
172 "srtp/crypto/rng/rand_source.c", | |
173 ] | |
174 sources += [ | |
175 "srtp/crypto/cipher/aes_gcm_ossl.c", | |
176 "srtp/crypto/cipher/aes_icm_ossl.c", | |
177 "srtp/crypto/hash/hmac_ossl.c", | |
178 "srtp/crypto/include/aes_gcm_ossl.h", | |
179 "srtp/crypto/include/aes_icm_ossl.h", | |
180 "srtp/crypto/rng/rand_source_ossl.c", | |
181 ] | |
182 } | |
152 } | 183 } |
153 | 184 |
154 # TODO(GYP): A bunch of these tests don't compile (in gyp either). They're | 185 # TODO(GYP): A bunch of these tests don't compile (in gyp either). They're |
155 # not very broken, so could probably be made to work if it's useful. | 186 # not very broken, so could probably be made to work if it's useful. |
156 if (!is_win) { | 187 if (!is_win) { |
157 executable("rdbx_driver") { | 188 executable("rdbx_driver") { |
158 configs -= [ "//build/config/compiler:chromium_code" ] | 189 configs -= [ "//build/config/compiler:chromium_code" ] |
159 configs += [ "//build/config/compiler:no_chromium_code" ] | 190 configs += [ "//build/config/compiler:no_chromium_code" ] |
160 deps = [ | 191 deps = [ |
161 ":libsrtp", | 192 ":libsrtp", |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 cflags = [ "-Wno-implicit-function-declaration" ] | 260 cflags = [ "-Wno-implicit-function-declaration" ] |
230 } | 261 } |
231 } | 262 } |
232 | 263 |
233 executable("srtp_test_cipher_driver") { | 264 executable("srtp_test_cipher_driver") { |
234 configs -= [ "//build/config/compiler:chromium_code" ] | 265 configs -= [ "//build/config/compiler:chromium_code" ] |
235 configs += [ "//build/config/compiler:no_chromium_code" ] | 266 configs += [ "//build/config/compiler:no_chromium_code" ] |
236 deps = [ | 267 deps = [ |
237 ":libsrtp", | 268 ":libsrtp", |
238 ] | 269 ] |
270 if (use_srtp_openssl) { | |
271 deps += [ "//third_party/boringssl:boringssl" ] | |
272 } | |
239 sources = [ | 273 sources = [ |
240 "srtp/crypto/test/cipher_driver.c", | 274 "srtp/crypto/test/cipher_driver.c", |
241 ] | 275 ] |
242 } | 276 } |
243 | 277 |
244 executable("srtp_test_datatypes_driver") { | 278 executable("srtp_test_datatypes_driver") { |
245 configs -= [ "//build/config/compiler:chromium_code" ] | 279 configs -= [ "//build/config/compiler:chromium_code" ] |
246 configs += [ "//build/config/compiler:no_chromium_code" ] | 280 configs += [ "//build/config/compiler:no_chromium_code" ] |
247 deps = [ | 281 deps = [ |
248 ":libsrtp", | 282 ":libsrtp", |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
300 configs -= [ "//build/config/compiler:chromium_code" ] | 334 configs -= [ "//build/config/compiler:chromium_code" ] |
301 configs += [ "//build/config/compiler:no_chromium_code" ] | 335 configs += [ "//build/config/compiler:no_chromium_code" ] |
302 deps = [ | 336 deps = [ |
303 ":libsrtp", | 337 ":libsrtp", |
304 ] | 338 ] |
305 sources = [ | 339 sources = [ |
306 "srtp/crypto/test/rand_gen.c", | 340 "srtp/crypto/test/rand_gen.c", |
307 ] | 341 ] |
308 } | 342 } |
309 | 343 |
344 executable("srtp_test_rand_gen_soak") { | |
345 configs -= [ "//build/config/compiler:chromium_code" ] | |
346 configs += [ "//build/config/compiler:no_chromium_code" ] | |
347 deps = [ | |
348 ":libsrtp", | |
349 ] | |
350 sources = [ | |
351 "srtp/crypto/test/rand_gen_soak.c", | |
352 ] | |
353 } | |
354 | |
310 executable("srtp_test_env") { | 355 executable("srtp_test_env") { |
311 configs -= [ "//build/config/compiler:chromium_code" ] | 356 configs -= [ "//build/config/compiler:chromium_code" ] |
312 configs += [ "//build/config/compiler:no_chromium_code" ] | 357 configs += [ "//build/config/compiler:no_chromium_code" ] |
313 deps = [ | 358 deps = [ |
314 ":libsrtp", | 359 ":libsrtp", |
315 ] | 360 ] |
316 sources = [ | 361 sources = [ |
317 "srtp/crypto/test/env.c", | 362 "srtp/crypto/test/env.c", |
318 ] | 363 ] |
319 } | 364 } |
320 | 365 |
321 group("srtp_runtest") { | 366 group("srtp_runtest") { |
322 deps = [ | 367 deps = [ |
323 ":rdbx_driver", | 368 ":rdbx_driver", |
324 ":srtp_driver", | 369 ":srtp_driver", |
325 ":roc_driver", | 370 ":roc_driver", |
326 ":replay_driver", | 371 ":replay_driver", |
327 ":rtpw", | 372 ":rtpw", |
328 ":srtp_test_cipher_driver", | 373 ":srtp_test_cipher_driver", |
329 ":srtp_test_datatypes_driver", | 374 ":srtp_test_datatypes_driver", |
330 ":srtp_test_stat_driver", | 375 ":srtp_test_stat_driver", |
331 ":srtp_test_sha1_driver", | 376 ":srtp_test_sha1_driver", |
332 ":srtp_test_kernel_driver", | 377 ":srtp_test_kernel_driver", |
333 ":srtp_test_aes_calc", | 378 ":srtp_test_aes_calc", |
334 ":srtp_test_rand_gen", | 379 ":srtp_test_rand_gen", |
380 ":srtp_test_rand_gen_soak", | |
335 ":srtp_test_env", | 381 ":srtp_test_env", |
336 ] | 382 ] |
337 } | 383 } |
338 } | 384 } |
339 } | 385 } |
OLD | NEW |