summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2015-06-17 19:21:45 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2015-06-17 19:25:05 +0200
commit1b5edbe49e5c36c4f35453de448b54f770e1c1be (patch)
tree0dedbac871cc89b8f886b9ee4effbadd5de7dc16
parentfec803156b1844a2deb705cf55933294ca60a5ea (diff)
m4: Add macro for --enable-lz4
It's not directly used by spice-common, but this way spice-gtk and spice-server can share the same implementation.
-rw-r--r--m4/spice-deps.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4
index 600dd98..df35a92 100644
--- a/m4/spice-deps.m4
+++ b/m4/spice-deps.m4
@@ -173,3 +173,27 @@ AC_DEFUN([SPICE_CHECK_PYTHON_MODULES], [
AX_PYTHON_MODULE([pyparsing], [1])
fi
])
+
+
+# SPICE_CHECK_LZ4(PREFIX)
+# -----------------------------
+# Adds a --enable-lz4 switch in order to enable/disable LZ4 compression
+# support, and checks if the needed libraries are available. If found, it will
+# append the flags to use to the $PREFIX_CFLAGS and $PREFIX_LIBS variables, and
+# it will define a USE_LZ4 preprocessor symbol as well as a SUPPORT_LZ4 Makefile
+# conditional.
+#------------------------------
+AC_DEFUN([SPICE_CHECK_LZ4], [
+ AC_ARG_ENABLE([lz4],
+ AS_HELP_STRING([--enable-lz4=@<:@yes/no@:>@],
+ [Enable LZ4 compression support @<:@default=no@:>@]),
+ [],
+ [enable_lz4="no"])
+
+ if test "x$enable_lz4" != "xno"; then
+ PKG_CHECK_MODULES([LZ4], [liblz4])
+ AC_DEFINE(USE_LZ4, [1], [Define to build with lz4 support])
+ fi
+ AS_VAR_APPEND([$1_CFLAGS], [" $LZ4_CFLAGS"])
+ AS_VAR_APPEND([$1_LIBS], [" $LZ4_LIBS"])
+])