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

Christophe Fergeau cfergeau at redhat.com
Thu Jun 16 13:54:07 UTC 2016


Looks good to me, 
Acked-by: Christophe Fergeau <cfergeau at redhat.com>

On Thu, Jun 16, 2016 at 10:39:58AM -0300, Eduardo Lima (Etrunko) wrote:
> 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 at redhat.com>
> ---
>  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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160616/1b4c7e5a/attachment.sig>


More information about the Spice-devel mailing list