INSERT
-lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty
-lib-$(CONFIG_LESS) += cat.o # less too
-lib-$(CONFIG_CRONTAB) += cat.o # crontab -l
-lib-$(CONFIG_ADDUSER) += chown.o # used by adduser
-lib-$(CONFIG_ADDGROUP) += chown.o # used by adduser
-lib-$(CONFIG_ASH) += echo.o # used by ash
-lib-$(CONFIG_HUSH) += echo.o # used by hush
-lib-$(CONFIG_FTPD) += ls.o # used by ftpd
+lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty
+lib-$(CONFIG_LESS) += cat.o # less too
+lib-$(CONFIG_CRONTAB) += cat.o # crontab -l
+lib-$(CONFIG_ADDUSER) += chown.o # used by adduser
+lib-$(CONFIG_ADDGROUP) += chown.o # used by adduser
+lib-$(CONFIG_ASH) += echo.o # used by ash
+lib-$(CONFIG_SH_IS_ASH) += echo.o # used by ash
+lib-$(CONFIG_BASH_IS_ASH) += echo.o # used by ash
+lib-$(CONFIG_HUSH) += echo.o # used by hush
+lib-$(CONFIG_SH_IS_HUSH) += echo.o # used by hush
+lib-$(CONFIG_BASH_IS_HUSH) += echo.o # used by hush
+lib-$(CONFIG_FTPD) += ls.o # used by ftpd
lib-$(CONFIG_ASH_BUILTIN_PRINTF) += printf.o
//kbuild:lib-$(CONFIG_TEST2) += test.o test_ptr_hack.o
//kbuild:lib-$(CONFIG_ASH_BUILTIN_TEST) += test.o test_ptr_hack.o
//kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o
+//kbuild:lib-$(CONFIG_SH_IS_HUSH) += test.o test_ptr_hack.o
+//kbuild:lib-$(CONFIG_BASH_IS_HUSH) += test.o test_ptr_hack.o
/* "test --help" is special-cased to ignore --help */
//usage:#define test_trivial_usage NOUSAGE_STR
for app in $apps; do
allno="`echo "$allno" | sed "s/^CONFIG_${app}=y\$/# CONFIG_${app} is not set/"`"
done
+#echo "$allno" >.config_allno
# Turn on each applet individually and build single-applet executable
fail=0
mv .config .config.SV
echo "CONFIG_${app}=y" >.config
echo "$allno" | sed "/^# CONFIG_${app} is not set\$/d" >>.config
+
+ if test x"${app}" != x"SH_IS_ASH"; then
+ # $allno has all choices for "sh" aliasing at off.
+ # "sh" aliasing defaults to "ash", not none.
+ # without this fix, "make oldconfig" sets it wrong,
+ # resulting in NUM_APPLETS = 2
+ sed '/CONFIG_SH_IS_NONE/d' -i .config
+ echo "CONFIG_SH_IS_NONE=y" >>.config
+ fi
+
if ! yes '' | make oldconfig >busybox_make_${app}.log 2>&1; then
: $((fail++))
echo "Config error for ${app}"
INSERT
lib-$(CONFIG_ASH) += kill.o # used for built-in kill by ash
+lib-$(CONFIG_SH_IS_ASH) += kill.o # used for built-in kill by ash
+lib-$(CONFIG_BASH_IS_ASH) += kill.o # used for built-in kill by ash
menu "Shells"
-INSERT
-
choice
prompt "Choose which shell is aliased to 'sh' name"
- default FEATURE_SH_IS_ASH
+ default SH_IS_ASH
help
Choose which shell you want to be executed by 'sh' alias.
The ash shell is the most bash compatible and full featured one.
# note: cannot use "select ASH" here, it breaks "make allnoconfig"
-config FEATURE_SH_IS_ASH
- depends on ASH
- bool "ash"
+config SH_IS_ASH
depends on !NOMMU
+ bool "ash"
-config FEATURE_SH_IS_HUSH
- depends on HUSH
+config SH_IS_HUSH
bool "hush"
-config FEATURE_SH_IS_NONE
+config SH_IS_NONE
bool "none"
endchoice
choice
prompt "Choose which shell is aliased to 'bash' name"
- default FEATURE_BASH_IS_NONE
+ default BASH_IS_NONE
help
Choose which shell you want to be executed by 'bash' alias.
The ash shell is the most bash compatible and full featured one.
can't be used for running them because it won't recongnize
"bash" as a supported applet name.
-config FEATURE_BASH_IS_ASH
- depends on ASH
- bool "ash"
+config BASH_IS_ASH
depends on !NOMMU
+ bool "ash"
-config FEATURE_BASH_IS_HUSH
- depends on HUSH
+config BASH_IS_HUSH
bool "hush"
-config FEATURE_BASH_IS_NONE
+config BASH_IS_NONE
bool "none"
endchoice
-config SH_MATH_SUPPORT
+INSERT
+
+
+config FEATURE_SH_MATH
bool "POSIX math support"
default y
- depends on ASH || HUSH
+ depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH
help
Enable math support in the shell via $((...)) syntax.
-config SH_MATH_SUPPORT_64
+config FEATURE_SH_MATH_64
bool "Extend POSIX math support to 64 bit"
default y
- depends on SH_MATH_SUPPORT
+ depends on FEATURE_SH_MATH
help
Enable 64-bit math support in the shell. This will make the shell
slightly larger, but will allow computation with very large numbers.
config FEATURE_SH_EXTRA_QUIET
bool "Hide message on interactive shell startup"
default y
- depends on HUSH || ASH
+ depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH
help
Remove the busybox introduction when starting a shell.
config FEATURE_SH_STANDALONE
bool "Standalone shell"
default n
- depends on (HUSH || ASH)
+ depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH
help
This option causes busybox shells to use busybox applets
in preference to executables in the PATH whenever possible. For
config FEATURE_SH_NOFORK
bool "Run 'nofork' applets directly"
default n
- depends on (HUSH || ASH)
+ depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH
help
This option causes busybox shells to not execute typical
fork/exec/wait sequence, but call <applet>_main directly,
config FEATURE_SH_HISTFILESIZE
bool "Use $HISTFILESIZE"
default y
- depends on HUSH || ASH
+ depends on ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH
help
This option makes busybox shells to use $HISTFILESIZE variable
to set shell history size. Note that its max value is capped
INSERT
-lib-$(CONFIG_SH_MATH_SUPPORT) += math.o
+lib-$(CONFIG_FEATURE_SH_MATH) += math.o
//config:config ASH_OPTIMIZE_FOR_SIZE
//config: bool "Optimize for size instead of speed"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Compile ash for reduced size at the price of speed.
//config:
//config:config ASH_INTERNAL_GLOB
//config: bool "Use internal glob() implementation"
//config: default y # Y is bigger, but because of uclibc glob() bug, let Y be default for now
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Do not use glob() function from libc, use internal implementation.
//config: Use this if you are getting "glob.h: No such file or directory"
//config:config ASH_RANDOM_SUPPORT
//config: bool "Pseudorandom generator and $RANDOM variable"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Enable pseudorandom generator and dynamic variable "$RANDOM".
//config: Each read of "$RANDOM" will generate a new pseudorandom value.
//config:config ASH_EXPAND_PRMT
//config: bool "Expand prompt string"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: "PS#" may contain volatile content, such as backquote commands.
//config: This option recreates the prompt string from the environment
//config:config ASH_BASH_COMPAT
//config: bool "bash-compatible extensions"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Enable bash-compatible extensions.
//config:
//config:config ASH_IDLE_TIMEOUT
//config: bool "Idle timeout variable"
//config: default n
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Enables bash-like auto-logout after $TMOUT seconds of idle time.
//config:
//config:config ASH_JOB_CONTROL
//config: bool "Job control"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Enable job control in the ash shell.
//config:
//config:config ASH_ALIAS
//config: bool "Alias support"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Enable alias support in the ash shell.
//config:
//config:config ASH_GETOPTS
//config: bool "Builtin getopt to parse positional parameters"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Enable support for getopts builtin in ash.
//config:
//config:config ASH_BUILTIN_ECHO
//config: bool "Builtin version of 'echo'"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Enable support for echo builtin in ash.
//config:
//config:config ASH_BUILTIN_PRINTF
//config: bool "Builtin version of 'printf'"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Enable support for printf builtin in ash.
//config:
//config:config ASH_BUILTIN_TEST
//config: bool "Builtin version of 'test'"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Enable support for test builtin in ash.
//config:
//config:config ASH_HELP
//config: bool "help builtin"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Enable help builtin in ash.
//config:
//config:config ASH_CMDCMD
//config: bool "'command' command to override shell builtins"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Enable support for the ash 'command' builtin, which allows
//config: you to run the specified command with the specified arguments,
//config:config ASH_MAIL
//config: bool "Check for new mail on interactive shells"
//config: default y
-//config: depends on ASH
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help
//config: Enable "check for new mail" function in the ash shell.
//applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
-//applet:IF_FEATURE_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, sh))
-//applet:IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, bash))
+//applet:IF_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
+//applet:IF_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
//kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o
+//kbuild:lib-$(CONFIG_SH_IS_ASH) += ash.o ash_ptr_hack.o shell_common.o
+//kbuild:lib-$(CONFIG_BASH_IS_ASH) += ash.o ash_ptr_hack.o shell_common.o
//kbuild:lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o
/*
#include "unicode.h"
#include "shell_common.h"
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
# include "math.h"
#endif
#if ENABLE_ASH_RANDOM_SUPPORT
return NULL;
}
+#if ENABLE_UNICODE_SUPPORT
static void
reinit_unicode_for_ash(void)
{
reinit_unicode(s);
}
}
+#else
+# define reinit_unicode_for_ash() ((void)0)
+#endif
/*
* Search the environment of a builtin command.
#define USE_SIT_FUNCTION ENABLE_ASH_OPTIMIZE_FOR_SIZE
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
# define SIT_ITEM(a,b,c,d) (a | (b << 4) | (c << 8) | (d << 12))
#else
# define SIT_ITEM(a,b,c,d) (a | (b << 4) | (c << 8))
({ \
if ((c) < 0 || (c) > (PEOF + ENABLE_ASH_ALIAS)) \
bb_error_msg_and_die("line:%d c:%d", __LINE__, (c)); \
- if ((syntax) < 0 || (syntax) > (2 + ENABLE_SH_MATH_SUPPORT)) \
+ if ((syntax) < 0 || (syntax) > (2 + ENABLE_FEATURE_SH_MATH)) \
bb_error_msg_and_die("line:%d c:%d", __LINE__, (c)); \
((S_I_T[syntax_index_table[c]] >> ((syntax)*4)) & 0xf); \
})
case CTLBACKQ:
str = "$(...)";
goto dostr;
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
case CTLARI:
str = "$((";
goto dostr;
* We have to deal with backquotes, shell variables, and file metacharacters.
*/
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
static arith_t
ash_arith(const char *s)
{
/*
* Our own itoa().
*/
-#if !ENABLE_SH_MATH_SUPPORT
+#if !ENABLE_FEATURE_SH_MATH
/* cvtnum() is used even if math support is off (to prepare $? values and such) */
typedef long arith_t;
# define ARITH_FMT "%ld"
stackblock() + startloc));
}
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
/*
* Expand arithmetic expression. Backup to start of expression,
* evaluate, place result in (backed up) result, adjust string position.
CTLESC,
CTLVAR,
CTLBACKQ,
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
CTLENDARI,
#endif
'\0'
c = p[length];
if (c) {
if (!(c & 0x80)
- IF_SH_MATH_SUPPORT(|| c == CTLENDARI)
+ IF_FEATURE_SH_MATH(|| c == CTLENDARI)
) {
/* c == '=' || c == ':' || c == CTLENDARI */
length++;
expbackq(argbackq->n, flags | inquotes);
argbackq = argbackq->next;
goto start;
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
case CTLENDARI:
p--;
expari(flags | inquotes);
#if MAX_HISTORY
static int historycmd(int, char **) FAST_FUNC;
#endif
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
static int letcmd(int, char **) FAST_FUNC;
#endif
static int readcmd(int, char **) FAST_FUNC;
{ BUILTIN_REGULAR "jobs" , jobscmd },
{ BUILTIN_REGULAR "kill" , killcmd },
#endif
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
{ BUILTIN_NOSPEC "let" , letcmd },
#endif
{ BUILTIN_ASSIGN "local" , localcmd },
smallint quotef;
smallint dblquote;
smallint oldstyle;
- IF_SH_MATH_SUPPORT(smallint prevsyntax;) /* syntax before arithmetic */
+ IF_FEATURE_SH_MATH(smallint prevsyntax;) /* syntax before arithmetic */
#if ENABLE_ASH_EXPAND_PRMT
smallint pssyntax; /* we are expanding a prompt string */
#endif
int varnest; /* levels of variables expansion */
- IF_SH_MATH_SUPPORT(int arinest;) /* levels of arithmetic expansion */
- IF_SH_MATH_SUPPORT(int parenlevel;) /* levels of parens in arithmetic */
+ IF_FEATURE_SH_MATH(int arinest;) /* levels of arithmetic expansion */
+ IF_FEATURE_SH_MATH(int parenlevel;) /* levels of parens in arithmetic */
int dqvarnest; /* levels of variables expansion within double quotes */
IF_ASH_BASH_COMPAT(smallint bash_dollar_squote = 0;)
startlinno = g_parsefile->linno;
bqlist = NULL;
quotef = 0;
- IF_SH_MATH_SUPPORT(prevsyntax = 0;)
+ IF_FEATURE_SH_MATH(prevsyntax = 0;)
#if ENABLE_ASH_EXPAND_PRMT
pssyntax = (syntax == PSSYNTAX);
if (pssyntax)
#endif
dblquote = (syntax == DQSYNTAX);
varnest = 0;
- IF_SH_MATH_SUPPORT(arinest = 0;)
- IF_SH_MATH_SUPPORT(parenlevel = 0;)
+ IF_FEATURE_SH_MATH(arinest = 0;)
+ IF_FEATURE_SH_MATH(parenlevel = 0;)
dqvarnest = 0;
STARTSTACKSTR(out);
}
USTPUTC(c, out);
break;
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
case CLP: /* '(' in arithmetic */
parenlevel++;
USTPUTC(c, out);
} /* for (;;) */
endword:
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
if (syntax == ARISYNTAX)
raise_error_syntax("missing '))'");
#endif
} else if (c == '(') {
/* $(command) or $((arith)) */
if (pgetc_eatbnl() == '(') {
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
PARSEARITH();
#else
raise_error_syntax("you disabled math support for $((arith)) syntax");
goto parsebackq_newreturn;
}
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
/*
* Parse an arithmetic expansion (indicate start of one and set state)
*/
return 0;
}
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
/*
* The let builtin. Partially stolen from GNU Bash, the Bourne Again SHell.
* Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc.
//usage:#define ash_full_usage "\n\n"
//usage: "Unix shell interpreter"
-//usage:#if ENABLE_FEATURE_SH_IS_ASH
-//usage:# define sh_trivial_usage ash_trivial_usage
-//usage:# define sh_full_usage ash_full_usage
-//usage:#endif
-//usage:#if ENABLE_FEATURE_BASH_IS_ASH
-//usage:# define bash_trivial_usage ash_trivial_usage
-//usage:# define bash_full_usage ash_full_usage
-//usage:#endif
-
/*
* Process the shell command line arguments.
*/
//config:config HUSH_BASH_COMPAT
//config: bool "bash-compatible extensions"
//config: default y
-//config: depends on HUSH
+//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
//config: help
//config: Enable bash-compatible extensions.
//config:
//config:config HUSH_HELP
//config: bool "help builtin"
//config: default y
-//config: depends on HUSH
+//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
//config: help
//config: Enable help builtin in hush. Code size + ~1 kbyte.
//config:
//config:config HUSH_INTERACTIVE
//config: bool "Interactive mode"
//config: default y
-//config: depends on HUSH
+//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
//config: help
//config: Enable interactive mode (prompt and command editing).
//config: Without this, hush simply reads and executes commands
//config:config HUSH_TICK
//config: bool "Process substitution"
//config: default y
-//config: depends on HUSH
+//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
//config: help
//config: Enable process substitution `command` and $(command) in hush.
//config:
//config:config HUSH_IF
//config: bool "Support if/then/elif/else/fi"
//config: default y
-//config: depends on HUSH
+//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
//config: help
//config: Enable if/then/elif/else/fi in hush.
//config:
//config:config HUSH_LOOPS
//config: bool "Support for, while and until loops"
//config: default y
-//config: depends on HUSH
+//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
//config: help
//config: Enable for, while and until loops in hush.
//config:
//config:config HUSH_CASE
//config: bool "Support case ... esac statement"
//config: default y
-//config: depends on HUSH
+//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
//config: help
//config: Enable case ... esac statement in hush. +400 bytes.
//config:
//config:config HUSH_FUNCTIONS
//config: bool "Support funcname() { commands; } syntax"
//config: default y
-//config: depends on HUSH
+//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
//config: help
//config: Enable support for shell functions in hush. +800 bytes.
//config:
//config:config HUSH_RANDOM_SUPPORT
//config: bool "Pseudorandom generator and $RANDOM variable"
//config: default y
-//config: depends on HUSH
+//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
//config: help
//config: Enable pseudorandom generator and dynamic variable "$RANDOM".
//config: Each read of "$RANDOM" will generate a new pseudorandom value.
//config:config HUSH_EXPORT_N
//config: bool "Support 'export -n' option"
//config: default y
-//config: depends on HUSH
+//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
//config: help
//config: export -n unexports variables. It is a bash extension.
//config:
//config:config HUSH_MODE_X
//config: bool "Support 'hush -x' option and 'set -x' command"
//config: default y
-//config: depends on HUSH
+//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH
//config: help
//config: This instructs hush to print commands before execution.
//config: Adds ~300 bytes.
//config: select HUSH
//config: help
//config: msh is deprecated and will be removed, please migrate to hush.
-//config:
//applet:IF_HUSH(APPLET(hush, BB_DIR_BIN, BB_SUID_DROP))
-//applet:IF_MSH(APPLET(msh, BB_DIR_BIN, BB_SUID_DROP))
-//applet:IF_FEATURE_SH_IS_HUSH(APPLET_ODDNAME(sh, hush, BB_DIR_BIN, BB_SUID_DROP, sh))
-//applet:IF_FEATURE_BASH_IS_HUSH(APPLET_ODDNAME(bash, hush, BB_DIR_BIN, BB_SUID_DROP, bash))
+//applet:IF_MSH(APPLET_ODDNAME(msh, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
+//applet:IF_SH_IS_HUSH(APPLET_ODDNAME(sh, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
+//applet:IF_BASH_IS_HUSH(APPLET_ODDNAME(bash, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
//kbuild:lib-$(CONFIG_HUSH) += hush.o match.o shell_common.o
+//kbuild:lib-$(CONFIG_SH_IS_HUSH) += hush.o match.o shell_common.o
+//kbuild:lib-$(CONFIG_BASH_IS_HUSH) += hush.o match.o shell_common.o
//kbuild:lib-$(CONFIG_HUSH_RANDOM_SUPPORT) += random.o
/* -i (interactive) and -s (read stdin) are also accepted,
//usage:#define hush_full_usage "\n\n"
//usage: "Unix shell interpreter"
-//usage:#define msh_trivial_usage hush_trivial_usage
-//usage:#define msh_full_usage hush_full_usage
-
-//usage:#if ENABLE_FEATURE_SH_IS_HUSH
-//usage:# define sh_trivial_usage hush_trivial_usage
-//usage:# define sh_full_usage hush_full_usage
-//usage:#endif
-//usage:#if ENABLE_FEATURE_BASH_IS_HUSH
-//usage:# define bash_trivial_usage hush_trivial_usage
-//usage:# define bash_full_usage hush_full_usage
-//usage:#endif
-
#if !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \
|| defined(__APPLE__) \
)
}
}
-#if ENABLE_HUSH_TICK || ENABLE_SH_MATH_SUPPORT || ENABLE_HUSH_DOLLAR_OPS
+#if ENABLE_HUSH_TICK || ENABLE_FEATURE_SH_MATH || ENABLE_HUSH_DOLLAR_OPS
/* Subroutines for copying $(...) and `...` things */
static int add_till_backquote(o_string *dest, struct in_str *input, int in_dquote);
/* '...' */
}
return ch;
}
-#endif /* ENABLE_HUSH_TICK || ENABLE_SH_MATH_SUPPORT || ENABLE_HUSH_DOLLAR_OPS */
+#endif /* ENABLE_HUSH_TICK || ENABLE_FEATURE_SH_MATH || ENABLE_HUSH_DOLLAR_OPS */
/* Return code: 0 for OK, 1 for syntax error */
#if BB_MMU
o_addchr(dest, SPECIAL_VAR_SYMBOL);
break;
}
-#if ENABLE_SH_MATH_SUPPORT || ENABLE_HUSH_TICK
+#if ENABLE_FEATURE_SH_MATH || ENABLE_HUSH_TICK
case '(': {
unsigned pos;
ch = i_getch(input);
nommu_addchr(as_string, ch);
-# if ENABLE_SH_MATH_SUPPORT
+# if ENABLE_FEATURE_SH_MATH
if (i_peek_and_eat_bkslash_nl(input) == '(') {
ch = i_getch(input);
nommu_addchr(as_string, ch);
return exp_str;
}
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
static arith_t expand_and_evaluate_arith(const char *arg, const char **errmsg_p)
{
arith_state_t math_state;
}
#endif
else if (exp_op == ':') {
-#if ENABLE_HUSH_BASH_COMPAT && ENABLE_SH_MATH_SUPPORT
+#if ENABLE_HUSH_BASH_COMPAT && ENABLE_FEATURE_SH_MATH
/* It's ${var:N[:M]} bashism.
* Note that in encoded form it has TWO parts:
* var:N<SPECIAL_VAR_SYMBOL>M<SPECIAL_VAR_SYMBOL>
#if ENABLE_HUSH_TICK
o_string subst_result = NULL_O_STRING;
#endif
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
char arith_buf[sizeof(arith_t)*3 + 2];
#endif
val = subst_result.data;
goto store_val;
#endif
-#if ENABLE_SH_MATH_SUPPORT
+#if ENABLE_FEATURE_SH_MATH
case '+': { /* <SPECIAL_VAR_SYMBOL>+cmd<SPECIAL_VAR_SYMBOL> */
arith_t res;
PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
-#if ENABLE_SH_MATH_SUPPORT_64
+#if ENABLE_FEATURE_SH_MATH_64
typedef long long arith_t;
#define ARITH_FMT "%lld"
#define strto_arith_t strtoull