squashfs3: fix build when zlib isn't available on the host
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 7 May 2010 19:23:31 +0000 (21:23 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 7 May 2010 19:32:02 +0000 (21:32 +0200)
We need to pass CFLAGS and LDFLAGS, and to rename the patch so that it
actually gets applied.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/squashfs3/squashfs-3.4-build-system-fix.patch [deleted file]
package/squashfs3/squashfs3-3.4-build-system-fix.patch [new file with mode: 0644]
package/squashfs3/squashfs3.mk

diff --git a/package/squashfs3/squashfs-3.4-build-system-fix.patch b/package/squashfs3/squashfs-3.4-build-system-fix.patch
deleted file mode 100644 (file)
index 5b86b00..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-[PATCH]: squashfs-tools: Handle user supplied CFLAGS/LDFLAGS
-
-Properly handle make CFLAGS=.. LDFLAGS=..
-
-Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
----
- squashfs-tools/Makefile |    4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-Index: squashfs3.4/squashfs-tools/Makefile
-===================================================================
---- squashfs3.4.orig/squashfs-tools/Makefile
-+++ squashfs3.4/squashfs-tools/Makefile
-@@ -2,12 +2,12 @@ INSTALL_DIR = /usr/local/bin
- INCLUDEDIR = .
--CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2
-+override CFLAGS += -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2
- all: mksquashfs unsquashfs
- mksquashfs: mksquashfs.o read_fs.o sort.o
--      $(CC) mksquashfs.o read_fs.o sort.o -lz -lpthread -lm -o $@
-+      $(CC) $(LDFLAGS) mksquashfs.o read_fs.o sort.o -lz -lpthread -lm -o $@
- mksquashfs.o: mksquashfs.c squashfs_fs.h mksquashfs.h global.h sort.h
diff --git a/package/squashfs3/squashfs3-3.4-build-system-fix.patch b/package/squashfs3/squashfs3-3.4-build-system-fix.patch
new file mode 100644 (file)
index 0000000..3c197eb
--- /dev/null
@@ -0,0 +1,37 @@
+[PATCH]: squashfs-tools: Handle user supplied CFLAGS/LDFLAGS
+
+Properly handle make CFLAGS=.. LDFLAGS=..
+
+Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
+---
+ squashfs-tools/Makefile |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: squashfs3.4/squashfs-tools/Makefile
+===================================================================
+--- squashfs3.4.orig/squashfs-tools/Makefile   2008-08-26 09:10:13.000000000 +0200
++++ squashfs3.4/squashfs-tools/Makefile        2010-05-06 21:09:28.000000000 +0200
+@@ -2,12 +2,12 @@
+ INCLUDEDIR = .
+-CFLAGS := -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2
++override CFLAGS += -I$(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -O2
+ all: mksquashfs unsquashfs
+ mksquashfs: mksquashfs.o read_fs.o sort.o
+-      $(CC) mksquashfs.o read_fs.o sort.o -lz -lpthread -lm -o $@
++      $(CC) $(LDFLAGS) mksquashfs.o read_fs.o sort.o -lz -lpthread -lm -o $@
+ mksquashfs.o: mksquashfs.c squashfs_fs.h mksquashfs.h global.h sort.h
+@@ -16,7 +16,7 @@
+ sort.o: sort.c squashfs_fs.h global.h sort.h
+ unsquashfs: unsquashfs.o
+-      $(CC) unsquashfs.o -lz -lpthread -lm -o $@
++      $(CC) $(LDFLAGS) unsquashfs.o -lz -lpthread -lm -o $@
+ unsquashfs.o: unsquashfs.c squashfs_fs.h read_fs.h global.h
index 5504b142630d3224446b0326db717cdd2b873ed8..69aab1489f177eb77bafd86f447115db63deb7bb 100644 (file)
@@ -18,7 +18,7 @@ define SQUASHFS3_INSTALL_TARGET_CMDS
 endef
 
 define HOST_SQUASHFS3_BUILD_CMDS
- $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/squashfs-tools/
+ $(HOST_MAKE_ENV) $(MAKE) CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS)" -C $(@D)/squashfs-tools/
 endef
 
 define HOST_SQUASHFS3_INSTALL_CMDS