mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-03-05 20:58:52 +00:00
[config] Change the way to select the CONFIG_SHELL
Transform the single boolean option to a 'choice' selection with two options: "sh" and "ash". This is needed to later add "bash" as override.
This commit is contained in:
parent
c0483fc7ec
commit
a08142a02a
@ -44,16 +44,46 @@ config USE_PIPES
|
|||||||
Use gcc's option -pipe to use pipes rather than temp files when building
|
Use gcc's option -pipe to use pipes rather than temp files when building
|
||||||
the toolchain.
|
the toolchain.
|
||||||
|
|
||||||
|
choice
|
||||||
|
bool
|
||||||
|
prompt "Shell to use as CONFIG_SHELL"
|
||||||
|
default CONFIG_SHELL_SYSTEM
|
||||||
|
|
||||||
|
config CONFIG_SHELL_SH
|
||||||
|
bool
|
||||||
|
prompt "sh (the system shell)"
|
||||||
|
help
|
||||||
|
Use 'sh' as CONFIG_SHELL.
|
||||||
|
|
||||||
|
./configure scripts and Makefiles make intensive use of calling
|
||||||
|
sub-shells. This is usually done by calling /bin/sh. /bin/sh ought
|
||||||
|
to be an at-least-POSIX-conformant shell (that is, able to interpret
|
||||||
|
POSIX shell scripts).
|
||||||
|
|
||||||
|
On many (most?) systems, /bin/sh is a symlink to bash. On some other
|
||||||
|
systems (eg. Ubuntu, latest Debian), /bin/sh points to dash (or ash).
|
||||||
|
bash is a full-featured shell, with many extension to POSIX, but is
|
||||||
|
quite slow (see ection BUGS in the bash man page), while dash is
|
||||||
|
faster, with very few extensions to POSIX. On the other hand, some
|
||||||
|
./configure scripts, although written to use /bin/sh, may really
|
||||||
|
require to be run by bash.
|
||||||
|
|
||||||
|
The default is to use your system's /bin/sh shell. If you want to
|
||||||
|
run faster, you can select to use dash. If you have problems with
|
||||||
|
either the system shell or when using dash, then you can force to
|
||||||
|
use bash.
|
||||||
|
|
||||||
config CONFIG_SHELL_ASH
|
config CONFIG_SHELL_ASH
|
||||||
bool
|
bool
|
||||||
prompt "Use 'ash' as CONFIG_SHELL"
|
prompt "ash"
|
||||||
default n
|
|
||||||
help
|
help
|
||||||
Use /bin/ash as the shell used by ./configure scripts.
|
Use 'ash' as CONFIG_SHELL.
|
||||||
|
|
||||||
./configure scripts make intensive use of calling a sub-shell, and the
|
See help for CONFIG_SHELL_SH, above, for more explanations.
|
||||||
traditional bash is slow, whereas ash is faster.
|
|
||||||
|
|
||||||
Saying 'y' here should be safe enough, but some components may not
|
endchoice
|
||||||
accept using a shell other than bash (this is most probably true for
|
|
||||||
old versions). If you have trouble, say 'n' here and see if it fixes it.
|
config CONFIG_SHELL
|
||||||
|
string
|
||||||
|
default "sh" if CONFIG_SHELL_SH
|
||||||
|
default "ash" if CONFIG_SHELL_ASH
|
||||||
|
@ -63,8 +63,13 @@ CT_DoExecLog DEBUG rm -f "${CT_WORK_DIR}/foo"
|
|||||||
# What's our shell?
|
# What's our shell?
|
||||||
# Will be plain /bin/sh on most systems, except if we have /bin/ash and we
|
# Will be plain /bin/sh on most systems, except if we have /bin/ash and we
|
||||||
# _explictly_ required using it
|
# _explictly_ required using it
|
||||||
CT_SHELL="/bin/sh"
|
case "${CT_CONFIG_SHELL}" in
|
||||||
[ "${CT_CONFIG_SHELL_ASH}" = "y" -a -x "/bin/ash" ] && CT_SHELL="/bin/ash"
|
sh) CT_SHELL="/bin/sh";;
|
||||||
|
ash) CT_SHELL="/bin/ash";;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Check the user is using an existing SHELL to be used by ./configure and Makefiles
|
||||||
|
CT_TestOrAbort "The CONFIG_SHELL '${CT_CONFIG_SHELL}' (${CT_SHELL}) is not valid" -f "${CT_SHELL}" -a -x "${CT_SHELL}"
|
||||||
|
|
||||||
# Create the bin-overide early
|
# Create the bin-overide early
|
||||||
# Contains symlinks to the tools found by ./configure
|
# Contains symlinks to the tools found by ./configure
|
||||||
@ -452,7 +457,8 @@ if [ -z "${CT_RESTART}" ]; then
|
|||||||
|
|
||||||
# Set the shell to be used by ./configure scripts and by Makefiles (those
|
# Set the shell to be used by ./configure scripts and by Makefiles (those
|
||||||
# that support it!).
|
# that support it!).
|
||||||
export CONFIG_SHELL="${CT_SHELL}"
|
export CONFIG_SHELL="${CT_SHELL}" # for ./configure
|
||||||
|
export SHELL="${CT_SHELL}" # for Makefiles
|
||||||
|
|
||||||
# And help make go faster
|
# And help make go faster
|
||||||
PARALLELMFLAGS=
|
PARALLELMFLAGS=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user