squashfs-4.1-build-system-fix.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. [PATCH]: allow custom EXTRA_CFLAGS/LDFLAGS/*_SUPPORT on the make cmd line
  2. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
  3. ---
  4. squashfs-tools/Makefile | 26 +++++++++++++-------------
  5. 1 file changed, 13 insertions(+), 13 deletions(-)
  6. Index: squashfs4.1/squashfs-tools/Makefile
  7. ===================================================================
  8. --- squashfs4.1.orig/squashfs-tools/Makefile
  9. +++ squashfs4.1/squashfs-tools/Makefile
  10. @@ -87,11 +87,11 @@ MKSQUASHFS_OBJS = mksquashfs.o read_fs.o
  11. UNSQUASHFS_OBJS = unsquashfs.o unsquash-1.o unsquash-2.o unsquash-3.o \
  12. unsquash-4.o swap.o compressor.o
  13. -CFLAGS = $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
  14. - -D_GNU_SOURCE -DCOMP_DEFAULT=\"$(COMP_DEFAULT)\" -O2 -Wall
  15. +CFLAGS = $(EXTRA_CFLAGS) $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
  16. + -D_GNU_SOURCE -DCOMP_DEFAULT=\"$(COMP_DEFAULT)\" -Wall
  17. LIBS =
  18. -ifdef GZIP_SUPPORT
  19. +ifeq ($(GZIP_SUPPORT),1)
  20. CFLAGS += -DGZIP_SUPPORT
  21. MKSQUASHFS_OBJS += gzip_wrapper.o
  22. UNSQUASHFS_OBJS += gzip_wrapper.o
  23. @@ -99,7 +99,7 @@ LIBS += -lz
  24. COMPRESSORS += gzip
  25. endif
  26. -ifdef LZMA_SUPPORT
  27. +ifeq ($(LZMA_SUPPORT),1)
  28. LZMA_OBJS = $(LZMA_DIR)/C/Alloc.o $(LZMA_DIR)/C/LzFind.o \
  29. $(LZMA_DIR)/C/LzmaDec.o $(LZMA_DIR)/C/LzmaEnc.o $(LZMA_DIR)/C/LzmaLib.o
  30. INCLUDEDIR += -I$(LZMA_DIR)/C
  31. @@ -109,7 +109,7 @@ UNSQUASHFS_OBJS += lzma_wrapper.o $(LZMA
  32. COMPRESSORS += lzma
  33. endif
  34. -ifdef XZ_SUPPORT
  35. +ifeq ($(XZ_SUPPORT),1)
  36. CFLAGS += -DLZMA_SUPPORT
  37. MKSQUASHFS_OBJS += xz_wrapper.o
  38. UNSQUASHFS_OBJS += xz_wrapper.o
  39. @@ -117,7 +117,7 @@ LIBS += -llzma
  40. COMPRESSORS += lzma
  41. endif
  42. -ifdef LZO_SUPPORT
  43. +ifeq ($(LZO_SUPPORT),1)
  44. CFLAGS += -DLZO_SUPPORT
  45. ifdef LZO_DIR
  46. INCLUDEDIR += -I$(LZO_DIR)/include
  47. @@ -129,8 +129,8 @@ LIBS += $(LZO_LIBDIR) -llzo2
  48. COMPRESSORS += lzo
  49. endif
  50. -ifdef XATTR_SUPPORT
  51. -ifdef XATTR_DEFAULT
  52. +ifeq ($(XATTR_SUPPORT),1)
  53. +ifeq ($(XATTR_DEFAULT),1)
  54. CFLAGS += -DXATTR_SUPPORT -DXATTR_DEFAULT
  55. else
  56. CFLAGS += -DXATTR_SUPPORT
  57. @@ -142,7 +142,7 @@ endif
  58. #
  59. # If LZMA_SUPPORT is specified then LZO_DIR must be specified too
  60. #
  61. -ifdef LZMA_SUPPORT
  62. +ifeq ($(LZMA_SUPPORT),1)
  63. ifndef LZMA_DIR
  64. $(error "LZMA_SUPPORT requires LZMA_DIR to be also defined")
  65. endif
  66. @@ -151,8 +151,8 @@ endif
  67. #
  68. # Both XZ_SUPPORT and LZMA_SUPPORT cannot be specified
  69. #
  70. -ifdef XZ_SUPPORT
  71. -ifdef LZMA_SUPPORT
  72. +ifeq ($(XZ_SUPPORT),1)
  73. +ifeq ($(LZMA_SUPPORT),1)
  74. $(error "Both XZ_SUPPORT and LZMA_SUPPORT cannot be specified")
  75. endif
  76. endif
  77. @@ -175,7 +175,7 @@ endif
  78. all: mksquashfs unsquashfs
  79. mksquashfs: $(MKSQUASHFS_OBJS)
  80. - $(CC) $(MKSQUASHFS_OBJS) -lpthread -lm $(LIBS) -o $@
  81. + $(CC) $(EXTRA_LDFLAGS) $(MKSQUASHFS_OBJS) -lpthread -lm $(LIBS) -o $@
  82. mksquashfs.o: mksquashfs.c squashfs_fs.h mksquashfs.h global.h sort.h \
  83. squashfs_swap.h xattr.h
  84. @@ -195,7 +195,7 @@ xattr.o: xattr.h
  85. read_xattrs.o: xattr.h
  86. unsquashfs: $(UNSQUASHFS_OBJS)
  87. - $(CC) $(UNSQUASHFS_OBJS) -lpthread -lm $(LIBS) -o $@
  88. + $(CC) $(EXTRA_LDFLAGS) $(UNSQUASHFS_OBJS) -lpthread -lm $(LIBS) -o $@
  89. unsquashfs.o: unsquashfs.h unsquashfs.c squashfs_fs.h squashfs_swap.h \
  90. squashfs_compat.h global.h xattr.h