[Spice-devel] Patch to support LZ4 compression algorithm

Christophe Fergeau cfergeau at redhat.com
Thu Nov 6 08:20:42 PST 2014


On Thu, Nov 06, 2014 at 10:33:19AM +0100, Javi wrote:
> diff --git a/configure.ac b/configure.ac
> index f47ee20..d295c5b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -694,6 +694,24 @@ if test "x$enable_dbus" != "xno"; then
>    fi
>  fi
>  
> +AC_ARG_ENABLE([lz4],
> +  AS_HELP_STRING([--enable-lz4=@<:@yes/no@:>@],
> +                 [Enable lz4 compression algorithm @<:@default=no@:>@]),
> +  [],
> +  [enable_lz4="no"])
> +
> +if test "x$enable_lz4" = "xyes"; then
> +    AC_CHECK_LIB(lz4, LZ4_compress_limitedOutput, LZ4_LIBS='-llz4', enable_lz4=no)
> +    AC_CHECK_HEADER([lz4.h], [], [enable_lz4=no])
> +    AC_DEFINE([USE_LZ4], [1], [Define to build with Lz4 support])
> +
> +    if test "x$enable_lz4" = "xno"; then
> +        AC_MSG_ERROR([lz4 not found])
> +    fi
> +fi

You should be able to use PKG_CHECK_MODULES instead of manually checking
for lib and header as lz4 comes with a .pc file.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20141106/793a2bcc/attachment.sig>


More information about the Spice-devel mailing list