
On Fri, Feb 18, 2011 at 16:21:20 +0800, Osier Yang wrote:
于 2011年02月18日 11:00, Wen Congyang 写道:
+DEVMAPPER_CFLAGS= +DEVMAPPER_LIBS= +PKG_CHECK_MODULES([DEVMAPPER], [devmapper>= $DEVMAPPER_REQUIRED], [], [DEVMAPPER_FOUND=no]) +if test "$DEVMAPPER_FOUND" = "no"; then + # devmapper is missing pkg-config files in ubuntu, suse, etc + 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 +if test "$DEVMAPPER_FOUND" = "no" ; then + AC_MSG_ERROR([You must install device-mapper-devel/libdevmapper>= $DEVMAPPER_REQUIRED to compile libvirt]) fi AC_SUBST([DEVMAPPER_CFLAGS]) AC_SUBST([DEVMAPPER_LIBS])
Thanks for the fix, actually It can be reproduced simply by: % ./autogen.sh --with-storage-mpath=no % make
As src/util/util.c invokes "dm_is_dm_major".
Yes it does, but I'm not convinced this is the right approach to fix it. Why should libvirt always require device-mapper libraries? It only needs it for disk and mpath storage drivers so if neither of them is built, we shouldn't check for the library and we shouldn't call dm_is_dm_major. NACK to the current patch. Jirka