*: fix places where we were still using malloc/realloc
[oweals/busybox.git] / shell / Config.in
1 #
2 # For a description of the syntax of this configuration file,
3 # see scripts/kbuild/config-language.txt.
4 #
5
6 menu "Shells"
7
8 choice
9         prompt "Choose your default shell"
10         default FEATURE_SH_IS_NONE
11         help
12           Choose a shell. The ash shell is the most bash compatible
13           and full featured one.
14
15 config FEATURE_SH_IS_ASH
16         select ASH
17         bool "ash"
18         depends on !NOMMU
19
20 config FEATURE_SH_IS_HUSH
21         select HUSH
22         bool "hush"
23
24 ####config FEATURE_SH_IS_LASH
25 ####    select LASH
26 ####    bool "lash"
27
28 ####config FEATURE_SH_IS_MSH
29 ####    select MSH
30 ####    bool "msh"
31
32 config FEATURE_SH_IS_NONE
33         bool "none"
34
35 endchoice
36
37 config ASH
38         bool "ash"
39         default n
40         depends on !NOMMU
41         help
42           Tha 'ash' shell adds about 60k in the default configuration and is
43           the most complete and most pedantically correct shell included with
44           busybox. This shell is actually a derivative of the Debian 'dash'
45           shell (by Herbert Xu), which was created by porting the 'ash' shell
46           (written by Kenneth Almquist) from NetBSD.
47
48 config ASH_BASH_COMPAT
49         bool "bash-compatible extensions"
50         default y
51         depends on ASH
52         help
53           Enable bash-compatible extensions.
54
55 config ASH_JOB_CONTROL
56         bool "Job control"
57         default y
58         depends on ASH
59         help
60           Enable job control in the ash shell.
61
62 config ASH_READ_NCHARS
63         bool "'read -n N' and 'read -s' support"
64         default n
65         depends on ASH
66         help
67           'read -n N' will return a value after N characters have been read.
68           'read -s' will read without echoing the user's input.
69
70 config ASH_READ_TIMEOUT
71         bool "'read -t S' support"
72         default n
73         depends on ASH
74         help
75           'read -t S' will return a value after S seconds have passed.
76           This implementation will allow fractional seconds, expressed
77           as a decimal fraction, e.g. 'read -t 2.5 foo'.
78
79 config ASH_ALIAS
80         bool "alias support"
81         default y
82         depends on ASH
83         help
84           Enable alias support in the ash shell.
85
86 config ASH_GETOPTS
87         bool "Builtin getopt to parse positional parameters"
88         default n
89         depends on ASH
90         help
91           Enable getopts builtin in the ash shell.
92
93 config ASH_BUILTIN_ECHO
94         bool "Builtin version of 'echo'"
95         default y
96         depends on ASH
97         help
98           Enable support for echo, builtin to ash.
99
100 config ASH_BUILTIN_PRINTF
101         bool "Builtin version of 'printf'"
102         default y
103         depends on ASH
104         help
105           Enable support for printf, builtin to ash.
106
107 config ASH_BUILTIN_TEST
108         bool "Builtin version of 'test'"
109         default y
110         depends on ASH
111         help
112           Enable support for test, builtin to ash.
113
114 config ASH_CMDCMD
115         bool "'command' command to override shell builtins"
116         default n
117         depends on ASH
118         help
119           Enable support for the ash 'command' builtin, which allows
120           you to run the specified command with the specified arguments,
121           even when there is an ash builtin command with the same name.
122
123 config ASH_MAIL
124         bool "Check for new mail on interactive shells"
125         default y
126         depends on ASH
127         help
128           Enable "check for new mail" in the ash shell.
129
130 config ASH_OPTIMIZE_FOR_SIZE
131         bool "Optimize for size instead of speed"
132         default y
133         depends on ASH
134         help
135           Compile ash for reduced size at the price of speed.
136
137 config ASH_RANDOM_SUPPORT
138         bool "Pseudorandom generator and $RANDOM variable"
139         default n
140         depends on ASH
141         help
142           Enable pseudorandom generator and dynamic variable "$RANDOM".
143           Each read of "$RANDOM" will generate a new pseudorandom value.
144           You can reset the generator by using a specified start value.
145           After "unset RANDOM" the generator will switch off and this
146           variable will no longer have special treatment.
147
148 config ASH_EXPAND_PRMT
149         bool "Expand prompt string"
150         default n
151         depends on ASH
152         help
153           "PS#" may contain volatile content, such as backquote commands.
154           This option recreates the prompt string from the environment
155           variable each time it is displayed.
156
157 config HUSH
158         bool "hush"
159         default n
160         help
161           hush is a small shell (22k). It handles the normal flow control
162           constructs such as if/then/elif/else/fi, for/in/do/done, while loops,
163           case/esac. Redirections, here documents, $((arithmetic))
164           and functions are supported.
165
166           It will compile and work on no-mmu systems.
167
168           It does not handle select, aliases, brace expansion,
169           tilde expansion, &>file and >&file redirection of stdout+stderr.
170
171 config HUSH_BASH_COMPAT
172         bool "bash-compatible extensions"
173         default y
174         depends on HUSH
175         help
176           Enable bash-compatible extensions.
177
178 config HUSH_HELP
179         bool "help builtin"
180         default n
181         depends on HUSH
182         help
183           Enable help builtin in hush. Code size + ~1 kbyte.
184
185 config HUSH_INTERACTIVE
186         bool "Interactive mode"
187         default y
188         depends on HUSH
189         help
190           Enable interactive mode (prompt and command editing).
191           Without this, hush simply reads and executes commands
192           from stdin just like a shell script from a file.
193           No prompt, no PS1/PS2 magic shell variables.
194
195 config HUSH_JOB
196         bool "Job control"
197         default n
198         depends on HUSH_INTERACTIVE
199         help
200           Enable job control: Ctrl-Z backgrounds, Ctrl-C interrupts current
201           command (not entire shell), fg/bg builtins work. Without this option,
202           "cmd &" still works by simply spawning a process and immediately
203           prompting for next command (or executing next command in a script),
204           but no separate process group is formed.
205
206 config HUSH_TICK
207         bool "Process substitution"
208         default n
209         depends on HUSH
210         help
211           Enable process substitution `command` and $(command) in hush.
212
213 config HUSH_IF
214         bool "Support if/then/elif/else/fi"
215         default n
216         depends on HUSH
217         help
218           Enable if/then/elif/else/fi in hush.
219
220 config HUSH_LOOPS
221         bool "Support for, while and until loops"
222         default n
223         depends on HUSH
224         help
225           Enable for, while and until loops in hush.
226
227 config HUSH_CASE
228         bool "Support case ... esac statement"
229         default n
230         depends on HUSH
231         help
232           Enable case ... esac statement in hush. +400 bytes.
233
234 config HUSH_FUNCTIONS
235         bool "Support funcname() { commands; } syntax"
236         default n
237         depends on HUSH
238         help
239           Enable support for shell functions in hush. +800 bytes.
240
241 config HUSH_LOCAL
242         bool "Support local builtin"
243         default n
244         depends on HUSH_FUNCTIONS
245         help
246           Enable support for local variables in functions.
247
248 config HUSH_EXPORT_N
249         bool "Support export '-n' option"
250         default n
251         depends on HUSH
252         help
253           Enable support for export '-n' option in hush. It is a bash extension.
254
255 config HUSH_RANDOM_SUPPORT
256         bool "Pseudorandom generator and $RANDOM variable"
257         default n
258         depends on HUSH
259         help
260           Enable pseudorandom generator and dynamic variable "$RANDOM".
261           Each read of "$RANDOM" will generate a new pseudorandom value.
262
263 config LASH
264         bool "lash (deprecated: aliased to hush)"
265         default n
266         select HUSH
267         help
268           lash is deprecated and will be removed, please migrate to hush.
269
270 config MSH
271         bool "msh (deprecated: please use hush)"
272         default n
273         select HUSH
274         help
275           msh is deprecated and will be removed, please migrate to hush.
276           If there is a feature msh has but hush does not, please let us know.
277
278 #         The minix shell (adds just 30k) is quite complete and handles things
279 #         like for/do/done, case/esac and all the things you expect a Bourne
280 #         shell to do. It is not always pedantically correct about Bourne
281 #         shell grammar (try running the shell testscript "tests/sh.testcases"
282 #         on it and compare vs bash) but for most things it works quite well.
283 #         It uses only vfork, so it can be used on uClinux systems.
284
285
286 config SH_MATH_SUPPORT
287         bool "POSIX math support"
288         default y
289         depends on ASH || HUSH
290         help
291           Enable math support in the shell via $((...)) syntax.
292
293 config SH_MATH_SUPPORT_64
294         bool "Extend POSIX math support to 64 bit"
295         default n
296         depends on SH_MATH_SUPPORT
297         help
298           Enable 64-bit math support in the shell. This will make the shell
299           slightly larger, but will allow computation with very large numbers.
300           This is not in POSIX, so do not rely on this in portable code.
301
302 config FEATURE_SH_EXTRA_QUIET
303         bool "Hide message on interactive shell startup"
304         default n
305         depends on MSH || LASH || HUSH || ASH
306         help
307           Remove the busybox introduction when starting a shell.
308
309 config FEATURE_SH_STANDALONE
310         bool "Standalone shell"
311         default n
312         depends on (MSH || LASH || HUSH || ASH) && FEATURE_PREFER_APPLETS
313         help
314           This option causes busybox shells to use busybox applets
315           in preference to executables in the PATH whenever possible. For
316           example, entering the command 'ifconfig' into the shell would cause
317           busybox to use the ifconfig busybox applet. Specifying the fully
318           qualified executable name, such as '/sbin/ifconfig' will still
319           execute the /sbin/ifconfig executable on the filesystem. This option
320           is generally used when creating a statically linked version of busybox
321           for use as a rescue shell, in the event that you screw up your system.
322
323           This is implemented by re-execing /proc/self/exe (typically)
324           with right parameters. Some selected applets ("NOFORK" applets)
325           can even be executed without creating new process.
326           Instead, busybox will call <applet>_main() internally.
327
328           However, this causes problems in chroot jails without mounted /proc
329           and with ps/top (command name can be shown as 'exe' for applets
330           started this way).
331 # untrue?
332 #         Note that this will *also* cause applets to take precedence
333 #         over shell builtins of the same name. So turning this on will
334 #         eliminate any performance gained by turning on the builtin "echo"
335 #         and "test" commands in ash.
336 # untrue?
337 #         Note that when using this option, the shell will attempt to directly
338 #         run '/bin/busybox'. If you do not have the busybox binary sitting in
339 #         that exact location with that exact name, this option will not work at
340 #         all.
341
342 config FEATURE_SH_NOFORK
343         bool "Run 'nofork' applets directly"
344         default n
345         depends on (MSH || LASH || HUSH || ASH) && FEATURE_PREFER_APPLETS
346         help
347           This option causes busybox shells [currently only ash]
348           to not execute typical fork/exec/wait sequence, but call <applet>_main
349           directly, if possible. (Sometimes it is not possible: for example,
350           this is not possible in pipes).
351
352           This will be done only for some applets (those which are marked
353           NOFORK in include/applets.h).
354
355           This may significantly speed up some shell scripts.
356
357           This feature is relatively new. Use with care.
358
359 config CTTYHACK
360         bool "cttyhack"
361         default n
362         help
363           One common problem reported on the mailing list is "can't access tty;
364           job control turned off" error message which typically appears when
365           one tries to use shell with stdin/stdout opened to /dev/console.
366           This device is special - it cannot be a controlling tty.
367
368           Proper solution is to use correct device instead of /dev/console.
369
370           cttyhack provides "quick and dirty" solution to this problem.
371           It analyzes stdin with various ioctls, trying to determine whether
372           it is a /dev/ttyN or /dev/ttySN (virtual terminal or serial line).
373           If it detects one, it closes stdin/out/err and reopens that device.
374           Then it executes given program. Usage example for /etc/inittab
375           (for busybox init):
376
377           ::respawn:/bin/cttyhack /bin/sh
378
379 endmenu