[libsoup/wip/meson] meson: Improve check for MIT Kerberos on Visual Studio
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/meson] meson: Improve check for MIT Kerberos on Visual Studio
- Date: Tue, 28 Nov 2017 10:39:00 +0000 (UTC)
commit 5ef44448dd211c7f169cd14becdbfcba276bb81e
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Nov 28 18:35:29 2017 +0800
meson: Improve check for MIT Kerberos on Visual Studio
Visual Studio builds will not be able to run the krb5-config script,
even if it is available, and it is not generated with the MIT Kerberos
build system for Visual Studio.
So, we need to manually check whether we have the gssapi/gssapi.h
header, and whether gssapi32.lib (32-build builds) or gssapi64.lib
(x64 builds) is available, to properly enable MIT Kerberos support on
Visual Studio builds.
meson.build | 51 ++++++++++++++++++++++++++++++++++-----------------
1 files changed, 34 insertions(+), 17 deletions(-)
---
diff --git a/meson.build b/meson.build
index dcba665..a3616da 100644
--- a/meson.build
+++ b/meson.build
@@ -140,28 +140,45 @@ endif
enable_gssapi = get_option('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')
+ if cc.get_id() == 'msvc'
+ if host_machine.cpu_family() == 'x86'
+ gssapi_lib_type = '32'
else
- error('Failed to obtain cflags for GSSAPI from krb5-config')
- enable_gssapi = false
+ gssapi_lib_type = '64'
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')
+ gssapi_header = cc.has_header('gssapi/gssapi.h', required: false)
+ if gssapi_header
+ gssapi_lib = cc.find_library('gssapi@0@'.format(gssapi_lib_type), required: false)
+ endif
+ if gssapi_header and gssapi_lib.found()
+ add_project_link_arguments('gssapi@0@.lib'.format(gssapi_lib_type), language : 'c')
else
- error('Failed to obtain cflags for GSSAPI from krb5-config')
- enable_gssapi = false
+ error('GSSAPI support requested, but the MIT Keberos 5 headers and libraries are not found')
endif
else
- error('GSSAPI support requested, but krb5-config not found. Please specify its path with
-Dkrb5-config=PATH')
- enable_gssapi = false
+ 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
endif
if enable_gssapi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]