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 | |
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>
-rw-r--r-- | coreutils/uname.c | 14 | ||||
-rwxr-xr-x | size_single_applets.sh | 46 |
2 files changed, 53 insertions, 7 deletions
diff --git a/coreutils/uname.c b/coreutils/uname.c index 9c6a06ebb..1f19c933d 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c | |||
@@ -57,18 +57,18 @@ | |||
57 | //config: default is "GNU/Linux". | 57 | //config: default is "GNU/Linux". |
58 | //config: | 58 | //config: |
59 | //can't use "ARCH" for this applet, all hell breaks loose in build system :) | 59 | //can't use "ARCH" for this applet, all hell breaks loose in build system :) |
60 | //config:config BBARCH | 60 | //config:config BB_ARCH |
61 | //config: bool "arch" | 61 | //config: bool "arch" |
62 | //config: default y | 62 | //config: default y |
63 | //config: help | 63 | //config: help |
64 | //config: Same as uname -m. | 64 | //config: Same as uname -m. |
65 | 65 | ||
66 | //applet:IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) | 66 | //applet:IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) |
67 | // APPLET_ODDNAME:name main location suid_type help | 67 | // APPLET_ODDNAME:name main location suid_type help |
68 | //applet:IF_BBARCH(APPLET_ODDNAME(arch, uname, BB_DIR_BIN, BB_SUID_DROP, arch)) | 68 | //applet:IF_BB_ARCH(APPLET_ODDNAME(arch, uname, BB_DIR_BIN, BB_SUID_DROP, arch)) |
69 | 69 | ||
70 | //kbuild:lib-$(CONFIG_UNAME) += uname.o | 70 | //kbuild:lib-$(CONFIG_UNAME) += uname.o |
71 | //kbuild:lib-$(CONFIG_BBARCH) += uname.o | 71 | //kbuild:lib-$(CONFIG_BB_ARCH) += uname.o |
72 | 72 | ||
73 | /* BB_AUDIT SUSv3 compliant */ | 73 | /* BB_AUDIT SUSv3 compliant */ |
74 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/uname.html */ | 74 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/uname.html */ |
@@ -131,7 +131,7 @@ int uname_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
131 | toprint = (1 << 4); /* "arch" = "uname -m" */ | 131 | toprint = (1 << 4); /* "arch" = "uname -m" */ |
132 | 132 | ||
133 | #if ENABLE_UNAME | 133 | #if ENABLE_UNAME |
134 | if (!ENABLE_BBARCH || applet_name[0] == 'u') { | 134 | if (!ENABLE_BB_ARCH || applet_name[0] == 'u') { |
135 | # if ENABLE_LONG_OPTS | 135 | # if ENABLE_LONG_OPTS |
136 | static const char uname_longopts[] ALIGN1 = | 136 | static const char uname_longopts[] ALIGN1 = |
137 | /* name, has_arg, val */ | 137 | /* name, has_arg, val */ |
@@ -172,7 +172,7 @@ int uname_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
172 | } | 172 | } |
173 | } | 173 | } |
174 | #endif | 174 | #endif |
175 | if (ENABLE_BBARCH && (!ENABLE_UNAME || applet_name[0] == 'a')) { | 175 | if (ENABLE_BB_ARCH && (!ENABLE_UNAME || applet_name[0] == 'a')) { |
176 | puts(uname_info.name.machine); | 176 | puts(uname_info.name.machine); |
177 | } else { | 177 | } else { |
178 | #if ENABLE_UNAME | 178 | #if ENABLE_UNAME |
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 | ||