[libsoup/wip/meson] Implement glib-networking check for TLS support



commit 4e015e707158a60fdc8dc5abf9f633265d632a3e
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Oct 3 11:45:43 2017 +0200

    Implement glib-networking check for TLS support

 meson.build       |   13 +++++++++++++
 meson_options.txt |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/meson.build b/meson.build
index 757653a..1c5259e 100644
--- a/meson.build
+++ b/meson.build
@@ -35,6 +35,19 @@ if host_machine.system() == 'windows'
   cdata.set('DLL_EXPORT', 1)
 endif
 
+check_glib_networking_src = '''#include <gio/gio.h>
+int main(void) {
+  return !g_tls_backend_supports_tls (g_tls_backend_get_default ());
+}
+'''
+
+enable_tls_check = get_option('enable-tls-check')
+if enable_tls_check
+  if not cc.compiles(check_glib_networking_src, name : 'glib-networking supports TLS', dependencies : 
glib_dep)
+    error('libsoup requires glib-networking for TLS support')
+  endif
+endif
+
 enable_gssapi = get_option('enable-gssapi')
 krb5_config_option = get_option('krb5-config')
 if enable_gssapi
diff --git a/meson_options.txt b/meson_options.txt
index 265a401..5ede4df 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,3 +2,4 @@ option('enable-gssapi', type : 'boolean', value : true, description : 'Build wit
 option('krb5-config', type : 'string', value : '', description : 'Where to look for krb5-config, path points 
to krb5-config installation (defaultly looking in PATH)')
 option('enable-ntlm', type : 'boolean', value : false, description : 'Build with NTLM support')
 option('ntlm-auth', type : 'string', value : '', description : 'Where to look for ntlm_auth, path points to 
ntlm_auth installation (defaultly looking in PATH)')
+option('enable-tls-check', type : 'boolean', value : true, description : 'Enable TLS support through 
glib-networking. If you are building a package, you can disable this to allow building libsoup anyway (since 
glib-networking is not actually required at compile time), but you should be sure to add a runtime dependency 
on it.')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]