Commit fefe5119 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠 Committed by Olivier Crête

meson: allow selecting crypto library manually via an option

parent 0e0f89d2
...@@ -165,10 +165,38 @@ foreach w : warnings ...@@ -165,10 +165,38 @@ foreach w : warnings
endforeach endforeach
# Dependencies # Dependencies
gnutls_dep = dependency('gnutls', version: gnutls_req)
glib_dep = dependency('gio-2.0', version: glib_req) glib_dep = dependency('gio-2.0', version: glib_req)
gthread_dep = dependency('gthread-2.0') gthread_dep = dependency('gthread-2.0')
# Cryto library
opt_cryptolib = get_option('crypto-library')
message('Crypto library: ' + opt_cryptolib)
if opt_cryptolib != 'openssl'
crypto_dep = dependency('gnutls', version: gnutls_req, required: false)
cdata.set('HAVE_GNUTLS', crypto_dep.found())
if not crypto_dep.found()
if opt_cryptolib != 'auto'
error('GnuTLS requested as crypto library, but not found')
endif
crypto_dep = dependency('openssl', required: false)
cdata.set('HAVE_OPENSSL', crypto_dep.found())
endif
else
crypto_dep = dependency('openssl', required: false)
cdata.set('HAVE_OPENSSL', crypto_dep.found())
if not crypto_dep.found()
if opt_cryptolib != 'auto'
error('OpenSSL requested as crypto library, but not found')
endif
crypto_dep = dependency('gnutls', version: gnutls_req, required: false)
cdata.set('HAVE_GNUTLS', crypto_dep.found())
endif
endif
if not crypto_dep.found()
error('Either GnuTLS or OpenSSL is required as crypto library, but neither was found')
endif
# GStreamer # GStreamer
gst_dep = dependency('gstreamer-base-1.0', version: gst_req, gst_dep = dependency('gstreamer-base-1.0', version: gst_req,
required: get_option('gstreamer'), required: get_option('gstreamer'),
...@@ -184,7 +212,7 @@ libm = cc.find_library('m', required: false) ...@@ -184,7 +212,7 @@ libm = cc.find_library('m', required: false)
nice_incs = include_directories('.', 'agent', 'random', 'socket', 'stun') nice_incs = include_directories('.', 'agent', 'random', 'socket', 'stun')
nice_deps = [glib_dep, gthread_dep, gnutls_dep, gupnp_igd_dep] + syslibs nice_deps = [glib_dep, gthread_dep, crypto_dep, gupnp_igd_dep] + syslibs
ignored_iface_prefix = get_option('ignored-network-interface-prefix') ignored_iface_prefix = get_option('ignored-network-interface-prefix')
if ignored_iface_prefix != '' if ignored_iface_prefix != ''
......
...@@ -4,6 +4,7 @@ option('gstreamer', type: 'feature', value: 'auto', ...@@ -4,6 +4,7 @@ option('gstreamer', type: 'feature', value: 'auto',
description: 'Enable or disable build of GStreamer plugins') description: 'Enable or disable build of GStreamer plugins')
option('ignored-network-interface-prefix', type: 'string', value: '', option('ignored-network-interface-prefix', type: 'string', value: '',
description: 'Ignore network interfaces whose name starts with this string in the ICE connection check algorithm. For example, "virbr" to ignore virtual bridge interfaces added by virtd, which do not help in finding connectivity.') description: 'Ignore network interfaces whose name starts with this string in the ICE connection check algorithm. For example, "virbr" to ignore virtual bridge interfaces added by virtd, which do not help in finding connectivity.')
option('crypto-library', type: 'combo', choices : ['auto', 'gnutls', 'openssl'], value : 'auto')
# Common feature options # Common feature options
option('examples', type : 'feature', value : 'auto', yield : true, option('examples', type : 'feature', value : 'auto', yield : true,
......
...@@ -62,5 +62,5 @@ pkg.generate(libnice, ...@@ -62,5 +62,5 @@ pkg.generate(libnice,
subdirs: 'nice', subdirs: 'nice',
description: 'ICE library', description: 'ICE library',
requires: glib_dep, requires: glib_dep,
requires_private: [gthread_dep, gupnp_igd_dep, gnutls_dep, syslibs], requires_private: [gthread_dep, gupnp_igd_dep, crypto_dep, syslibs],
variables: ['upnp_enabled=@0@'.format(upnp_enabled_string)]) variables: ['upnp_enabled=@0@'.format(upnp_enabled_string)])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment