Commit d1189c1b authored by Iñigo Martínez's avatar Iñigo Martínez

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
parent d274add5
......@@ -525,7 +525,7 @@ if enable_afp
sources = common_sources + files('gvfsbackendafp.c')
deps = []
if have_gcrypt
if enable_gcrypt
deps += libgcrypt_dep
endif
......
......@@ -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')
......
......@@ -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')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment