summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/conf.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2005-11-08 21:34:49 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 07:55:53 -0800
commit90389160efc2864501ced6e662f9419eb7a3e6c8 (patch)
tree3b2957a7540bf9e78ef106fe606945e435fab957 /scripts/kconfig/conf.c
parent3f23ca2b37d13a89bb6cd0421821fc9c3b8ccd47 (diff)
downloadop-kernel-dev-90389160efc2864501ced6e662f9419eb7a3e6c8.zip
op-kernel-dev-90389160efc2864501ced6e662f9419eb7a3e6c8.tar.gz
[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 dffbf2e..8ba5d29 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)
}
switch (input_mode) {
+ case set_no:
+ case set_mod:
+ case set_yes:
+ case set_random:
+ if (sym_has_value(sym)) {
+ printf("%s\n", def);
+ return;
+ }
+ break;
case ask_new:
case ask_silent:
if (sym_has_value(sym)) {
@@ -558,6 +567,27 @@ int main(int ac, char **av)
case ask_new:
conf_read(NULL);
break;
+ case set_no:
+ case set_mod:
+ case set_yes:
+ case set_random:
+ name = getenv("KCONFIG_ALLCONFIG");
+ if (name && !stat(name, &tmpstat)) {
+ conf_read_simple(name);
+ break;
+ }
+ switch (input_mode) {
+ case set_no: name = "allno.config"; break;
+ case set_mod: name = "allmod.config"; break;
+ case set_yes: name = "allyes.config"; break;
+ case set_random: name = "allrandom.config"; break;
+ default: break;
+ }
+ if (!stat(name, &tmpstat))
+ conf_read_simple(name);
+ else if (!stat("all.config", &tmpstat))
+ conf_read_simple("all.config");
+ break;
default:
break;
}
OpenPOWER on IntegriCloud