[glib-networking/wip/inigomartinez/meson: 4/4] build: Make TLS support required



commit 4771766eb8478332d9f8db32ee3d3443b32d09bd
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Wed Oct 18 21:01:46 2017 +0200

    build: Make TLS support required
    
    This patch removes the build option for TLS support and makes it
    necessary for a successfull build.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786639

 meson.build       |   74 ++++++++++++++++++++++++----------------------------
 meson_options.txt |    1 -
 2 files changed, 34 insertions(+), 41 deletions(-)
---
diff --git a/meson.build b/meson.build
index 87b4efa..7c7ac95 100644
--- a/meson.build
+++ b/meson.build
@@ -68,52 +68,49 @@ endif
 # *** Checks for GNUTLS     ***
 tls_support = []
 
-enable_tls_support = get_option('tls_support')
-if enable_tls_support
-  gnutls_dep = dependency('gnutls', version: '>= 3.0')
-  tls_support += ['gnutls']
-  pkcs_support = []
-
-  msg = 'location of system Certificate Authority list: '
-  ca_certificates_path = get_option('ca_certificates_path').strip()
-  test_cmd = find_program('test')
-
-  if ca_certificates_path == ''
-    cert_file = '/etc/pki/tls/certs/ca-bundle.crt'
+gnutls_dep = dependency('gnutls', version: '>= 3.0')
+tls_support += ['gnutls']
+pkcs_support = []
+
+msg = 'location of system Certificate Authority list: '
+ca_certificates_path = get_option('ca_certificates_path').strip()
+test_cmd = find_program('test')
+
+if ca_certificates_path == ''
+  cert_file = '/etc/pki/tls/certs/ca-bundle.crt'
+  res = run_command(test_cmd, '-e', cert_file)
+
+  if res.returncode() != 0
+    cert_file = '/etc/ssl/certs/ca-certificates.crt'
     res = run_command(test_cmd, '-e', cert_file)
 
     if res.returncode() != 0
-      cert_file = '/etc/ssl/certs/ca-certificates.crt'
+      cert_file = '/etc/ssl/ca-bundle.pem'
       res = run_command(test_cmd, '-e', cert_file)
 
-      if res.returncode() != 0
-        cert_file = '/etc/ssl/ca-bundle.pem'
-        res = run_command(test_cmd, '-e', cert_file)
-
-        assert(res.returncode() != 0, msg + 'could not find. Use -Dca_certificates_path=PATH to set, or 
-Dtls_support=no to disable')
-        ca_certificates_path = cert_file
-      else
-        ca_certificates_path = cert_file
-      endif
+      assert(res.returncode() != 0, msg + 'could not find. Use -Dca_certificates_path=PATH to set, or 
-Dtls_support=no to disable')
+      ca_certificates_path = cert_file
     else
       ca_certificates_path = cert_file
     endif
   else
-    res = run_command(test_cmd, '-e', ca_certificates_path)
-    assert(res.returncode() != 0, msg + ca_certificates_path  + ' does not exist. Use 
-Dca_certificates_path=PATH to set, or -Dtls_support=no to disable')
+    ca_certificates_path = cert_file
   endif
-  message(msg + ca_certificates_path)
+else
+  res = run_command(test_cmd, '-e', ca_certificates_path)
+  assert(res.returncode() != 0, msg + ca_certificates_path  + ' does not exist. Use 
-Dca_certificates_path=PATH to set, or -Dtls_support=no to disable')
+endif
 
-  # *** Checks for pkcs11    ***
-  pkcs11_dep = dependency('p11-kit-1', version: '>= 0.8')
-  tls_support += ['gnutls-pkcs11']
-  pkcs_support += ['p11-kit']
+message(msg + ca_certificates_path)
+config_h.set('HAVE_GNUTLS', true)
 
-  config_h.set('HAVE_PKCS11', true,
-               description: 'Building with PKCS#11 support')
-endif
+# *** Checks for pkcs11    ***
+pkcs11_dep = dependency('p11-kit-1', version: '>= 0.8')
+tls_support += ['gnutls-pkcs11']
+pkcs_support += ['p11-kit']
 
-config_h.set('HAVE_GNUTLS', enable_tls_support)
+config_h.set('HAVE_PKCS11', true,
+             description: 'Building with PKCS#11 support')
 
 configure_file(
   output: 'config.h',
@@ -127,6 +124,7 @@ pkg = import('pkgconfig')
 po_dir = join_paths(meson.source_root(), 'po')
 
 top_inc = include_directories('.')
+tls_inc = include_directories('tls')
 
 subdir('po')
 
@@ -147,13 +145,9 @@ if have_libproxy or have_gnome_proxy
   subdir('proxy/tests')
 endif
 
-if enable_tls_support
-  tls_inc = include_directories('tls')
-
-  subdir('tls/pkcs11')
-  subdir('tls/gnutls')
-  subdir('tls/tests')
-endif
+subdir('tls/pkcs11')
+subdir('tls/gnutls')
+subdir('tls/tests')
 
 meson.add_install_script('meson_post_install.py', gio_module_dir)
 
diff --git a/meson_options.txt b/meson_options.txt
index db4a67c..7974174 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,4 @@
 option('libproxy_backend', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 
'support for libproxy')
 option('gnome_proxy_backend', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 
'support for GNOME proxy configuration')
-option('tls_support', type: 'boolean', value: true, description: 'support for GNUTLS')
 option('ca_certificates_path', type: 'string', value: '', description: 'path to system Certificate Authority 
list')
 option('installed-tests', type: 'boolean', value: false, description: 'enable installed unit tests')


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