]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
m4/virt-devmapper: use LIBVIRT_CHECK_(PKG|LIB)
authorPavel Hrdina <phrdina@redhat.com>
Mon, 12 Dec 2016 12:33:42 +0000 (13:33 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 21 Dec 2016 14:39:39 +0000 (15:39 +0100)
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
config-post.h
configure.ac
m4/virt-devmapper.m4
src/util/virutil.c

index 6a91ff66b1e906090b0cb6913b9dccc0dbc00190..ffd0904dd22cd4f8632ef9deb56b3a89badeef7d 100644 (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
  * 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
index 7c6031d1375dc8bdd0ec724679e0820d17494474..2efda1058055e9c5e87d4917dca81117948f070b 100644 (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
index f0316ac434875bcda0811e3f3597b759fd3d2bc1..165caa696854eccbd005ea47e8912bddb4c6d884 100644 (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])
 ])
index 02913787da0cac68f43a527817ba2b1ed88394cf..933d5b06b4a31c273d1ae4ed00ee4293a9ef918d 100644 (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)
 {