Add a "nonintconfig" option to the Makefile needed for unattended builds.
This patch is from Arjan ven de Ven <[email protected]>

[Ameya Palande]: Get rid of fuzz and checkpatch warnings.

Signed-off-by: Yong Wang <[email protected]>
Signed-off-by: Ameya Palande <[email protected]>
---
 scripts/kconfig/Makefile |    5 +++++
 scripts/kconfig/conf.c   |   37 +++++++++++++++++++++++++++++++++----
 2 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 7ea649d..d647eca 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -33,6 +33,11 @@ silentoldconfig: $(obj)/conf
        $(Q)mkdir -p include/generated
        $< -s $(Kconfig)
 
+nonint_oldconfig: $(obj)/conf
+       $< -b $(Kconfig)
+loose_nonint_oldconfig: $(obj)/conf
+       $< -B $(Kconfig)
+
 # if no path is given, then use src directory to find file
 ifdef LSMOD
 LSMOD_F := $(LSMOD)
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 9960d1c..a3b2c99 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -23,6 +23,8 @@ enum {
        ask_all,
        ask_new,
        ask_silent,
+       dont_ask,
+       dont_ask_dont_tell,
        set_default,
        set_yes,
        set_mod,
@@ -38,6 +40,8 @@ static int conf_cnt;
 static char line[128];
 static struct menu *rootEntry;
 
+static int return_value;
+
 static void print_help(struct menu *menu)
 {
        struct gstr help = str_new();
@@ -360,7 +364,10 @@ static void conf(struct menu *menu)
 
                switch (prop->type) {
                case P_MENU:
-                       if (input_mode == ask_silent && rootEntry != menu) {
+                       if ((input_mode == ask_silent ||
+                            input_mode == dont_ask ||
+                            input_mode == dont_ask_dont_tell) &&
+                           rootEntry != menu) {
                                check_conf(menu);
                                return;
                        }
@@ -418,12 +425,22 @@ static void check_conf(struct menu *menu)
        if (sym && !sym_has_value(sym)) {
                if (sym_is_changable(sym) ||
                    (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) 
{
+                       if (input_mode == dont_ask ||
+                           input_mode == dont_ask_dont_tell) {
+                               if (input_mode == dont_ask &&
+                                   sym->name && !sym_is_choice_value(sym)) {
+                                       fprintf(stderr, "CONFIG_%s\n",
+                                                       sym->name);
+                                       ++return_value;
+                               }
+                       } else {
                        if (!conf_cnt++)
                                printf(_("*\n* Restart config...\n*\n"));
                        rootEntry = menu_get_parent_menu(menu);
                        conf(rootEntry);
                }
        }
+       }
 
        for (child = menu->list; child; child = child->next)
                check_conf(child);
@@ -439,7 +456,7 @@ int main(int ac, char **av)
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
 
-       while ((opt = getopt(ac, av, "osdD:nmyrh")) != -1) {
+       while ((opt = getopt(ac, av, "osbBdD:nmyrh")) != -1) {
                switch (opt) {
                case 'o':
                        input_mode = ask_silent;
@@ -448,6 +465,12 @@ int main(int ac, char **av)
                        input_mode = ask_silent;
                        sync_kconfig = 1;
                        break;
+               case 'b':
+                       input_mode = dont_ask;
+                       break;
+               case 'B':
+                       input_mode = dont_ask_dont_tell;
+                       break;
                case 'd':
                        input_mode = set_default;
                        break;
@@ -525,6 +548,8 @@ int main(int ac, char **av)
        case ask_silent:
        case ask_all:
        case ask_new:
+       case dont_ask:
+       case dont_ask_dont_tell:
                conf_read(NULL);
                break;
        case set_no:
@@ -586,12 +611,16 @@ int main(int ac, char **av)
                conf(&rootmenu);
                input_mode = ask_silent;
                /* fall through */
+       case dont_ask:
+       case dont_ask_dont_tell:
        case ask_silent:
                /* Update until a loop caused no more changes */
                do {
                        conf_cnt = 0;
                        check_conf(&rootmenu);
-               } while (conf_cnt);
+               } while (conf_cnt &&
+                        (input_mode != dont_ask &&
+                         input_mode != dont_ask_dont_tell));
                break;
        }
 
@@ -613,5 +642,5 @@ int main(int ac, char **av)
                        exit(1);
                }
        }
-       return 0;
+       return return_value;
 }
-- 
1.7.0.4

_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev

Reply via email to