]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: fix broken mingw cross-compilation
authorEric Blake <eblake@redhat.com>
Fri, 18 Feb 2011 19:00:47 +0000 (12:00 -0700)
committerEric Blake <eblake@redhat.com>
Fri, 18 Feb 2011 19:02:22 +0000 (12:02 -0700)
Two regressions:
Commit df1011ca broke builds for systems that lack devmapper
(non-Linux, as well as Linux with ./autogen.sh --without-libvirtd
and without the libraries present).
Commit ce6fd650 broke cross-compilation, due to a gnulib bug.

* .gnulib: Update to latest, for cross-compilation fix.
* src/util/util.c (virIsDevMapperDevice): Provide stub for
platforms not using storage driver.
* configure.ac (devmapper): Arrange to define HAVE_LIBDEVMAPPER_H.
devmapper issue reported by Wen Congyang.

.gnulib
configure.ac
src/util/util.c

diff --git a/.gnulib b/.gnulib
index aa0f5d7586efe7044f6ca9e07be3f579ee0d5618..17adb5d75404cf6cdde0eb3b2edc6110d9fa8001 160000 (submodule)
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit aa0f5d7586efe7044f6ca9e07be3f579ee0d5618
+Subproject commit 17adb5d75404cf6cdde0eb3b2edc6110d9fa8001
index f79babb6264089a7e7fbac49d700a321f49ddaed..2b26e57eb3edbfbf9e54632cfcae701586fc71d3 100644 (file)
@@ -1711,12 +1711,12 @@ if test "$with_storage_mpath" = "yes"; then
      save_LIBS="$LIBS"
      save_CFLAGS="$CFLAGS"
      DEVMAPPER_FOUND=yes
-     AC_CHECK_HEADER([libdevmapper.h],,[DEVMAPPER_FOUND=no])
      AC_CHECK_LIB([devmapper], [dm_task_run],,[DEVMAPPER_FOUND=no])
      DEVMAPPER_LIBS="-ldevmapper"
      LIBS="$save_LIBS"
      CFLAGS="$save_CFLAGS"
    fi
+   AC_CHECK_HEADERS([libdevmapper.h],,[DEVMAPPER_FOUND=no])
    if test "$DEVMAPPER_FOUND" = "no" ; then
      AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper >= $DEVMAPPER_REQUIRED to compile libvirt])
    fi
index a7ce4b31101c0cbaf0f45ad6e3d39bf932a99ad2..cbdae67393b4ad82123b97eece479a0db8d46163 100644 (file)
@@ -45,7 +45,9 @@
 #include <string.h>
 #include <signal.h>
 #include <termios.h>
-#include <libdevmapper.h>
+#if HAVE_LIBDEVMAPPER_H
+# include <libdevmapper.h>
+#endif
 #include "c-ctype.h"
 
 #ifdef HAVE_PATHS_H
@@ -3125,6 +3127,7 @@ virTimestamp(void)
     return timestamp;
 }
 
+#if HAVE_LIBDEVMAPPER_H
 bool
 virIsDevMapperDevice(const char *devname)
 {
@@ -3137,3 +3140,9 @@ virIsDevMapperDevice(const char *devname)
 
     return false;
 }
+#else
+bool virIsDevMapperDevice(const char *devname ATTRIBUTE_UNUSED)
+{
+    return false;
+}
+#endif