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 } | 7 } |
8 | 8 |
9 config("libsrtp_config") { | 9 config("libsrtp_config") { |
10 defines = [ | 10 defines = [ |
(...skipping 20 matching lines...) Expand all Loading... |
31 "HAVE_INTTYPES_H", | 31 "HAVE_INTTYPES_H", |
32 "HAVE_NETINET_IN_H", | 32 "HAVE_NETINET_IN_H", |
33 "INLINE=inline", | 33 "INLINE=inline", |
34 ] | 34 ] |
35 } | 35 } |
36 | 36 |
37 if (is_win) { | 37 if (is_win) { |
38 defines += [ | 38 defines += [ |
39 "INLINE=__inline", | 39 "INLINE=__inline", |
40 "HAVE_BYTESWAP_METHODS_H", | 40 "HAVE_BYTESWAP_METHODS_H", |
| 41 |
41 # All Windows architectures are this way. | 42 # All Windows architectures are this way. |
42 "SIZEOF_UNSIGNED_LONG=4", | 43 "SIZEOF_UNSIGNED_LONG=4", |
43 "SIZEOF_UNSIGNED_LONG_LONG=8", | 44 "SIZEOF_UNSIGNED_LONG_LONG=8", |
44 ] | 45 ] |
45 } | 46 } |
46 | 47 |
47 if (cpu_arch == "x64" || cpu_arch == "x86" || cpu_arch == "arm") { | 48 if (cpu_arch == "x64" || cpu_arch == "x86" || cpu_arch == "arm") { |
48 defines += [ | 49 defines += [ |
49 # TODO(leozwang): CPU_RISC doesn"t work properly on android/arm | 50 # TODO(leozwang): CPU_RISC doesn"t work properly on android/arm |
50 # platform for unknown reasons, need to investigate the root cause | 51 # 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 # 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 # just work just fine, it has been tested on android/arm with srtp |
53 # test applications and libjingle. | 54 # test applications and libjingle. |
54 "CPU_CISC", | 55 "CPU_CISC", |
55 ] | 56 ] |
56 } | 57 } |
57 | 58 |
58 if (cpu_arch == "mipsel") { | 59 if (cpu_arch == "mipsel") { |
59 defines += [ "CPU_RISC" ] | 60 defines += [ "CPU_RISC" ] |
60 } | 61 } |
61 } | 62 } |
62 | 63 |
63 config("system_libsrtp_config") { | 64 config("system_libsrtp_config") { |
64 defines = [ "USE_SYSTEM_LIBSRTP" ] | 65 defines = [ "USE_SYSTEM_LIBSRTP" ] |
65 include_dirs = [ "/usr/include/srtp" ] | 66 include_dirs = [ "/usr/include/srtp" ] |
66 } | 67 } |
67 | 68 |
68 if (use_system_libsrtp) { | 69 if (use_system_libsrtp) { |
69 group("libsrtp") { | 70 group("libsrtp") { |
70 public_configs = [ ":libsrtp_config", ":system_libsrtp_config" ] | 71 public_configs = [ |
| 72 ":libsrtp_config", |
| 73 ":system_libsrtp_config", |
| 74 ] |
71 libs = [ "-lsrtp" ] | 75 libs = [ "-lsrtp" ] |
72 } | 76 } |
73 } else { | 77 } else { |
74 static_library("libsrtp") { | 78 static_library("libsrtp") { |
75 configs -= [ "//build/config/compiler:chromium_code" ] | 79 configs -= [ "//build/config/compiler:chromium_code" ] |
76 configs += [ "//build/config/compiler:no_chromium_code" ] | 80 configs += [ "//build/config/compiler:no_chromium_code" ] |
77 public_configs = [ ":libsrtp_config" ] | 81 public_configs = [ ":libsrtp_config" ] |
78 | 82 |
79 sources = [ | 83 sources = [ |
80 # includes | 84 # includes |
(...skipping 30 matching lines...) Expand all Loading... |
111 "srtp/crypto/include/rand_source.h", | 115 "srtp/crypto/include/rand_source.h", |
112 "srtp/crypto/include/rdb.h", | 116 "srtp/crypto/include/rdb.h", |
113 "srtp/crypto/include/rdbx.h", | 117 "srtp/crypto/include/rdbx.h", |
114 "srtp/crypto/include/sha1.h", | 118 "srtp/crypto/include/sha1.h", |
115 "srtp/crypto/include/stat.h", | 119 "srtp/crypto/include/stat.h", |
116 "srtp/crypto/include/xfm.h", | 120 "srtp/crypto/include/xfm.h", |
117 | 121 |
118 # sources | 122 # sources |
119 "srtp/srtp/ekt.c", | 123 "srtp/srtp/ekt.c", |
120 "srtp/srtp/srtp.c", | 124 "srtp/srtp/srtp.c", |
121 | |
122 "srtp/crypto/cipher/aes.c", | 125 "srtp/crypto/cipher/aes.c", |
123 "srtp/crypto/cipher/aes_cbc.c", | 126 "srtp/crypto/cipher/aes_cbc.c", |
124 "srtp/crypto/cipher/aes_icm.c", | 127 "srtp/crypto/cipher/aes_icm.c", |
125 "srtp/crypto/cipher/cipher.c", | 128 "srtp/crypto/cipher/cipher.c", |
126 "srtp/crypto/cipher/null_cipher.c", | 129 "srtp/crypto/cipher/null_cipher.c", |
127 "srtp/crypto/hash/auth.c", | 130 "srtp/crypto/hash/auth.c", |
128 "srtp/crypto/hash/hmac.c", | 131 "srtp/crypto/hash/hmac.c", |
129 "srtp/crypto/hash/null_auth.c", | 132 "srtp/crypto/hash/null_auth.c", |
130 "srtp/crypto/hash/sha1.c", | 133 "srtp/crypto/hash/sha1.c", |
131 "srtp/crypto/kernel/alloc.c", | 134 "srtp/crypto/kernel/alloc.c", |
(...skipping 15 matching lines...) Expand all Loading... |
147 cflags = [ "-Wno-implicit-function-declaration" ] | 150 cflags = [ "-Wno-implicit-function-declaration" ] |
148 } | 151 } |
149 } | 152 } |
150 | 153 |
151 # TODO(GYP): A bunch of these tests don't compile (in gyp either). They're | 154 # TODO(GYP): A bunch of these tests don't compile (in gyp either). They're |
152 # not very broken, so could probably be made to work if it's useful. | 155 # not very broken, so could probably be made to work if it's useful. |
153 if (!is_win) { | 156 if (!is_win) { |
154 executable("rdbx_driver") { | 157 executable("rdbx_driver") { |
155 configs -= [ "//build/config/compiler:chromium_code" ] | 158 configs -= [ "//build/config/compiler:chromium_code" ] |
156 configs += [ "//build/config/compiler:no_chromium_code" ] | 159 configs += [ "//build/config/compiler:no_chromium_code" ] |
157 deps = [ ":libsrtp" ] | 160 deps = [ |
| 161 ":libsrtp", |
| 162 ] |
158 sources = [ | 163 sources = [ |
159 "srtp/include/getopt_s.h", | 164 "srtp/include/getopt_s.h", |
160 "srtp/test/getopt_s.c", | 165 "srtp/test/getopt_s.c", |
161 "srtp/test/rdbx_driver.c", | 166 "srtp/test/rdbx_driver.c", |
162 ] | 167 ] |
163 } | 168 } |
164 | 169 |
165 executable("srtp_driver") { | 170 executable("srtp_driver") { |
166 configs -= [ "//build/config/compiler:chromium_code" ] | 171 configs -= [ "//build/config/compiler:chromium_code" ] |
167 configs += [ "//build/config/compiler:no_chromium_code" ] | 172 configs += [ "//build/config/compiler:no_chromium_code" ] |
168 deps = [ ":libsrtp" ] | 173 deps = [ |
| 174 ":libsrtp", |
| 175 ] |
169 sources = [ | 176 sources = [ |
170 "srtp/include/getopt_s.h", | 177 "srtp/include/getopt_s.h", |
171 "srtp/include/srtp_priv.h", | 178 "srtp/include/srtp_priv.h", |
172 "srtp/test/getopt_s.c", | 179 "srtp/test/getopt_s.c", |
173 "srtp/test/srtp_driver.c", | 180 "srtp/test/srtp_driver.c", |
174 ] | 181 ] |
175 } | 182 } |
176 | 183 |
177 executable("roc_driver") { | 184 executable("roc_driver") { |
178 configs -= [ "//build/config/compiler:chromium_code" ] | 185 configs -= [ "//build/config/compiler:chromium_code" ] |
179 configs += [ "//build/config/compiler:no_chromium_code" ] | 186 configs += [ "//build/config/compiler:no_chromium_code" ] |
180 deps = [ ":libsrtp" ] | 187 deps = [ |
| 188 ":libsrtp", |
| 189 ] |
181 sources = [ | 190 sources = [ |
182 "srtp/crypto/include/rdbx.h", | 191 "srtp/crypto/include/rdbx.h", |
183 "srtp/include/ut_sim.h", | 192 "srtp/include/ut_sim.h", |
184 "srtp/test/roc_driver.c", | 193 "srtp/test/roc_driver.c", |
185 ] | 194 ] |
186 } | 195 } |
187 | 196 |
188 executable("replay_driver") { | 197 executable("replay_driver") { |
189 configs -= [ "//build/config/compiler:chromium_code" ] | 198 configs -= [ "//build/config/compiler:chromium_code" ] |
190 configs += [ "//build/config/compiler:no_chromium_code" ] | 199 configs += [ "//build/config/compiler:no_chromium_code" ] |
191 deps = [ ":libsrtp" ] | 200 deps = [ |
| 201 ":libsrtp", |
| 202 ] |
192 sources = [ | 203 sources = [ |
193 "srtp/crypto/include/rdbx.h", | 204 "srtp/crypto/include/rdbx.h", |
194 "srtp/include/ut_sim.h", | 205 "srtp/include/ut_sim.h", |
195 "srtp/test/replay_driver.c", | 206 "srtp/test/replay_driver.c", |
196 ] | 207 ] |
197 } | 208 } |
198 | 209 |
199 executable("rtpw") { | 210 executable("rtpw") { |
200 configs -= [ "//build/config/compiler:chromium_code" ] | 211 configs -= [ "//build/config/compiler:chromium_code" ] |
201 configs += [ "//build/config/compiler:no_chromium_code" ] | 212 configs += [ "//build/config/compiler:no_chromium_code" ] |
202 deps = [ ":libsrtp" ] | 213 deps = [ |
| 214 ":libsrtp", |
| 215 ] |
203 sources = [ | 216 sources = [ |
204 "srtp/include/getopt_s.h", | 217 "srtp/include/getopt_s.h", |
205 "srtp/include/rtp.h", | 218 "srtp/include/rtp.h", |
206 "srtp/include/srtp.h", | 219 "srtp/include/srtp.h", |
207 "srtp/crypto/include/datatypes.h", | 220 "srtp/crypto/include/datatypes.h", |
208 "srtp/test/getopt_s.c", | 221 "srtp/test/getopt_s.c", |
209 "srtp/test/rtp.c", | 222 "srtp/test/rtp.c", |
210 "srtp/test/rtpw.c", | 223 "srtp/test/rtpw.c", |
211 ] | 224 ] |
212 if (is_android) { | 225 if (is_android) { |
213 defines = [ "HAVE_SYS_SOCKET_H" ] | 226 defines = [ "HAVE_SYS_SOCKET_H" ] |
214 } | 227 } |
215 if (is_clang) { | 228 if (is_clang) { |
216 cflags = [ "-Wno-implicit-function-declaration" ] | 229 cflags = [ "-Wno-implicit-function-declaration" ] |
217 } | 230 } |
218 } | 231 } |
219 | 232 |
220 executable("srtp_test_cipher_driver") { | 233 executable("srtp_test_cipher_driver") { |
221 configs -= [ "//build/config/compiler:chromium_code" ] | 234 configs -= [ "//build/config/compiler:chromium_code" ] |
222 configs += [ "//build/config/compiler:no_chromium_code" ] | 235 configs += [ "//build/config/compiler:no_chromium_code" ] |
223 deps = [ ":libsrtp" ] | 236 deps = [ |
| 237 ":libsrtp", |
| 238 ] |
224 sources = [ | 239 sources = [ |
225 "srtp/crypto/test/cipher_driver.c", | 240 "srtp/crypto/test/cipher_driver.c", |
226 ] | 241 ] |
227 } | 242 } |
228 | 243 |
229 executable("srtp_test_datatypes_driver") { | 244 executable("srtp_test_datatypes_driver") { |
230 configs -= [ "//build/config/compiler:chromium_code" ] | 245 configs -= [ "//build/config/compiler:chromium_code" ] |
231 configs += [ "//build/config/compiler:no_chromium_code" ] | 246 configs += [ "//build/config/compiler:no_chromium_code" ] |
232 deps = [ ":libsrtp" ] | 247 deps = [ |
| 248 ":libsrtp", |
| 249 ] |
233 sources = [ | 250 sources = [ |
234 "srtp/crypto/test/datatypes_driver.c", | 251 "srtp/crypto/test/datatypes_driver.c", |
235 ] | 252 ] |
236 } | 253 } |
237 | 254 |
238 executable("srtp_test_stat_driver") { | 255 executable("srtp_test_stat_driver") { |
239 configs -= [ "//build/config/compiler:chromium_code" ] | 256 configs -= [ "//build/config/compiler:chromium_code" ] |
240 configs += [ "//build/config/compiler:no_chromium_code" ] | 257 configs += [ "//build/config/compiler:no_chromium_code" ] |
241 deps = [ ":libsrtp" ] | 258 deps = [ |
| 259 ":libsrtp", |
| 260 ] |
242 sources = [ | 261 sources = [ |
243 "srtp/crypto/test/stat_driver.c", | 262 "srtp/crypto/test/stat_driver.c", |
244 ] | 263 ] |
245 } | 264 } |
246 | 265 |
247 executable("srtp_test_sha1_driver") { | 266 executable("srtp_test_sha1_driver") { |
248 configs -= [ "//build/config/compiler:chromium_code" ] | 267 configs -= [ "//build/config/compiler:chromium_code" ] |
249 configs += [ "//build/config/compiler:no_chromium_code" ] | 268 configs += [ "//build/config/compiler:no_chromium_code" ] |
250 deps = [ ":libsrtp" ] | 269 deps = [ |
| 270 ":libsrtp", |
| 271 ] |
251 sources = [ | 272 sources = [ |
252 "srtp/crypto/test/sha1_driver.c", | 273 "srtp/crypto/test/sha1_driver.c", |
253 ] | 274 ] |
254 } | 275 } |
255 | 276 |
256 executable("srtp_test_kernel_driver") { | 277 executable("srtp_test_kernel_driver") { |
257 configs -= [ "//build/config/compiler:chromium_code" ] | 278 configs -= [ "//build/config/compiler:chromium_code" ] |
258 configs += [ "//build/config/compiler:no_chromium_code" ] | 279 configs += [ "//build/config/compiler:no_chromium_code" ] |
259 deps = [ ":libsrtp" ] | 280 deps = [ |
| 281 ":libsrtp", |
| 282 ] |
260 sources = [ | 283 sources = [ |
261 "srtp/crypto/test/kernel_driver.c", | 284 "srtp/crypto/test/kernel_driver.c", |
262 ] | 285 ] |
263 } | 286 } |
264 | 287 |
265 executable("srtp_test_aes_calc") { | 288 executable("srtp_test_aes_calc") { |
266 configs -= [ "//build/config/compiler:chromium_code" ] | 289 configs -= [ "//build/config/compiler:chromium_code" ] |
267 configs += [ "//build/config/compiler:no_chromium_code" ] | 290 configs += [ "//build/config/compiler:no_chromium_code" ] |
268 deps = [ ":libsrtp" ] | 291 deps = [ |
| 292 ":libsrtp", |
| 293 ] |
269 sources = [ | 294 sources = [ |
270 "srtp/crypto/test/aes_calc.c", | 295 "srtp/crypto/test/aes_calc.c", |
271 ] | 296 ] |
272 } | 297 } |
273 | 298 |
274 executable("srtp_test_rand_gen") { | 299 executable("srtp_test_rand_gen") { |
275 configs -= [ "//build/config/compiler:chromium_code" ] | 300 configs -= [ "//build/config/compiler:chromium_code" ] |
276 configs += [ "//build/config/compiler:no_chromium_code" ] | 301 configs += [ "//build/config/compiler:no_chromium_code" ] |
277 deps = [ ":libsrtp" ] | 302 deps = [ |
| 303 ":libsrtp", |
| 304 ] |
278 sources = [ | 305 sources = [ |
279 "srtp/crypto/test/rand_gen.c", | 306 "srtp/crypto/test/rand_gen.c", |
280 ] | 307 ] |
281 } | 308 } |
282 | 309 |
283 executable("srtp_test_env") { | 310 executable("srtp_test_env") { |
284 configs -= [ "//build/config/compiler:chromium_code" ] | 311 configs -= [ "//build/config/compiler:chromium_code" ] |
285 configs += [ "//build/config/compiler:no_chromium_code" ] | 312 configs += [ "//build/config/compiler:no_chromium_code" ] |
286 deps = [ ":libsrtp" ] | 313 deps = [ |
| 314 ":libsrtp", |
| 315 ] |
287 sources = [ | 316 sources = [ |
288 "srtp/crypto/test/env.c", | 317 "srtp/crypto/test/env.c", |
289 ] | 318 ] |
290 } | 319 } |
291 | 320 |
292 group("srtp_runtest") { | 321 group("srtp_runtest") { |
293 deps = [ | 322 deps = [ |
294 ":rdbx_driver", | 323 ":rdbx_driver", |
295 ":srtp_driver", | 324 ":srtp_driver", |
296 ":roc_driver", | 325 ":roc_driver", |
297 ":replay_driver", | 326 ":replay_driver", |
298 ":rtpw", | 327 ":rtpw", |
299 ":srtp_test_cipher_driver", | 328 ":srtp_test_cipher_driver", |
300 ":srtp_test_datatypes_driver", | 329 ":srtp_test_datatypes_driver", |
301 ":srtp_test_stat_driver", | 330 ":srtp_test_stat_driver", |
302 ":srtp_test_sha1_driver", | 331 ":srtp_test_sha1_driver", |
303 ":srtp_test_kernel_driver", | 332 ":srtp_test_kernel_driver", |
304 ":srtp_test_aes_calc", | 333 ":srtp_test_aes_calc", |
305 ":srtp_test_rand_gen", | 334 ":srtp_test_rand_gen", |
306 ":srtp_test_env", | 335 ":srtp_test_env", |
307 ] | 336 ] |
308 } | 337 } |
309 } | 338 } |
310 } | 339 } |
OLD | NEW |