diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-01 14:47:57 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-01 14:47:57 +0000 |
commit | 468aea2d8800cc0496383616d82d7c957ae8bc50 (patch) | |
tree | 8a2f3d80dc2440dd007caed4cfa235b3858c9170 /shell | |
parent | 165f5b394fa337e71e08435b51108f4394199b2b (diff) | |
download | busybox-w32-468aea2d8800cc0496383616d82d7c957ae8bc50.tar.gz busybox-w32-468aea2d8800cc0496383616d82d7c957ae8bc50.tar.bz2 busybox-w32-468aea2d8800cc0496383616d82d7c957ae8bc50.zip |
shells: do not frocibly enable test, echo and kill _applets_,
just build relevant source and use xxx_main functions.
build system: add a special case when we have exactly one applet enabled
(makes "true", "false", "basename" REALLY tiny).
getopt32: do not use stdio.
function old new delta
getopt32 1385 1412 +27
make_device 1187 1200 +13
basename_main 120 127 +7
tcpudpsvd_main 1922 1926 +4
testcmd 5 - -5
echocmd 5 - -5
fuser_main 1243 1231 -12
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 4/1 up/down: 51/-22) Total: 29 bytes
Diffstat (limited to 'shell')
-rw-r--r-- | shell/Config.in | 11 | ||||
-rw-r--r-- | shell/ash.c | 25 |
2 files changed, 3 insertions, 33 deletions
diff --git a/shell/Config.in b/shell/Config.in index 5ea071c36..40e0217f4 100644 --- a/shell/Config.in +++ b/shell/Config.in | |||
@@ -36,7 +36,6 @@ endchoice | |||
36 | config ASH | 36 | config ASH |
37 | bool "ash" | 37 | bool "ash" |
38 | default n | 38 | default n |
39 | select TEST | ||
40 | help | 39 | help |
41 | Tha 'ash' shell adds about 60k in the default configuration and is | 40 | Tha 'ash' shell adds about 60k in the default configuration and is |
42 | the most complete and most pedantically correct shell included with | 41 | the most complete and most pedantically correct shell included with |
@@ -111,7 +110,6 @@ config ASH_GETOPTS | |||
111 | config ASH_BUILTIN_ECHO | 110 | config ASH_BUILTIN_ECHO |
112 | bool "Builtin version of 'echo'" | 111 | bool "Builtin version of 'echo'" |
113 | default y | 112 | default y |
114 | select ECHO | ||
115 | depends on ASH | 113 | depends on ASH |
116 | help | 114 | help |
117 | Enable support for echo, builtin to ash. | 115 | Enable support for echo, builtin to ash. |
@@ -119,7 +117,6 @@ config ASH_BUILTIN_ECHO | |||
119 | config ASH_BUILTIN_TEST | 117 | config ASH_BUILTIN_TEST |
120 | bool "Builtin version of 'test'" | 118 | bool "Builtin version of 'test'" |
121 | default y | 119 | default y |
122 | select TEST | ||
123 | depends on ASH | 120 | depends on ASH |
124 | help | 121 | help |
125 | Enable support for test, builtin to ash. | 122 | Enable support for test, builtin to ash. |
@@ -170,10 +167,6 @@ config ASH_EXPAND_PRMT | |||
170 | config HUSH | 167 | config HUSH |
171 | bool "hush" | 168 | bool "hush" |
172 | default n | 169 | default n |
173 | select TRUE | ||
174 | select FALSE | ||
175 | select TEST | ||
176 | select ECHO | ||
177 | help | 170 | help |
178 | hush is a very small shell (just 18k) and it has fairly complete | 171 | hush is a very small shell (just 18k) and it has fairly complete |
179 | Bourne shell grammar. It even handles all the normal flow control | 172 | Bourne shell grammar. It even handles all the normal flow control |
@@ -240,13 +233,9 @@ config LASH | |||
240 | help | 233 | help |
241 | lash is deprecated and will be removed, please migrate to hush. | 234 | lash is deprecated and will be removed, please migrate to hush. |
242 | 235 | ||
243 | |||
244 | config MSH | 236 | config MSH |
245 | bool "msh" | 237 | bool "msh" |
246 | default n | 238 | default n |
247 | select TRUE | ||
248 | select FALSE | ||
249 | select TEST | ||
250 | help | 239 | help |
251 | The minix shell (adds just 30k) is quite complete and handles things | 240 | The minix shell (adds just 30k) is quite complete and handles things |
252 | like for/do/done, case/esac and all the things you expect a Bourne | 241 | like for/do/done, case/esac and all the things you expect a Bourne |
diff --git a/shell/ash.c b/shell/ash.c index 3651929c2..360d39b4c 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -8417,12 +8417,6 @@ returncmd(int argc ATTRIBUTE_UNUSED, char **argv) | |||
8417 | static int breakcmd(int, char **); | 8417 | static int breakcmd(int, char **); |
8418 | static int dotcmd(int, char **); | 8418 | static int dotcmd(int, char **); |
8419 | static int evalcmd(int, char **); | 8419 | static int evalcmd(int, char **); |
8420 | #if ENABLE_ASH_BUILTIN_ECHO | ||
8421 | static int echocmd(int, char **); | ||
8422 | #endif | ||
8423 | #if ENABLE_ASH_BUILTIN_TEST | ||
8424 | static int testcmd(int, char **); | ||
8425 | #endif | ||
8426 | static int exitcmd(int, char **); | 8420 | static int exitcmd(int, char **); |
8427 | static int exportcmd(int, char **); | 8421 | static int exportcmd(int, char **); |
8428 | #if ENABLE_ASH_GETOPTS | 8422 | #if ENABLE_ASH_GETOPTS |
@@ -8464,6 +8458,9 @@ static int ulimitcmd(int, char **); | |||
8464 | * Apart from the above, [[ expr ]] should work as [ expr ] | 8458 | * Apart from the above, [[ expr ]] should work as [ expr ] |
8465 | */ | 8459 | */ |
8466 | 8460 | ||
8461 | #define testcmd test_main | ||
8462 | #define echocmd echo_main | ||
8463 | |||
8467 | /* Keep these in proper order since it is searched via bsearch() */ | 8464 | /* Keep these in proper order since it is searched via bsearch() */ |
8468 | static const struct builtincmd builtintab[] = { | 8465 | static const struct builtincmd builtintab[] = { |
8469 | { BUILTIN_SPEC_REG ".", dotcmd }, | 8466 | { BUILTIN_SPEC_REG ".", dotcmd }, |
@@ -11506,22 +11503,6 @@ exitcmd(int argc ATTRIBUTE_UNUSED, char **argv) | |||
11506 | /* NOTREACHED */ | 11503 | /* NOTREACHED */ |
11507 | } | 11504 | } |
11508 | 11505 | ||
11509 | #if ENABLE_ASH_BUILTIN_ECHO | ||
11510 | static int | ||
11511 | echocmd(int argc, char **argv) | ||
11512 | { | ||
11513 | return echo_main(argc, argv); | ||
11514 | } | ||
11515 | #endif | ||
11516 | |||
11517 | #if ENABLE_ASH_BUILTIN_TEST | ||
11518 | static int | ||
11519 | testcmd(int argc, char **argv) | ||
11520 | { | ||
11521 | return test_main(argc, argv); | ||
11522 | } | ||
11523 | #endif | ||
11524 | |||
11525 | /* | 11506 | /* |
11526 | * Read a file containing shell functions. | 11507 | * Read a file containing shell functions. |
11527 | */ | 11508 | */ |