# $FreeWRT$

comment "Building shell packages and configuring their features"
source "package/busybox/config/shell/Config.in"
source "package/mksh/Config.in"
comment "Selecting appropriate shells from these enabled above"
choice
	prompt "Choose the default bourne shell (/bin/sh)"
	default BUSYBOX_CONFIG_FEATURE_SH_IS_ASH if BUSYBOX_CONFIG_ASH
	default FWRT_PACKAGE_MKSH_AS_BINSH if FWRT_PACKAGE_MKSH
	help
	  Choose a shell which is to be used for /bin/sh.
	  The ash shell is the most bash-compatible shell
	  and full-featured one in busybox; mksh is a bit
	  more heavy-weight but feature-complete. The other
	  shells probably do not work as /bin/sh in FreeWRT.

config BUSYBOX_CONFIG_FEATURE_SH_IS_ASH
	depends BUSYBOX_CONFIG_ASH
	bool "ash (busybox)"
	help
	  Tha 'ash' shell adds about 60k in the default configuration and is
	  the most complete and most pedantically correct shell included with
	  busybox.  This shell is actually a derivative of the Debian 'dash'
	  shell (by Herbert Xu), which was created by porting the 'ash' shell
	  (written by Kenneth Almquist) from NetBSD.

config FWRT_PACKAGE_MKSH_AS_BINSH
	depends FWRT_PACKAGE_MKSH
	select BUSYBOX_CONFIG_FEATURE_SH_IS_NONE
	bool "mksh"
	help
	  mksh is the MirBSD enhanced version of the Public Domain Korn
	  shell (pdksh), a bourne-compatible shell which is largely similar
	  to the original AT&T Korn shell. It includes bug fixes and
	  feature improvements in order to produce a modern, robust shell
	  good for interactive and especially script use. Some sh/ksh/pdksh
	  compatibility kludges have been removed.

config BUSYBOX_CONFIG_FEATURE_SH_IS_HUSH
	depends BUSYBOX_CONFIG_HUSH
	bool "hush (busybox)"
	help
	  hush is a very small shell (just 18k) and it has fairly complete
	  Bourne shell grammar.  It even handles all the normal flow control
	  options such as if/then/elif/else/fi, for/in/do/done, while loops,
	  etc.

	  It does not handle case/esac, select, function, here documents ( <<
	  word ), arithmetic expansion, aliases, brace expansion, tilde
	  expansion, &> and >& redirection of stdout+stderr, etc.

config BUSYBOX_CONFIG_FEATURE_SH_IS_LASH
	depends BUSYBOX_CONFIG_LASH
	bool "lash (busybox)"
	help
	  lash is the very smallest shell (adds just 10k) and it is quite
	  usable as a command prompt, but it is not suitable for any but the
	  most trivial scripting (such as an initrd that calls insmod a few
	  times) since it does not understand any Bourne shell grammar.  It
	  does handle pipes, redirects, and job control though.  Adding in
	  command editing makes it a very nice lightweight command prompt.

config BUSYBOX_CONFIG_FEATURE_SH_IS_MSH
	depends BUSYBOX_CONFIG_MSH
	bool "msh (busybox)"
	help
	  The minix shell (adds just 30k) is quite complete and handles things
	  like for/do/done, case/esac and all the things you expect a Bourne
	  shell to do.  It is not always pedantically correct about Bourne
	  shell grammar (try running the shell testscript "tests/sh.testcases"
	  on it and compare vs bash) but for most things it works quite well.
	  It also uses only vfork, so it can be used on uClinux systems.

endchoice

choice
	prompt "Choose the login shell for the admin user"
	default FWRT_BASEFILES_ADMIN_ASH if BUSYBOX_CONFIG_ASH
	default FWRT_BASEFILES_ADMIN_MKSH if FWRT_PACKAGE_MKSH
	default FWRT_BASEFILES_ADMIN_SH if (!BUSYBOX_CONFIG_ASH && !FWRT_PACKAGE_MKSH)
	help
	  Choose a shell which is to be used as the default login
	  shell for the "admin" user. Only shells selected above
	  can be chosen.

config FWRT_BASEFILES_ADMIN_ASH
	depends BUSYBOX_CONFIG_ASH
	bool "ash (busybox)"
	help
	  Tha 'ash' shell adds about 60k in the default configuration and is
	  the most complete and most pedantically correct shell included with
	  busybox.  This shell is actually a derivative of the Debian 'dash'
	  shell (by Herbert Xu), which was created by porting the 'ash' shell
	  (written by Kenneth Almquist) from NetBSD.

config FWRT_BASEFILES_ADMIN_MKSH
	depends FWRT_PACKAGE_MKSH
	bool "mksh"
	help
	  mksh is the MirBSD enhanced version of the Public Domain Korn
	  shell (pdksh), a bourne-compatible shell which is largely similar
	  to the original AT&T Korn shell. It includes bug fixes and
	  feature improvements in order to produce a modern, robust shell
	  good for interactive and especially script use. Some sh/ksh/pdksh
	  compatibility kludges have been removed.

config FWRT_BASEFILES_ADMIN_HUSH
	depends BUSYBOX_CONFIG_HUSH
	bool "hush (busybox)"
	help
	  hush is a very small shell (just 18k) and it has fairly complete
	  Bourne shell grammar.  It even handles all the normal flow control
	  options such as if/then/elif/else/fi, for/in/do/done, while loops,
	  etc.

	  It does not handle case/esac, select, function, here documents ( <<
	  word ), arithmetic expansion, aliases, brace expansion, tilde
	  expansion, &> and >& redirection of stdout+stderr, etc.

config FWRT_BASEFILES_ADMIN_LASH
	depends BUSYBOX_CONFIG_LASH
	bool "lash (busybox)"
	help
	  lash is the very smallest shell (adds just 10k) and it is quite
	  usable as a command prompt, but it is not suitable for any but the
	  most trivial scripting (such as an initrd that calls insmod a few
	  times) since it does not understand any Bourne shell grammar.  It
	  does handle pipes, redirects, and job control though.  Adding in
	  command editing makes it a very nice lightweight command prompt.

config FWRT_BASEFILES_ADMIN_MSH
	depends BUSYBOX_CONFIG_MSH
	bool "msh (busybox)"
	help
	  The minix shell (adds just 30k) is quite complete and handles things
	  like for/do/done, case/esac and all the things you expect a Bourne
	  shell to do.  It is not always pedantically correct about Bourne
	  shell grammar (try running the shell testscript "tests/sh.testcases"
	  on it and compare vs bash) but for most things it works quite well.
	  It also uses only vfork, so it can be used on uClinux systems.

config FWRT_BASEFILES_ADMIN_SH
	bool "/bin/sh"
	help
	  Fall-back: use /bin/sh, whatever it is.

endchoice
