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],
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)
'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)