Added support for a local copy of dependencies, when the system version is not compatible or available

Change-Id: Ibd5c74bff376df49631710e72136416197251d62
This commit is contained in:
Thulinma 2022-12-28 13:19:56 +01:00
parent 529adbfaf6
commit 00833223e1
9 changed files with 273 additions and 10 deletions

View file

@ -0,0 +1,77 @@
project('SRT', 'cpp', 'c', version: '1.5.1')
add_project_arguments(['-DENABLE_LOGGING=1', '-O3', '-DNDEBUG', '-DENABLE_MONOTONIC_CLOCK=1', '-DENABLE_NEW_RCVBUFFER=1', '-DENABLE_SOCK_CLOEXEC=1', '-DHAI_ENABLE_SRT=1', '-DHAI_PATCH=1', '-DHAVE_INET_PTON=1', '-DHAVE_PTHREAD_GETNAME_NP=1', '-DHAVE_PTHREAD_SETNAME_NP=1', '-DLINUX=1', '-DNDEBUG', '-DSRT_DYNAMIC', '-DSRT_ENABLE_APP_READER', '-DSRT_ENABLE_BINDTODEVICE', '-DSRT_ENABLE_CLOSE_SYNCH', '-DSRT_ENABLE_ENCRYPTION', '-DSRT_EXPORTS', '-DSRT_VERSION="1.5.1"', '-DUSE_MBEDTLS=1', '-D_GNU_SOURCE'], language: ['cpp','c'])
mbedcrypto_lib = dependency('mbedcrypto', required: false)
mbedx509_lib = dependency('mbedx509', required: false)
mbedtls_lib = dependency('mbedtls', required: false)
if not mbedtls_lib.found()
ccpp = meson.get_compiler('cpp')
mbedtls_lib = ccpp.find_library('mbedtls')
mbedx509_lib = ccpp.find_library('mbedx509')
mbedcrypto_lib = ccpp.find_library('mbedcrypto')
endif
header_tgts = []
subdir('srt')
srt_src = files(
'srtcore/api.cpp',
'srtcore/buffer.cpp',
'srtcore/buffer_rcv.cpp',
'srtcore/cache.cpp',
'srtcore/channel.cpp',
'srtcore/common.cpp',
'srtcore/core.cpp',
'srtcore/crypto.cpp',
'srtcore/epoll.cpp',
'srtcore/fec.cpp',
'srtcore/handshake.cpp',
'srtcore/list.cpp',
'srtcore/logger_default.cpp',
'srtcore/logger_defs.cpp',
'srtcore/md5.cpp',
'srtcore/packet.cpp',
'srtcore/packetfilter.cpp',
'srtcore/queue.cpp',
'srtcore/congctl.cpp',
'srtcore/socketconfig.cpp',
'srtcore/srt_c_api.cpp',
'srtcore/strerror_defs.cpp',
'srtcore/sync.cpp',
'srtcore/tsbpd_time.cpp',
'srtcore/window.cpp',
'srtcore/sync_posix.cpp',
'haicrypt/haicrypt_log.cpp',
'srtcore/srt_compat.c',
'haicrypt/cryspr.c',
'haicrypt/cryspr-mbedtls.c',
'haicrypt/hcrypt.c',
'haicrypt/hcrypt_ctx_rx.c',
'haicrypt/hcrypt_ctx_tx.c',
'haicrypt/hcrypt_rx.c',
'haicrypt/hcrypt_sa.c',
'haicrypt/hcrypt_tx.c',
'haicrypt/hcrypt_xpt_srt.c',
'srtcore/srt.h',
'srtcore/logging_api.h',
'srtcore/access_control.h',
'srtcore/platform_sys.h',
'srtcore/udt.h'
)
libsrt = library(
'srt',
sources: [srt_src, versionfile],
dependencies: [mbedtls_lib, mbedx509_lib, mbedcrypto_lib],
include_directories: ['srt', 'haicrypt', 'srtcore']
)
srt_dep = declare_dependency(
link_with : [libsrt],
dependencies: [mbedtls_lib, mbedx509_lib, mbedcrypto_lib],
sources: [header_tgts],
include_directories: include_directories('.'),
)

