[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] check device-mapper when building without storage mpath



When I build libvirt without libvirtd, I receive the following errors:
  GEN    virsh.1
  CCLD   virsh
../src/.libs/libvirt.so: undefined reference to `dm_is_dm_major'
collect2: ld returned 1 exit status
make[3]: *** [virsh] Error 1

My build step:
# ./autogen.sh --without-libvirtd
# make dist
# rpmbuild --nodeps --define "_sourcedir `pwd`" --define "_without_libvirtd 1" -ba libvirt.spec

This bug was caused by commit df1011ca.

Signed-off-by: Wen Congyang <wency cn fujitsu com>

---
 configure.ac |   35 ++++++++++++++++-------------------
 1 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2bb6918..0f81484 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1697,25 +1697,22 @@ if test "$with_storage_mpath" = "check" && test "$with_linux" = "yes"; then
 fi
 AM_CONDITIONAL([WITH_STORAGE_MPATH], [test "$with_storage_mpath" = "yes"])
 
-if test "$with_storage_mpath" = "yes"; then
-   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
-
+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])
-- 
1.7.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]