]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: fix parted detection at configure time
authorEric Blake <eblake@redhat.com>
Mon, 31 Jan 2011 22:08:26 +0000 (15:08 -0700)
committerEric Blake <eblake@redhat.com>
Tue, 1 Feb 2011 16:05:05 +0000 (09:05 -0700)
* configure.ac (PARTED_FOUND): Issue configure error if
--with-storage-disk=yes but no parted is found.

configure.ac

index f310a5e814113dd3633426c16118e2c61120fac1..8a4083f93ea234354a9e05a7a5ce6a5188fc5950 100644 (file)
@@ -1703,17 +1703,18 @@ AC_SUBST([DEVMAPPER_LIBS])
 
 LIBPARTED_CFLAGS=
 LIBPARTED_LIBS=
-if test "$with_storage_disk" = "yes" || test "$with_storage_disk" = "check"; then
+if test "$with_storage_disk" = "yes" ||
+   test "$with_storage_disk" = "check"; then
   AC_PATH_PROG([PARTED], [parted], [], [$PATH:/sbin:/usr/sbin])
   if test -z "$PARTED" ; then
-    with_storage_disk=no
     PARTED_FOUND=no
   else
     PARTED_FOUND=yes
   fi
 
-  if test "$with_storage_disk" != "no" && test "x$PKG_CONFIG" != "x" ; then
-    PKG_CHECK_MODULES(LIBPARTED, libparted >= $PARTED_REQUIRED, [], [PARTED_FOUND=no])
+  if test "$PARTED_FOUND" = "yes" && test "x$PKG_CONFIG" != "x" ; then
+    PKG_CHECK_MODULES([LIBPARTED], [libparted >= $PARTED_REQUIRED], [],
+      [PARTED_FOUND=no])
   fi
   if test "$PARTED_FOUND" = "no"; then
     # RHEL-5 vintage parted is missing pkg-config files
@@ -1739,8 +1740,10 @@ if test "$with_storage_disk" = "yes" || test "$with_storage_disk" = "check"; the
   fi
 
   if test "$with_storage_disk" = "yes"; then
-    AC_DEFINE_UNQUOTED([WITH_STORAGE_DISK], 1, [whether Disk backend for storage driver is enabled])
-    AC_DEFINE_UNQUOTED([PARTED],["$PARTED"], [Location or name of the parted program])
+    AC_DEFINE_UNQUOTED([WITH_STORAGE_DISK], 1,
+      [whether Disk backend for storage driver is enabled])
+    AC_DEFINE_UNQUOTED([PARTED],["$PARTED"],
+      [Location or name of the parted program])
   fi
 fi
 AM_CONDITIONAL([WITH_STORAGE_DISK], [test "$with_storage_disk" = "yes"])