View file

@ -0,0 +1,15 @@
versionfile = configure_file(format: 'cmake@', output: 'version.h', input: files('../srtcore/version.h.in'), configuration: {
'SRT_VERSION_MAJOR': 1,
'SRT_VERSION_MINOR' : 5,
'SRT_VERSION_PATCH': 1,
'CI_BUILD_NUMBER_STRING': '"1.5.1"',
'SRT_VERSION': '1.5.1',
})
header_tgts += configure_file(copy:true, input: files('../srtcore/srt.h'), output: 'srt.h')
header_tgts += configure_file(copy:true, input: files('../srtcore/logging_api.h'), output: 'logging_api.h')
header_tgts += configure_file(copy:true, input: files('../srtcore/access_control.h'), output: 'access_control.h')
header_tgts += configure_file(copy:true, input: files('../srtcore/platform_sys.h'), output: 'platform_sys.h')
header_tgts += configure_file(copy:true, input: files('../srtcore/udt.h'), output: 'udt.h')

View file

@ -0,0 +1,112 @@
project('mbedtls', 'c', default_options: ['optimization=2', 'warning_level=0'])
add_project_arguments(['-Wno-stringop-overflow'], language: 'c')
incl = include_directories('include')
libmbedcrypto = library('mbedcrypto',
'library/aes.c',
'library/aesni.c',
'library/arc4.c',
'library/aria.c',
'library/asn1parse.c',
'library/asn1write.c',
'library/base64.c',
'library/bignum.c',
'library/blowfish.c',
'library/camellia.c',
'library/ccm.c',
'library/chacha20.c',
'library/chachapoly.c',
'library/cipher.c',
'library/cipher_wrap.c',
'library/cmac.c',
'library/ctr_drbg.c',
'library/des.c',
'library/dhm.c',
'library/ecdh.c',
'library/ecdsa.c',
'library/ecjpake.c',
'library/ecp.c',
'library/ecp_curves.c',
'library/entropy.c',
'library/entropy_poll.c',
'library/error.c',
'library/gcm.c',
'library/havege.c',
'library/hkdf.c',
'library/hmac_drbg.c',
'library/md.c',
'library/md2.c',
'library/md4.c',
'library/md5.c',
'library/md_wrap.c',
'library/memory_buffer_alloc.c',
'library/oid.c',
'library/padlock.c',
'library/pem.c',
'library/pk.c',
'library/pk_wrap.c',
'library/pkcs12.c',
'library/pkcs5.c',
'library/pkparse.c',
'library/pkwrite.c',
'library/platform.c',
'library/platform_util.c',
'library/poly1305.c',
'library/ripemd160.c',
'library/rsa.c',
'library/rsa_internal.c',
'library/sha1.c',
'library/sha256.c',
'library/sha512.c',
'library/threading.c',
'library/timing.c',
'library/version.c',
'library/version_features.c',
'library/xtea.c',
include_directories: incl
)
mbedcrypto_dep = declare_dependency(
link_with: [libmbedcrypto],
include_directories: incl,
)
libmbedx509 = library('mbedx509',
'library/certs.c',
'library/pkcs11.c',
'library/x509.c',
'library/x509_create.c',
'library/x509_crl.c',
'library/x509_crt.c',
'library/x509_csr.c',
'library/x509write_crt.c',
'library/x509write_csr.c',
include_directories: incl,
dependencies: mbedcrypto_dep,
)
mbedx509_dep = declare_dependency(
link_with: [libmbedx509],
include_directories: incl,
)
libmbedtls = library('mbedtls',
'library/debug.c',
'library/net_sockets.c',
'library/ssl_cache.c',
'library/ssl_ciphersuites.c',
'library/ssl_cli.c',
'library/ssl_cookie.c',
'library/ssl_srv.c',
'library/ssl_ticket.c',
'library/ssl_tls.c',
include_directories: incl,
dependencies: [mbedx509_dep, mbedcrypto_dep],
)
mbedtls_dep = declare_dependency(
link_with: [libmbedtls],
include_directories: incl,
)