]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add rbd build dependency
authorPavel Hrdina <phrdina@redhat.com>
Wed, 29 Apr 2020 09:37:40 +0000 (11:37 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:00 +0000 (09:27 +0200)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
m4/virt-storage-rbd.m4
meson.build

index f3d9d0490843d0a389e5571bfb198c5e93dc1fa9..cd3b24ea2fab88b062b4179de7fdabfcaff28583 100644 (file)
@@ -25,18 +25,6 @@ AC_DEFUN([LIBVIRT_STORAGE_ARG_RBD], [
 AC_DEFUN([LIBVIRT_STORAGE_CHECK_RBD], [
   LIBRBD_LIBS=
   if test "$with_storage_rbd" = "yes" || test "$with_storage_rbd" = "check"; then
-    AC_CHECK_HEADER([rbd/librbd.h], [LIBRBD_FOUND=yes; break;])
-
-    if test "$LIBRBD_FOUND" = "yes"; then
-      LIBRBD_LIBS="-lrbd -lrados"
-
-      old_LIBS="$LIBS"
-      LIBS="$LIBS $LIBRBD_LIBS"
-      AC_CHECK_FUNCS([rbd_get_features],[],[LIBRBD_FOUND=no])
-      AC_CHECK_FUNCS([rbd_list2])
-      LIBS="$old_LIBS"
-    fi
-
     if test "$LIBRBD_FOUND" = "yes"; then
       with_storage_rbd=yes
       AC_DEFINE_UNQUOTED([WITH_STORAGE_RBD], [1],
index 0b69c12cd7f002d09b39cfaa43daa12a3f9a8669..10bbcff9b973c3f3f133804773a6da5237c80c08 100644 (file)
@@ -1250,6 +1250,21 @@ else
   pkcheck_prog = dependency('', required: false)
 endif
 
+rbd_dep = cc.find_library('rbd', required: false)
+rados_dep = cc.find_library('rados', required: false)
+if rbd_dep.found() and not cc.has_function('rbd_get_features', dependencies: rbd_dep)
+  rbd_dep = dependency('', required: false)
+endif
+if rbd_dep.found() and rados_dep.found()
+  if cc.has_function('rbd_list2', dependencies: rbd_dep)
+    conf.set('HAVE_RBD_LIST2', 1)
+  endif
+
+  rbd_dep = declare_dependency(dependencies: [ rbd_dep, rados_dep ])
+else
+  rbd_dep = dependency('', required: false)
+endif
+
 # readline 7.0 is the first version which includes pkg-config support
 readline_version = '7.0'
 readline_dep = dependency('readline', version: '>=' + readline_version, required: false)
@@ -1413,6 +1428,7 @@ libs_summary = {
   'openwsman': openwsman_dep.found(),
   'pciaccess': pciaccess_dep.found(),
   'polkit': conf.has('WITH_POLKIT'),
+  'rbd': rbd_dep.found(),
   'readline': readline_dep.found(),
 }
 summary(libs_summary, section: 'Libraries', bool_yn: true)