From 49b1f5846ab97a0efbd4b37e084dbe29c15717cd Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Tue, 7 Feb 2017 09:33:25 +0000 Subject: ash: make the noconsole option configurable at build time The noconsole option depends on APIs that aren't available in all incarnations of Microsoft Windows. Allow it to be disabled at build time. Note that, by default, 'noconsole' is enabled in 32-bit builds but disabled in 64-bit builds. --- shell/ash.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index fe185f5d9..e21c4433d 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -161,6 +161,18 @@ //config: help //config: Enable "check for new mail" function in the ash shell. //config: +//config: +//config:config ASH_NOCONSOLE +//config: bool "'noconsole' option" +//config: default y +//config: depends on (ASH || SH_IS_ASH || BASH_IS_ASH) && PLATFORM_MINGW32 +//config: help +//config: Enable support for the 'noconsole' option, which attempts to +//config: hide the console normally associated with a command line +//config: application. This may be useful when running a shell script +//config: from a GUI application. Disable this if your platform doesn't +//config: support the required APIs. +//config: //config:endif # ash options //applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP)) @@ -334,9 +346,11 @@ static const char *const optletters_optnames[] = { ,"\0" "debug" #endif #if ENABLE_PLATFORM_MINGW32 - ,"\0" "noconsole" ,"X" "winxp" #endif +#if ENABLE_ASH_NOCONSOLE + ,"\0" "noconsole" +#endif }; #define optletters(n) optletters_optnames[n][0] @@ -417,8 +431,10 @@ struct globals_misc { # define debug optlist[15 + ENABLE_ASH_BASH_COMPAT] #endif #if ENABLE_PLATFORM_MINGW32 -# define noconsole optlist[14 + ENABLE_ASH_BASH_COMPAT + 2*DEBUG] -# define winxp optlist[15 + ENABLE_ASH_BASH_COMPAT + 2*DEBUG] +# define winxp optlist[14 + ENABLE_ASH_BASH_COMPAT + 2*DEBUG] +#endif +#if ENABLE_ASH_NOCONSOLE +# define noconsole optlist[15 + ENABLE_ASH_BASH_COMPAT + 2*DEBUG] #endif /* trap handler commands */ @@ -14097,7 +14113,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv) trace_puts_args(argv); #endif -#if ENABLE_PLATFORM_MINGW32 +#if ENABLE_ASH_NOCONSOLE if ( noconsole ) { DWORD dummy; -- cgit v1.2.3-55-g6feb