moz.build (2414B)
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- 2 # vim: set filetype=python: 3 # This Source Code Form is subject to the terms of the Mozilla Public 4 # License, v. 2.0. If a copy of the MPL was not distributed with this 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 7 # we don't use mbedtls 8 9 UNIFIED_SOURCES += [ 10 'crypto/cipher/aes_gcm_nss.c', 11 'crypto/cipher/aes_icm_nss.c', 12 'crypto/cipher/cipher.c', 13 'crypto/cipher/cipher_test_cases.c', 14 'crypto/cipher/null_cipher.c', 15 'crypto/hash/auth.c', 16 'crypto/hash/auth_test_cases.c', 17 'crypto/hash/hmac.c', 18 'crypto/hash/null_auth.c', 19 'crypto/hash/sha1.c', 20 'crypto/kernel/alloc.c', 21 'crypto/kernel/crypto_kernel.c', 22 'crypto/kernel/err.c', 23 'crypto/kernel/key.c', 24 'crypto/math/datatypes.c', 25 'crypto/replay/rdb.c', 26 'crypto/replay/rdbx.c', 27 'srtp/srtp.c', 28 ] 29 30 Library('nksrtp_s') 31 32 include('/ipc/chromium/chromium-config.mozbuild') 33 34 FINAL_LIBRARY = 'xul' 35 36 LOCAL_INCLUDES += [ 37 'crypto/include', 38 'include', 39 ] 40 41 DEFINES['PACKAGE_STRING'] = '"libsrtp2 2.2.0-pre"' 42 DEFINES['PACKAGE_VERSION'] = '"2.2.0-pre"' 43 44 # This is needed to enable the be32_to_cpu and be64_to_cpu 45 # macro's in datatypes.h 46 DEFINES['HAVE_CONFIG_H'] = 1 47 48 # We know stdint.h will define uint8/16/32/64_t, so we don't need 49 # to define SIZEOF_UNSIGNED_LONG/SIZEOF_UNSIGNED_LONG_LONG 50 for var in ('HAVE_STDLIB_H', 'HAVE_UINT8_T', 'HAVE_UINT16_T', 51 'HAVE_INT32_T', 'HAVE_UINT32_T', 'HAVE_UINT64_T'): 52 DEFINES[var] = 1 53 54 # Enable AES-GCM cipher suite in libsrtp 55 DEFINES['GCM'] = 1 56 # Let libsrtp use NSS instead of build-in crypto 57 DEFINES['NSS'] = 1 58 59 # XXX while arm is not a CISC architecture, the code guarded by CPU_RISC makes 60 # (at least) the AES ciphers fail their self-tests on ARM, so for now we're 61 # falling back to the (presumably) slower-on-this-architecture but working 62 # code path. https://bugzilla.mozilla.org/show_bug.cgi?id=822380 has been filed 63 # to make the right and more performant fix and push it back upstream. 64 if CONFIG['TARGET_CPU'] in ('arm', 'x86', 'x86_64', 'mips32', 'mips64'): 65 DEFINES['CPU_CISC'] = 1 66 else: 67 # best guess 68 DEFINES['CPU_RISC'] = 1 69 70 if CONFIG['TARGET_CPU'] in ('x86', 'x86_64'): 71 DEFINES['HAVE_X86'] = True 72 73 if CONFIG['OS_TARGET'] == 'WINNT': 74 DEFINES['HAVE_WINSOCK2_H'] = True 75 DEFINES['inline'] = '__inline' 76 else: 77 DEFINES['HAVE_NETINET_IN_H'] = 1