From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hrndva-omtalb.mail.rr.com ([71.74.56.124]:38896 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757338Ab0BCPtJ (ORCPT ); Wed, 3 Feb 2010 10:49:09 -0500 Message-Id: <20100203154905.979883839@goodmis.org> Date: Wed, 03 Feb 2010 10:46:07 -0500 From: Steven Rostedt Subject: [PATCH 2/4] kconfig: Check for if conditions in Kconfig for localmodconfig References: <20100203154605.461025238@goodmis.org> Content-Disposition: inline; filename=0002-kconfig-Check-for-if-conditions-in-Kconfig-for-local.patch Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: linux-kernel@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, Andrew Morton , Anibal Monsalve Salazar , Michal Marek , Anton Blanchard From: Steven Rostedt The streamline_config.pl misses the if conditions for checking dependencies. For Kconfigs with the following construct: if MEDIA_SUPPORT config VIDEO_DEV [...] If VIDEO_DEV was enabled, the script will miss the fact that MEDIA_SUPPORT is also needed. This patch changes streamline_config.pl to include if conditions into the dependencies of configs. Reported-by: Anton Blanchard Tested-by: Anton Blanchard Signed-off-by: Steven Rostedt --- scripts/kconfig/streamline_config.pl | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index 0d80082..9e66fa8 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -121,6 +121,8 @@ my %prompts; my %objects; my $var; my $cont = 0; +my $iflevel = 0; +my @ifdeps; # prevent recursion my %read_kconfigs; @@ -146,6 +148,15 @@ sub read_kconfig { $state = "NEW"; $config = $1; + for (my $i = 0; $i < $iflevel; $i++) { + if ($i) { + $depends{$config} .= " " . $ifdeps[$i]; + } else { + $depends{$config} = $ifdeps[$i]; + } + $state = "DEP"; + } + # collect the depends for the config } elsif ($state eq "NEW" && /^\s*depends\s+on\s+(.*)$/) { $state = "DEP"; @@ -166,6 +177,21 @@ sub read_kconfig { # note if the config has a prompt $prompt{$config} = 1; + # Check for if statements + } elsif (/^if\s+(.*\S)\s*$/) { + my $deps = $1; + # remove beginning and ending non text + $deps =~ s/^[^a-zA-Z0-9_]*//; + $deps =~ s/[^a-zA-Z0-9_]*$//; + + my @deps = split /[^a-zA-Z0-9_]+/, $deps; + + $ifdeps[$iflevel++] = join ':', @deps; + + } elsif (/^endif/) { + + $iflevel-- if ($iflevel); + # stop on "help" } elsif (/^\s*help\s*$/) { $state = "NONE"; -- 1.6.5