]> git.proxmox.com Git - mirror_qemu.git/commitdiff
meson: move keyutils dependency check
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 28 Aug 2020 11:07:25 +0000 (15:07 +0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Sep 2020 09:43:16 +0000 (11:43 +0200)
Since there is not minimum version specified, and it's a test-only
dependency, it's fair to depend on a version that ships with a .pc I
suppose.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-8-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
configure
meson.build

index 8c9bbfad515faaa0fe391c1a5696e4941e0f8be4..1471b35d96c46b1321d632f191f49ff78e605f49 100755 (executable)
--- a/configure
+++ b/configure
@@ -6312,28 +6312,6 @@ but not implemented on your system"
     fi
 fi
 
-##########################################
-# check for usable keyutils.h
-
-if test "$linux" = "yes" ; then
-
-    have_keyutils=no
-    cat > $TMPC << EOF
-#include <errno.h>
-#include <asm/unistd.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <keyutils.h>
-int main(void) {
-    return request_key("user", NULL, NULL, 0);
-}
-EOF
-    if compile_prog "" "-lkeyutils"; then
-        have_keyutils=yes
-    fi
-fi
-
-
 ##########################################
 # End of CC checks
 # After here, no more $cc or $ld runs
@@ -7522,9 +7500,6 @@ fi
 
 if test "$secret_keyring" = "yes" ; then
   echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak
-  if test "$have_keyutils" = "yes" ; then
-    echo "CONFIG_KEYUTILS=y" >> $config_host_mak
-  fi
 fi
 
 if test "$tcg_interpreter" = "yes"; then
index d3cf531297bbb0a8ef26aeefa66b2a040abcaf09..f7cd2b6f73e8fb3140e36286a2773d31be548725 100644 (file)
@@ -415,10 +415,8 @@ if 'CONFIG_TASN1' in config_host
   tasn1 = declare_dependency(compile_args: config_host['TASN1_CFLAGS'].split(),
                              link_args: config_host['TASN1_LIBS'].split())
 endif
-keyutils = not_found
-if 'CONFIG_KEYUTILS' in config_host
-  keyutils = declare_dependency(link_args: '-lkeyutils')
-endif
+keyutils = dependency('libkeyutils', required: false,
+                      method: 'pkg-config', static: enable_static)
 
 # Create config-host.h
 
@@ -429,6 +427,7 @@ config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
 config_host_data.set('CONFIG_VNC_PNG', png.found())
 config_host_data.set('CONFIG_VNC_SASL', sasl.found())
 config_host_data.set('CONFIG_XKBCOMMON', xkbcommon.found())
+config_host_data.set('CONFIG_KEYUTILS', keyutils.found())
 config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version()))
 config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('.')[0])
 config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('.')[1])