[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <A46E6EB1-4687-43BA-8DE9-BBAE7BD0D160@kernel.crashing.org>
Date: Thu, 15 Feb 2007 17:44:42 -0600
From: Kumar Gala <galak@...nel.crashing.org>
To: Sam Ravnborg <sam@...nborg.org>
Cc: Linux Kernel list <linux-kernel@...r.kernel.org>
Subject: Re: kbuild question
On Feb 15, 2007, at 4:33 PM, Sam Ravnborg wrote:
> On Thu, Feb 15, 2007 at 01:18:52PM -0600, Kumar Gala wrote:
>> I was wondering if there was some way to make a Kconfig menu either
>> be just a menu or a choice depending on another bool being set or
>> not.
>>
>> What I'm trying to accomplish is if CONFIG_ONLY_HAVE_ONE is set I
>> want it so you can only select on option, however if
>> CONFIG_ONLY_HAVE_ONE is not set you should be able to select multiple
>> options.
>
> You can do so using if.
> See following example:
> --------------------------------------------------------------
> config ONLY_HAVE_ONE
> prompt "only have one?"
> boolean
>
> if ONLY_HAVE_ONE
> config FOO
> bool foo
> default y
> endif
>
> if !ONLY_HAVE_ONE
> choice
> prompt "multiple values"
> default VAL_FIRST
>
> config VAL_FIRST
> bool "First value"
>
> config VAL_SECOND
> bool "Second value"
> endchoice
>
> endif
> --------------------------------------------------------------
>
> You should be able to modify this for the usage you ask for.
>
> Hope this is useful,
It is.
Now is there some way to not have to duplicate the 'config choices
between if ONLY_HAVE_ONE and if !ONLY_HAVE_ONE
To use your example I want to do:
config ONLY_HAVE_ONE
prompt "only have one?"
boolean
if ONLY_HAVE_ONE
config VAL_FIRST
bool "First value"
config VAL_SECOND
bool "Second value"
endif
if !ONLY_HAVE_ONE
choice
prompt "multiple values"
default VAL_FIRST
config VAL_FIRST
bool "First value"
config VAL_SECOND
bool "Second value"
endchoice
endif
I'd like not to have to repeat/duplicate VAL_FIRST, VAL_SECOND, etc..
- k
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists