Skip to contentSkip to conversation

Help by KConfig expansion

DISCUSSION Ahmad Reza Cheraghi 3 participants 5 messages Sep 16, 2005 – Sep 19, 2005 Kconfig

lore
Share & tools
lore
#0 lore raw

Im all the time going through all the file in the
<KERNEL>/scripts/kconfig without any success. I dont find any beginning and any end.
I want to expand the Kconfig by a new Attribute. The property of the attribute is just to give out the message that is written beside it, to a new component of the struct menu or struct poperty.

e.g.

config BLA
bool "bla"
auto "blabla"

That what is written beside the "auto" should save in the Component called char *auto in one of the above mentioned struct. There must be some changes in the file zconf.tab.c. Any Suggestion how to this??

__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com

#1 lore raw

Hi,

Quoted 4 lines · Ahmad Reza Cheraghi

That what is written beside the "auto" should save in the Component called char *auto in one of the above mentioned struct. There must be some changes in the file zconf.tab.c. Any Suggestion how to this??

You have to modify zconf.l/zconf.y for this and regenerate this file (check the Makefile). First you have to define the keywords in zconf.l and then extend the parser in zconf.y to recognize them and add the data to the internal structures.

bye, Roman

#2 lore raw

Dear Roman

Quoted 7 lines

You have to modify zconf.l/zconf.y for this and regenerate this file
(check the Makefile). First you have to define the keywords in zconf.l
and then extend the parser in zconf.y to recognize them and add the data
to the internal structures.

I tryed to do this. I saw how the attribute "comment" is definded in the zconf.l and zconf.y, and definded the the attribute "autorule" exactly the same way. But it still don't work. Even though I changed the zconf.tab.c_shipped as well but it still dont work. I dont understand the switch-case for yyn(line 1274 in zconf.tab.c_shipped). Why does a the function "menu_add_prop(P_COMMENT...)" (line 1587) gets called by the case 75? How do you declare such a case number? e.g. case 100 should calle "menu_add_prop(P_AUTORULE...)".
I seriously wouldn't take your time by asking that, if I didn't tryed any thing out, what comes up in my mind. I realy cant figure it out by myself. I send you diff file(patch) of what I changed. To see me what I did wrong and what I should do.

Your sincerly

A.R.Cheraghi

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#3 lore raw
Quoted 5 lines

I tryed to do this. I saw how the attribute "comment" is definded in the zconf.l and zconf.y, and definded the the attribute "autorule" exactly the same way. But it still don't work. Even though I changed the zconf.tab.c_shipped as well but it still dont work.

You need to generate the source using bison.
You must understand that zconf.l is an input file for flex. Likewise zconf.y is input for bison.

See scripts/kconfig/Makefile for how to generate the files.

Sam

Or even simpler - apply following patch:

scripts/kconfig/Makefile +4 -4
@@ -129,9 +129,9 @@ HOSTCFLAGS_gconf.o	= `pkg-config gtk+-2.
 
 $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o $(obj)/kxgettext: $(obj)/zconf.tab.h
 
-$(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped
-$(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped
-$(obj)/lex.zconf.c: $(src)/lex.zconf.c_shipped
+#$(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped
+#$(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped
+#$(obj)/lex.zconf.c: $(src)/lex.zconf.c_shipped
 
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
@@ -212,7 +212,7 @@ $(obj)/lkc_defs.h: $(src)/lkc_proto.h
 # The following requires flex/bison
 # By default we use the _shipped versions, uncomment the following line if
 # you are modifying the flex/bison src.
-# LKC_GENPARSER := 1
+LKC_GENPARSER := 1
 
 ifdef LKC_GENPARSER
 
#4 lore raw
Quoted 10 lines · --- Sam Ravnborg
Quoted 1 line

I tryed to do this. I saw how the attribute

"comment"

Quoted 1 line

is definded in the zconf.l and zconf.y, and

definded

Quoted 1 line

the the attribute "autorule" exactly the same way.

But

Quoted 2 lines

it still don't work. Even though I changed the
zconf.tab.c_shipped as well but it still dont

work.

Quoted 8 lines

You need to generate the source using bison.
You must understand that zconf.l is an input file
for flex.
Likewise zconf.y is input for bison.

See scripts/kconfig/Makefile for how to generate the files.

It works. Thanks you very much.

Regards

A.R.Cheraghi

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com