mirror of https://gitee.com/openkylin/libvirt.git
meson: add rbd build dependency
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
parent
67103acfc7
commit
59610e5336
|
@ -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],
|
||||
|
|
16
meson.build
16
meson.build
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue