diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-18 20:17:51 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-18 20:17:51 +0200 |
commit | 483405a9b0df6ea14344b1144959be1debef925e (patch) | |
tree | 4aeb87458ccc564621985c181142e2498d0b8d9f /size_single_applets.sh | |
parent | d2c15bc7633d91400a46700af78bb36b2aa0a402 (diff) | |
download | busybox-w32-483405a9b0df6ea14344b1144959be1debef925e.tar.gz busybox-w32-483405a9b0df6ea14344b1144959be1debef925e.tar.bz2 busybox-w32-483405a9b0df6ea14344b1144959be1debef925e.zip |
Tweaks from mass recompile for 1.27.1 release
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'size_single_applets.sh')
-rwxr-xr-x | size_single_applets.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/size_single_applets.sh b/size_single_applets.sh new file mode 100755 index 000000000..d59ab045b --- /dev/null +++ b/size_single_applets.sh | |||
@@ -0,0 +1,46 @@ | |||
1 | #!/bin/bash | ||
2 | # The list of all applet config symbols | ||
3 | test -f include/applets.h || { echo "No include/applets.h file"; exit 1; } | ||
4 | apps="` | ||
5 | grep ^IF_ include/applets.h \ | ||
6 | | grep -v ^IF_FEATURE_ \ | ||
7 | | sed 's/IF_\([A-Z0-9._-]*\)(.*/\1/' \ | ||
8 | | sort | uniq | ||
9 | `" | ||
10 | |||
11 | # Take existing config | ||
12 | test -f .config || { echo "No .config file"; exit 1; } | ||
13 | cfg="`cat .config`" | ||
14 | |||
15 | # Make a config with all applet symbols off | ||
16 | allno="$cfg" | ||
17 | for app in $apps; do | ||
18 | allno="`echo "$allno" | sed "s/^CONFIG_${app}=y\$/# CONFIG_${app} is not set/"`" | ||
19 | done | ||
20 | #echo "$allno" >.config_allno | ||
21 | |||
22 | test $# = 0 && set -- $apps | ||
23 | |||
24 | mintext=999999999 | ||
25 | for app; do | ||
26 | b="busybox_${app}" | ||
27 | test -f "$b" || continue | ||
28 | text=`size "$b" | tail -1 | sed -e's/\t/ /g' -e's/^ *//' -e's/ .*//'` | ||
29 | #echo "text from $app: $text" | ||
30 | test x"${text//[0123456789]/}" = x"" || { | ||
31 | echo "Can't get: size $b" | ||
32 | exit 1 | ||
33 | } | ||
34 | test $mintext -gt $text && { | ||
35 | mintext=$text | ||
36 | echo "New mintext from $app: $mintext" | ||
37 | } | ||
38 | eval "text_${app}=$text" | ||
39 | done | ||
40 | |||
41 | for app; do | ||
42 | b="busybox_${app}" | ||
43 | test -f "$b" || continue | ||
44 | eval "text=\$text_${app}" | ||
45 | echo "$app adds $((text-mintext))" | ||
46 | done | ||