提交 33639a84 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Merge branch 'issue-353' into v3

gyp stuff for libsrtp taken from Chromium project:
https://chromium.googlesource.com/chromium/deps/libsrtp/+/master/
# libsrtp dependency for mediasoup
Here we provide our own `libsrtp.gyp` for mediasoup which is inspired by the corresponding file in Chromium sources. However, Chromium has migrated from GYP to GN:
* https://chromium.googlesource.com/chromium/deps/libsrtp/+/master/BUILD.gn
## IMPORTANT
When the `libsrtp` dependency is updated to a new version, we must update according the `config/config.h` file which defines C macros with the new version.
......@@ -5,8 +5,8 @@
// This is a stub config.h for libSRTP. It doesn't define anything besides
// version number strings because the build is configured by libsrtp.gyp.
#define PACKAGE_STRING "libsrtp 2.0.0"
#define PACKAGE_VERSION "2.0.0"
#define PACKAGE_STRING "libsrtp 2.3.0"
#define PACKAGE_VERSION "2.3.0"
#if defined(_MSC_VER) && !defined(__cplusplus)
// Microsoft provides "inline" only for C++ code
......
# NOTE: Inspired by https://chromium.googlesource.com/chromium/deps/libsrtp/+/master/libsrtp.gyp
#
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......@@ -11,60 +9,55 @@
},
'target_defaults': {
'defines': [
# Config.
'HAVE_CONFIG_H',
# Platform properties.
'HAVE_STDLIB_H',
'HAVE_STRING_H',
'TESTAPP_SOURCE',
],
'include_dirs': [
'./config',
'srtp/include',
'srtp/crypto/include',
'HAVE_STDINT_H',
'HAVE_INTTYPES_H',
'HAVE_INT8_T',
'HAVE_INT16_T',
'HAVE_INT32_T',
'HAVE_UINT8_T',
'HAVE_UINT16_T',
'HAVE_UINT32_T',
'HAVE_UINT64_T',
],
'conditions': [
['use_openssl==1', {
[ 'use_openssl == 1', {
'defines': [
'OPENSSL',
'GCM',
],
}],
# NOTE: Avoid having to set os_posix.
# ['os_posix==1', {
['OS!="win"', {
[ 'OS != "win"', {
'defines': [
'HAVE_INT16_T',
'HAVE_INT32_T',
'HAVE_INT8_T',
'HAVE_UINT16_T',
'HAVE_UINT32_T',
'HAVE_UINT64_T',
'HAVE_UINT8_T',
'HAVE_STDINT_H',
'HAVE_INTTYPES_H',
'HAVE_NETINET_IN_H',
'HAVE_ARPA_INET_H',
'HAVE_NETINET_IN_H',
'HAVE_SYS_TYPES_H',
'HAVE_UNISTD_H',
],
'cflags': [
'-Wno-unused-variable',
],
'cflags': [ '-Wall', '-Wno-unused-variable', '-Wno-sign-compare' ],
}],
['OS=="win"', {
[ 'OS == "mac"', {
'xcode_settings':
{
'WARNING_CFLAGS': [ '-Wall', '-Wno-unused-variable', '-Wno-sign-compare' ],
}
}],
[ 'OS == "win"', {
'defines': [
'HAVE_BYTESWAP_METHODS_H',
# All Windows architectures are this way.
'SIZEOF_UNSIGNED_LONG=4',
'SIZEOF_UNSIGNED_LONG_LONG=8',
'HAVE_WINSOCK2_H',
],
}],
['target_arch=="x64" or target_arch=="ia32"', {
[ 'target_arch == "x64" or target_arch == "ia32"', {
'defines': [
'CPU_CISC',
],
}],
['target_arch=="arm" or target_arch=="arm64" \
or target_arch=="mipsel" or target_arch=="mips64el"', {
[ 'target_arch == "arm" or target_arch == "arm64" \
or target_arch == "mipsel" or target_arch == "mips64el"', {
'defines': [
# TODO(leozwang): CPU_RISC doesn't work properly on android/arm and
# mips platforms for unknown reasons, need to investigate the root
......@@ -74,55 +67,18 @@
'CPU_CISC',
],
}],
['target_arch=="mipsel" or target_arch=="arm" or target_arch=="ia32"', {
'defines': [
# Define FORCE_64BIT_ALIGN to avoid alignment-related-crashes like
# crbug/414919. Without this, aes_cbc_alloc will allocate an
# aes_cbc_ctx_t not 64-bit aligned and the v128_t members of
# aes_cbc_ctx_t will not be 64-bit aligned, which breaks the
# compiler optimizations that assume 64-bit alignment of v128_t.
'FORCE_64BIT_ALIGN',
],
}],
],
'include_dirs': [
'./config',
'srtp/include',
'srtp/crypto/include',
],
'direct_dependent_settings': {
'include_dirs': [
# NOTE: I don't think we must export this.
'srtp/include',
# NOTE: I don't think we must export this.
# 'srtp/crypto/include',
],
'conditions': [
# NOTE: Avoid having to set os_posix.
# ['os_posix==1', {
['OS!="win"', {
'defines': [
'HAVE_INT16_T',
'HAVE_INT32_T',
'HAVE_INT8_T',
'HAVE_UINT16_T',
'HAVE_UINT32_T',
'HAVE_UINT64_T',
'HAVE_UINT8_T',
'HAVE_STDINT_H',
'HAVE_INTTYPES_H',
'HAVE_NETINET_IN_H',
],
}],
['OS=="win"', {
'defines': [
'HAVE_BYTESWAP_METHODS_H',
# All Windows architectures are this way.
'SIZEOF_UNSIGNED_LONG=4',
'SIZEOF_UNSIGNED_LONG_LONG=8',
],
}],
['target_arch=="x64" or target_arch=="ia32"', {
'defines': [
'CPU_CISC',
],
}],
],
},
},
'targets': [
......@@ -130,13 +86,12 @@
'target_name': 'libsrtp',
'type': 'static_library',
'sources': [
# includes
# Includes.
'srtp/include/ekt.h',
'srtp/include/getopt_s.h',
'srtp/include/srtp.h',
# Headers.
'srtp/include/srtp_priv.h',
'srtp/include/ut_sim.h',
# headers
'srtp/crypto/include/aes.h',
'srtp/crypto/include/aes_gcm.h',
'srtp/crypto/include/aes_icm.h',
......@@ -159,7 +114,7 @@
'srtp/crypto/include/rdbx.h',
'srtp/crypto/include/sha1.h',
'srtp/crypto/include/stat.h',
# sources
# Sources.
'srtp/srtp/ekt.c',
'srtp/srtp/srtp.c',
'srtp/crypto/cipher/aes.c',
......@@ -181,7 +136,7 @@
'srtp/crypto/replay/ut_sim.c',
],
'conditions': [
['use_openssl==1', {
[ 'use_openssl == 1', {
'dependencies': [
'<(DEPTH)/deps/openssl/openssl.gyp:openssl',
],
......@@ -197,203 +152,6 @@
],
}],
],
}, # target libsrtp
{
'target_name': 'rdbx_driver',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/include/getopt_s.h',
'srtp/test/getopt_s.c',
'srtp/test/rdbx_driver.c',
],
},
{
'target_name': 'srtp_driver',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/include/getopt_s.h',
'srtp/include/srtp_priv.h',
'srtp/test/getopt_s.c',
'srtp/test/srtp_driver.c',
],
},
{
'target_name': 'roc_driver',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/crypto/include/rdbx.h',
'srtp/include/ut_sim.h',
'srtp/test/roc_driver.c',
],
},
{
'target_name': 'replay_driver',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/crypto/include/rdbx.h',
'srtp/include/ut_sim.h',
'srtp/test/replay_driver.c',
],
},
{
'target_name': 'rtpw',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/include/getopt_s.h',
'srtp/include/rtp.h',
'srtp/include/srtp.h',
'srtp/crypto/include/datatypes.h',
'srtp/test/getopt_s.c',
'srtp/test/rtp.c',
'srtp/test/rtpw.c',
],
'conditions': [
['OS=="android"', {
'defines': [
'HAVE_SYS_SOCKET_H',
],
}],
],
},
{
'target_name': 'srtp_test_cipher_driver',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/crypto/test/cipher_driver.c',
'srtp/include/getopt_s.h',
'srtp/test/getopt_s.c',
],
'conditions': [
['use_openssl==1', {
'dependencies': [
'<(DEPTH)/deps/openssl/openssl.gyp:openssl',
],
}],
],
},
{
'target_name': 'srtp_test_datatypes_driver',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/crypto/test/datatypes_driver.c',
],
},
{
'target_name': 'srtp_test_stat_driver',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/crypto/test/stat_driver.c',
],
},
{
'target_name': 'srtp_test_sha1_driver',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/crypto/test/sha1_driver.c',
],
},
{
'target_name': 'srtp_test_kernel_driver',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/crypto/test/kernel_driver.c',
'srtp/include/getopt_s.h',
'srtp/test/getopt_s.c',
],
},
{
'target_name': 'srtp_test_aes_calc',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/crypto/test/aes_calc.c',
],
},
{
'target_name': 'srtp_test_rand_gen',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/crypto/test/rand_gen.c',
'srtp/include/getopt_s.h',
'srtp/test/getopt_s.c',
],
},
{
'target_name': 'srtp_test_rand_gen_soak',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/crypto/test/rand_gen_soak.c',
'srtp/include/getopt_s.h',
'srtp/test/getopt_s.c',
],
},
{
'target_name': 'srtp_test_env',
'type': 'executable',
'dependencies': [
'libsrtp',
],
'sources': [
'srtp/crypto/test/env.c',
],
},
{
'target_name': 'srtp_runtest',
'type': 'none',
'dependencies': [
'rdbx_driver',
'srtp_driver',
'roc_driver',
'replay_driver',
'rtpw',
'srtp_test_cipher_driver',
'srtp_test_datatypes_driver',
'srtp_test_stat_driver',
'srtp_test_sha1_driver',
'srtp_test_kernel_driver',
'srtp_test_aes_calc',
'srtp_test_rand_gen',
'srtp_test_rand_gen_soak',
'srtp_test_env',
],
},
], # targets
}
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论