build: fix broken mingw cross-compilation

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.
This commit is contained in:
Eric Blake 2011-02-18 12:00:47 -07:00
parent 791da4e736
commit 7b6286b780
3 changed files with 12 additions and 3 deletions

@ -1 +1 @@
Subproject commit aa0f5d7586efe7044f6ca9e07be3f579ee0d5618 Subproject commit 17adb5d75404cf6cdde0eb3b2edc6110d9fa8001

View File

@ -1711,12 +1711,12 @@ if test "$with_storage_mpath" = "yes"; then
save_LIBS="$LIBS" save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS" save_CFLAGS="$CFLAGS"
DEVMAPPER_FOUND=yes DEVMAPPER_FOUND=yes
AC_CHECK_HEADER([libdevmapper.h],,[DEVMAPPER_FOUND=no])
AC_CHECK_LIB([devmapper], [dm_task_run],,[DEVMAPPER_FOUND=no]) AC_CHECK_LIB([devmapper], [dm_task_run],,[DEVMAPPER_FOUND=no])
DEVMAPPER_LIBS="-ldevmapper" DEVMAPPER_LIBS="-ldevmapper"
LIBS="$save_LIBS" LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS" CFLAGS="$save_CFLAGS"
fi fi
AC_CHECK_HEADERS([libdevmapper.h],,[DEVMAPPER_FOUND=no])
if test "$DEVMAPPER_FOUND" = "no" ; then if test "$DEVMAPPER_FOUND" = "no" ; then
AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper >= $DEVMAPPER_REQUIRED to compile libvirt]) AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper >= $DEVMAPPER_REQUIRED to compile libvirt])
fi fi

View File

@ -45,7 +45,9 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <termios.h> #include <termios.h>
#include <libdevmapper.h> #if HAVE_LIBDEVMAPPER_H
# include <libdevmapper.h>
#endif
#include "c-ctype.h" #include "c-ctype.h"
#ifdef HAVE_PATHS_H #ifdef HAVE_PATHS_H
@ -3125,6 +3127,7 @@ virTimestamp(void)
return timestamp; return timestamp;
} }
#if HAVE_LIBDEVMAPPER_H
bool bool
virIsDevMapperDevice(const char *devname) virIsDevMapperDevice(const char *devname)
{ {
@ -3137,3 +3140,9 @@ virIsDevMapperDevice(const char *devname)
return false; return false;
} }
#else
bool virIsDevMapperDevice(const char *devname ATTRIBUTE_UNUSED)
{
return false;
}
#endif