[Spice-devel] [spice-common 1/2] ppc: Fix lz magic endianness

Christophe Fergeau cfergeau at redhat.com
Mon Dec 15 03:14:57 PST 2014


From: Erlon Cruz <erlon.cruz at br.flextronics.com>

Signed-off-by: Erlon R. Cruz <erlon.cruz at br.flextronics.com>
Signed-off-by: Rafael F. Santos <fonsecasantos.rafael at gmail.com>
Signed-off-by: Fabiano FidĂȘncio <Fabiano.FidĂȘncio at fit-tecnologia.org.br>
---
 common/lz.c      |  4 +++-
 configure.ac     |  1 +
 m4/spice-deps.m4 | 12 ++++++++++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/common/lz.c b/common/lz.c
index d1c4033..2350152 100644
--- a/common/lz.c
+++ b/common/lz.c
@@ -47,6 +47,8 @@
 #include <config.h>
 #endif
 
+#include <glib.h>
+
 #include "spice_common.h"
 #include "lz.h"
 
@@ -537,7 +539,7 @@ int lz_encode(LzContext *lz, LzImageType type, int width, int height, int top_do
         encoder->usr->error(encoder->usr, "lz encoder reading image segments failed\n");
     }
 
-    encode_32(encoder, LZ_MAGIC);
+    encode_32(encoder, GUINT32_TO_LE(LZ_MAGIC));
     encode_32(encoder, LZ_VERSION);
     encode_32(encoder, type);
     encode_32(encoder, width);
diff --git a/configure.ac b/configure.ac
index 32d4c4d..73102c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,7 @@ AC_SUBST(PROTOCOL_CFLAGS)
 SPICE_CHECK_PIXMAN(SPICE_COMMON)
 SPICE_CHECK_SMARTCARD(SPICE_COMMON)
 SPICE_CHECK_CELT051(SPICE_COMMON)
+SPICE_CHECK_GLIB2(SPICE_COMMON)
 SPICE_CHECK_OPUS(SPICE_COMMON)
 SPICE_CHECK_OPENGL(SPICE_COMMON)
 AC_SUBST(SPICE_COMMON_CFLAGS)
diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4
index 0815766..e5eb7fd 100644
--- a/m4/spice-deps.m4
+++ b/m4/spice-deps.m4
@@ -141,3 +141,15 @@ AC_DEFUN([SPICE_CHECK_PIXMAN], [
     AS_VAR_APPEND([$1_CFLAGS], [" $PIXMAN_CFLAGS"])
     AS_VAR_APPEND([$1_LIBS], [" $PIXMAN_LIBS"])
 ])
+
+
+# SPICE_CHECK_GLIB2(PREFIX)
+# --------------------------
+# Check for the availability of glib2. If found, it will append the flags to
+# use to the $PREFIX_CFLAGS and $PREFIX_LIBS variables.
+#---------------------------
+AC_DEFUN([SPICE_CHECK_GLIB2], [
+    PKG_CHECK_MODULES(GLIB2, glib-2.0)
+    AS_VAR_APPEND([$1_CFLAGS], [" $GLIB2_CFLAGS"])
+    AS_VAR_APPEND([$1_LIBS], [" $GLIB2_LIBS"])
+])
-- 
2.1.0



More information about the Spice-devel mailing list