From 246cf9c26bf11f2bffbecea6e5bd222eee7b1df8 Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Tue, 8 Jun 2010 17:25:57 +0100 Subject: kbuild: Warn on selecting symbols with unmet direct dependencies The "select" statement in Kconfig files allows the enabling of options even if they have unmet direct dependencies (i.e. "depends on" expands to "no"). Currently, the "depends on" clauses are used in calculating the visibility but they do not affect the reverse dependencies in any way. The patch introduces additional tracking of the "depends on" statements and prints a warning on selecting an option if its direct dependencies are not met. Signed-off-by: Catalin Marinas Cc: Sam Ravnborg Cc: Arnd Bergmann Cc: Andrew Morton Cc: Linus Torvalds Signed-off-by: Michal Marek --- scripts/kconfig/menu.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts/kconfig/menu.c') diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index eef17bacb6b..11799894f3b 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -105,6 +105,7 @@ static struct expr *menu_check_dep(struct expr *e) void menu_add_dep(struct expr *dep) { current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep)); + current_entry->dir_dep = current_entry->dep; } void menu_set_type(int type) @@ -288,6 +289,10 @@ void menu_finalize(struct menu *parent) for (menu = parent->list; menu; menu = menu->next) menu_finalize(menu); } else if (sym) { + /* ignore inherited dependencies for dir_dep */ + sym->dir_dep.expr = expr_transform(expr_copy(parent->dir_dep)); + sym->dir_dep.expr = expr_eliminate_dups(sym->dir_dep.expr); + basedep = parent->prompt ? parent->prompt->visible.expr : NULL; basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no); basedep = expr_eliminate_dups(expr_transform(basedep)); -- cgit v1.2.3