ash: explicltly group ash options

This would makes all ash options indented inside "ash" in menuconfig.
It appears that menuconfig has a limit at tracking multiple dependency
lines like this (it looks like a "diamond problem" but I'm not sure if
it is):

               ---ASH <----------
              /                  \       ASH_OPTIMIZE_FOR_SIZE
    !NOMMU <-*----SH_IS_ASH <----[OR] <--ASH_INTERNAL_GLOB
              \                  /       ASH_RANDOM_SUPPORT
               ---BASH_IS_ASH <--        [...]

The kconfig-language document [1] states that:

> If a menu entry somehow depends on the previous entry, it can be
> made a submenu of it. First, the previous (parent) symbol must be
> part of the dependency list and then one of these two conditions
> must be true:
> - the child entry must become invisible, if the parent is set to 'n'

    [BusyBox ash used to satisfy this, but no longer does]

> - the child entry must only be visible, if the parent is visible

    [BusyBox ash configs actually satisfy this, but because of
     "diamond" above this might not be easily detected]

So I found out a direct workaround: by making ash options explicitly
depend on !NOMMU, we can tell menuconfig that rule 2 above is satisfied
without any more tracking.

               ---------------------
              /                     \
    !NOMMU <-*-----ASH <--------     \
              \                 \     \        ASH_OPTIMIZE_FOR_SIZE
               *---SH_IS_ASH <---[OR]-[AND] <--ASH_INTERNAL_GLOB
                \                /             ASH_RANDOM_SUPPORT
                 --BASH_IS_ASH <-              [...]

So all ash options would now be indented under "ash".

[1] "Documentation/kbuild/kconfig-language.txt" in Linux kernel source

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Kang-Che Sung 2017-01-06 17:02:03 +01:00 committed by Denys Vlasenko
parent b62ea34afe
commit 6cd0294725
2 changed files with 11 additions and 0 deletions

View File

@ -80,6 +80,9 @@ endchoice
INSERT INSERT
comment "Options common to all shells"
if ASH || HUSH || SH_IS_ASH || BASH_IS_ASH || SH_IS_HUSH || BASH_IS_HUSH
config FEATURE_SH_MATH config FEATURE_SH_MATH
bool "POSIX math support" bool "POSIX math support"
default y default y
@ -163,5 +166,6 @@ config FEATURE_SH_HISTFILESIZE
to set shell history size. Note that its max value is capped to set shell history size. Note that its max value is capped
by "History size" setting in library tuning section. by "History size" setting in library tuning section.
endif # Options common to all shells
endmenu endmenu

View File

@ -26,6 +26,11 @@
//config: shell (by Herbert Xu), which was created by porting the 'ash' shell //config: shell (by Herbert Xu), which was created by porting the 'ash' shell
//config: (written by Kenneth Almquist) from NetBSD. //config: (written by Kenneth Almquist) from NetBSD.
//config: //config:
//config:# ash options
//config:# note: Don't remove !NOMMU part in the next line; it would break
//config:# menuconfig's indenting.
//config:if !NOMMU && (ASH || SH_IS_ASH || BASH_IS_ASH)
//config:
//config:config ASH_OPTIMIZE_FOR_SIZE //config:config ASH_OPTIMIZE_FOR_SIZE
//config: bool "Optimize for size instead of speed" //config: bool "Optimize for size instead of speed"
//config: default y //config: default y
@ -140,6 +145,8 @@
//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
//config: help //config: help
//config: Enable "check for new mail" function in the ash shell. //config: Enable "check for new mail" function in the ash shell.
//config:
//config:endif # ash options
//applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP)) //applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
//applet:IF_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, ash)) //applet:IF_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, ash))