1 diff --git a/mkfs.ubifs/Makefile b/mkfs.ubifs/Makefile
2 index a678b0a..919ce89 100644
3 --- a/mkfs.ubifs/Makefile
4 +++ b/mkfs.ubifs/Makefile
5 @@ -5,7 +5,7 @@ ALL_SOURCES=*.[ch] hashtable/*.[ch]
9 -LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid -L../ubi-utils/ -lubi
10 +LDLIBS_mkfs.ubifs = -lz $(if,$(NO_LZO),,-llzo2) -lm -luuid -L../ubi-utils/ -lubi
14 diff --git a/mkfs.ubifs/compr.c b/mkfs.ubifs/compr.c
15 index e378c5d..0208f80 100644
16 --- a/mkfs.ubifs/compr.c
17 +++ b/mkfs.ubifs/compr.c
23 #include <lzo/lzo1x.h>
25 #include <linux/types.h>
28 @@ -83,6 +85,17 @@ static int zlib_deflate(void *in_buf, size_t in_len, void *out_buf,
32 +static int no_compress(void *in_buf, size_t in_len, void *out_buf,
35 + memcpy(out_buf, in_buf, in_len);
43 static int lzo_compress(void *in_buf, size_t in_len, void *out_buf,
46 @@ -101,14 +114,16 @@ static int lzo_compress(void *in_buf, size_t in_len, void *out_buf,
50 -static int no_compress(void *in_buf, size_t in_len, void *out_buf,
54 +static int lzo_compress(void *in_buf, size_t in_len, void *out_buf,
57 - memcpy(out_buf, in_buf, in_len);
65 static char *zlib_buf;
67 static int favor_lzo_compress(void *in_buf, size_t in_len, void *out_buf,
68 @@ -195,9 +210,11 @@ int compress_data(void *in_buf, size_t in_len, void *out_buf, size_t *out_len,
70 int init_compression(void)
72 +#ifdef CONFIG_UBIFS_LZO
73 lzo_mem = malloc(LZO1X_999_MEM_COMPRESS);
78 zlib_buf = malloc(UBIFS_BLOCK_SIZE * WORST_COMPR_FACTOR);
80 @@ -211,7 +228,9 @@ int init_compression(void)
81 void destroy_compression(void)
84 +#ifdef CONFIG_UBIFS_LZO
88 fprintf(stderr, "%llu compression errors occurred\n", errcnt);