diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-06 19:16:36 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-06 19:16:36 +0100 |
commit | fe93624fb69e3858ebaea2d9e53e0522c1025698 (patch) | |
tree | 2e33e0d8f29068eb1220c90ae5ba78fb1c652cbd | |
parent | 6cd0294725cf40a3ef0bb0a1dcc7a7044a85cbf5 (diff) | |
download | busybox-w32-fe93624fb69e3858ebaea2d9e53e0522c1025698.tar.gz busybox-w32-fe93624fb69e3858ebaea2d9e53e0522c1025698.tar.bz2 busybox-w32-fe93624fb69e3858ebaea2d9e53e0522c1025698.zip |
Automatically disable FEATURE_COMPRESS_USAGE for small builds.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-x | applets/usage_compressed | 3 | ||||
-rw-r--r-- | libbb/appletlib.c | 26 |
2 files changed, 29 insertions, 0 deletions
diff --git a/applets/usage_compressed b/applets/usage_compressed index 186fcde77..36fc2a007 100755 --- a/applets/usage_compressed +++ b/applets/usage_compressed | |||
@@ -36,6 +36,9 @@ echo '' | |||
36 | #0000040 114 105 135 040 133 055 141 040 101 103 124 111 117 116 106 111 | 36 | #0000040 114 105 135 040 133 055 141 040 101 103 124 111 117 116 106 111 |
37 | # 042514 020135 026533 020141 041501 044524 047117 044506 | 37 | # 042514 020135 026533 020141 041501 044524 047117 044506 |
38 | 38 | ||
39 | echo "#define UNPACKED_USAGE_LENGTH `$loc/usage | wc -c`" | ||
40 | echo | ||
41 | |||
39 | echo '#define PACKED_USAGE \' | 42 | echo '#define PACKED_USAGE \' |
40 | ## Breaks on big-endian systems! | 43 | ## Breaks on big-endian systems! |
41 | ## # Extra effort to avoid using "od -t x1": -t is not available | 44 | ## # Extra effort to avoid using "od -t x1": -t is not available |
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 @@ | |||
52 | 52 | ||
53 | #include "usage_compressed.h" | 53 | #include "usage_compressed.h" |
54 | 54 | ||
55 | |||
56 | /* "Do not compress usage text if uncompressed text is small | ||
57 | * and we don't include bunzip2 code for other reasons" | ||
58 | * | ||
59 | * Useful for mass one-applet rebuild (bunzip2 code is ~2.7k). | ||
60 | * | ||
61 | * Unlike BUNZIP2, if FEATURE_SEAMLESS_BZ2 is on, bunzip2 code is built but | ||
62 | * still may be unused if none of the selected applets calls open_zipped() | ||
63 | * or its friends; we test for (FEATURE_SEAMLESS_BZ2 && <APPLET>) instead. | ||
64 | * For example, only if TAR and FEATURE_SEAMLESS_BZ2 are both selected, | ||
65 | * then bunzip2 code will be linked in anyway, and disabling help compression | ||
66 | * would be not optimal: | ||
67 | */ | ||
68 | #if UNPACKED_USAGE_LENGTH < 4*1024 \ | ||
69 | && !(ENABLE_FEATURE_SEAMLESS_BZ2 && ENABLE_TAR) \ | ||
70 | && !(ENABLE_FEATURE_SEAMLESS_BZ2 && ENABLE_MODPROBE) \ | ||
71 | && !(ENABLE_FEATURE_SEAMLESS_BZ2 && ENABLE_INSMOD) \ | ||
72 | && !(ENABLE_FEATURE_SEAMLESS_BZ2 && ENABLE_DEPMOD) \ | ||
73 | && !(ENABLE_FEATURE_SEAMLESS_BZ2 && ENABLE_MAN) \ | ||
74 | && !ENABLE_BUNZIP2 \ | ||
75 | && !ENABLE_BZCAT | ||
76 | # undef ENABLE_FEATURE_COMPRESS_USAGE | ||
77 | # define ENABLE_FEATURE_COMPRESS_USAGE 0 | ||
78 | #endif | ||
79 | |||
80 | |||
55 | #if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE | 81 | #if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE |
56 | static const char usage_messages[] ALIGN1 = UNPACKED_USAGE; | 82 | static const char usage_messages[] ALIGN1 = UNPACKED_USAGE; |
57 | #else | 83 | #else |