[Toybox] kconfig replacement

Rob Landley rob at landley.net
Tue Feb 21 18:02:15 PST 2012


On 02/18/2012 11:54 PM, David Seikel wrote:
> On Sat, 18 Feb 2012 23:37:17 -0600 Rob Landley <rob at landley.net> wrote:
> 
>> On 02/17/2012 03:52 PM, Kai Trukenmueller wrote:
>>> attached is scripts/mkconfig.awk which could replace kconfig/*.
>>
>> Hmmm.  Interesting.
>>
>> I'm by no means an awk expert, but then I didn't know anything about
>> sed before I had to turn busybox's half implementation into a real
>> one that autoconf could use.  I'll need to write an awk eventually...
>>
>>> It could be used from the makefile for the targets:
>>>
>>> config:
>>>     awk -f scripts/mkconfig.awk Config.in toys/*.c
>>>
>>> allyesconfig:
>>>     yes | awk -f script/mkconfig.awk Config.in toys/*.c
>>>
>>> allnoconfig:
>>>     yes n | awk -f scripts/mkconfig.awk Config.in toys/*.c
>>>
>>> defaultconfig:
>>>     yes "" | awk -f scripts/mkconfig.awk Config.in toys/*.c
>>>
>>>
>>> it is not a replacement for menuconfig.
>>
>> Which worries me a bit.
>>
>> The plan for the new menuconfig was to just emit ANSI sequences rather
>> than using ncurses, but it still needs to interactively respond to
>> cursor keys (which are themselves multi-character sequences), maintain
>> internal state (what you've selected and what you haven't, plus
>> dependency resolution), and then write out the result.
>>
>> I have no idea how to do this in awk.  But then, I don't know awk.
>>
>> Awk is a SUSv4 command I plan to add to toybox, if this _can_ be
>> implemented in awk by all means let's do it. The alternative is to
>> write it in C.
>>
>> We could also do just menuconfig in C, and do the others in awk, but
>> then they can't share infrastructure.  Running menuconfig and then
>> exiting immediately is pretty much either "defconfig" or "oldconfig"
>> depending on context...
> 
> This is around about the time that people convert awk to perl and keep
> going.  Don't think either of us want that.

Not gonna happen.

> C that constructs awk commands then runs them maybe?  Not actually
> looked at this yet.

Just being able to do allnoconfig/allyesconfig/defconfig is good.  I can
move some of a config targets over to the new infrastructure without
necessarily moving all of them over...

I may still eventually write a new menuconfig in C, but until then this
is a pretty good stopgap...

Rob



More information about the Toybox mailing list