blob: d59ab045b4277cf0432935b17c4da5aae7951230 [file] [log] [blame]
Denys Vlasenko483405a2017-07-18 20:17:51 +02001#!/bin/bash
2# The list of all applet config symbols
3test -f include/applets.h || { echo "No include/applets.h file"; exit 1; }
4apps="`
5grep ^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
12test -f .config || { echo "No .config file"; exit 1; }
13cfg="`cat .config`"
14
15# Make a config with all applet symbols off
16allno="$cfg"
17for app in $apps; do
18 allno="`echo "$allno" | sed "s/^CONFIG_${app}=y\$/# CONFIG_${app} is not set/"`"
19done
20#echo "$allno" >.config_allno
21
22test $# = 0 && set -- $apps
23
24mintext=999999999
25for 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"
39done
40
41for app; do
42 b="busybox_${app}"
43 test -f "$b" || continue
44 eval "text=\$text_${app}"
45 echo "$app adds $((text-mintext))"
46done