]> www.infradead.org Git - mtd-utils.git/commitdiff
Fix optional compilation of lzo compressors
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Sat, 17 Feb 2024 20:13:24 +0000 (21:13 +0100)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Sat, 17 Feb 2024 20:20:34 +0000 (21:20 +0100)
 - Simple fixup in autoconf.ac
 - Make compilation of jffsX-utils compr_lzo.c optional. Simply
   don't compile it if we built without LZO and remove the place
   holders. They are not used anyway if we build without LZO.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
configure.ac
jffsX-utils/Makemodule.am
jffsX-utils/compr_lzo.c

index fdd9c3c7d6dbe1006c99df79ba06a88fab47a094..0751b3b96a9a339a97600a1a7ae5b3162e9f17ce 100644 (file)
@@ -198,7 +198,7 @@ AS_IF([test -z "$LZO_LIBS" -a "x$with_lzo" != "xno"], [
                    )
 ], [])
 
-AS_IF([test -z "$LZO_LIBS"], [AS_IF([test "x$with_lzo" != "xcheck"],
+AS_IF([test -z "$LZO_LIBS"], [AS_IF([test "x$with_lzo" = "xyes"],
                                    [AC_MSG_ERROR([cannot find liblzo])],
                                    [with_lzo="no"])],
                             [with_lzo="yes"])
index 7112d6e8af74e50151f961ab245ed9505b02d919..ee8d04088e12a50fe0c4e340a08bec9602caf99f 100644 (file)
@@ -4,7 +4,6 @@ mkfs_jffs2_SOURCES = \
        jffsX-utils/compr_zlib.c \
        jffsX-utils/compr.h \
        jffsX-utils/rbtree.c \
-       jffsX-utils/compr_lzo.c \
        jffsX-utils/compr.c \
        jffsX-utils/compr_rtime.c \
        jffsX-utils/compr.h \
@@ -27,6 +26,10 @@ jffs2dump_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS)
 sumtool_SOURCES = jffsX-utils/sumtool.c jffsX-utils/summary.h
 sumtool_LDADD = libmtd.a
 
+if WITH_LZO
+mkfs_jffs2_SOURCES += jffsX-utils/compr_lzo.c
+endif
+
 EXTRA_DIST += jffsX-utils/device_table.txt jffsX-utils/mkfs.jffs2.1
 
 dist_man1_MANS += jffsX-utils/mkfs.jffs2.1
index 337ebe9528e2eeed7195b43498a4cb5a67612dce..ddd8d554c4c43c882b69b2db14dafdabd450d7d2 100644 (file)
@@ -24,8 +24,6 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-
-#ifdef WITH_LZO
 #include <asm/types.h>
 #include <linux/jffs2.h>
 #include <lzo/lzo1x.h>
@@ -121,16 +119,3 @@ 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