aboutsummaryrefslogtreecommitdiff
path: root/difftool
diff options
context:
space:
mode:
Diffstat (limited to 'difftool')
-rw-r--r--difftool/Makemodule.am2
-rw-r--r--difftool/sqfsdiff.c15
2 files changed, 15 insertions, 2 deletions
diff --git a/difftool/Makemodule.am b/difftool/Makemodule.am
index e43f35d..e827a8b 100644
--- a/difftool/Makemodule.am
+++ b/difftool/Makemodule.am
@@ -2,6 +2,6 @@ sqfsdiff_SOURCES = difftool/sqfsdiff.c difftool/sqfsdiff.h difftool/util.c
sqfsdiff_SOURCES += difftool/compare_dir.c difftool/node_compare.c
sqfsdiff_SOURCES += difftool/compare_files.c difftool/super.c
sqfsdiff_SOURCES += difftool/extract.c difftool/options.c
-sqfsdiff_LDADD = libcommon.a libsquashfs.la libutil.la
+sqfsdiff_LDADD = libcommon.a libsquashfs.la libutil.la $(LZO_LIBS)
bin_PROGRAMS += sqfsdiff
diff --git a/difftool/sqfsdiff.c b/difftool/sqfsdiff.c
index 7479938..1c80812 100644
--- a/difftool/sqfsdiff.c
+++ b/difftool/sqfsdiff.c
@@ -22,7 +22,14 @@ static int open_sfqs(sqfs_state_t *state, const char *path)
goto fail_file;
}
- if (!sqfs_compressor_exists(state->super.compression_id)) {
+ ret = sqfs_compressor_exists(state->super.compression_id);
+
+#ifdef WITH_LZO
+ if (state->super.compression_id == SQFS_COMP_LZO)
+ ret = true;
+#endif
+
+ if (!ret) {
fprintf(stderr, "%s: unknown compressor used.\n",
path);
goto fail_file;
@@ -33,6 +40,12 @@ static int open_sfqs(sqfs_state_t *state, const char *path)
SQFS_COMP_FLAG_UNCOMPRESS);
state->cmp = sqfs_compressor_create(&state->cfg);
+
+#ifdef WITH_LZO
+ if (state->super.compression_id == SQFS_COMP_LZO && state->cmp == NULL)
+ state->cmp = lzo_compressor_create(&state->cfg);
+#endif
+
if (state->cmp == NULL) {
fprintf(stderr, "%s: error creating compressor.\n", path);
goto fail_file;