diff options
author | Michael Biebl <biebl@debian.org> | 2017-04-21 23:45:54 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-04-24 19:25:33 -0400 |
commit | 76c8741060bd0f5f64d9c05fd6b402e4e6e4eb66 (patch) | |
tree | 1d038da4653cca8529797e996ea5de93a4a5eae4 /meson.build | |
parent | 36f0387efc0d7d3a72a7b0e3c94e513b14505d04 (diff) |
meson: fix gcrypt config option
Also detect libgpg-error. Require both to be present for HAVE_CRYPT,
even though libgpg-error is only used in src/resolve. If one is available,
the other should be too, so it doesn't seem worth the trouble to make two
separate conditions.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/meson.build b/meson.build index 4515c0098d..c808a8fc43 100644 --- a/meson.build +++ b/meson.build @@ -899,14 +899,21 @@ else libdbus = [] endif -want_libgcrypt = get_option('libgcrypt') -if want_libgcrypt != 'false' - libgcrypt = cc.find_library('gcrypt', required : want_libgcrypt == 'true') - if libgcrypt.found() - conf.set('HAVE_LIBGCRYPT', 1) +want_gcrypt = get_option('gcrypt') +if want_gcrypt != 'false' + libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true') + libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true') + + if libgcrypt.found() and libgpg_error.found() + conf.set('HAVE_GCRYPT', 1) + else + # link to neither of the libs if one is not found + libgcrypt = [] + libgpg_error = [] endif else libgcrypt = [] + libgpg_error = [] endif want_importd = get_option('importd') @@ -915,7 +922,7 @@ if want_importd != 'false' conf.get('HAVE_ZLIB', 0) == 1 and conf.get('HAVE_BZIP2', 0) == 1 and conf.get('HAVE_XZ', 0) == 1 and - conf.get('HAVE_LIBGCRYPT', 0) == 1) + conf.get('HAVE_GCRYPT', 0) == 1) if have_deps conf.set('ENABLE_IMPORTD', 1) elif want_importd == 'true' @@ -1060,6 +1067,7 @@ libsystemd = shared_library( '-Wl,--version-script=' + libsystemd_sym_path], link_with : [libbasic], dependencies : [threads, + libgcrypt, librt, libxz, liblz4], @@ -1305,9 +1313,12 @@ endif if conf.get('ENABLE_RESOLVED', 0) == 1 executable('systemd-resolved', systemd_resolved_sources, + gcrypt_util_sources, include_directories : includes, link_with : [libshared], dependencies : [threads, + libgcrypt, + libgpg_error, libm, libidn], install_rpath : rootlibexecdir, @@ -1316,9 +1327,12 @@ if conf.get('ENABLE_RESOLVED', 0) == 1 exe = executable('systemd-resolve', systemd_resolve_sources, + gcrypt_util_sources, include_directories : includes, link_with : [libshared], dependencies : [threads, + libgcrypt, + libgpg_error, libm, libidn], install_rpath : rootlibexecdir, |