# Re: \[RFC\]\[PATCH\] kconfig: implement select with values

- From: Grant Likely \<hidden\>
- Date: 2010-07-26 22:47:23 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2010/07/3597405
- Thread: https://ratatoskr.run/linuxppc-dev/2010/07/3594890/t.md

```text
Hi Sam,

On Mon, Jul 26, 2010 at 4:17 PM, Sam Ravnborg [ref] wrote:
> On Tue, Jul 20, 2010 at 04:37:06AM +1000, Stephen Rothwell wrote:
>> This is a fairly brute force approach to allowing a Kconfig "select"
>> to specify an excplicit value for the selected config sybmol.
>>
>> The syntax of select is changed to:
>>
>> =A0 =A0 =A0 "select" <symbol> [<expr>] ["if" expr]
>>
>> The approach taken is to add a list of <value, dependency expression>
>> pairs to the symbol and check them whenever the reverse depends (from
>> a current-style select) are checked.
>
> I do not see the need for this feature.
> I have read most of the postings in the defconfig battle and
> I saw Linus' select suggestion.
>
> But we can do almost all of this today (or tomorrow).
>
> Consider following Kconfig file:
>
> =A0 =A0config USB_SUPPORT
> =A0 =A0 =A0 =A0 =A0 =A0def_bool n
>
> =A0 =A0config NET
> =A0 =A0 =A0 =A0 =A0 =A0def_bool y
>
> =A0 =A0source arch/x86/Kconfig
>
> We use the feature that we can specify the same
> config option several times.
> And the first default value that is "visible"
> will be used.
>
> So it allows us to enable and disable any option.
>
> And if we for example want to set a specific LOG_BUF_SHIFT
> we use the same trick:
>
> =A0 =A0config LOG_BUF_SHIFT
> =A0 =A0 =A0 =A0 =A0 =A0int
> =A0 =A0 =A0 =A0 =A0 =A0default 14

Cute.  I didn't know this was possible.  I'll give it a try and see
how it works for me.  Do override config options also pickup
select/depends constraints applied by later definitions?  I think that
would be necessary to kick out warnings when a defconfig selection
isn't actually achievable.

g.

>
>
> Now in the original suggestion of Linus he used:
>
> =A0 =A0KBUILD_KCONFIG=3DMykconfig make allnoconfig
>
> And "allnoconfig" would make the modified defaults useless.
>
> But the soon-to-be-introduced alldefconfig is more sensible.
>
> alldefconfig uses default values for everything.

I basically used defconfig in the prototype that I posted.  I think it
works well for me, and I've got it integrated into the build targets
(just like Stephen's earlier patch) without having to do a
KBUILD_KCONFIG trick.

g.

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
```
