public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Lacombe <lacombar@gmail.com>
To: Sam Ravnborg <sam@ravnborg.org>, Michal Marek <mmarek@suse.cz>
Cc: linux-kbuild <linux-kbuild@vger.kernel.org>,
	Arnaud Lacombe <lacombar@gmail.com>
Subject: [PATCH 06/15] kconfig: implement the `mainmenu' directive
Date: Sat, 11 Sep 2010 11:51:13 -0400	[thread overview]
Message-ID: <1284220282-3500-7-git-send-email-lacombar@gmail.com> (raw)
In-Reply-To: <1284220282-3500-1-git-send-email-lacombar@gmail.com>

If specified, the directive must be placed at the top of the Kconfig file.

We need to change the grammar to make the mainmenu directive set the
`rootmenu' prompt. This reflect how menu_add_prompt() works internally, ie.
set the prompt of the `current_entry', pointing originally to `rootmenu'.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
---
 Documentation/kbuild/kconfig-language.txt |    3 ++-
 scripts/kconfig/zconf.y                   |   14 +++++++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt
index b472e4e..2fe93ca 100644
--- a/Documentation/kbuild/kconfig-language.txt
+++ b/Documentation/kbuild/kconfig-language.txt
@@ -322,7 +322,8 @@ mainmenu:
 	"mainmenu" <prompt>
 
 This sets the config program's title bar if the config program chooses
-to use it.
+to use it. It should be placed at the top of the configuration, before any
+other statement.
 
 
 Kconfig hints
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 23dfd3b..e9b14efd 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -36,7 +36,7 @@ static struct menu *current_menu, *current_entry;
 #define YYERROR_VERBOSE
 #endif
 %}
-%expect 26
+%expect 28
 
 %union
 {
@@ -104,14 +104,15 @@ static struct menu *current_menu, *current_entry;
 %}
 
 %%
-input: stmt_list;
+input: nl start | start;
+
+start: mainmenu_stmt stmt_list | stmt_list;
 
 stmt_list:
 	  /* empty */
 	| stmt_list common_stmt
 	| stmt_list choice_stmt
 	| stmt_list menu_stmt
-	| stmt_list T_MAINMENU prompt nl
 	| stmt_list end			{ zconf_error("unexpected end statement"); }
 	| stmt_list T_WORD error T_EOL	{ zconf_error("unknown statement \"%s\"", $2); }
 	| stmt_list option_name error T_EOL
@@ -342,6 +343,13 @@ if_block:
 	| if_block choice_stmt
 ;
 
+/* mainmenu entry */
+
+mainmenu_stmt: T_MAINMENU prompt nl
+{
+	menu_add_prompt(P_MENU, $2, NULL);
+};
+
 /* menu entry */
 
 menu: T_MENU prompt T_EOL
-- 
1.7.2.30.gc37d7.dirty


  parent reply	other threads:[~2010-09-11 15:54 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-11 15:51 [PATCH 00/15] Kconfig generalization Arnaud Lacombe
2010-09-11 15:51 ` [PATCH 01/15] kconfig: replace a `switch()' statement by a more flexible `if()' statement Arnaud Lacombe
2010-09-11 15:51 ` [PATCH 02/15] kconfig: rephrase help text not to mention the internal prefix Arnaud Lacombe
2010-09-11 15:51 ` [PATCH 03/15] kconfig: allow build-time definition of the internal config prefix Arnaud Lacombe
2010-09-11 15:51 ` [PATCH 04/15] kconfig: rephrase help texts/comments not to include the package name Arnaud Lacombe
2010-09-11 20:22   ` Randy Dunlap
2010-09-12  4:04     ` Arnaud Lacombe
2010-10-21  2:40     ` Arnaud Lacombe
2010-10-21  3:44       ` Randy Dunlap
2010-09-17 21:59   ` Michal Marek
2010-09-11 15:51 ` [PATCH 05/15] kconfig: allow PACKAGE to be defined on the compiler's command-line Arnaud Lacombe
2010-09-11 15:51 ` Arnaud Lacombe [this message]
2010-09-19  9:42   ` [PATCH 06/15] kconfig: implement the `mainmenu' directive Sam Ravnborg
2010-09-19 14:53     ` Arnaud Lacombe
2010-09-11 15:51 ` [PATCH 07/15] kconfig: add a symbol string expansion helper Arnaud Lacombe
2010-09-11 15:51 ` [PATCH 08/15] kconfig: expand by default the rootmenu's prompt Arnaud Lacombe
2010-09-11 15:57   ` Arnaud Lacombe
2010-09-11 15:51 ` [PATCH 09/15] kconfig: replace KERNELVERSION usage by the mainmenu's prompt Arnaud Lacombe
2010-09-11 16:05   ` Arnaud Lacombe
2010-09-17 22:02   ` Michal Marek
2010-09-17 22:16   ` Arnaud Lacombe
2010-09-11 15:51 ` [PATCH 10/15] kconfig: don't emit warning upon rootmenu's prompt redefinition Arnaud Lacombe
2010-09-11 15:51 ` [PATCH 11/15] kconfig: constify file name Arnaud Lacombe
2010-09-11 15:51 ` [PATCH 12/15] kconfig: use the file's name of sourced file Arnaud Lacombe
2010-09-11 15:51 ` [PATCH 13/15] kconfig: expand file names Arnaud Lacombe
2010-09-11 15:51 ` [PATCH 14/15] kconfig: regen parser Arnaud Lacombe
2010-09-17 22:10   ` Michal Marek
2010-09-11 15:51 ` [PATCH 15/15] kbuild: migrate all arch to the kconfig mainmenu upgrade Arnaud Lacombe
2010-09-12  4:12 ` [DIFF] kbuild-generic-v5 -> kbuild-generic-v6 Arnaud Lacombe
2010-09-22 17:07   ` [DIFF] kbuild-generic-v6 -> kbuild/kconfig/kbuild-generic-v7 Arnaud Lacombe
2010-09-27 21:25     ` Michal Marek
2010-09-17 22:16 ` [PATCH 00/15] Kconfig generalization Michal Marek
2010-09-19  9:50 ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1284220282-3500-7-git-send-email-lacombar@gmail.com \
    --to=lacombar@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox