kconfig-language.rst (8dd06ef34b6e2f41b29fbf5fc1663780f2524285) | kconfig-language.rst (893ab00439a45513cae55781fc8e3b7108ee1cda) |
---|---|
1================ 2Kconfig Language 3================ 4 5Introduction 6------------ 7 8The configuration database is a collection of configuration options --- 145 unchanged lines hidden (view full) --- 154 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 | 1================ 2Kconfig Language 3================ 4 5Introduction 6------------ 7 8The configuration database is a collection of configuration options --- 145 unchanged lines hidden (view full) --- 154 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 | 162 tristate "foo" |
163 imply BAZ 164 165 config BAZ | 163 imply BAZ 164 165 config BAZ |
166 tristate | 166 tristate "baz" |
167 depends on BAR 168 169 The following values are possible: 170 171 === === ============= ============== 172 FOO BAR BAZ's default choice for BAZ 173 === === ============= ============== 174 n y n N/m/y 175 m y m M/y/n | 167 depends on BAR 168 169 The following values are possible: 170 171 === === ============= ============== 172 FOO BAR BAZ's default choice for BAZ 173 === === ============= ============== 174 n y n N/m/y 175 m y m M/y/n |
176 y y y Y/n | 176 y y y Y/m/n 177 n m n N/m 178 m m m M/n 179 y m n M/n |
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 | 180 y n * N 181 === === ============= ============== 182 183 This is useful e.g. with multiple drivers that want to indicate their 184 ability to hook into a secondary subsystem while allowing the user to 185 configure that subsystem out without also having to unset these drivers. 186 |
187 Note: If the combination of FOO=y and BAR=m causes a link error, 188 you can guard the function call with IS_REACHABLE():: 189 190 foo_init() 191 { 192 if (IS_REACHABLE(CONFIG_BAZ)) 193 baz_register(&foo); 194 ... 195 } 196 197 Note: If the feature provided by BAZ is highly desirable for FOO, 198 FOO should imply not only BAZ, but also its dependency BAR:: 199 200 config FOO 201 tristate "foo" 202 imply BAR 203 imply BAZ 204 |
|
184- limiting menu display: "visible if" <expr> 185 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 --- 322 unchanged lines hidden (view full) --- 514 config STACKPROTECTOR 515 bool "Stack Protector buffer overflow detection" 516 depends on $(cc-option,-fstack-protector) 517 ... 518 519If you need to expose a compiler capability to makefiles and/or C source files, 520`CC_HAS_` is the recommended prefix for the config option:: 521 | 205- limiting menu display: "visible if" <expr> 206 207 This attribute is only applicable to menu blocks, if the condition is 208 false, the menu block is not displayed to the user (the symbols 209 contained there can still be selected by other symbols, though). It is 210 similar to a conditional "prompt" attribute for individual menu 211 entries. Default value of "visible" is true. 212 --- 322 unchanged lines hidden (view full) --- 535 config STACKPROTECTOR 536 bool "Stack Protector buffer overflow detection" 537 depends on $(cc-option,-fstack-protector) 538 ... 539 540If you need to expose a compiler capability to makefiles and/or C source files, 541`CC_HAS_` is the recommended prefix for the config option:: 542 |
522 config CC_HAS_STACKPROTECTOR_NONE 523 def_bool $(cc-option,-fno-stack-protector) | 543 config CC_HAS_ASM_GOTO 544 def_bool $(success,$(srctree)/scripts/gcc-goto.sh $(CC)) |
524 525Build as module only 526~~~~~~~~~~~~~~~~~~~~ 527To restrict a component build to module-only, qualify its config symbol 528with "depends on m". E.g.:: 529 530 config FOO 531 depends on BAR && m --- 168 unchanged lines hidden --- | 545 546Build as module only 547~~~~~~~~~~~~~~~~~~~~ 548To restrict a component build to module-only, qualify its config symbol 549with "depends on m". E.g.:: 550 551 config FOO 552 depends on BAR && m --- 168 unchanged lines hidden --- |