kconfig-language.rst (e9a83bd2322035ed9d7dcf35753d3f984d76c6a5) kconfig-language.rst (168869492e7009b6861b615f1d030c99bc805e83)
1================
2Kconfig Language
3================
4
5Introduction
6------------
7
8The configuration database is a collection of configuration options

--- 39 unchanged lines hidden (view full) ---

48
49Menu attributes
50---------------
51
52A menu entry can have a number of attributes. Not all of them are
53applicable everywhere (see syntax).
54
55- type definition: "bool"/"tristate"/"string"/"hex"/"int"
1================
2Kconfig Language
3================
4
5Introduction
6------------
7
8The configuration database is a collection of configuration options

--- 39 unchanged lines hidden (view full) ---

48
49Menu attributes
50---------------
51
52A menu entry can have a number of attributes. Not all of them are
53applicable everywhere (see syntax).
54
55- type definition: "bool"/"tristate"/"string"/"hex"/"int"
56
56 Every config option must have a type. There are only two basic types:
57 tristate and string; the other types are based on these two. The type
58 definition optionally accepts an input prompt, so these two examples
59 are equivalent::
60
61 bool "Networking support"
62
63 and::
64
65 bool
66 prompt "Networking support"
67
68- input prompt: "prompt" <prompt> ["if" <expr>]
57 Every config option must have a type. There are only two basic types:
58 tristate and string; the other types are based on these two. The type
59 definition optionally accepts an input prompt, so these two examples
60 are equivalent::
61
62 bool "Networking support"
63
64 and::
65
66 bool
67 prompt "Networking support"
68
69- input prompt: "prompt" <prompt> ["if" <expr>]
70
69 Every menu entry can have at most one prompt, which is used to display
70 to the user. Optionally dependencies only for this prompt can be added
71 with "if".
72
73- default value: "default" <expr> ["if" <expr>]
71 Every menu entry can have at most one prompt, which is used to display
72 to the user. Optionally dependencies only for this prompt can be added
73 with "if".
74
75- default value: "default" <expr> ["if" <expr>]
76
74 A config option can have any number of default values. If multiple
75 default values are visible, only the first defined one is active.
76 Default values are not limited to the menu entry where they are
77 defined. This means the default can be defined somewhere else or be
78 overridden by an earlier definition.
79 The default value is only assigned to the config symbol if no other
80 value was set by the user (via the input prompt above). If an input
81 prompt is visible the default value is presented to the user and can

--- 25 unchanged lines hidden (view full) ---

107- type definition + default value::
108
109 "def_bool"/"def_tristate" <expr> ["if" <expr>]
110
111 This is a shorthand notation for a type definition plus a value.
112 Optionally dependencies for this default value can be added with "if".
113
114- dependencies: "depends on" <expr>
77 A config option can have any number of default values. If multiple
78 default values are visible, only the first defined one is active.
79 Default values are not limited to the menu entry where they are
80 defined. This means the default can be defined somewhere else or be
81 overridden by an earlier definition.
82 The default value is only assigned to the config symbol if no other
83 value was set by the user (via the input prompt above). If an input
84 prompt is visible the default value is presented to the user and can

--- 25 unchanged lines hidden (view full) ---

110- type definition + default value::
111
112 "def_bool"/"def_tristate" <expr> ["if" <expr>]
113
114 This is a shorthand notation for a type definition plus a value.
115 Optionally dependencies for this default value can be added with "if".
116
117- dependencies: "depends on" <expr>
118
115 This defines a dependency for this menu entry. If multiple
116 dependencies are defined, they are connected with '&&'. Dependencies
117 are applied to all other options within this menu entry (which also
118 accept an "if" expression), so these two examples are equivalent::
119
120 bool "foo" if BAR
121 default y if BAR
122
123 and::
124
125 depends on BAR
126 bool "foo"
127 default y
128
129- reverse dependencies: "select" <symbol> ["if" <expr>]
119 This defines a dependency for this menu entry. If multiple
120 dependencies are defined, they are connected with '&&'. Dependencies
121 are applied to all other options within this menu entry (which also
122 accept an "if" expression), so these two examples are equivalent::
123
124 bool "foo" if BAR
125 default y if BAR
126
127 and::
128
129 depends on BAR
130 bool "foo"
131 default y
132
133- reverse dependencies: "select" <symbol> ["if" <expr>]
134
130 While normal dependencies reduce the upper limit of a symbol (see
131 below), reverse dependencies can be used to force a lower limit of
132 another symbol. The value of the current menu symbol is used as the
133 minimal value <symbol> can be set to. If <symbol> is selected multiple
134 times, the limit is set to the largest selection.
135 Reverse dependencies can only be used with boolean or tristate
136 symbols.
137
138 Note:
139 select should be used with care. select will force
140 a symbol to a value without visiting the dependencies.
141 By abusing select you are able to select a symbol FOO even
142 if FOO depends on BAR that is not set.
143 In general use select only for non-visible symbols
144 (no prompts anywhere) and for symbols with no dependencies.
145 That will limit the usefulness but on the other hand avoid
146 the illegal configurations all over.
147
148- weak reverse dependencies: "imply" <symbol> ["if" <expr>]
135 While normal dependencies reduce the upper limit of a symbol (see
136 below), reverse dependencies can be used to force a lower limit of
137 another symbol. The value of the current menu symbol is used as the
138 minimal value <symbol> can be set to. If <symbol> is selected multiple
139 times, the limit is set to the largest selection.
140 Reverse dependencies can only be used with boolean or tristate
141 symbols.
142
143 Note:
144 select should be used with care. select will force
145 a symbol to a value without visiting the dependencies.
146 By abusing select you are able to select a symbol FOO even
147 if FOO depends on BAR that is not set.
148 In general use select only for non-visible symbols
149 (no prompts anywhere) and for symbols with no dependencies.
150 That will limit the usefulness but on the other hand avoid
151 the illegal configurations all over.
152
153- weak reverse dependencies: "imply" <symbol> ["if" <expr>]
154
149 This is similar to "select" as it enforces a lower limit on another
150 symbol except that the "implied" symbol's value may still be set to n
151 from a direct dependency or with a visible prompt.
152
153 Given the following example::
154
155 config FOO
156 tristate

--- 14 unchanged lines hidden (view full) ---

171 y n * N
172 === === ============= ==============
173
174 This is useful e.g. with multiple drivers that want to indicate their
175 ability to hook into a secondary subsystem while allowing the user to
176 configure that subsystem out without also having to unset these drivers.
177
178- limiting menu display: "visible if" <expr>
155 This is similar to "select" as it enforces a lower limit on another
156 symbol except that the "implied" symbol's value may still be set to n
157 from a direct dependency or with a visible prompt.
158
159 Given the following example::
160
161 config FOO
162 tristate

--- 14 unchanged lines hidden (view full) ---

177 y n * N
178 === === ============= ==============
179
180 This is useful e.g. with multiple drivers that want to indicate their
181 ability to hook into a secondary subsystem while allowing the user to
182 configure that subsystem out without also having to unset these drivers.
183
184- limiting menu display: "visible if" <expr>
185
179 This attribute is only applicable to menu blocks, if the condition is
180 false, the menu block is not displayed to the user (the symbols
181 contained there can still be selected by other symbols, though). It is
182 similar to a conditional "prompt" attribute for individual menu
183 entries. Default value of "visible" is true.
184
185- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
186 This attribute is only applicable to menu blocks, if the condition is
187 false, the menu block is not displayed to the user (the symbols
188 contained there can still be selected by other symbols, though). It is
189 similar to a conditional "prompt" attribute for individual menu
190 entries. Default value of "visible" is true.
191
192- numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
193
186 This allows to limit the range of possible input values for int
187 and hex symbols. The user can only input a value which is larger than
188 or equal to the first symbol and smaller than or equal to the second
189 symbol.
190
191- help text: "help" or "---help---"
194 This allows to limit the range of possible input values for int
195 and hex symbols. The user can only input a value which is larger than
196 or equal to the first symbol and smaller than or equal to the second
197 symbol.
198
199- help text: "help" or "---help---"
200
192 This defines a help text. The end of the help text is determined by
193 the indentation level, this means it ends at the first line which has
194 a smaller indentation than the first line of the help text.
195 "---help---" and "help" do not differ in behaviour, "---help---" is
196 used to help visually separate configuration logic from help within
197 the file as an aid to developers.
198
199- misc options: "option" <symbol>[=<value>]
201 This defines a help text. The end of the help text is determined by
202 the indentation level, this means it ends at the first line which has
203 a smaller indentation than the first line of the help text.
204 "---help---" and "help" do not differ in behaviour, "---help---" is
205 used to help visually separate configuration logic from help within
206 the file as an aid to developers.
207
208- misc options: "option" <symbol>[=<value>]
209
200 Various less common options can be defined via this option syntax,
201 which can modify the behaviour of the menu entry and its config
202 symbol. These options are currently possible:
203
204 - "defconfig_list"
205 This declares a list of default entries which can be used when
206 looking for the default configuration (which is used when the main
207 .config doesn't exists yet.)

--- 112 unchanged lines hidden (view full) ---

320- comment
321- menu/endmenu
322- if/endif
323- source
324
325The first five also start the definition of a menu entry.
326
327config::
210 Various less common options can be defined via this option syntax,
211 which can modify the behaviour of the menu entry and its config
212 symbol. These options are currently possible:
213
214 - "defconfig_list"
215 This declares a list of default entries which can be used when
216 looking for the default configuration (which is used when the main
217 .config doesn't exists yet.)

--- 112 unchanged lines hidden (view full) ---

330- comment
331- menu/endmenu
332- if/endif
333- source
334
335The first five also start the definition of a menu entry.
336
337config::
338
328 "config" <symbol>
329 <config options>
330
331This defines a config symbol <symbol> and accepts any of above
332attributes as options.
333
334menuconfig::
339 "config" <symbol>
340 <config options>
341
342This defines a config symbol <symbol> and accepts any of above
343attributes as options.
344
345menuconfig::
346
335 "menuconfig" <symbol>
336 <config options>
337
338This is similar to the simple config entry above, but it also gives a
339hint to front ends, that all suboptions should be displayed as a
340separate list of options. To make sure all the suboptions will really
341show up under the menuconfig entry and not outside of it, every item
342from the <config options> list must depend on the menuconfig symbol.

--- 347 unchanged lines hidden ---
347 "menuconfig" <symbol>
348 <config options>
349
350This is similar to the simple config entry above, but it also gives a
351hint to front ends, that all suboptions should be displayed as a
352separate list of options. To make sure all the suboptions will really
353show up under the menuconfig entry and not outside of it, every item
354from the <config options> list must depend on the menuconfig symbol.

--- 347 unchanged lines hidden ---