mallinath@google.com | b313d03 | 2012-01-24 23:00:41 +0000 | [diff] [blame] | 1 | # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
mallinath@google.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 2 | # 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.org | d910efb | 2012-10-17 23:50:04 +0000 | [diff] [blame] | 6 | 'variables': { |
| 7 | 'use_system_libsrtp%': 0, |
| 8 | }, |
mallinath@google.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 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': [ |
sergeyu@chromium.org | e151e51 | 2013-03-21 05:37:21 +0000 | [diff] [blame] | 20 | ['os_posix==1', { |
mallinath@google.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 21 | 'defines': [ |
sergeyu@chromium.org | e151e51 | 2013-03-21 05:37:21 +0000 | [diff] [blame] | 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', |
mallinath@google.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 33 | ], |
| 34 | }], |
sergeyu@chromium.org | e151e51 | 2013-03-21 05:37:21 +0000 | [diff] [blame] | 35 | ['OS=="win"', { |
jschuh@chromium.org | aaa7ffc | 2012-12-26 19:36:04 +0000 | [diff] [blame] | 36 | 'defines': [ |
sergeyu@chromium.org | e151e51 | 2013-03-21 05:37:21 +0000 | [diff] [blame] | 37 | 'INLINE=__inline', |
| 38 | 'HAVE_BYTESWAP_METHODS_H', |
| 39 | # All Windows architectures are this way. |
jschuh@chromium.org | aaa7ffc | 2012-12-26 19:36:04 +0000 | [diff] [blame] | 40 | 'SIZEOF_UNSIGNED_LONG=4', |
| 41 | 'SIZEOF_UNSIGNED_LONG_LONG=8', |
sergeyu@chromium.org | e151e51 | 2013-03-21 05:37:21 +0000 | [diff] [blame] | 42 | ], |
jschuh@chromium.org | aaa7ffc | 2012-12-26 19:36:04 +0000 | [diff] [blame] | 43 | }], |
sergeyu@chromium.org | e151e51 | 2013-03-21 05:37:21 +0000 | [diff] [blame] | 44 | ['target_arch=="x64" or target_arch=="ia32"', { |
mallinath@google.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 45 | 'defines': [ |
| 46 | 'CPU_CISC', |
mallinath@google.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 47 | ], |
| 48 | }], |
primiano@chromium.org | 2f2e557 | 2014-04-03 10:17:27 +0000 | [diff] [blame] | 49 | ['target_arch=="arm" or target_arch=="armv7" or target_arch=="arm64"', { |
mallinath@google.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 50 | 'defines': [ |
leozwang@google.com | 4e2f8a6 | 2012-04-09 22:31:02 +0000 | [diff] [blame] | 51 | # 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.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 57 | ], |
| 58 | }], |
mallinath@chromium.org | 5eebd25 | 2014-08-07 15:32:34 +0000 | [diff] [blame] | 59 | ['target_arch=="mipsel" or target_arch=="mips64el"', { |
wjia@chromium.org | fe888df | 2012-09-26 17:41:03 +0000 | [diff] [blame] | 60 | 'defines': [ |
| 61 | 'CPU_RISC', |
badea@adobe.com | 7655e35 | 2012-09-13 06:40:38 +0000 | [diff] [blame] | 62 | ], |
| 63 | }], |
jiayl@chromium.org | 98284c8 | 2014-09-22 22:04:31 +0000 | [diff] [blame] | 64 | ['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.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 74 | ], |
| 75 | 'direct_dependent_settings': { |
| 76 | 'include_dirs': [ |
| 77 | './config', |
| 78 | 'srtp/include', |
| 79 | 'srtp/crypto/include', |
| 80 | ], |
| 81 | 'conditions': [ |
sergeyu@chromium.org | e151e51 | 2013-03-21 05:37:21 +0000 | [diff] [blame] | 82 | ['os_posix==1', { |
mallinath@google.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 83 | 'defines': [ |
leozwang@google.com | 4e2f8a6 | 2012-04-09 22:31:02 +0000 | [diff] [blame] | 84 | '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.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 91 | 'HAVE_STDINT_H', |
| 92 | 'HAVE_INTTYPES_H', |
mallinath@google.com | 40a4558 | 2012-02-10 18:48:09 +0000 | [diff] [blame] | 93 | 'HAVE_NETINET_IN_H', |
scottmg@chromium.org | 7bcb8db | 2012-10-16 01:25:03 +0000 | [diff] [blame] | 94 | 'INLINE=inline', |
mallinath@google.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 95 | ], |
| 96 | }], |
| 97 | ['OS=="win"', { |
| 98 | 'defines': [ |
scottmg@chromium.org | 7bcb8db | 2012-10-16 01:25:03 +0000 | [diff] [blame] | 99 | 'INLINE=__inline', |
mallinath@chromium.org | 4af3b6f | 2012-02-28 01:07:05 +0000 | [diff] [blame] | 100 | 'HAVE_BYTESWAP_METHODS_H', |
sergeyu@chromium.org | e151e51 | 2013-03-21 05:37:21 +0000 | [diff] [blame] | 101 | # 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.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 109 | ], |
| 110 | }], |
mallinath@chromium.org | 5eebd25 | 2014-08-07 15:32:34 +0000 | [diff] [blame] | 111 | ['target_arch=="mipsel" or target_arch=="mips64el"', { |
badea@adobe.com | 7655e35 | 2012-09-13 06:40:38 +0000 | [diff] [blame] | 112 | 'defines': [ |
sergeyu@chromium.org | e151e51 | 2013-03-21 05:37:21 +0000 | [diff] [blame] | 113 | 'CPU_RISC', |
badea@adobe.com | 7655e35 | 2012-09-13 06:40:38 +0000 | [diff] [blame] | 114 | ], |
| 115 | }], |
mallinath@google.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 116 | ], |
| 117 | }, |
| 118 | }, |
phajdan.jr@chromium.org | d910efb | 2012-10-17 23:50:04 +0000 | [diff] [blame] | 119 | '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.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 134 | |
phajdan.jr@chromium.org | d910efb | 2012-10-17 23:50:04 +0000 | [diff] [blame] | 135 | # 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.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 163 | |
phajdan.jr@chromium.org | d910efb | 2012-10-17 23:50:04 +0000 | [diff] [blame] | 164 | # sources |
| 165 | 'srtp/srtp/ekt.c', |
| 166 | 'srtp/srtp/srtp.c', |
primiano@chromium.org | 2f2e557 | 2014-04-03 10:17:27 +0000 | [diff] [blame] | 167 | |
phajdan.jr@chromium.org | d910efb | 2012-10-17 23:50:04 +0000 | [diff] [blame] | 168 | '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.com | 4e2f8a6 | 2012-04-09 22:31:02 +0000 | [diff] [blame] | 190 | ], |
phajdan.jr@chromium.org | d910efb | 2012-10-17 23:50:04 +0000 | [diff] [blame] | 191 | }, # 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.com | be69050 | 2011-12-22 02:29:50 +0000 | [diff] [blame] | 386 | } |