summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini2022-04-20 17:33:42 +0200
committerPaolo Bonzini2022-04-28 08:52:22 +0200
commit2edd2c04c27b469ab2b46c6fe6e4bffe6b0c2895 (patch)
tree8ede384bdaf5749378e1270129ebdc905f8fe83c /meson.build
parentmeson, configure: move RDMA options to meson (diff)
downloadqemu-2edd2c04c27b469ab2b46c6fe6e4bffe6b0c2895.tar.gz
qemu-2edd2c04c27b469ab2b46c6fe6e4bffe6b0c2895.tar.xz
qemu-2edd2c04c27b469ab2b46c6fe6e4bffe6b0c2895.zip
meson, configure: move keyctl test to meson
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build15
1 files changed, 14 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 9c03436756..64161dffe7 100644
--- a/meson.build
+++ b/meson.build
@@ -1940,6 +1940,19 @@ config_host_data.set('CONFIG_GETAUXVAL', cc.links(gnu_source_prefix + '''
return getauxval(AT_HWCAP) == 0;
}'''))
+have_keyring = get_option('keyring') \
+ .require(targetos == 'linux', error_message: 'keyring is only available on Linux') \
+ .require(cc.compiles('''
+ #include <errno.h>
+ #include <asm/unistd.h>
+ #include <linux/keyctl.h>
+ #include <sys/syscall.h>
+ #include <unistd.h>
+ int main(void) {
+ return syscall(__NR_keyctl, KEYCTL_READ, 0, NULL, NULL, 0);
+ }'''), error_message: 'keyctl syscall not available on this system').allowed()
+config_host_data.set('CONFIG_SECRET_KEYRING', have_keyring)
+
have_cpuid_h = cc.links('''
#include <cpuid.h>
int main(void) {
@@ -3698,7 +3711,7 @@ if nettle.found()
endif
summary_info += {'AF_ALG support': have_afalg}
summary_info += {'rng-none': get_option('rng_none')}
-summary_info += {'Linux keyring': config_host.has_key('CONFIG_SECRET_KEYRING')}
+summary_info += {'Linux keyring': have_keyring}
summary(summary_info, bool_yn: true, section: 'Crypto')
# Libraries