2005-09-16 08:12:27

by Ahmad Reza Cheraghi

[permalink] [raw]
Subject: Help by KConfig expansion

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


2005-09-17 01:43:21

by Roman Zippel

[permalink] [raw]
Subject: Re: Help by KConfig expansion

Hi,

On Fri, 16 Sep 2005, Ahmad Reza Cheraghi wrote:

> 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

2005-09-19 16:57:42

by Ahmad Reza Cheraghi

[permalink] [raw]
Subject: Re: Help by KConfig expansion

Dear Roman

> 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


Attachments:
zconfchange (6.51 kB)
pat1604154112

2005-09-19 17:05:15

by Sam Ravnborg

[permalink] [raw]
Subject: Re: Help by KConfig expansion

> 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:

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -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


2005-09-19 22:01:26

by Ahmad Reza Cheraghi

[permalink] [raw]
Subject: Re: Help by KConfig expansion



--- Sam Ravnborg <[email protected]> wrote:

> > 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.
>

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