diff options
| author | Eric Andersen <andersen@codepoet.org> | 2001-07-06 19:24:27 +0000 |
|---|---|---|
| committer | Eric Andersen <andersen@codepoet.org> | 2001-07-06 19:24:27 +0000 |
| commit | 00e56ada9cd67851d8ff3a9660c6e4fd7816a266 (patch) | |
| tree | 77c9698acecbb239a4ee16d472fcc985c79b6d01 | |
| parent | 3bbcc95ac939f50e4319a1dcc0db9e1ba548ba70 (diff) | |
| download | busybox-w32-00e56ada9cd67851d8ff3a9660c6e4fd7816a266.tar.gz busybox-w32-00e56ada9cd67851d8ff3a9660c6e4fd7816a266.tar.bz2 busybox-w32-00e56ada9cd67851d8ff3a9660c6e4fd7816a266.zip | |
Let people select their shell at compile time.
| -rw-r--r-- | Config.h | 55 | ||||
| -rw-r--r-- | sh.c | 39 |
2 files changed, 94 insertions, 0 deletions
| @@ -144,6 +144,41 @@ | |||
| 144 | // pretty/useful). | 144 | // pretty/useful). |
| 145 | // | 145 | // |
| 146 | // | 146 | // |
| 147 | // If you enabled BB_SH above, you may select one of the following shells. | ||
| 148 | // You can only select ONE of the following shells. Sorry. | ||
| 149 | // | ||
| 150 | // lash is the very smallest shell (adds just 10k) and it is quite usable as a | ||
| 151 | // command prompt, but it is not suitable for any but the most trivial scripting | ||
| 152 | // (such as an initrd that calls insmod a few times) since it does not | ||
| 153 | // understand Bourne shell grammer. It does handle pipes, redirects, and job | ||
| 154 | // control though. Adding in command editing makes it very nice lightweight | ||
| 155 | // command prompt. | ||
| 156 | //#define BB_FEATURE_LASH | ||
| 157 | // | ||
| 158 | // hush is also quite small (just 18k) and it has very complete Bourne shell | ||
| 159 | // grammer. It handles if/then/else/fi just fine, but doesn't handle loops | ||
| 160 | // like for/do/done or case/esac and such. It also currently has a problem | ||
| 161 | // with job control. | ||
| 162 | //#define BB_FEATURE_HUSH | ||
| 163 | // | ||
| 164 | // msh: The minix shell (adds just 30k) is quite complete and handles things | ||
| 165 | // like for/do/done, case/esac and all the things you expect a Bourne shell to | ||
| 166 | // do. It is not always pedantically correct about Bourne shell grammer (try | ||
| 167 | // running the shell testscript "tests/sh.testcases" on it and compare vs | ||
| 168 | // bash) but for most things it works quite well. It also uses only vfork, so | ||
| 169 | // it can be used on uClinux systems. This was only recently added, so there is | ||
| 170 | // still room to shrink it further... | ||
| 171 | #define BB_FEATURE_MSH | ||
| 172 | // | ||
| 173 | // ash: This adds about 60k in the default configuration and is the most | ||
| 174 | // complete and most pedantically correct shell included with busybox. This | ||
| 175 | // shell was also recently added, and several people (mainly Vladimir and Erik) | ||
| 176 | // have been working on it. There are a number of configurable things at the | ||
| 177 | // top of ash.c as well, so check those out if you want to tweak things. The | ||
| 178 | // Posix math support is currently disabled (that bit of code was horrible) but | ||
| 179 | // will be restored for the next BusyBox release. | ||
| 180 | //#define BB_FEATURE_ASH | ||
| 181 | // | ||
| 147 | // BusyBox will, by default, malloc space for its buffers. This costs code | 182 | // BusyBox will, by default, malloc space for its buffers. This costs code |
| 148 | // size for the call to xmalloc. You can use the following feature to have | 183 | // size for the call to xmalloc. You can use the following feature to have |
| 149 | // them put on the stack. For some very small machines with limited stack | 184 | // them put on the stack. For some very small machines with limited stack |
| @@ -391,6 +426,26 @@ | |||
| 391 | #undef BB_FEATURE_COMMAND_USERNAME_COMPLETION | 426 | #undef BB_FEATURE_COMMAND_USERNAME_COMPLETION |
| 392 | #undef BB_FEATURE_SH_FANCY_PROMPT | 427 | #undef BB_FEATURE_SH_FANCY_PROMPT |
| 393 | #endif | 428 | #endif |
| 429 | #if ! defined BB_FEATURE_LASH && ! defined BB_FEATURE_HUSH && ! defined BB_FEATURE_MSH && ! defined BB_FEATURE_ASH | ||
| 430 | #define BB_FEATURE_MSH | ||
| 431 | #endif | ||
| 432 | #if defined BB_FEATURE_ASH && (defined BB_FEATURE_LASH || defined BB_FEATURE_HUSH || defined BB_FEATURE_MSH) | ||
| 433 | #undef BB_FEATURE_LASH | ||
| 434 | #undef BB_FEATURE_HUSH | ||
| 435 | #undef BB_FEATURE_MSH | ||
| 436 | #elif defined BB_FEATURE_MSH && (defined BB_FEATURE_LASH || defined BB_FEATURE_HUSH || defined BB_FEATURE_MSH) | ||
| 437 | #undef BB_FEATURE_LASH | ||
| 438 | #undef BB_FEATURE_HUSH | ||
| 439 | #undef BB_FEATURE_ASH | ||
| 440 | #elif defined BB_FEATURE_HUSH && (defined BB_FEATURE_LASH || defined BB_FEATURE_HUSH || defined BB_FEATURE_MSH) | ||
| 441 | #undef BB_FEATURE_LASH | ||
| 442 | #undef BB_FEATURE_MSH | ||
| 443 | #undef BB_FEATURE_ASH | ||
| 444 | #elif defined BB_FEATURE_LASH && (defined BB_FEATURE_LASH || defined BB_FEATURE_HUSH || defined BB_FEATURE_MSH) | ||
| 445 | #undef BB_FEATURE_HUSH | ||
| 446 | #undef BB_FEATURE_MSH | ||
| 447 | #undef BB_FEATURE_ASH | ||
| 448 | #endif | ||
| 394 | #else | 449 | #else |
| 395 | #undef BB_FEATURE_SH_APPLETS_ALWAYS_WIN | 450 | #undef BB_FEATURE_SH_APPLETS_ALWAYS_WIN |
| 396 | #undef BB_FEATURE_SH_STANDALONE_SHELL | 451 | #undef BB_FEATURE_SH_STANDALONE_SHELL |
| @@ -0,0 +1,39 @@ | |||
| 1 | /* vi: set sw=4 ts=4: */ | ||
| 2 | /* | ||
| 3 | * Shell wrapper file for busybox | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | * General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 18 | * | ||
| 19 | */ | ||
| 20 | |||
| 21 | #include "busybox.h" | ||
| 22 | |||
| 23 | #if defined BB_FEATURE_ASH | ||
| 24 | #include "ash.c" | ||
| 25 | #elif defined BB_FEATURE_MSH | ||
| 26 | #include "msh.c" | ||
| 27 | #elif defined BB_FEATURE_HUSH | ||
| 28 | #include "hush.c" | ||
| 29 | #elif defined BB_FEATURE_LASH | ||
| 30 | #include "lash.c" | ||
| 31 | #endif | ||
| 32 | |||
| 33 | /* | ||
| 34 | Local Variables: | ||
| 35 | c-file-style: "linux" | ||
| 36 | c-basic-offset: 4 | ||
| 37 | tab-width: 4 | ||
| 38 | End: | ||
| 39 | */ | ||
