summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-11-02 09:44:12 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-11-30 23:00:21 +0100
commit57633d2376233629c73cf580650902ba6d1ada8d (patch)
treed98bf265ab9582167aa30c0095529531aa568dce /meson.build
parentade99252e2cdd9eeff78566789008996d27e4dc0 (diff)
downloadsystemd-57633d2376233629c73cf580650902ba6d1ada8d.tar.gz
meson: add config setting to select between openssl and gcrypt
This is not pretty, but it is supposed to be only a temporary measure.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build20
1 files changed, 20 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index b0054b6667..dee05b6017 100644
--- a/meson.build
+++ b/meson.build
@@ -1523,6 +1523,18 @@ else
endif
conf.set10('ENABLE_REPART', have)
+# We support one or the other. If gcrypt is available, we assume it's there to
+# be used, and use it in preference.
+opt = get_option('cryptolib')
+if opt == 'openssl' and conf.get('HAVE_OPENSSL') == 0
+ error('openssl requested as the default cryptolib, but not available')
+endif
+conf.set10('PREFER_OPENSSL',
+ opt == 'openssl' or (opt == 'auto' and conf.get('HAVE_OPENSSL') == 1 and conf.get('HAVE_GCRYPT') == 0))
+conf.set10('HAVE_OPENSSL_OR_GCRYPT',
+ conf.get('HAVE_OPENSSL') == 1 or conf.get('HAVE_GCRYPT') == 1)
+lib_openssl_or_gcrypt = conf.get('PREFER_OPENSSL') == 1 ? libopenssl : libgcrypt
+
want_importd = get_option('importd')
if want_importd != 'false'
have = (conf.get('HAVE_LIBCURL') == 1 and
@@ -4023,6 +4035,14 @@ else
found += 'static-libudev(@0@)'.format(static_libudev)
endif
+if conf.get('HAVE_OPENSSL_OR_GCRYPT') == 1 and conf.get('PREFER_OPENSSL') == 1
+ found += 'cryptolib(openssl)'
+elif conf.get('HAVE_OPENSSL_OR_GCRYPT') == 1
+ found += 'cryptolib(gcrypt)'
+else
+ missing += 'cryptolib'
+endif
+
if conf.get('DNS_OVER_TLS_USE_GNUTLS') == 1
found += 'DNS-over-TLS(gnutls)'
elif conf.get('DNS_OVER_TLS_USE_OPENSSL') == 1