[PATCH v2 spice-common] Make LZ4 dependency check more robust

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

 



Add a new 'HAVE_LZ4' automake conditional to really tell if we have the
dependency installed on the system. It will later be used in Makefile to
decide whether or not the specific files related to LZ4 should be built.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@xxxxxxxxxx>
---
 m4/spice-deps.m4 | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4
index 2e2fcf5..6cb8bde 100644
--- a/m4/spice-deps.m4
+++ b/m4/spice-deps.m4
@@ -183,16 +183,17 @@ AC_DEFUN([SPICE_CHECK_LZ4], [
       [],
       [enable_lz4="auto"])
 
+    have_lz4="no"
     if test "x$enable_lz4" != "xno"; then
-      PKG_CHECK_MODULES([LZ4], [liblz4],
-        [enable_lz4=yes
-         AC_DEFINE(USE_LZ4, [1], [Define to build with lz4 support])
-        ],
-        [if test "x$enable_lz4" = "xyes"; then
-          AC_MSG_ERROR([lz4 support requested but liblz4 could not be found])
-        fi]
-      )
+      PKG_CHECK_MODULES([LZ4], [liblz4], [have_lz4="yes"], [have_lz4="no"])
+
+      if test "x$have_lz4" = "xyes"; then
+        AC_DEFINE(USE_LZ4, [1], [Define to build with lz4 support])
+      elif test "x$enable_lz4" = "xyes"; then
+        AC_MSG_ERROR([lz4 support requested but liblz4 could not be found])
+      fi
     fi
+    AM_CONDITIONAL(HAVE_LZ4, test "x$have_lz4" = "xyes")
 ])
 
 
-- 
2.5.5

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]