mirror of https://gitee.com/openkylin/libvirt.git
build: fix broken mingw cross-compilation
Two regressions: Commitdf1011ca
broke builds for systems that lack devmapper (non-Linux, as well as Linux with ./autogen.sh --without-libvirtd and without the libraries present). Commitce6fd650
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:
parent
791da4e736
commit
7b6286b780
2
.gnulib
2
.gnulib
|
@ -1 +1 @@
|
||||||
Subproject commit aa0f5d7586efe7044f6ca9e07be3f579ee0d5618
|
Subproject commit 17adb5d75404cf6cdde0eb3b2edc6110d9fa8001
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue