Re: [kbuild-devel] [rfe] easier customization of kconfig for non-Linux projects

From: Yann E. MORIN
Date: Thu May 24 2007 - 18:27:41 EST


Hello all!

Sorry to jump into the discussion, but...

On Thursday 24 May 2007 08:40, Sam Ravnborg wrote:
> The intent with this is clear but the solution you suggest albeit simple
> does not really match where we could end up with kconfig.
> Recently Roman added support for options in the kconfig language
> and I would assume we could deal with most of this just using options.
>
> One example could be to support options for the mainmenu entrye like this:
>
> mainmenu "Busybow config system"
> option project="Busybox"
> option version="$VERSION" <= Where '$' signify an environment variable

I would rather suggest a kind of 'namespace' thing. This way, one could use
the kconfig language for a project (eg. buildroot) and include sub-Kconfig
files from other sub-projects (eg. kernel), thus making all configurable
from the same menu.

Something like (syntax proposal):

----8<----
mainmenu "Buildroot config system"
option prefix="" <= prefix to config options

config foo => foo=y / # foo is not set
blah blah blah...

namespace "Buildroot options"
option project="Buildroot"
option version="${VERSION}" <= To avoid $VERSION_test ambiguity
option prefix="BR2_" <= prefix to config options

config bar => BR2_bar=y / # BR2_bar is not set
blah blah blah...

endnamespace

namespace "Linux Kernel options"
option project="Linux"
option version="..."
option prefix="CONFIG_"

include "${BR2_KERNEL_DIR}/arch/${BR2_ARCH]/Kconfig"

endnamespace
----8<----

Then with a simple grep -E '^CONFIG_' one can easily extract the kernel
options from the others.

We _may_ need to support nested namespaces also, concatenating the prefixes.

I once tried to do such thing, but I'm lacking good lex/yacc fu, and I
miserably failed... :-(

Comments?

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software Designer | \ / CAMPAIGN | ^ |
| --==< °_° >==-- °------------.-------: X AGAINST | /e\ There is no |
| http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL | """ conspiracy. |
°------------------------------°-------°------------------°--------------------°

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/