blob: a3956ebeb7b66fa7fd568245a7237fd2d8bb3ccc [file] [log] [blame]
mallinath@google.comb313d032012-01-24 23:00:41 +00001# Copyright (c) 2012 The Chromium Authors. All rights reserved.
mallinath@google.combe690502011-12-22 02:29:50 +00002# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5{
phajdan.jr@chromium.orgd910efb2012-10-17 23:50:04 +00006 'variables': {
7 'use_system_libsrtp%': 0,
8 },
mallinath@google.combe690502011-12-22 02:29:50 +00009 'target_defaults': {
10 'defines': [
11 'HAVE_STDLIB_H',
12 'HAVE_STRING_H',
13 ],
14 'include_dirs': [
15 './config',
16 'srtp/include',
17 'srtp/crypto/include',
18 ],
19 'conditions': [
sergeyu@chromium.orge151e512013-03-21 05:37:21 +000020 ['os_posix==1', {
mallinath@google.combe690502011-12-22 02:29:50 +000021 'defines': [
sergeyu@chromium.orge151e512013-03-21 05:37:21 +000022 'HAVE_INT16_T',
23 'HAVE_INT32_T',
24 'HAVE_INT8_T',
25 'HAVE_UINT16_T',
26 'HAVE_UINT32_T',
27 'HAVE_UINT64_T',
28 'HAVE_UINT8_T',
29 'HAVE_STDINT_H',
30 'HAVE_INTTYPES_H',
31 'HAVE_NETINET_IN_H',
32 'INLINE=inline',
mallinath@google.combe690502011-12-22 02:29:50 +000033 ],
34 }],
sergeyu@chromium.orge151e512013-03-21 05:37:21 +000035 ['OS=="win"', {
jschuh@chromium.orgaaa7ffc2012-12-26 19:36:04 +000036 'defines': [
sergeyu@chromium.orge151e512013-03-21 05:37:21 +000037 'INLINE=__inline',
38 'HAVE_BYTESWAP_METHODS_H',
39 # All Windows architectures are this way.
jschuh@chromium.orgaaa7ffc2012-12-26 19:36:04 +000040 'SIZEOF_UNSIGNED_LONG=4',
41 'SIZEOF_UNSIGNED_LONG_LONG=8',
sergeyu@chromium.orge151e512013-03-21 05:37:21 +000042 ],
jschuh@chromium.orgaaa7ffc2012-12-26 19:36:04 +000043 }],
sergeyu@chromium.orge151e512013-03-21 05:37:21 +000044 ['target_arch=="x64" or target_arch=="ia32"', {
mallinath@google.combe690502011-12-22 02:29:50 +000045 'defines': [
46 'CPU_CISC',
mallinath@google.combe690502011-12-22 02:29:50 +000047 ],
48 }],
primiano@chromium.org2f2e5572014-04-03 10:17:27 +000049 ['target_arch=="arm" or target_arch=="armv7" or target_arch=="arm64"', {
mallinath@google.combe690502011-12-22 02:29:50 +000050 'defines': [
leozwang@google.com4e2f8a62012-04-09 22:31:02 +000051 # TODO(leozwang): CPU_RISC doesn't work properly on android/arm
52 # platform for unknown reasons, need to investigate the root cause
53 # of it. CPU_RISC is used for optimization only, and CPU_CISC should
54 # just work just fine, it has been tested on android/arm with srtp
55 # test applications and libjingle.
56 'CPU_CISC',
mallinath@google.combe690502011-12-22 02:29:50 +000057 ],
58 }],
mallinath@chromium.org5eebd252014-08-07 15:32:34 +000059 ['target_arch=="mipsel" or target_arch=="mips64el"', {
wjia@chromium.orgfe888df2012-09-26 17:41:03 +000060 'defines': [
61 'CPU_RISC',
badea@adobe.com7655e352012-09-13 06:40:38 +000062 ],
63 }],
jiayl@chromium.org98284c82014-09-22 22:04:31 +000064 ['target_arch=="mipsel" or target_arch=="arm" or target_arch=="armv7" or target_arch=="ia32"', {
65 'defines': [
66 # Define FORCE_64BIT_ALIGN to avoid alignment-related-crashes like
67 # crbug/414919. Without this, aes_cbc_alloc will allocate an
68 # aes_cbc_ctx_t not 64-bit aligned and the v128_t members of
69 # aes_cbc_ctx_t will not be 64-bit aligned, which breaks the
70 # compiler optimizations that assume 64-bit alignment of v128_t.
71 'FORCE_64BIT_ALIGN',
72 ],
73 }],
mallinath@google.combe690502011-12-22 02:29:50 +000074 ],
75 'direct_dependent_settings': {
76 'include_dirs': [
77 './config',
78 'srtp/include',
79 'srtp/crypto/include',
80 ],
81 'conditions': [
sergeyu@chromium.orge151e512013-03-21 05:37:21 +000082 ['os_posix==1', {
mallinath@google.combe690502011-12-22 02:29:50 +000083 'defines': [
leozwang@google.com4e2f8a62012-04-09 22:31:02 +000084 'HAVE_INT16_T',
85 'HAVE_INT32_T',
86 'HAVE_INT8_T',
87 'HAVE_UINT16_T',
88 'HAVE_UINT32_T',
89 'HAVE_UINT64_T',
90 'HAVE_UINT8_T',
mallinath@google.combe690502011-12-22 02:29:50 +000091 'HAVE_STDINT_H',
92 'HAVE_INTTYPES_H',
mallinath@google.com40a45582012-02-10 18:48:09 +000093 'HAVE_NETINET_IN_H',
scottmg@chromium.org7bcb8db2012-10-16 01:25:03 +000094 'INLINE=inline',
mallinath@google.combe690502011-12-22 02:29:50 +000095 ],
96 }],
97 ['OS=="win"', {
98 'defines': [
scottmg@chromium.org7bcb8db2012-10-16 01:25:03 +000099 'INLINE=__inline',
mallinath@chromium.org4af3b6f2012-02-28 01:07:05 +0000100 'HAVE_BYTESWAP_METHODS_H',
sergeyu@chromium.orge151e512013-03-21 05:37:21 +0000101 # All Windows architectures are this way.
102 'SIZEOF_UNSIGNED_LONG=4',
103 'SIZEOF_UNSIGNED_LONG_LONG=8',
104 ],
105 }],
106 ['target_arch=="x64" or target_arch=="ia32"', {
107 'defines': [
108 'CPU_CISC',
mallinath@google.combe690502011-12-22 02:29:50 +0000109 ],
110 }],
mallinath@chromium.org5eebd252014-08-07 15:32:34 +0000111 ['target_arch=="mipsel" or target_arch=="mips64el"', {
badea@adobe.com7655e352012-09-13 06:40:38 +0000112 'defines': [
sergeyu@chromium.orge151e512013-03-21 05:37:21 +0000113 'CPU_RISC',
badea@adobe.com7655e352012-09-13 06:40:38 +0000114 ],
115 }],
mallinath@google.combe690502011-12-22 02:29:50 +0000116 ],
117 },
118 },
phajdan.jr@chromium.orgd910efb2012-10-17 23:50:04 +0000119 'conditions': [
120 ['use_system_libsrtp==0', {
121 'targets': [
122 {
123 'target_name': 'libsrtp',
124 'type': 'static_library',
125 'sources': [
126 # includes
127 'srtp/include/ekt.h',
128 'srtp/include/getopt_s.h',
129 'srtp/include/rtp.h',
130 'srtp/include/rtp_priv.h',
131 'srtp/include/srtp.h',
132 'srtp/include/srtp_priv.h',
133 'srtp/include/ut_sim.h',
mallinath@google.combe690502011-12-22 02:29:50 +0000134
phajdan.jr@chromium.orgd910efb2012-10-17 23:50:04 +0000135 # headers
136 'srtp/crypto/include/aes_cbc.h',
137 'srtp/crypto/include/aes.h',
138 'srtp/crypto/include/aes_icm.h',
139 'srtp/crypto/include/alloc.h',
140 'srtp/crypto/include/auth.h',
141 'srtp/crypto/include/cipher.h',
142 'srtp/crypto/include/cryptoalg.h',
143 'srtp/crypto/include/crypto.h',
144 'srtp/crypto/include/crypto_kernel.h',
145 'srtp/crypto/include/crypto_math.h',
146 'srtp/crypto/include/crypto_types.h',
147 'srtp/crypto/include/datatypes.h',
148 'srtp/crypto/include/err.h',
149 'srtp/crypto/include/gf2_8.h',
150 'srtp/crypto/include/hmac.h',
151 'srtp/crypto/include/integers.h',
152 'srtp/crypto/include/kernel_compat.h',
153 'srtp/crypto/include/key.h',
154 'srtp/crypto/include/null_auth.h',
155 'srtp/crypto/include/null_cipher.h',
156 'srtp/crypto/include/prng.h',
157 'srtp/crypto/include/rand_source.h',
158 'srtp/crypto/include/rdb.h',
159 'srtp/crypto/include/rdbx.h',
160 'srtp/crypto/include/sha1.h',
161 'srtp/crypto/include/stat.h',
162 'srtp/crypto/include/xfm.h',
mallinath@google.combe690502011-12-22 02:29:50 +0000163
phajdan.jr@chromium.orgd910efb2012-10-17 23:50:04 +0000164 # sources
165 'srtp/srtp/ekt.c',
166 'srtp/srtp/srtp.c',
primiano@chromium.org2f2e5572014-04-03 10:17:27 +0000167
phajdan.jr@chromium.orgd910efb2012-10-17 23:50:04 +0000168 'srtp/crypto/cipher/aes.c',
169 'srtp/crypto/cipher/aes_cbc.c',
170 'srtp/crypto/cipher/aes_icm.c',
171 'srtp/crypto/cipher/cipher.c',
172 'srtp/crypto/cipher/null_cipher.c',
173 'srtp/crypto/hash/auth.c',
174 'srtp/crypto/hash/hmac.c',
175 'srtp/crypto/hash/null_auth.c',
176 'srtp/crypto/hash/sha1.c',
177 'srtp/crypto/kernel/alloc.c',
178 'srtp/crypto/kernel/crypto_kernel.c',
179 'srtp/crypto/kernel/err.c',
180 'srtp/crypto/kernel/key.c',
181 'srtp/crypto/math/datatypes.c',
182 'srtp/crypto/math/gf2_8.c',
183 'srtp/crypto/math/stat.c',
184 'srtp/crypto/replay/rdb.c',
185 'srtp/crypto/replay/rdbx.c',
186 'srtp/crypto/replay/ut_sim.c',
187 'srtp/crypto/rng/ctr_prng.c',
188 'srtp/crypto/rng/prng.c',
189 'srtp/crypto/rng/rand_source.c',
leozwang@google.com4e2f8a62012-04-09 22:31:02 +0000190 ],
phajdan.jr@chromium.orgd910efb2012-10-17 23:50:04 +0000191 }, # target libsrtp
192 {
193 'target_name': 'rdbx_driver',
194 'type': 'executable',
195 'dependencies': [
196 'libsrtp',
197 ],
198 'sources': [
199 'srtp/include/getopt_s.h',
200 'srtp/test/getopt_s.c',
201 'srtp/test/rdbx_driver.c',
202 ],
203 },
204 {
205 'target_name': 'srtp_driver',
206 'type': 'executable',
207 'dependencies': [
208 'libsrtp',
209 ],
210 'sources': [
211 'srtp/include/getopt_s.h',
212 'srtp/include/srtp_priv.h',
213 'srtp/test/getopt_s.c',
214 'srtp/test/srtp_driver.c',
215 ],
216 },
217 {
218 'target_name': 'roc_driver',
219 'type': 'executable',
220 'dependencies': [
221 'libsrtp',
222 ],
223 'sources': [
224 'srtp/crypto/include/rdbx.h',
225 'srtp/include/ut_sim.h',
226 'srtp/test/roc_driver.c',
227 ],
228 },
229 {
230 'target_name': 'replay_driver',
231 'type': 'executable',
232 'dependencies': [
233 'libsrtp',
234 ],
235 'sources': [
236 'srtp/crypto/include/rdbx.h',
237 'srtp/include/ut_sim.h',
238 'srtp/test/replay_driver.c',
239 ],
240 },
241 {
242 'target_name': 'rtpw',
243 'type': 'executable',
244 'dependencies': [
245 'libsrtp',
246 ],
247 'sources': [
248 'srtp/include/getopt_s.h',
249 'srtp/include/rtp.h',
250 'srtp/include/srtp.h',
251 'srtp/crypto/include/datatypes.h',
252 'srtp/test/getopt_s.c',
253 'srtp/test/rtp.c',
254 'srtp/test/rtpw.c',
255 ],
256 'conditions': [
257 ['OS=="android"', {
258 'defines': [
259 'HAVE_SYS_SOCKET_H',
260 ],
261 }],
262 ],
263 },
264 {
265 'target_name': 'srtp_test_cipher_driver',
266 'type': 'executable',
267 'dependencies': [
268 'libsrtp',
269 ],
270 'sources': [
271 'srtp/crypto/test/cipher_driver.c',
272 ],
273 },
274 {
275 'target_name': 'srtp_test_datatypes_driver',
276 'type': 'executable',
277 'dependencies': [
278 'libsrtp',
279 ],
280 'sources': [
281 'srtp/crypto/test/datatypes_driver.c',
282 ],
283 },
284 {
285 'target_name': 'srtp_test_stat_driver',
286 'type': 'executable',
287 'dependencies': [
288 'libsrtp',
289 ],
290 'sources': [
291 'srtp/crypto/test/stat_driver.c',
292 ],
293 },
294 {
295 'target_name': 'srtp_test_sha1_driver',
296 'type': 'executable',
297 'dependencies': [
298 'libsrtp',
299 ],
300 'sources': [
301 'srtp/crypto/test/sha1_driver.c',
302 ],
303 },
304 {
305 'target_name': 'srtp_test_kernel_driver',
306 'type': 'executable',
307 'dependencies': [
308 'libsrtp',
309 ],
310 'sources': [
311 'srtp/crypto/test/kernel_driver.c',
312 ],
313 },
314 {
315 'target_name': 'srtp_test_aes_calc',
316 'type': 'executable',
317 'dependencies': [
318 'libsrtp',
319 ],
320 'sources': [
321 'srtp/crypto/test/aes_calc.c',
322 ],
323 },
324 {
325 'target_name': 'srtp_test_rand_gen',
326 'type': 'executable',
327 'dependencies': [
328 'libsrtp',
329 ],
330 'sources': [
331 'srtp/crypto/test/rand_gen.c',
332 ],
333 },
334 {
335 'target_name': 'srtp_test_env',
336 'type': 'executable',
337 'dependencies': [
338 'libsrtp',
339 ],
340 'sources': [
341 'srtp/crypto/test/env.c',
342 ],
343 },
344 {
345 'target_name': 'srtp_runtest',
346 'type': 'none',
347 'dependencies': [
348 'rdbx_driver',
349 'srtp_driver',
350 'roc_driver',
351 'replay_driver',
352 'rtpw',
353 'srtp_test_cipher_driver',
354 'srtp_test_datatypes_driver',
355 'srtp_test_stat_driver',
356 'srtp_test_sha1_driver',
357 'srtp_test_kernel_driver',
358 'srtp_test_aes_calc',
359 'srtp_test_rand_gen',
360 'srtp_test_env',
361 ],
362 },
363 ], # targets
364 }, { # use_system_libsrtp==1
365 'targets': [
366 {
367 'target_name': 'libsrtp',
368 'type': 'none',
369 'direct_dependent_settings': {
370 'defines': [
371 'USE_SYSTEM_LIBSRTP',
372 ],
373 'include_dirs': [
374 '/usr/include/srtp',
375 ],
376 },
377 'link_settings': {
378 'libraries': [
379 '-lsrtp',
380 ],
381 },
382 }, # target libsrtp
383 ], # targets
384 }],
385 ],
mallinath@google.combe690502011-12-22 02:29:50 +0000386}