diff options
author | Iñigo Martínez <inigomartinez@gmail.com> | 2017-11-06 19:52:34 +0100 |
---|---|---|
committer | Iñigo Martínez <inigomartinez@gmail.com> | 2017-11-07 10:18:03 +0100 |
commit | d1189c1bede6a6cd2b6e89dfe50d66fead49a47e (patch) | |
tree | 79bd514b140c1804d4dc2a7242bbf703dfe9a91f | |
parent | d274add5e0024be0d20456f1bd9c3b3326ed06d9 (diff) | |
download | gvfs-d1189c1bede6a6cd2b6e89dfe50d66fead49a47e.tar.gz |
build: Add an option for gcrypt
Add an option to make gcrypt conditional allowing to disable it if
desired. This patch also makes the existence of libgcrypt-config
program mandatory if the gcrypt option is enabled.
https://bugzilla.gnome.org/show_bug.cgi?id=786149
-rw-r--r-- | daemon/meson.build | 2 | ||||
-rw-r--r-- | meson.build | 27 | ||||
-rw-r--r-- | meson_options.txt | 1 |
3 files changed, 18 insertions, 12 deletions
diff --git a/daemon/meson.build b/daemon/meson.build index 606d83f4..a31f5f6e 100644 --- a/daemon/meson.build +++ b/daemon/meson.build @@ -525,7 +525,7 @@ if enable_afp sources = common_sources + files('gvfsbackendafp.c') deps = [] - if have_gcrypt + if enable_gcrypt deps += libgcrypt_dep endif diff --git a/meson.build b/meson.build index 913355d9..07eff014 100644 --- a/meson.build +++ b/meson.build @@ -249,20 +249,25 @@ libxml_dep = dependency('libxml-2.0', required: false) have_libxml = libxml_dep.found() # *** Check for libgcrypt *** -libgcrypt_config = find_program('libgcrypt-config') -libgcrypt_version = run_command(libgcrypt_config, '--version').stdout().strip() +enable_gcrypt = get_option('enable-gcrypt') +if enable_gcrypt + libgcrypt_req_version = '>= 1.2.2' -libgcrypt_cflags = run_command(libgcrypt_config, '--cflags').stdout().strip().split() -libgcrypt_libs = run_command(libgcrypt_config, '--libs').stdout().strip().split() + libgcrypt_config = find_program('libgcrypt-config') + libgcrypt_version = run_command(libgcrypt_config, '--version').stdout().strip() -libgcrypt_dep = declare_dependency( - compile_args: libgcrypt_cflags, - link_args: libgcrypt_libs, - version: libgcrypt_version -) + assert(libgcrypt_version.version_compare(libgcrypt_req_version), 'gcrypt required but libgcrypt ' + libgcrypt_req_version + ' not found') + + libgcrypt_cflags = run_command(libgcrypt_config, '--cflags').stdout().strip().split() + libgcrypt_libs = run_command(libgcrypt_config, '--libs').stdout().strip().split() -have_gcrypt = libgcrypt_version.version_compare('>= 1.2.2') -config_h.set('HAVE_GCRYPT', have_gcrypt) + libgcrypt_dep = declare_dependency( + compile_args: libgcrypt_cflags, + link_args: libgcrypt_libs, + version: libgcrypt_version + ) +endif +config_h.set('HAVE_GCRYPT', enable_gcrypt) # *** Check for dbus service dir *** dbus_service_dir = get_option('with-dbus-service-dir') diff --git a/meson_options.txt b/meson_options.txt index 833b7d79..205bb61f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -22,6 +22,7 @@ option('enable-udisks2', type: 'boolean', value: true, description: 'build with option('enable-bluray', type: 'boolean', value: true, description: 'build with bluray metadata support') option('enable-fuse', type: 'boolean', value: true, description: 'build with fuse support') option('enable-gcr', type: 'boolean', value: true, description: 'build with gcr certificate support') +option('enable-gcrypt', type: 'boolean', value: true, description: 'build with gcrypt support') option('enable-gudev', type: 'boolean', value: true, description: 'build with gudev device support') option('enable-keyring', type: 'boolean', value: true, description: 'build with keyring support') option('enable-logind', type: 'boolean', value: true, description: 'build with logind support') |