Skip to contentSkip to conversation

Fix bzip2/lzma compilation/linking problems in tools/libxc/Makefile

PATCH In review Pasi Kärkkäinen 2 participants 2 messages Aug 23, 2009 – Aug 24, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix bzip2/lzma compilation/linking problems in tools/libxc/Makefile

Hello,

The attached patch fixes two problems in tools/libxc/Makefile in xen-unstable.

1) libxenguest.so.3.4.0 is linked from *.opic files, so the -DHAVE_BZLIB -DHAVE_LZMA CFLAGS need to be added to xc_dom_bzimageloader.opic aswell.

2) There was an ordering/dependency problem with .zlib.deps file generation resulting in missing CFLAGS for xc_dom_bzimageloader.o|.opic compilation.

ie. sometimes (for example during rpmbuild) this is what happened:

grep: .zlib.deps: No such file or directory
- BZIP2 decompression supported
- LZMA decompression supported

The .zlib.deps file generation was done _after_ the CFLAGS += stuff was ran.. obviously resulting in missing BZIP2/LZMA support.

I fixed this by making the .zlib.deps generation being the first thing to run.

-- Pasi

tools/libxc/Makefile renamed from tools/libxc/Makefile.orig +4 -1
@@ -86,7 +86,7 @@
 all: build
 
 .PHONY: build
-build:
+build: .zlib.deps
 	$(MAKE) libs
 
 .PHONY: libs
@@ -175,6 +175,9 @@
 xc_dom_bzimageloader.o: .zlib.deps
 xc_dom_bzimageloader.o: CFLAGS += $(shell grep D .zlib.deps)
 
+xc_dom_bzimageloader.opic: .zlib.deps
+xc_dom_bzimageloader.opic: CFLAGS += $(shell grep D .zlib.deps)
+
 libxenguest.so.$(MAJOR).$(MINOR): LDFLAGS += $(shell grep l .zlib.deps)
 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)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

I fixed this differently. See c/s 20116.

-- Keir

Quoted 24 lines · Pasi Kärkkäinen

Hello,

The attached patch fixes two problems in tools/libxc/Makefile in xen-unstable.

1) libxenguest.so.3.4.0 is linked from *.opic files, so the -DHAVE_BZLIB -DHAVE_LZMA
CFLAGS need to be added to xc_dom_bzimageloader.opic aswell.

2) There was an ordering/dependency problem with .zlib.deps file generation resulting
in missing CFLAGS for xc_dom_bzimageloader.o|.opic compilation.

ie. sometimes (for example during rpmbuild) this is what happened:

grep: .zlib.deps: No such file or directory
- BZIP2 decompression supported
- LZMA decompression supported

The .zlib.deps file generation was done _after_ the CFLAGS += stuff was ran.. obviously resulting in missing BZIP2/LZMA support.

I fixed this by making the .zlib.deps generation being the first thing to run.

-- Pasi