aboutsummaryrefslogtreecommitdiff
path: root/crypto/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-06-03 11:15:26 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2021-06-25 10:53:46 +0200
commit5761251138cb69c310e9df7dfc82c4c6fd2444e4 (patch)
treed1783c0d2a6b85c1ef223783dea240c1d9676e23 /crypto/meson.build
parent4c1f23cfb84c386a8f4f5433f0fd98e0c85d057b (diff)
configure, meson: convert crypto detection to meson
Reviewed-by: Richard Henderson <richard.henderson@liaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'crypto/meson.build')
-rw-r--r--crypto/meson.build41
1 files changed, 12 insertions, 29 deletions
diff --git a/crypto/meson.build b/crypto/meson.build
index af7e80c6f6..7cbf1a6ba7 100644
--- a/crypto/meson.build
+++ b/crypto/meson.build
@@ -22,48 +22,31 @@ crypto_ss.add(files(
'tlssession.c',
))
-if 'CONFIG_NETTLE' in config_host
- crypto_ss.add(files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'))
-elif 'CONFIG_GCRYPT' in config_host
- crypto_ss.add(files('hash-gcrypt.c', 'pbkdf-gcrypt.c'))
- crypto_ss.add(files('hmac-gcrypt.c'))
+if nettle.found()
+ crypto_ss.add(nettle, files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'))
+elif gcrypt.found()
+ crypto_ss.add(gcrypt, files('hash-gcrypt.c', 'hmac-gcrypt.c', 'pbkdf-gcrypt.c'))
else
crypto_ss.add(files('hash-glib.c', 'hmac-glib.c', 'pbkdf-stub.c'))
endif
+if xts == 'private'
+ crypto_ss.add(files('xts.c'))
+endif
crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c'))
-crypto_ss.add(when: 'CONFIG_QEMU_PRIVATE_XTS', if_true: files('xts.c'))
crypto_ss.add(when: 'CONFIG_AF_ALG', if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c'))
-crypto_ss.add(when: 'CONFIG_GNUTLS', if_true: files('tls-cipher-suites.c'))
-
-if 'CONFIG_NETTLE' in config_host
- crypto_ss.add(nettle)
-elif 'CONFIG_GCRYPT' in config_host
- crypto_ss.add(gcrypt)
-endif
-
-if 'CONFIG_GNUTLS' in config_host
- crypto_ss.add(gnutls)
-endif
-
+crypto_ss.add(when: gnutls, if_true: files('tls-cipher-suites.c'))
util_ss.add(files('aes.c'))
util_ss.add(files('init.c'))
-if 'CONFIG_GCRYPT' in config_host
- util_ss.add(files('random-gcrypt.c'))
-elif 'CONFIG_GNUTLS' in config_host
- util_ss.add(files('random-gnutls.c'))
+if gcrypt.found()
+ util_ss.add(gcrypt, files('random-gcrypt.c'))
+elif gnutls.found()
+ util_ss.add(gnutls, files('random-gnutls.c'))
elif 'CONFIG_RNG_NONE' in config_host
util_ss.add(files('random-none.c'))
else
util_ss.add(files('random-platform.c'))
endif
-if 'CONFIG_GCRYPT' in config_host
- util_ss.add(gcrypt)
-endif
-
-if 'CONFIG_GNUTLS' in config_host
- util_ss.add(gnutls)
-endif