From patchwork Fri Jul 1 23:31:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Lacombe X-Patchwork-Id: 939572 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p61NWRS7008108 for ; Fri, 1 Jul 2011 23:32:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758169Ab1GAXbl (ORCPT ); Fri, 1 Jul 2011 19:31:41 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:57845 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757689Ab1GAXbe (ORCPT ); Fri, 1 Jul 2011 19:31:34 -0400 Received: by mail-iy0-f174.google.com with SMTP id 12so3173064iyb.19 for ; Fri, 01 Jul 2011 16:31:34 -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=mo4bEDICuQJ9H0WPKtZDRRHqEpjTwHfOx5IDvFGs2rI=; b=eb04ZZnrb/lZt4VANOee3SCXmN2j3uPdw9bFw3+U3544IW8k951SvxJj8TKDqQZQZo HU1WnYJIcQVlFAD6XYPZp2vaJM6IEj2BNJNEnDAZ5SekQEnYnyuIKhvA56wRQZUR7XNI gEt0bPtXctZfYLof9zFmv9DUkIomdSvzwJ4v0= Received: by 10.42.163.133 with SMTP id c5mr3785743icy.178.1309563094654; Fri, 01 Jul 2011 16:31:34 -0700 (PDT) Received: from localhost.localdomain (69-165-144-226.dsl.teksavvy.com [69.165.144.226]) by mx.google.com with ESMTPS id hp8sm3820881icc.11.2011.07.01.16.31.33 (version=SSLv3 cipher=OTHER); Fri, 01 Jul 2011 16:31:33 -0700 (PDT) From: Arnaud Lacombe To: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michal Marek , Arnaud Lacombe , Steven Rostedt Subject: [RFC 3/4] kconfig/streamline_config.pl: merge local{mod,yes}config Date: Fri, 1 Jul 2011 19:31:15 -0400 Message-Id: <1309563076-5050-4-git-send-email-lacombar@gmail.com> X-Mailer: git-send-email 1.7.3.4.574.g608b.dirty In-Reply-To: <1309563076-5050-1-git-send-email-lacombar@gmail.com> References: <1309563076-5050-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 (demeter1.kernel.org [140.211.167.41]); Fri, 01 Jul 2011 23:32:51 +0000 (UTC) The two targets `localmodconfig' and `localyesconfig' only differs from the sed(1) ran on the result of `streamline_config.pl' to convert symbols set to `modules' to `yes'. This conversion can be made directly from the perl script, and thus avoid duplicating the command to generate the configuration. Cc: Steven Rostedt --- scripts/kconfig/Makefile | 18 +----------------- scripts/kconfig/streamline_config.pl | 11 ++++++++++- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index a718b3c..8a59adf 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -33,7 +33,7 @@ silentoldconfig: $(obj)/conf $(Q)mkdir -p include/generated $< --$@ $(Kconfig) -localmodconfig: $(obj)/streamline_config.pl $(obj)/conf +localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf $(Q)mkdir -p include/generated $(Q)perl $< $(srctree) $(Kconfig) > .tmp.config $(Q)if [ -f .config ]; then \ @@ -48,22 +48,6 @@ localmodconfig: $(obj)/streamline_config.pl $(obj)/conf fi $(Q)rm -f .tmp.config -localyesconfig: $(obj)/streamline_config.pl $(obj)/conf - $(Q)mkdir -p include/generated - $(Q)perl $< $(srctree) $(Kconfig) > .tmp.config - $(Q)sed -i s/=m/=y/ .tmp.config - $(Q)if [ -f .config ]; then \ - cmp -s .tmp.config .config || \ - (mv -f .config .config.old.1; \ - mv -f .tmp.config .config; \ - $(obj)/conf --silentoldconfig $(Kconfig); \ - mv -f .config.old.1 .config.old) \ - else \ - mv -f .tmp.config .config; \ - $(obj)/conf --silentoldconfig $(Kconfig); \ - fi - $(Q)rm -f .tmp.config - # Create new linux.pot file # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files # The symlink is used to repair a deficiency in arch/um diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index ae34d20..c762d9d 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -117,6 +117,11 @@ my $ksource = $ARGV[0]; my $kconfig = $ARGV[1]; my $lsmod_file = $ENV{'LSMOD'}; +my $localyesconfig = 0; +if ($ENV{'MAKECMDGOALS'} =~ /.*localyesconfig.*/) { + $localyesconfig = 1; +} + my @makefiles = `find $ksource -name Makefile 2>/dev/null`; chomp @makefiles; @@ -425,7 +430,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;