public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: sam@ravnborg.org
To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Cc: Sam Ravnborg <sam@uranus.ravnborg.org>, Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH] kconfig: drop all*config support in conf.c
Date: Fri,  2 May 2008 22:49:15 +0200	[thread overview]
Message-ID: <1209761358-6579-2-git-send-email-sam@ravnborg.org> (raw)
In-Reply-To: <1209761358-6579-1-git-send-email-sam@ravnborg.org>

From: Sam Ravnborg <sam@uranus.ravnborg.org>

With the introduction of aconf we can now kill all
the old all*config support code in conf.c
Modified Makefile so defconfig is now handled by
aconf always.
This removed the feature that kconfig could look
up a default configuration in one of the files listed
in DEFCONFIG_LIST.
But this was only used by archs that did not define
KBUILD_DEFCONFIG so no harm done.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/kconfig/Makefile |   12 ++--
 scripts/kconfig/conf.c   |  128 +---------------------------------------------
 2 files changed, 7 insertions(+), 133 deletions(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 3e560a4..47d5df8 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -57,14 +57,14 @@ $(aconf-targets): $(src)/aconf.sh $(obj)/aconf
 	$(Q)K=arch/$(SRCARCH)/configs/$@ \
 	$(CONFIG_SHELL) $< alldefconfig $(Kconfig)
 
-ifeq ($(KBUILD_DEFCONFIG),)
-defconfig: $(obj)/conf
-	$< -d $(Kconfig)
-else
+defconfig-file := $(if $(KBUILD_DEFCONFIG),            \
+        arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG),   \
+        arch/$(SRCARCH)/defconfig)
+defconfig-file := $(strip $(defconfig-file))
+
 defconfig: $(src)/aconf.sh $(obj)/aconf
-	$(Q)K=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) \
+	$(Q)K=$(defconfig-file) \
 	$(CONFIG_SHELL) $< alldefconfig $(Kconfig)
-endif
 
 
 # Help text used by make help
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index fda6313..7aabe0b 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -22,13 +22,7 @@ enum {
 	ask_all,
 	ask_new,
 	ask_silent,
-	set_default,
-	set_yes,
-	set_mod,
-	set_no,
-	set_random
 } input_mode = ask_all;
-char *defconfig_file;
 
 static int indent = 1;
 static int valid_stdin = 1;
@@ -76,7 +70,6 @@ static void check_stdin(void)
 static int conf_askvalue(struct symbol *sym, const char *def)
 {
 	enum symbol_type type = sym_get_type(sym);
-	tristate val;
 
 	if (!sym_has_value(sym))
 		printf(_("(NEW) "));
@@ -92,15 +85,6 @@ static int 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 0;
-		}
-		break;
 	case ask_new:
 	case ask_silent:
 		if (sym_has_value(sym)) {
@@ -112,9 +96,6 @@ static int conf_askvalue(struct symbol *sym, const char *def)
 		fflush(stdout);
 		fgets(line, 128, stdin);
 		return 1;
-	case set_default:
-		printf("%s\n", def);
-		return 1;
 	default:
 		break;
 	}
@@ -128,52 +109,6 @@ static int conf_askvalue(struct symbol *sym, const char *def)
 	default:
 		;
 	}
-	switch (input_mode) {
-	case set_yes:
-		if (sym_tristate_within_range(sym, yes)) {
-			line[0] = 'y';
-			line[1] = '\n';
-			line[2] = 0;
-			break;
-		}
-	case set_mod:
-		if (type == S_TRISTATE) {
-			if (sym_tristate_within_range(sym, mod)) {
-				line[0] = 'm';
-				line[1] = '\n';
-				line[2] = 0;
-				break;
-			}
-		} else {
-			if (sym_tristate_within_range(sym, yes)) {
-				line[0] = 'y';
-				line[1] = '\n';
-				line[2] = 0;
-				break;
-			}
-		}
-	case set_no:
-		if (sym_tristate_within_range(sym, no)) {
-			line[0] = 'n';
-			line[1] = '\n';
-			line[2] = 0;
-			break;
-		}
-	case set_random:
-		do {
-			val = (tristate)(rand() % 3);
-		} while (!sym_tristate_within_range(sym, val));
-		switch (val) {
-		case no: line[0] = 'n'; break;
-		case mod: line[0] = 'm'; break;
-		case yes: line[0] = 'y'; break;
-		}
-		line[1] = '\n';
-		line[2] = 0;
-		break;
-	default:
-		break;
-	}
 	printf("%s", line);
 	return 1;
 }
