[libsoup/wip/meson: 28/75] Add support for GSSAPI and NTLM



commit 64cc3eb66782d04f1725e819ad894f0ad32c0712
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Oct 3 11:14:00 2017 +0200

    Add support for GSSAPI and NTLM

 meson.build       |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 meson_options.txt |    4 ++++
 2 files changed, 51 insertions(+), 0 deletions(-)
---
diff --git a/meson.build b/meson.build
index ae5de58..8abaf9c 100644
--- a/meson.build
+++ b/meson.build
@@ -35,6 +35,53 @@ if host_machine.system() == 'windows'
   cdata.set('DLL_EXPORT', 1)
 endif
 
+enable_gssapi = get_option('enable-gssapi')
+krb5_config_option = get_option('krb5-config')
+if enable_gssapi
+  krb5_config_path = krb5_config_option != '' ? krb5_config_option : 'krb5-config'
+  krb5_config = find_program(krb5_config_path, required : false)
+
+  if krb5_config.found()
+    krb5_config_output = run_command (krb5_config, '--libs', 'gssapi')
+    if krb5_config_output.returncode() == 0
+      add_project_link_arguments(krb5_config_output.stdout().split(), language : 'c')
+    else
+      error('Failed to obtain cflags for GSSAPI from krb5-config')
+      enable_gssapi = false
+    endif
+
+    krb5_config_output = run_command (krb5_config, '--cflags', 'gssapi')
+    if krb5_config_output.returncode() == 0
+      add_project_arguments(krb5_config_output.stdout().split(), language : 'c')
+    else
+      error('Failed to obtain cflags for GSSAPI from krb5-config')
+      enable_gssapi = false
+    endif
+  else
+    error('GSSAPI support requested, but krb5-config not found. Please specify its path with 
-Dkrb5-config=PATH')
+    enable_gssapi = false
+  endif
+
+  if enable_gssapi
+    add_project_arguments('-DLIBSOUP_HAVE_GSSAPI=1', language : 'c')
+  endif
+endif
+
+# NTLM not supported on Windows
+if host_machine.system() != 'windows'
+  enable_ntlm = get_option('enable-ntlm')
+  if enable_ntlm
+    ntlm_auth_option = get_option('ntlm-auth')
+    ntlm_auth_path = ntlm_auth_option != '' ? ntlm_auth_option : 'ntlm_auth'
+    ntlm_auth = find_program(ntlm_auth_path, required : false)
+
+    if ntlm_auth.found()
+        add_project_arguments('-DUSE_NTLM_AUTH=1', language : 'c')
+        add_project_arguments('-DNTLM_AUTH=' + ntlm_auth.path(), language : 'c')
+    endif
+  endif
+endif
+
 configinc = include_directories('.')
 
 prefix = get_option('prefix')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..265a401
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,4 @@
+option('enable-gssapi', type : 'boolean', value : true, description : 'Build with GSSAPI support')
+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)')


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