m4/virt-devmapper: use LIBVIRT_CHECK_(PKG|LIB)

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2016-12-12 13:33:42 +01:00
parent f1a7a624d0
commit 60af91ca85
4 changed files with 11 additions and 21 deletions

View File

@ -26,7 +26,6 @@
*/
#ifdef LIBVIRT_SETUID_RPC_CLIENT
# undef HAVE_LIBDEVMAPPER_H
# undef HAVE_LIBNL
# undef HAVE_LIBNL3
# undef HAVE_LIBSASL2
@ -34,6 +33,7 @@
# undef WITH_CAPNG
# undef WITH_CURL
# undef WITH_DBUS
# undef WITH_DEVMAPPER
# undef WITH_DTRACE_PROBES
# undef WITH_GNUTLS
# undef WITH_GNUTLS_GCRYPT
@ -53,13 +53,13 @@
* explanation above.
*/
#ifdef LIBVIRT_NSS
# undef HAVE_LIBDEVMAPPER_H
# undef HAVE_LIBNL
# undef HAVE_LIBNL3
# undef HAVE_LIBSASL2
# undef HAVE_SYS_ACL_H
# undef WITH_CAPNG
# undef WITH_CURL
# undef WITH_DEVMAPPER
# undef WITH_DTRACE_PROBES
# undef WITH_GNUTLS
# undef WITH_GNUTLS_GCRYPT

View File

@ -1420,7 +1420,7 @@ LIBVIRT_CHECK_DEVMAPPER
if test "$with_storage_mpath" = "yes" ||
test "$with_storage_disk" = "yes"; then
if test "$DEVMAPPER_FOUND" = "no" ; then
if test "$with_devmapper" = "no" ; then
AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper >= $DEVMAPPER_REQUIRED to compile libvirt])
fi
fi

View File

@ -19,24 +19,14 @@ dnl
AC_DEFUN([LIBVIRT_CHECK_DEVMAPPER], [
DEVMAPPER_REQUIRED=1.0.0
DEVMAPPER_CFLAGS=
DEVMAPPER_LIBS=
PKG_CHECK_MODULES([DEVMAPPER], [devmapper >= $DEVMAPPER_REQUIRED], [], [DEVMAPPER_FOUND=no])
with_devmapper=check
if test "$DEVMAPPER_FOUND" = "no"; then
LIBVIRT_CHECK_PKG([DEVMAPPER], [devmapper], [$DEVMAPPER_REQUIRED], [])
if test "x$with_devmapper" = "xno"; then
# devmapper is missing pkg-config files in ubuntu, suse, etc
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
DEVMAPPER_FOUND=yes
AC_CHECK_LIB([devmapper], [dm_task_run],,[DEVMAPPER_FOUND=no])
DEVMAPPER_LIBS="-ldevmapper"
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
with_devmapper=check
LIBVIRT_CHECK_LIB([DEVMAPPER], [devmapper], [dm_task_run], [libdevmapper.h])
fi
AC_CHECK_HEADERS([libdevmapper.h],,[DEVMAPPER_FOUND=no])
AC_SUBST([DEVMAPPER_CFLAGS])
AC_SUBST([DEVMAPPER_LIBS])
])

View File

@ -48,7 +48,7 @@
#include <termios.h>
#include <locale.h>
#if HAVE_LIBDEVMAPPER_H
#if WITH_DEVMAPPER
# include <libdevmapper.h>
#endif
@ -1608,7 +1608,7 @@ void virFileWaitForDevices(void)
{}
#endif
#if HAVE_LIBDEVMAPPER_H
#if WITH_DEVMAPPER
bool
virIsDevMapperDevice(const char *dev_name)
{