[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxc: More LZMA/BZIP fixes.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1251098850 -3600
# Node ID c5125c0ea051be8babe0533c94a5635eaa760272
# Parent  4e67ba3c321affda3f90734ba62ce04b23fce66c
libxc: More LZMA/BZIP fixes.

 - Fix an error message in xc_try_bzip2_decode()
 - Check library installation on demand using a Makefile function,
   rather than generating a dependency file. Cleaner and avoids a race
   on generating the dep file.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 .hgignore                          |    2 +-
 tools/libxc/Makefile               |   36 +++++++++++++++---------------------
 tools/libxc/xc_dom_bzimageloader.c |    2 +-
 3 files changed, 17 insertions(+), 23 deletions(-)

diff -r 4e67ba3c321a -r c5125c0ea051 .hgignore
--- a/.hgignore Mon Aug 24 08:08:52 2009 +0100
+++ b/.hgignore Mon Aug 24 08:27:30 2009 +0100
@@ -102,6 +102,7 @@
 ^stubdom/ocaml-.*$
 ^stubdom/lwip/
 ^stubdom/ioemu/
+^stubdom/stubdompath\.sh$
 ^tools/.*/build/lib.*/.*\.py$
 ^tools/blktap2/daemon/blktapctrl$
 ^tools/blktap2/drivers/img2qcow$
@@ -170,7 +171,6 @@
 ^tools/ioemu/qemu\.1$
 ^tools/ioemu/qemu\.pod$
 ^tools/ioemu/tapdisk-ioemu$
-^tools/libxc/\.zlib\.deps$
 ^tools/libxc/ia64/asm/.*\.h$
 ^tools/libxc/ia64/acpi/.*\.h$
 ^tools/libxc/ia64/acpi/platform/.*\.h$
diff -r 4e67ba3c321a -r c5125c0ea051 tools/libxc/Makefile
--- a/tools/libxc/Makefile      Mon Aug 24 08:08:52 2009 +0100
+++ b/tools/libxc/Makefile      Mon Aug 24 08:27:30 2009 +0100
@@ -114,7 +114,7 @@ TAGS:
 
 .PHONY: clean
 clean:
-       rm -rf *.rpm $(LIB) *~ $(DEPS) .*.deps \
+       rm -rf *.rpm $(LIB) *~ $(DEPS) \
             $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \
             $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS)
 
@@ -152,30 +152,24 @@ libxenguest.so.$(MAJOR): libxenguest.so.
        ln -sf $< $@
 
 ifeq ($(CONFIG_MiniOS),y)
-.zlib.deps:
-       echo >$@
+zlib-options =
 else
-.zlib.deps:
-       @(set -e;                                       \
-          . ../check/funcs.sh;                         \
-         echo >$@.new;                                 \
-         if has_header bzlib.h; then                   \
-            echo "-DHAVE_BZLIB" >>$@.new;              \
-           echo "-lbz2" >>$@.new;                      \
-           echo " - BZIP2 decompression supported";    \
-         fi;                                           \
-         if has_header lzma.h; then                    \
-           echo "-DHAVE_LZMA" >>$@.new;                \
-           echo "-llzma" >>$@.new;                     \
-           echo " - LZMA decompression supported";     \
-         fi;                                           \
-         mv $@.new $@)
+zlib-options = $(shell                                 \
+       (. ../check/funcs.sh;                           \
+        if has_header bzlib.h; then                    \
+           echo "-DHAVE_BZLIB";                                \
+          echo "-lbz2";                                \
+        fi;                                            \
+        if has_header lzma.h; then                     \
+          echo "-DHAVE_LZMA";                          \
+          echo "-llzma";                               \
+        fi) | grep $(1))
 endif
 
-xc_dom_bzimageloader.o: .zlib.deps
-xc_dom_bzimageloader.o: CFLAGS += $(shell grep D .zlib.deps)
+xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D)
+xc_dom_bzimageloader.opic: CFLAGS += $(call zlib-options,D)
 
-libxenguest.so.$(MAJOR).$(MINOR): LDFLAGS += $(shell grep l .zlib.deps)
+libxenguest.so.$(MAJOR).$(MINOR): LDFLAGS += $(call zlib-options,l)
 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
        $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) 
-Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz 
-lxenctrl $(PTHREAD_LIBS)
 
diff -r 4e67ba3c321a -r c5125c0ea051 tools/libxc/xc_dom_bzimageloader.c
--- a/tools/libxc/xc_dom_bzimageloader.c        Mon Aug 24 08:08:52 2009 +0100
+++ b/tools/libxc/xc_dom_bzimageloader.c        Mon Aug 24 08:27:30 2009 +0100
@@ -112,7 +112,7 @@ static int xc_try_bzip2_decode(
 static int xc_try_bzip2_decode(
     struct xc_dom_image *dom, void **blob, size_t *size)
 {
-    xc_dom_printf("%s: LZMA decompress support unavailable\n",
+    xc_dom_printf("%s: BZIP2 decompress support unavailable\n",
                   __FUNCTION__);
     return -1;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.