Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / libsrtp / libsrtp.gyp
1 # Copyright (c) 2012 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.
4
5 {
6   'variables': {
7     'use_system_libsrtp%': 0,
8   },
9   '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': [
20       ['os_posix==1', {
21         'defines': [
22           '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',
33         ],
34       }],
35       ['OS=="win"', {
36         'defines': [
37           'INLINE=__inline',
38           'HAVE_BYTESWAP_METHODS_H',
39           # All Windows architectures are this way.
40           'SIZEOF_UNSIGNED_LONG=4',
41           'SIZEOF_UNSIGNED_LONG_LONG=8',
42          ],
43       }],
44       ['target_arch=="x64" or target_arch=="ia32"', {
45         'defines': [
46           'CPU_CISC',
47         ],
48       }],
49       ['target_arch=="arm" or target_arch=="armv7" or target_arch=="arm64" \
50        or target_arch=="mipsel" or target_arch=="mips64el"', {
51         'defines': [
52           # TODO(leozwang): CPU_RISC doesn't work properly on android/arm and
53           # mips platforms for unknown reasons, need to investigate the root
54           # cause of it. CPU_RISC is used for optimization only, and CPU_CISC
55           # should just work just fine, it has been tested on android/arm with
56           # srtp test applications and libjingle.
57           'CPU_CISC',
58         ],
59       }],
60       ['target_arch=="mipsel" or target_arch=="arm" or target_arch=="armv7" or target_arch=="ia32"', {
61         'defines': [
62           # Define FORCE_64BIT_ALIGN to avoid alignment-related-crashes like
63           # crbug/414919. Without this, aes_cbc_alloc will allocate an
64           # aes_cbc_ctx_t not 64-bit aligned and the v128_t members of
65           # aes_cbc_ctx_t will not be 64-bit aligned, which breaks the
66           # compiler optimizations that assume 64-bit alignment of v128_t.
67           'FORCE_64BIT_ALIGN',
68         ],
69       }],
70     ],
71     'direct_dependent_settings': {
72       'include_dirs': [
73         './config',
74         'srtp/include',
75         'srtp/crypto/include',
76       ],
77       'conditions': [
78         ['os_posix==1', {
79           'defines': [
80             'HAVE_INT16_T',
81             'HAVE_INT32_T',
82             'HAVE_INT8_T',
83             'HAVE_UINT16_T',
84             'HAVE_UINT32_T',
85             'HAVE_UINT64_T',
86             'HAVE_UINT8_T',
87             'HAVE_STDINT_H',
88             'HAVE_INTTYPES_H',
89             'HAVE_NETINET_IN_H',
90             'INLINE=inline',
91           ],
92         }],
93         ['OS=="win"', {
94           'defines': [
95             'INLINE=__inline',
96             'HAVE_BYTESWAP_METHODS_H',
97             # All Windows architectures are this way.
98             'SIZEOF_UNSIGNED_LONG=4',
99             'SIZEOF_UNSIGNED_LONG_LONG=8',
100            ],
101         }],
102         ['target_arch=="x64" or target_arch=="ia32"', {
103           'defines': [
104             'CPU_CISC',
105           ],
106         }],
107       ],
108     },
109   },
110   'conditions': [
111     ['use_system_libsrtp==0', {
112       'targets': [
113         {
114           'target_name': 'libsrtp',
115           'type': 'static_library',
116           'sources': [
117             # includes
118             'srtp/include/ekt.h',
119             'srtp/include/getopt_s.h',
120             'srtp/include/rtp.h',
121             'srtp/include/rtp_priv.h',
122             'srtp/include/srtp.h',
123             'srtp/include/srtp_priv.h',
124             'srtp/include/ut_sim.h',
125
126             # headers
127             'srtp/crypto/include/aes_cbc.h',
128             'srtp/crypto/include/aes.h',
129             'srtp/crypto/include/aes_icm.h',
130             'srtp/crypto/include/alloc.h',
131             'srtp/crypto/include/auth.h',
132             'srtp/crypto/include/cipher.h',
133             'srtp/crypto/include/cryptoalg.h',
134             'srtp/crypto/include/crypto.h',
135             'srtp/crypto/include/crypto_kernel.h',
136             'srtp/crypto/include/crypto_math.h',
137             'srtp/crypto/include/crypto_types.h',
138             'srtp/crypto/include/datatypes.h',
139             'srtp/crypto/include/err.h',
140             'srtp/crypto/include/gf2_8.h',
141             'srtp/crypto/include/hmac.h',
142             'srtp/crypto/include/integers.h',
143             'srtp/crypto/include/kernel_compat.h',
144             'srtp/crypto/include/key.h',
145             'srtp/crypto/include/null_auth.h',
146             'srtp/crypto/include/null_cipher.h',
147             'srtp/crypto/include/prng.h',
148             'srtp/crypto/include/rand_source.h',
149             'srtp/crypto/include/rdb.h',
150             'srtp/crypto/include/rdbx.h',
151             'srtp/crypto/include/sha1.h',
152             'srtp/crypto/include/stat.h',
153             'srtp/crypto/include/xfm.h',
154
155             # sources
156             'srtp/srtp/ekt.c',
157             'srtp/srtp/srtp.c',
158
159             'srtp/crypto/cipher/aes.c',
160             'srtp/crypto/cipher/aes_cbc.c',
161             'srtp/crypto/cipher/aes_icm.c',
162             'srtp/crypto/cipher/cipher.c',
163             'srtp/crypto/cipher/null_cipher.c',
164             'srtp/crypto/hash/auth.c',
165             'srtp/crypto/hash/hmac.c',
166             'srtp/crypto/hash/null_auth.c',
167             'srtp/crypto/hash/sha1.c',
168             'srtp/crypto/kernel/alloc.c',
169             'srtp/crypto/kernel/crypto_kernel.c',
170             'srtp/crypto/kernel/err.c',
171             'srtp/crypto/kernel/key.c',
172             'srtp/crypto/math/datatypes.c',
173             'srtp/crypto/math/gf2_8.c',
174             'srtp/crypto/math/stat.c',
175             'srtp/crypto/replay/rdb.c',
176             'srtp/crypto/replay/rdbx.c',
177             'srtp/crypto/replay/ut_sim.c',
178             'srtp/crypto/rng/ctr_prng.c',
179             'srtp/crypto/rng/prng.c',
180             'srtp/crypto/rng/rand_source.c',
181           ],
182         }, # target libsrtp
183         {
184           'target_name': 'rdbx_driver',
185           'type': 'executable',
186           'dependencies': [
187             'libsrtp',
188           ],
189           'sources': [
190             'srtp/include/getopt_s.h',
191             'srtp/test/getopt_s.c',
192             'srtp/test/rdbx_driver.c',
193           ],
194         },
195         {
196           'target_name': 'srtp_driver',
197           'type': 'executable',
198           'dependencies': [
199             'libsrtp',
200           ],
201           'sources': [
202             'srtp/include/getopt_s.h',
203             'srtp/include/srtp_priv.h',
204             'srtp/test/getopt_s.c',
205             'srtp/test/srtp_driver.c',
206           ],
207         },
208         {
209           'target_name': 'roc_driver',
210           'type': 'executable',
211           'dependencies': [
212             'libsrtp',
213           ],
214           'sources': [
215             'srtp/crypto/include/rdbx.h',
216             'srtp/include/ut_sim.h',
217             'srtp/test/roc_driver.c',
218           ],
219         },
220         {
221           'target_name': 'replay_driver',
222           'type': 'executable',
223           'dependencies': [
224             'libsrtp',
225           ],
226           'sources': [
227             'srtp/crypto/include/rdbx.h',
228             'srtp/include/ut_sim.h',
229             'srtp/test/replay_driver.c',
230           ],
231         },
232         {
233           'target_name': 'rtpw',
234           'type': 'executable',
235           'dependencies': [
236             'libsrtp',
237           ],
238           'sources': [
239             'srtp/include/getopt_s.h',
240             'srtp/include/rtp.h',
241             'srtp/include/srtp.h',
242             'srtp/crypto/include/datatypes.h',
243             'srtp/test/getopt_s.c',
244             'srtp/test/rtp.c',
245             'srtp/test/rtpw.c',
246           ],
247           'conditions': [
248             ['OS=="android"', {
249               'defines': [
250                 'HAVE_SYS_SOCKET_H',
251               ],
252             }],
253           ],
254         },
255         {
256           'target_name': 'srtp_test_cipher_driver',
257           'type': 'executable',
258           'dependencies': [
259             'libsrtp',
260           ],
261           'sources': [
262             'srtp/crypto/test/cipher_driver.c',
263           ],
264         },
265         {
266           'target_name': 'srtp_test_datatypes_driver',
267           'type': 'executable',
268           'dependencies': [
269             'libsrtp',
270           ],
271           'sources': [
272             'srtp/crypto/test/datatypes_driver.c',
273           ],
274         },
275         {
276           'target_name': 'srtp_test_stat_driver',
277           'type': 'executable',
278           'dependencies': [
279             'libsrtp',
280           ],
281           'sources': [
282             'srtp/crypto/test/stat_driver.c',
283           ],
284         },
285         {
286           'target_name': 'srtp_test_sha1_driver',
287           'type': 'executable',
288           'dependencies': [
289             'libsrtp',
290           ],
291           'sources': [
292             'srtp/crypto/test/sha1_driver.c',
293           ],
294         },
295         {
296           'target_name': 'srtp_test_kernel_driver',
297           'type': 'executable',
298           'dependencies': [
299             'libsrtp',
300           ],
301           'sources': [
302             'srtp/crypto/test/kernel_driver.c',
303           ],
304         },
305         {
306           'target_name': 'srtp_test_aes_calc',
307           'type': 'executable',
308           'dependencies': [
309             'libsrtp',
310           ],
311           'sources': [
312             'srtp/crypto/test/aes_calc.c',
313           ],
314         },
315         {
316           'target_name': 'srtp_test_rand_gen',
317           'type': 'executable',
318           'dependencies': [
319             'libsrtp',
320           ],
321           'sources': [
322             'srtp/crypto/test/rand_gen.c',
323           ],
324         },
325         {
326           'target_name': 'srtp_test_env',
327           'type': 'executable',
328           'dependencies': [
329             'libsrtp',
330           ],
331           'sources': [
332             'srtp/crypto/test/env.c',
333           ],
334         },
335         {
336           'target_name': 'srtp_runtest',
337           'type': 'none',
338           'dependencies': [
339             'rdbx_driver',
340             'srtp_driver',
341             'roc_driver',
342             'replay_driver',
343             'rtpw',
344             'srtp_test_cipher_driver',
345             'srtp_test_datatypes_driver',
346             'srtp_test_stat_driver',
347             'srtp_test_sha1_driver',
348             'srtp_test_kernel_driver',
349             'srtp_test_aes_calc',
350             'srtp_test_rand_gen',
351             'srtp_test_env',
352           ],
353         },
354       ], # targets
355     }, { # use_system_libsrtp==1
356       'targets': [
357         {
358           'target_name': 'libsrtp',
359           'type': 'none',
360           'direct_dependent_settings': {
361             'defines': [
362               'USE_SYSTEM_LIBSRTP',
363             ],
364             'include_dirs': [
365               '/usr/include/srtp',
366             ],
367           },
368           'link_settings': {
369             'libraries': [
370               '-lsrtp',
371             ],
372           },
373         }, # target libsrtp
374       ], # targets
375     }],
376   ],
377 }