From patchwork Tue Aug 16 05:23:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Lacombe X-Patchwork-Id: 1070332 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7G5O1XN018461 for ; Tue, 16 Aug 2011 05:24:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751456Ab1HPFYE (ORCPT ); Tue, 16 Aug 2011 01:24:04 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:46886 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647Ab1HPFYE (ORCPT ); Tue, 16 Aug 2011 01:24:04 -0400 Received: by yxj19 with SMTP id 19so3557331yxj.19 for ; Mon, 15 Aug 2011 22:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=2Mh13Xo89gvbPT3DiJDJ+OGLc3E22oMpF8/Jw1u9Ynk=; b=mPW9gsqRtmB8LF413qMZ7vpIPGNEQFwC0dx9kWRnx9xsSJT152bby5vt62sAonoyDO 0/XD6xcSbC76H4WYRJRbJLqOB3AvCbPlOyOtWMvlnBrzhPEgaapY1zItUfvRXqEifjuL WPf4Zx8kOzrOdnNLELLMBdbJd6ZyJ4M5MB7cw= Received: by 10.236.144.226 with SMTP id n62mr15066111yhj.136.1313472241833; Mon, 15 Aug 2011 22:24:01 -0700 (PDT) Received: from localhost.localdomain (69-165-142-232.dsl.teksavvy.com [69.165.142.232]) by mx.google.com with ESMTPS id q25sm625292yhm.48.2011.08.15.22.24.00 (version=SSLv3 cipher=OTHER); Mon, 15 Aug 2011 22:24:01 -0700 (PDT) From: Arnaud Lacombe To: linux-kbuild@vger.kernel.org Cc: Arnaud Lacombe , Steven Rostedt Subject: [PATCH 2/3] kconfig/streamline_config.pl: use options to determine operating mode Date: Tue, 16 Aug 2011 01:23:52 -0400 Message-Id: <1313472233-14094-2-git-send-email-lacombar@gmail.com> X-Mailer: git-send-email 1.7.6.153.g78432 In-Reply-To: <1313472233-14094-1-git-send-email-lacombar@gmail.com> References: <1313472233-14094-1-git-send-email-lacombar@gmail.com> 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.6 (demeter2.kernel.org [140.211.167.43]); Tue, 16 Aug 2011 05:24:05 +0000 (UTC) The options introduced are --localmodconfig (default) and --localyesconfig. They match the Makefile target behavior. Cc: Steven Rostedt Signed-off-by: Arnaud Lacombe --- scripts/kconfig/Makefile | 4 ++-- scripts/kconfig/streamline_config.pl | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index bd41ab2..4de8973 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -35,7 +35,7 @@ silentoldconfig: $(obj)/conf localmodconfig: $(obj)/streamline_config.pl $(obj)/conf $(Q)mkdir -p include/generated - $(Q)perl $< $(srctree) $(Kconfig) > .tmp.config + $(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config $(Q)if [ -f .config ]; then \ cmp -s .tmp.config .config || \ (mv -f .config .config.old.1; \ @@ -50,7 +50,7 @@ localmodconfig: $(obj)/streamline_config.pl $(obj)/conf localyesconfig: $(obj)/streamline_config.pl $(obj)/conf $(Q)mkdir -p include/generated - $(Q)perl $< $(srctree) $(Kconfig) > .tmp.config + $(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config $(Q)sed -i s/=m/=y/ .tmp.config $(Q)if [ -f .config ]; then \ cmp -s .tmp.config .config || \ diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index ae34d20..ec7afce 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -43,6 +43,7 @@ # make oldconfig # use strict; +use Getopt::Long; my $config = ".config"; @@ -112,6 +113,13 @@ sub find_config { find_config; +# Parse options +my $localmodconfig = 0; +my $localyesconfig = 0; + +GetOptions("localmodconfig" => \$localmodconfig, + "localyesconfig" => \$localyesconfig); + # Get the build source and top level Kconfig file (passed in) my $ksource = $ARGV[0]; my $kconfig = $ARGV[1]; @@ -425,7 +433,11 @@ while() { if (/^(CONFIG.*)=(m|y)/) { if (defined($configs{$1})) { - $setconfigs{$1} = $2; + if ($localyesconfig) { + $setconfigs{$1} = 'y'; + } else { + $setconfigs{$1} = $2; + } } elsif ($2 eq "m") { print "# $1 is not set\n"; next;