@@ -374,16 +309,6 @@ static int conf_choice(struct menu *menu)
 			else
 				continue;
 			break;
-		case set_random:
-			if (is_new)
-				def = (rand() % cnt) + 1;
-		case set_default:
-		case set_yes:
-		case set_mod:
-		case set_no:
-			cnt = def;
-			printf("%d\n", cnt);
-			break;
 		}
 
 	conf_childs:
@@ -504,7 +429,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, "osh")) != -1) {
 		switch (opt) {
 		case 'o':
 			input_mode = ask_new;
@@ -513,26 +438,6 @@ int main(int ac, char **av)
 			input_mode = ask_silent;
 			valid_stdin = isatty(0) && isatty(1) && isatty(2);
 			break;
-		case 'd':
-			input_mode = set_default;
-			break;
-		case 'D':
-			input_mode = set_default;
-			defconfig_file = optarg;
-			break;
-		case 'n':
-			input_mode = set_no;
-			break;
-		case 'm':
-			input_mode = set_mod;
-			break;
-		case 'y':
-			input_mode = set_yes;
-			break;
-		case 'r':
-			input_mode = set_random;
-			srand(time(NULL));
-			break;
 		case 'h':
 			printf(_("See README for usage info\n"));
 			exit(0);
@@ -550,16 +455,6 @@ int main(int ac, char **av)
 	conf_parse(name);
 	//zconfdump(stdout);
 	switch (input_mode) {
-	case set_default:
-		if (!defconfig_file)
-			defconfig_file = conf_get_default_confname();
-		if (conf_read(defconfig_file)) {
-			printf(_("***\n"
-				"*** Can't find default configuration \"%s\"!\n"
-				"***\n"), defconfig_file);
-			exit(1);
-		}
-		break;
 	case ask_silent:
 		if (stat(".config", &tmpstat)) {
 			printf(_("***\n"
@@ -575,27 +470,6 @@ 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, S_DEF_USER);
-			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, S_DEF_USER);
-		else if (!stat("all.config", &tmpstat))
-			conf_read_simple("all.config", S_DEF_USER);
-		break;
 	default:
 		break;
 	}
-- 
1.5.4.1.143.ge7e51


  reply	other threads:[~2008-05-02 20:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-02 20:47 kconfig frontend updates Sam Ravnborg
2008-05-02 20:49 ` [PATCH] kconfig: add support for K=file sam
2008-05-02 20:49   ` sam [this message]
2008-05-02 20:49     ` [PATCH] kconfig: conf is less chatty sam
2008-05-02 20:49       ` [PATCH] kconfig: .gitignore aconf sam
2008-05-02 20:49         ` [PATCH] kconfig: kill the warning "trying to assign nonexistent symbol" sam
2008-05-10 21:25   ` [PATCH] kconfig: add support for K=file Oleg Verych
2008-05-10 21:10     ` Sam Ravnborg
2008-05-10 21:50       ` Oleg Verych
2008-05-02 21:01 ` kconfig frontend updates Sam Ravnborg
2008-05-04 18:57 ` Sam Ravnborg
2008-05-04 18:59   ` [PATCH 1/2] kconfig: introduce K= support Sam Ravnborg
2008-05-06  2:55     ` Roman Zippel
2008-05-06  4:34       ` Sam Ravnborg
2008-05-04 18:59   ` [PATCH 2/2] kconfig: make oldconfig less chatty and clean up conf.c Sam Ravnborg
2008-05-06  3:08     ` Roman Zippel
2008-05-06  4:37       ` Sam Ravnborg
2008-05-06  9:03       ` Jan Engelhardt

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=1209761358-6579-2-git-send-email-sam@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@uranus.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