aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/conf.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2005-11-09 00:34:49 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 10:55:53 -0500
commit90389160efc2864501ced6e662f9419eb7a3e6c8 (patch)
tree3b2957a7540bf9e78ef106fe606945e435fab957 /scripts/kconfig/conf.c
parent3f23ca2b37d13a89bb6cd0421821fc9c3b8ccd47 (diff)
[PATCH] kconfig: preset config during all*config
Allow to force setting of config variables during all{no,mod,yes,random}config to a specific value. For that conf first checks the KCONFIG_ALLCONFIG environment variable for a file name, otherwise it checks for all{no,mod,yes,random}.config and all.config. The file is a normal config file, which presets the config variables, but they are still subject to normal dependency checks. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'scripts/kconfig/conf.c')
-rw-r--r--scripts/kconfig/conf.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index dffbf2ea1f9d..8ba5d29d3d42 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -82,6 +82,15 @@ static void conf_askvalue(struct symbol *sym, const char *def)
82 } 82 }
83 83
84 switch (input_mode) { 84 switch (input_mode) {
85 case set_no:
86 case set_mod:
87 case set_yes:
88 case set_random:
89 if (sym_has_value(sym)) {
90 printf("%s\n", def);
91 return;
92 }
93 break;
85 case ask_new: 94 case ask_new:
86 case ask_silent: 95 case ask_silent:
87 if (sym_has_value(sym)) { 96 if (sym_has_value(sym)) {
@@ -558,6 +567,27 @@ int main(int ac, char **av)
558 case ask_new: 567 case ask_new:
559 conf_read(NULL); 568 conf_read(NULL);
560 break; 569 break;
570 case set_no:
571 case set_mod:
572 case set_yes:
573 case set_random:
574 name = getenv("KCONFIG_ALLCONFIG");
575 if (name && !stat(name, &tmpstat)) {
576 conf_read_simple(name);
577 break;
578 }
579 switch (input_mode) {
580 case set_no: name = "allno.config"; break;
581 case set_mod: name = "allmod.config"; break;
582 case set_yes: name = "allyes.config"; break;
583 case set_random: name = "allrandom.config"; break;
584 default: break;
585 }
586 if (!stat(name, &tmpstat))
587 conf_read_simple(name);
588 else if (!stat("all.config", &tmpstat))
589 conf_read_simple("all.config");
590 break;
561 default: 591 default:
562 break; 592 break;
563 } 593 }