I'm using the Linux kernel's configuration tool Kconfig
to manage the configuration of my own project.
(Please could someone with sufficient rep add "Kconfig" tag or whatever tag would be more appropriate). I didn't tag as "linux" or as "kernel" since my actual project is not the Linux kernel.
Given the following configuration:
mainmenu "Select/choice interaction test"
# Selectable menu granting access to multiple potentially independent config vars
menuconfig MULTICHOICE
bool "Multichoice"
config MULTICHOICE_A
bool "A"
depends on MULTICHOICE
config MULTICHOICE_B
bool "B"
depends on MULTICHOICE
config MULTICHOICE_C
bool "C"
depends on MULTICHOICE
# Choose exactly one item
choice CHOICE
prompt "Choice"
config CHOICE_A
bool "A"
config CHOICE_B
bool "B"
config CHOICE_C
bool "C"
endchoice
# Booleans which restrict/select other options from the previous sections
config SET_A
bool "Select A"
select CHOICE_A
select MULTICHOICE
select MULTICHOICE_A
config SET_B
bool "Select B"
select CHOICE_B
select MULTICHOICE
select MULTICHOICE_B
config SET_C
bool "Select C"
select CHOICE_C
select MULTICHOICE
select MULTICHOICE_C
Selecting items in a menuconfig
works as expected. But setting the value of the choice
does not work.
I can understand a potential problem (conflict) here - what if multiple options from the choice
were selected implicitly by other configuration variables?
But in the sane case of only one choice option being implicitly selected by others, the value of the choice does not change.
For example, open that configuration file above with nconfig/menuconfig/gconfig/xconfig then select exactly one of SET_A
/SET_B
/SET_C
. The value of CHOICE
does not change at all.
Is there some other way of ensuring that only one option from a set is selected, but also forcing it to a certain value if other configuration variables are set a particular way?
kconfig
tag. – pevik Feb 27 '20 at 18:01