Tweaks from mass recompile for 1.27.1 release
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 18 Jul 2017 18:17:51 +0000 (20:17 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 18 Jul 2017 18:17:51 +0000 (20:17 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/uname.c
size_single_applets.sh [new file with mode: 0755]

index 9c6a06ebbc8875f77297c620198250f305dc55d5..1f19c933db802abb889194623af79d3144002d95 100644 (file)
 //config:        default is "GNU/Linux".
 //config:
 //can't use "ARCH" for this applet, all hell breaks loose in build system :)
-//config:config BBARCH
+//config:config BB_ARCH
 //config:      bool "arch"
 //config:      default y
 //config:      help
 //config:        Same as uname -m.
 
 //applet:IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP))
-//                 APPLET_ODDNAME:name  main   location    suid_type     help
-//applet:IF_BBARCH(APPLET_ODDNAME(arch, uname, BB_DIR_BIN, BB_SUID_DROP, arch))
+//                  APPLET_ODDNAME:name  main   location    suid_type     help
+//applet:IF_BB_ARCH(APPLET_ODDNAME(arch, uname, BB_DIR_BIN, BB_SUID_DROP, arch))
 
-//kbuild:lib-$(CONFIG_UNAME)  += uname.o
-//kbuild:lib-$(CONFIG_BBARCH) += uname.o
+//kbuild:lib-$(CONFIG_UNAME)   += uname.o
+//kbuild:lib-$(CONFIG_BB_ARCH) += uname.o
 
 /* BB_AUDIT SUSv3 compliant */
 /* http://www.opengroup.org/onlinepubs/007904975/utilities/uname.html */
@@ -131,7 +131,7 @@ int uname_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
        toprint = (1 << 4); /* "arch" = "uname -m" */
 
 #if ENABLE_UNAME
-       if (!ENABLE_BBARCH || applet_name[0] == 'u') {
+       if (!ENABLE_BB_ARCH || applet_name[0] == 'u') {
 # if ENABLE_LONG_OPTS
                static const char uname_longopts[] ALIGN1 =
                        /* name, has_arg, val */
@@ -172,7 +172,7 @@ int uname_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
                }
        }
 #endif
-       if (ENABLE_BBARCH && (!ENABLE_UNAME || applet_name[0] == 'a')) {
+       if (ENABLE_BB_ARCH && (!ENABLE_UNAME || applet_name[0] == 'a')) {
                puts(uname_info.name.machine);
        } else {
 #if ENABLE_UNAME
diff --git a/size_single_applets.sh b/size_single_applets.sh
new file mode 100755 (executable)
index 0000000..d59ab04
--- /dev/null
@@ -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