1 Dec 2010 17:34
[PATCH V2] add support for LDFLAGS, don't overwrite CFLAGS
When cross compiling, the linker cannot find libz. This patch adds the LDFLAGS variable to pass the linkerflags. Based on earlier work by Erwin Rol and added suggestions from Mike Frysinger. Signed-off-by: Marc Kleine-Budde <mkl@...> Signed-off-by: Wolfram Sang <w.sang@...> Acked-by: Peter Korsgaard <jacmet@...> --- Thanks for the suggestions, Mike! squashfs-tools/Makefile | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/squashfs-tools/Makefile b/squashfs-tools/Makefile index f45d722..f6a0c0a 100644 --- a/squashfs-tools/Makefile +++ b/squashfs-tools/Makefile <at> <at> -100,8 +100,9 <at> <at> MKSQUASHFS_OBJS = mksquashfs.o read_fs.o sort.o swap.o pseudo.o compressor.o UNSQUASHFS_OBJS = unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o \ unsquash-4.o swap.o compressor.o -CFLAGS = $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ - -D_GNU_SOURCE -DCOMP_DEFAULT=\"$(COMP_DEFAULT)\" -O2 -Wall +CFLAGS ?= -O2 +CFLAGS += $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ + -D_GNU_SOURCE -DCOMP_DEFAULT=\"$(COMP_DEFAULT)\" -Wall LIBS = ifdef GZIP_SUPPORT <at> <at> -196,7 +197,7 <at> <at> endif all: mksquashfs unsquashfs mksquashfs: $(MKSQUASHFS_OBJS) - $(CC) $(MKSQUASHFS_OBJS) -lpthread -lm $(LIBS) -o $ <at> + $(CC) $(LDFLAGS) $(MKSQUASHFS_OBJS) -lpthread -lm $(LIBS) -o $ <at> mksquashfs.o: mksquashfs.c squashfs_fs.h mksquashfs.h global.h sort.h \ squashfs_swap.h xattr.h <at> <at> -216,7 +217,7 <at> <at> xattr.o: xattr.h read_xattrs.o: xattr.h unsquashfs: $(UNSQUASHFS_OBJS) - $(CC) $(UNSQUASHFS_OBJS) -lpthread -lm $(LIBS) -o $ <at> + $(CC) $(LDFLAGS) $(UNSQUASHFS_OBJS) -lpthread -lm $(LIBS) -o $ <at> unsquashfs.o: unsquashfs.h unsquashfs.c squashfs_fs.h squashfs_swap.h \ squashfs_compat.h global.h xattr.h -- -- 1.7.2.3
RSS Feed