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",
42 # All Windows architectures are this way.
43 "SIZEOF_UNSIGNED_LONG=4",
44 "SIZEOF_UNSIGNED_LONG_LONG=8",
48 if (current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm") {
50 # TODO(leozwang): CPU_RISC doesn"t work properly on android/arm
51 # platform for unknown reasons, need to investigate the root cause
52 # of it. CPU_RISC is used for optimization only, and CPU_CISC should
53 # just work just fine, it has been tested on android/arm with srtp
54 # test applications and libjingle.
59 if (current_cpu == "mipsel") {
60 defines += [ "CPU_RISC" ]
64 config("system_libsrtp_config") {
65 defines = [ "USE_SYSTEM_LIBSRTP" ]
66 include_dirs = [ "/usr/include/srtp" ]
69 if (use_system_libsrtp) {
73 ":system_libsrtp_config",
78 static_library("libsrtp") {
79 configs -= [ "//build/config/compiler:chromium_code" ]
80 configs += [ "//build/config/compiler:no_chromium_code" ]
81 public_configs = [ ":libsrtp_config" ]
86 "srtp/include/getopt_s.h",
88 "srtp/include/rtp_priv.h",
89 "srtp/include/srtp.h",
90 "srtp/include/srtp_priv.h",
91 "srtp/include/ut_sim.h",
94 "srtp/crypto/include/aes.h",
95 "srtp/crypto/include/aes_cbc.h",
96 "srtp/crypto/include/aes_icm.h",
97 "srtp/crypto/include/alloc.h",
98 "srtp/crypto/include/auth.h",
99 "srtp/crypto/include/cipher.h",
100 "srtp/crypto/include/crypto.h",
101 "srtp/crypto/include/crypto_kernel.h",
102 "srtp/crypto/include/crypto_math.h",
103 "srtp/crypto/include/crypto_types.h",
104 "srtp/crypto/include/cryptoalg.h",
105 "srtp/crypto/include/datatypes.h",
106 "srtp/crypto/include/err.h",
107 "srtp/crypto/include/gf2_8.h",
108 "srtp/crypto/include/hmac.h",
109 "srtp/crypto/include/integers.h",
110 "srtp/crypto/include/kernel_compat.h",
111 "srtp/crypto/include/key.h",
112 "srtp/crypto/include/null_auth.h",
113 "srtp/crypto/include/null_cipher.h",
114 "srtp/crypto/include/prng.h",
115 "srtp/crypto/include/rand_source.h",
116 "srtp/crypto/include/rdb.h",
117 "srtp/crypto/include/rdbx.h",
118 "srtp/crypto/include/sha1.h",
119 "srtp/crypto/include/stat.h",
120 "srtp/crypto/include/xfm.h",
123 "srtp/crypto/cipher/aes.c",
124 "srtp/crypto/cipher/aes_cbc.c",
125 "srtp/crypto/cipher/aes_icm.c",
126 "srtp/crypto/cipher/cipher.c",
127 "srtp/crypto/cipher/null_cipher.c",
128 "srtp/crypto/hash/auth.c",
129 "srtp/crypto/hash/hmac.c",
130 "srtp/crypto/hash/null_auth.c",
131 "srtp/crypto/hash/sha1.c",
132 "srtp/crypto/kernel/alloc.c",
133 "srtp/crypto/kernel/crypto_kernel.c",
134 "srtp/crypto/kernel/err.c",
135 "srtp/crypto/kernel/key.c",
136 "srtp/crypto/math/datatypes.c",
137 "srtp/crypto/math/gf2_8.c",
138 "srtp/crypto/math/stat.c",
139 "srtp/crypto/replay/rdb.c",
140 "srtp/crypto/replay/rdbx.c",
141 "srtp/crypto/replay/ut_sim.c",
142 "srtp/crypto/rng/ctr_prng.c",
143 "srtp/crypto/rng/prng.c",
144 "srtp/crypto/rng/rand_source.c",
150 cflags = [ "-Wno-implicit-function-declaration" ]
154 # 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.
157 executable("rdbx_driver") {
158 configs -= [ "//build/config/compiler:chromium_code" ]
159 configs += [ "//build/config/compiler:no_chromium_code" ]
164 "srtp/include/getopt_s.h",
165 "srtp/test/getopt_s.c",
166 "srtp/test/rdbx_driver.c",
170 executable("srtp_driver") {
171 configs -= [ "//build/config/compiler:chromium_code" ]
172 configs += [ "//build/config/compiler:no_chromium_code" ]
177 "srtp/include/getopt_s.h",
178 "srtp/include/srtp_priv.h",
179 "srtp/test/getopt_s.c",
180 "srtp/test/srtp_driver.c",
184 executable("roc_driver") {
185 configs -= [ "//build/config/compiler:chromium_code" ]
186 configs += [ "//build/config/compiler:no_chromium_code" ]
191 "srtp/crypto/include/rdbx.h",
192 "srtp/include/ut_sim.h",
193 "srtp/test/roc_driver.c",
197 executable("replay_driver") {
198 configs -= [ "//build/config/compiler:chromium_code" ]
199 configs += [ "//build/config/compiler:no_chromium_code" ]
204 "srtp/crypto/include/rdbx.h",
205 "srtp/include/ut_sim.h",
206 "srtp/test/replay_driver.c",
211 configs -= [ "//build/config/compiler:chromium_code" ]
212 configs += [ "//build/config/compiler:no_chromium_code" ]
217 "srtp/crypto/include/datatypes.h",
218 "srtp/include/getopt_s.h",
219 "srtp/include/rtp.h",
220 "srtp/include/srtp.h",
221 "srtp/test/getopt_s.c",
226 defines = [ "HAVE_SYS_SOCKET_H" ]
229 cflags = [ "-Wno-implicit-function-declaration" ]
233 executable("srtp_test_cipher_driver") {
234 configs -= [ "//build/config/compiler:chromium_code" ]
235 configs += [ "//build/config/compiler:no_chromium_code" ]
240 "srtp/crypto/test/cipher_driver.c",
244 executable("srtp_test_datatypes_driver") {
245 configs -= [ "//build/config/compiler:chromium_code" ]
246 configs += [ "//build/config/compiler:no_chromium_code" ]
251 "srtp/crypto/test/datatypes_driver.c",
255 executable("srtp_test_stat_driver") {
256 configs -= [ "//build/config/compiler:chromium_code" ]
257 configs += [ "//build/config/compiler:no_chromium_code" ]
262 "srtp/crypto/test/stat_driver.c",
266 executable("srtp_test_sha1_driver") {
267 configs -= [ "//build/config/compiler:chromium_code" ]
268 configs += [ "//build/config/compiler:no_chromium_code" ]
273 "srtp/crypto/test/sha1_driver.c",
277 executable("srtp_test_kernel_driver") {
278 configs -= [ "//build/config/compiler:chromium_code" ]
279 configs += [ "//build/config/compiler:no_chromium_code" ]
284 "srtp/crypto/test/kernel_driver.c",
288 executable("srtp_test_aes_calc") {
289 configs -= [ "//build/config/compiler:chromium_code" ]
290 configs += [ "//build/config/compiler:no_chromium_code" ]
295 "srtp/crypto/test/aes_calc.c",
299 executable("srtp_test_rand_gen") {
300 configs -= [ "//build/config/compiler:chromium_code" ]
301 configs += [ "//build/config/compiler:no_chromium_code" ]
306 "srtp/crypto/test/rand_gen.c",
310 executable("srtp_test_env") {
311 configs -= [ "//build/config/compiler:chromium_code" ]
312 configs += [ "//build/config/compiler:no_chromium_code" ]
317 "srtp/crypto/test/env.c",
321 group("srtp_runtest") {
328 ":srtp_test_cipher_driver",
329 ":srtp_test_datatypes_driver",
330 ":srtp_test_stat_driver",
331 ":srtp_test_sha1_driver",
332 ":srtp_test_kernel_driver",
333 ":srtp_test_aes_calc",
334 ":srtp_test_rand_gen",