提交 7b6286b7 编写于 作者: E Eric Blake

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.
上级 791da4e7
.gnulib @ 17adb5d7
Subproject commit aa0f5d7586efe7044f6ca9e07be3f579ee0d5618
Subproject commit 17adb5d75404cf6cdde0eb3b2edc6110d9fa8001
......@@ -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
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册