diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-20 17:33:42 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-28 08:52:22 +0200 |
commit | 2edd2c04c27b469ab2b46c6fe6e4bffe6b0c2895 (patch) | |
tree | 8ede384bdaf5749378e1270129ebdc905f8fe83c /meson.build | |
parent | 3730a7341f19cbadde4d12e214b7a82b9de01f75 (diff) |
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.build | 15 |
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 |