diff options
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | compr_lzo.c | 15 |
2 files changed, 22 insertions, 2 deletions
@@ -6,6 +6,11 @@ CPPFLAGS += -I./include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) ifeq ($(WITHOUT_XATTR), 1) CPPFLAGS += -DWITHOUT_XATTR endif +ifeq ($(WITHOUT_LZO), 1) + CPPFLAGS += -DWITHOUT_LZO +else + LZOLDLIBS = -llzo2 +endif SUBDIRS = lib ubi-utils mkfs.ubifs TESTS = tests @@ -48,11 +53,11 @@ $(BUILDDIR)/mkfs.jffs2: $(addprefix $(BUILDDIR)/,\ compr_rtime.o mkfs.jffs2.o compr_zlib.o compr_lzo.o \ compr.o rbtree.o) LDFLAGS_mkfs.jffs2 = $(ZLIBLDFLAGS) $(LZOLDFLAGS) -LDLIBS_mkfs.jffs2 = -lz -llzo2 +LDLIBS_mkfs.jffs2 = -lz $(LZOLDLIBS) $(BUILDDIR)/jffs2reader: $(BUILDDIR)/jffs2reader.o LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS) -LDLIBS_jffs2reader = -lz -llzo2 +LDLIBS_jffs2reader = -lz $(LZOLDLIBS) $(BUILDDIR)/lib/libmtd.a: subdirs_lib_all ; diff --git a/compr_lzo.c b/compr_lzo.c index d0f0ed7..d2e2afc 100644 --- a/compr_lzo.c +++ b/compr_lzo.c @@ -24,6 +24,8 @@ #include <stdint.h> #include <stdio.h> #include <string.h> + +#ifndef WITHOUT_LZO #include <asm/types.h> #include <linux/jffs2.h> #include <lzo/lzo1x.h> @@ -118,3 +120,16 @@ void jffs2_lzo_exit(void) free(lzo_compress_buf); free(lzo_mem); } + +#else + +int jffs2_lzo_init(void) +{ + return 0; +} + +void jffs2_lzo_exit(void) +{ +} + +#endif |