summaryrefslogtreecommitdiff
path: root/scripts/kconfig/lkc-language.txt
Side-by-side diff
Diffstat (limited to 'scripts/kconfig/lkc-language.txt') (more/less context) (ignore whitespace changes)
-rw-r--r--scripts/kconfig/lkc-language.txt52
1 files changed, 38 insertions, 14 deletions
diff --git a/scripts/kconfig/lkc-language.txt b/scripts/kconfig/lkc-language.txt
index a3037ff..40f8583 100644
--- a/scripts/kconfig/lkc-language.txt
+++ b/scripts/kconfig/lkc-language.txt
@@ -15,13 +15,13 @@ organized in a tree structure:
| +- Enable loadable module support
| +- Set version information on all module symbols
| +- Kernel module loader
+- ...
Every entry has its own dependencies. These dependencies are used
-to determine the visible of an entry. Any child entry is only
+to determine the visibility of an entry. Any child entry is only
visible if its parent entry is also visible.
Menu entries
------------
Most entries define a config option, all other entries help to organize
@@ -47,13 +47,13 @@ Menu attributes
A menu entry can have a number of attributes. Not all of them are
applicable everywhere (see syntax).
- type definition: "bool"/"tristate"/"string"/"hex"/"integer"
Every config option must have a type. There are only two basic types:
- tristate and string, the other types base on these two. The type
+ tristate and string, the other types are based on these two. The type
definition optionally accepts an input prompt, so these two examples
are equivalent:
bool "Networking support"
and
bool
@@ -61,41 +61,56 @@ applicable everywhere (see syntax).
- input prompt: "prompt" <prompt> ["if" <expr>]
Every menu entry can have at most one prompt, which is used to display
to the user. Optionally dependencies only for this prompt can be added
with "if".
-- default value: "default" <symbol> ["if" <expr>]
+- default value: "default" <expr> ["if" <expr>]
A config option can have any number of default values. If multiple
default values are visible, only the first defined one is active.
Default values are not limited to the menu entry, where they are
defined, this means the default can be defined somewhere else or be
- overriden by an earlier definition.
+ overridden by an earlier definition.
The default value is only assigned to the config symbol if no other
value was set by the user (via the input prompt above). If an input
prompt is visible the default value is presented to the user and can
be overridden by him.
Optionally dependencies only for this default value can be added with
"if".
- dependencies: "depends on"/"requires" <expr>
This defines a dependency for this menu entry. If multiple
dependencies are defined they are connected with '&&'. Dependencies
are applied to all other options within this menu entry (which also
- accept "if" expression), so these two examples are equivalent:
+ accept an "if" expression), so these two examples are equivalent:
bool "foo" if BAR
default y if BAR
and
depends on BAR
bool "foo"
default y
+- reverse dependencies: "select" <symbol> ["if" <expr>]
+ While normal dependencies reduce the upper limit of a symbol (see
+ below), reverse dependencies can be used to force a lower limit of
+ another symbol. The value of the current menu symbol is used as the
+ minimal value <symbol> can be set to. If <symbol> is selected multiple
+ times, the limit is set to the largest selection.
+ Reverse dependencies can only be used with boolean or tristate
+ symbols.
+
+- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
+ This allows to limit the range of possible input values for integer
+ and hex symbols. The user can only input a value which is larger than
+ or equal to the first symbol and smaller than or equal to the second
+ symbol.
+
- help text: "help"
This defines a help text. The end of the help text is determined by
- the level indentation, this means it ends at the first line which has
+ the indentation level, this means it ends at the first line which has
a smaller indentation than the first line of the help text.
Menu dependencies
-----------------
@@ -120,32 +135,32 @@ Expressions are listed in decreasing order of precedence.
(2) If the values of both symbols are equal, it returns 'y',
otherwise 'n'.
(3) If the values of both symbols are equal, it returns 'n',
otherwise 'y'.
(4) Returns the value of the expression. Used to override precedence.
(5) Returns the result of (2-/expr/).
-(6) Returns the result of min(/expr/, /expr/).
-(7) Returns the result of max(/expr/, /expr/).
+(6) Returns the result of max(/expr/, /expr/).
+(7) Returns the result of min(/expr/, /expr/).
An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2
respectively for calculations). A menu entry becomes visible when it's
expression evaluates to 'm' or 'y'.
-There are two type of symbols: constant and nonconstant symbols.
+There are two types of symbols: constant and nonconstant symbols.
Nonconstant symbols are the most common ones and are defined with the
'config' statement. Nonconstant symbols consist entirely of alphanumeric
characters or underscores.
Constant symbols are only part of expressions. Constant symbols are
always surrounded by single or double quotes. Within the quote any
other character is allowed and the quotes can be escaped using '\'.
Menu structure
--------------
The position of a menu entry in the tree is determined in two ways. First
-it can be specified explicitely:
+it can be specified explicitly:
menu "Network device support"
depends NET
config NETDEVICES
...
@@ -156,14 +171,14 @@ All entries within the "menu" ... "endmenu" block become a submenu of
"Network device support". All subentries inherit the dependencies from
the menu entry, e.g. this means the dependency "NET" is added to the
dependency list of the config option NETDEVICES.
The other way to generate the menu structure is done by analyzing the
dependencies. If a menu entry somehow depends on the previous entry, it
-can be made a submenu of it. First the the previous (parent) symbol must
-be part of the dependency list and then one of these two condititions
+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'
- the child entry must only be visible, if the parent is visible
config MODULES
bool "Enable loadable module support"
@@ -174,38 +189,47 @@ config MODVERSIONS
comment "module support disabled"
depends !MODULES
MODVERSIONS directly depends on MODULES, this means it's only visible if
MODULES is different from 'n'. The comment on the other hand is always
-visible when MODULES it's visible (the (empty) dependency of MODULES is
+visible when MODULES is visible (the (empty) dependency of MODULES is
also part of the comment dependencies).
Kconfig syntax
--------------
The configuration file describes a series of menu entries, where every
line starts with a keyword (except help texts). The following keywords
end a menu entry:
- config
+- menuconfig
- choice/endchoice
- comment
- menu/endmenu
- if/endif
- source
-The first four also start the definition of a menu entry.
+The first five also start the definition of a menu entry.
config:
"config" <symbol>
<config options>
This defines a config symbol <symbol> and accepts any of above
attributes as options.
+menuconfig:
+ "menuconfig" <symbol>
+ <config options>
+
+This is similiar to the simple config entry above, but it also gives a
+hint to front ends, that all suboptions should be displayed as a
+separate list of options.
+
choices:
"choice"
<choice options>
<choice block>
"endchoice"