[libvirt] PATCH: Remove duplicate messages in configure.ac

Daniel P. Berrange berrange at redhat.com
Wed May 21 22:22:42 UTC 2008


Another configure.ac cleanup, this time removing a bunch of duplicated 
messages printed out by various checks. Applies ontop of the previous
patch.

Dan.

diff -r cc378ee57aab configure.in
--- a/configure.in	Tue May 20 14:23:31 2008 -0400
+++ b/configure.in	Tue May 20 14:32:17 2008 -0400
@@ -355,16 +355,14 @@
      [GNUTLS_FOUND=yes], [GNUTLS_FOUND=no])
 fi
 if test "$GNUTLS_FOUND" = "no"; then
-  AC_CHECK_HEADER([gnutls/gnutls.h],
-    [],
-    AC_MSG_ERROR(
-      [You must install the GnuTLS development package in order to compile libvirt]))
+  fail=0
   old_libs="$LIBS"
-  AC_CHECK_LIB([gnutls], [gnutls_handshake],
-    [],
-    [AC_MSG_ERROR(
-       [You must install the GnuTLS library in order to compile and run libvirt])],
-    [-lgcrypt])
+  AC_CHECK_HEADER([gnutls/gnutls.h], [], [fail=1])
+  AC_CHECK_LIB([gnutls], [gnutls_handshake],[], [fail=1], [-lgcrypt])
+
+  test $fail = 1 &&
+    AC_MSG_ERROR([You must install the GnuTLS library in order to compile and run libvirt])
+
   GNUTLS_LIBS=$LIBS
   LIBS="$old_libs"
 fi
@@ -400,6 +398,7 @@
     SASL_CFLAGS="-I$with_sasl"
     SASL_LIBS="-L$with_sasl"
   fi
+  fail=0
   old_cflags="$CFLAGS"
   old_libs="$LIBS"
   CFLAGS="$CFLAGS $SASL_CFLAGS"
@@ -408,18 +407,18 @@
     if test "x$with_sasl" != "xcheck" ; then
         with_sasl=no
     else
-        AC_MSG_ERROR(
-          [You must install the Cyrus SASL development package in order to compile libvirt])
+        fail=1
     fi])
   if test "x$with_sasl" != "xno" ; then
     AC_CHECK_LIB([sasl2], [sasl_client_init],[with_sasl=yes],[
       if test "x$with_sasl" = "xcheck" ; then
           with_sasl=no
       else
-          AC_MSG_ERROR(
-            [You must install the Cyrus SASL library in order to compile and run libvirt])
+          fail=1
       fi])
   fi
+  test $fail = 1 &&
+    AC_MSG_ERROR([You must install the Cyrus SASL development package in order to compile libvirt])
   CFLAGS="$old_cflags"
   LIBS="$old_libs"
   SASL_LIBS="$SASL_LIBS -lsasl2"
@@ -518,10 +517,11 @@
       with_selinux="yes"
     fi
   else
-    AC_CHECK_HEADER([selinux/selinux.h],[],
-       [AC_MSG_ERROR([You must install the SELinux development package in order to compile libvirt])])
-    AC_CHECK_LIB([selinux], [fgetfilecon],[],
-       [AC_MSG_ERROR([You must install the SELinux development package in order to compile and run libvirt])])
+    fail=0
+    AC_CHECK_HEADER([selinux/selinux.h],[],[fail=1])
+    AC_CHECK_LIB([selinux], [fgetfilecon],[],[fail=1])
+    test $fail = 1 &&
+      AC_MSG_ERROR([You must install the SELinux development package in order to compile libvirt])
   fi
   CFLAGS="$old_cflags"
   LIBS="$old_libs"
@@ -552,10 +552,11 @@
       with_numactl="yes"
     fi
   else
-    AC_CHECK_HEADER([numa.h],[],
-       [AC_MSG_ERROR([You must install the numactl development package in order to compile libvirt])])
-    AC_CHECK_LIB([numa], [numa_available],[],
-       [AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt])])
+    fail=0
+    AC_CHECK_HEADER([numa.h],[],[fail=1])
+    AC_CHECK_LIB([numa], [numa_available],[],[fail=1])
+    test $fail = 1 &&
+      AC_MSG_ERROR([You must install the numactl development package in order to compile and run libvirt])
   fi
   CFLAGS="$old_cflags"
   LIBS="$old_libs"
@@ -632,7 +633,7 @@
   AC_PATH_PROG([UMOUNT], [umount], [], [$PATH:/sbin:/usr/sbin])
   if test "$with_storage_fs" = "yes" ; then
     if test -z "$MOUNT" ; then AC_MSG_ERROR(We need mount for FS storage driver) ; fi
-    if test -z "$UMOUNT" ; then AC_MSG_ERROR(We need mount for FS storage driver) ; fi
+    if test -z "$UMOUNT" ; then AC_MSG_ERROR(We need umount for FS storage driver) ; fi
   else
     if test -z "$MOUNT" ; then with_storage_fs=no ; fi
     if test -z "$UMOUNT" ; then with_storage_fs=no ; fi


-- 
|: Red Hat, Engineering, Boston   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list