aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-01-06 19:16:36 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2017-01-06 19:16:36 +0100
commitfe93624fb69e3858ebaea2d9e53e0522c1025698 (patch)
tree2e33e0d8f29068eb1220c90ae5ba78fb1c652cbd /libbb
parent6cd0294725cf40a3ef0bb0a1dcc7a7044a85cbf5 (diff)
downloadbusybox-fe93624fb69e3858ebaea2d9e53e0522c1025698.tar.gz
Automatically disable FEATURE_COMPRESS_USAGE for small builds.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 805cd3ae6..bf6d4762c 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -52,6 +52,32 @@
#include "usage_compressed.h"
+
+/* "Do not compress usage text if uncompressed text is small
+ * 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:
+ */
+#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
+# undef ENABLE_FEATURE_COMPRESS_USAGE
+# define ENABLE_FEATURE_COMPRESS_USAGE 0
+#endif
+
+
#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE
static const char usage_messages[] ALIGN1 = UNPACKED_USAGE;
#else