diff options
author | Eduardo Lima (Etrunko) <etrunko@redhat.com> | 2016-06-15 16:21:21 -0300 |
---|---|---|
committer | Eduardo Lima (Etrunko) <etrunko@redhat.com> | 2016-06-16 10:36:48 -0300 |
commit | 535930471320fb370c3027c158a1944a9729ce93 (patch) | |
tree | 8b778ec475c350c51e5c63132e8c2fda79e7bf68 | |
parent | 4284011bdce6dd94301a2c83f4416ed3ad500881 (diff) |
Make LZ4 dependency check more robust
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@redhat.com>
-rw-r--r-- | m4/spice-deps.m4 | 17 |
1 files 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") ]) |