From patchwork Wed Feb 3 15:46:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 76735 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o13Fodp8022859 for ; Wed, 3 Feb 2010 15:50:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757354Ab0BCPtM (ORCPT ); Wed, 3 Feb 2010 10:49:12 -0500 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 X-Authority-Analysis: v=1.0 c=1 a=HyQetJ44mwMA:10 a=20KFwNOVAAAA:8 a=zNJO5AVcAAAA:8 a=meVymXHHAAAA:8 a=OEG27LXpydlWjQojsbEA:9 a=gCP-VbKTZTxyZL2R3aTI4XPjnisA:4 a=jEp0ucaQiEUA:10 a=OusbKJ8RKEoA:10 a=jeBq3FmKZ4MA:10 X-Cloudmark-Score: 0 X-Originating-IP: 74.67.89.75 Received: from [74.67.89.75] ([74.67.89.75:34621] helo=gandalf.stny.rr.com) by hrndva-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id 61/7B-27603-2FA996B4; Wed, 03 Feb 2010 15:49:08 +0000 Received: from rostedt by gandalf.stny.rr.com with local (Exim 4.71) (envelope-from ) id 1NchTW-0006Sy-4Q; Wed, 03 Feb 2010 10:49:06 -0500 Message-Id: <20100203154905.979883839@goodmis.org> User-Agent: quilt/0.48-1 Date: Wed, 03 Feb 2010 10:46:07 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, Andrew Morton , Anibal Monsalve Salazar , Michal Marek , Anton Blanchard 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 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 03 Feb 2010 15:50:39 +0000 (UTC) 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";