--- squashfs-tools/Makefile	2009-04-04 22:03:36.000000000 -0400
+++ squashfs-tools/Makefile	2009-11-07 18:07:24.000000000 -0500
@@ -4,10 +4,10 @@
 
 CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2
 
-all: mksquashfs unsquashfs
+all: mksquashfs4-lzma unsquashfs4-lzma
 
-mksquashfs: mksquashfs.o read_fs.o sort.o swap.o pseudo.o
-	$(CC) mksquashfs.o read_fs.o sort.o swap.o pseudo.o -lz -lpthread -lm -o $@
+mksquashfs4-lzma: mksquashfs.o read_fs.o sort.o swap.o pseudo.o
+	$(CXX) mksquashfs.o read_fs.o sort.o  swap.o pseudo.o -L$(LZMA_DIR) -llzma -lz -lpthread -lm -o $@
 
 mksquashfs.o: mksquashfs.c squashfs_fs.h mksquashfs.h global.h sort.h squashfs_swap.h Makefile
 
@@ -19,8 +19,8 @@
 
 pseudo.o: pseudo.c pseudo.h Makefile
 
-unsquashfs: unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o
-	$(CC) unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o -lz -lpthread -lm -o $@
+unsquashfs4-lzma: unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o
+	$(CXX) unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o unsquash-4.o swap.o -L$(LZMA_DIR) -llzma -lz -lpthread -lm -o $@
 
 unsquashfs.o: unsquashfs.h unsquashfs.c squashfs_fs.h squashfs_swap.h squashfs_compat.h global.h Makefile
 
@@ -37,5 +37,5 @@
 
 install: mksquashfs unsquashfs
 	mkdir -p $(INSTALL_DIR)
-	cp mksquashfs $(INSTALL_DIR)
-	cp unsquashfs $(INSTALL_DIR)
+	cp mksquashfs4-lzma $(INSTALL_DIR)
+	cp unsquashfs4-lzma $(INSTALL_DIR)
