# This file is part of the FreeWRT project. FreeWRT is copyrighted
# material, please see the LICENCE file in the top-level directory

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
	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.

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_SH
	bool "/bin/sh"
	help
	  Fall-back: use /bin/sh, whatever it is.

endchoice
