aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/Kbuild.src12
-rw-r--r--shell/hush.c29
2 files changed, 24 insertions, 17 deletions
diff --git a/coreutils/Kbuild.src b/coreutils/Kbuild.src
index 9ac6b9e78..d0b3f629b 100644
--- a/coreutils/Kbuild.src
+++ b/coreutils/Kbuild.src
@@ -14,15 +14,11 @@ lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty
14lib-$(CONFIG_LESS) += cat.o # less too 14lib-$(CONFIG_LESS) += cat.o # less too
15lib-$(CONFIG_CRONTAB) += cat.o # crontab -l 15lib-$(CONFIG_CRONTAB) += cat.o # crontab -l
16lib-$(CONFIG_ADDUSER) += chown.o # used by adduser 16lib-$(CONFIG_ADDUSER) += chown.o # used by adduser
17lib-$(CONFIG_ADDGROUP) += chown.o # used by adduser 17lib-$(CONFIG_ADDGROUP) += chown.o # used by addgroup
18lib-$(CONFIG_FTPD) += ls.o # used by ftpd 18lib-$(CONFIG_FTPD) += ls.o # used by ftpd
19 19
20lib-$(CONFIG_ASH) += echo.o # used by ash 20lib-$(CONFIG_ASH_BUILTIN_ECHO) += echo.o
21lib-$(CONFIG_SH_IS_ASH) += echo.o # used by ash 21lib-$(CONFIG_HUSH_ECHO) += echo.o
22lib-$(CONFIG_BASH_IS_ASH) += echo.o # used by ash
23lib-$(CONFIG_HUSH) += echo.o # used by hush
24lib-$(CONFIG_SH_IS_HUSH) += echo.o # used by hush
25lib-$(CONFIG_BASH_IS_HUSH) += echo.o # used by hush
26 22
27lib-$(CONFIG_ASH_BUILTIN_PRINTF) += printf.o 23lib-$(CONFIG_ASH_BUILTIN_PRINTF) += printf.o
28lib-$(CONFIG_HUSH_PRINTF) += printf.o 24lib-$(CONFIG_HUSH_PRINTF) += printf.o
diff --git a/shell/hush.c b/shell/hush.c
index 5c5715b3f..22d71cb07 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -195,6 +195,20 @@
195//config: This instructs hush to print commands before execution. 195//config: This instructs hush to print commands before execution.
196//config: Adds ~300 bytes. 196//config: Adds ~300 bytes.
197//config: 197//config:
198//config:config HUSH_ECHO
199//config: bool "echo builtin"
200//config: default y
201//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
202//config: help
203//config: Enable echo builtin in hush.
204//config:
205//config:config HUSH_PRINTF
206//config: bool "printf builtin"
207//config: default y
208//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
209//config: help
210//config: Enable printf builtin in hush.
211//config:
198//config:config HUSH_EXPORT 212//config:config HUSH_EXPORT
199//config: bool "export builtin" 213//config: bool "export builtin"
200//config: default y 214//config: default y
@@ -216,13 +230,6 @@
216//config: help 230//config: help
217//config: Enable help builtin in hush. Code size + ~1 kbyte. 231//config: Enable help builtin in hush. Code size + ~1 kbyte.
218//config: 232//config:
219//config:config HUSH_PRINTF
220//config: bool "printf builtin"
221//config: default y
222//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
223//config: help
224//config: Enable printf builtin in hush.
225//config:
226//config:config HUSH_KILL 233//config:config HUSH_KILL
227//config: bool "kill builtin (for kill %jobspec)" 234//config: bool "kill builtin (for kill %jobspec)"
228//config: default y 235//config: default y
@@ -934,7 +941,9 @@ struct globals {
934 941
935/* Function prototypes for builtins */ 942/* Function prototypes for builtins */
936static int builtin_cd(char **argv) FAST_FUNC; 943static int builtin_cd(char **argv) FAST_FUNC;
944#if ENABLE_HUSH_ECHO
937static int builtin_echo(char **argv) FAST_FUNC; 945static int builtin_echo(char **argv) FAST_FUNC;
946#endif
938static int builtin_eval(char **argv) FAST_FUNC; 947static int builtin_eval(char **argv) FAST_FUNC;
939static int builtin_exec(char **argv) FAST_FUNC; 948static int builtin_exec(char **argv) FAST_FUNC;
940static int builtin_exit(char **argv) FAST_FUNC; 949static int builtin_exit(char **argv) FAST_FUNC;
@@ -1091,7 +1100,9 @@ static const struct built_in_command bltins1[] = {
1091 * Maybe make it configurable? */ 1100 * Maybe make it configurable? */
1092static const struct built_in_command bltins2[] = { 1101static const struct built_in_command bltins2[] = {
1093 BLTIN("[" , builtin_test , NULL), 1102 BLTIN("[" , builtin_test , NULL),
1103#if ENABLE_HUSH_ECHO
1094 BLTIN("echo" , builtin_echo , NULL), 1104 BLTIN("echo" , builtin_echo , NULL),
1105#endif
1095#if ENABLE_HUSH_PRINTF 1106#if ENABLE_HUSH_PRINTF
1096 BLTIN("printf" , builtin_printf , NULL), 1107 BLTIN("printf" , builtin_printf , NULL),
1097#endif 1108#endif
@@ -8832,12 +8843,12 @@ static int FAST_FUNC builtin_test(char **argv)
8832{ 8843{
8833 return run_applet_main(argv, test_main); 8844 return run_applet_main(argv, test_main);
8834} 8845}
8835 8846#if ENABLE_HUSH_ECHO
8836static int FAST_FUNC builtin_echo(char **argv) 8847static int FAST_FUNC builtin_echo(char **argv)
8837{ 8848{
8838 return run_applet_main(argv, echo_main); 8849 return run_applet_main(argv, echo_main);
8839} 8850}
8840 8851#endif
8841#if ENABLE_HUSH_PRINTF 8852#if ENABLE_HUSH_PRINTF
8842static int FAST_FUNC builtin_printf(char **argv) 8853static int FAST_FUNC builtin_printf(char **argv)
8843{ 8854{