As long as FEATURE_SEAMLESS_BZ2 depends on FEATURE_HAVE_SEAMLESS_COMPRESSION, we won't need to check individual applets that use seamless compression.
Also add the missing FEATURE_UNZIP_BZIP2 to the preprocessor check. TODO: See if we need to address FEATURE_COMPRESS_BBCONFIG here as well. Signed-off-by: Kang-Che Sung <explore...@gmail.com> --- libbb/appletlib.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 7f0d62060..02ffd319b 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c @@ -57,22 +57,15 @@ * and we don't include bunzip2 code for other reasons" * * Useful for mass one-applet rebuild (bunzip2 code is ~2.7k). - * - * Unlike BUNZIP2, if FEATURE_SEAMLESS_BZ2 is on, bunzip2 code is built but - * still may be unused if none of the selected applets calls open_zipped() - * or its friends; we test for (FEATURE_SEAMLESS_BZ2 && <APPLET>) instead. - * For example, only if TAR and FEATURE_SEAMLESS_BZ2 are both selected, - * then bunzip2 code will be linked in anyway, and disabling help compression - * would be not optimal: */ +/* Note: Please keep USE_BUNZIP2_CODE in sync with the entries in + * archival/libarchive/Kbuild.src */ +#define USE_BUNZIP2_CODE (ENABLE_FEATURE_SEAMLESS_BZ2 \ + || ENABLE_FEATURE_BZIP2_DECOMPRESS \ + || ENABLE_FEATURE_UNZIP_BZIP2) + #if UNPACKED_USAGE_LENGTH < 4*1024 \ - && !(ENABLE_FEATURE_SEAMLESS_BZ2 && ENABLE_TAR) \ - && !(ENABLE_FEATURE_SEAMLESS_BZ2 && ENABLE_MODPROBE) \ - && !(ENABLE_FEATURE_SEAMLESS_BZ2 && ENABLE_INSMOD) \ - && !(ENABLE_FEATURE_SEAMLESS_BZ2 && ENABLE_DEPMOD) \ - && !(ENABLE_FEATURE_SEAMLESS_BZ2 && ENABLE_MAN) \ - && !ENABLE_BUNZIP2 \ - && !ENABLE_BZCAT + && !USE_BUNZIP2_CODE # undef ENABLE_FEATURE_COMPRESS_USAGE # define ENABLE_FEATURE_COMPRESS_USAGE 0 #endif -- 2.11.0 _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox