summaryrefslogtreecommitdiff
path: root/size_single_applets.sh
diff options
context:
space:
mode:
authorDenys Vlasenko2017-07-18 20:17:51 +0200
committerDenys Vlasenko2017-07-18 20:17:51 +0200
commit483405a9b0df6ea14344b1144959be1debef925e (patch)
tree4aeb87458ccc564621985c181142e2498d0b8d9f /size_single_applets.sh
parentd2c15bc7633d91400a46700af78bb36b2aa0a402 (diff)
downloadbusybox-483405a9b0df6ea14344b1144959be1debef925e.zip
busybox-483405a9b0df6ea14344b1144959be1debef925e.tar.gz
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-xsize_single_applets.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/size_single_applets.sh b/size_single_applets.sh
new file mode 100755
index 0000000..d59ab04
--- /dev/null
+++ b/size_single_applets.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+# The list of all applet config symbols
+test -f include/applets.h || { echo "No include/applets.h file"; exit 1; }
+apps="`
+grep ^IF_ include/applets.h \
+| grep -v ^IF_FEATURE_ \
+| sed 's/IF_\([A-Z0-9._-]*\)(.*/\1/' \
+| sort | uniq
+`"
+
+# Take existing config
+test -f .config || { echo "No .config file"; exit 1; }
+cfg="`cat .config`"
+
+# Make a config with all applet symbols off
+allno="$cfg"
+for app in $apps; do
+ allno="`echo "$allno" | sed "s/^CONFIG_${app}=y\$/# CONFIG_${app} is not set/"`"
+done
+#echo "$allno" >.config_allno
+
+test $# = 0 && set -- $apps
+
+mintext=999999999
+for app; do
+ b="busybox_${app}"
+ test -f "$b" || continue
+ text=`size "$b" | tail -1 | sed -e's/\t/ /g' -e's/^ *//' -e's/ .*//'`
+ #echo "text from $app: $text"
+ test x"${text//[0123456789]/}" = x"" || {
+ echo "Can't get: size $b"
+ exit 1
+ }
+ test $mintext -gt $text && {
+ mintext=$text
+ echo "New mintext from $app: $mintext"
+ }
+ eval "text_${app}=$text"
+done
+
+for app; do
+ b="busybox_${app}"
+ test -f "$b" || continue
+ eval "text=\$text_${app}"
+ echo "$app adds $((text-mintext))"
+done