From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:19735 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754558Ab2G3TpD (ORCPT ); Mon, 30 Jul 2012 15:45:03 -0400 Message-Id: <20120730194501.681442369@goodmis.org> Date: Mon, 30 Jul 2012 15:43:17 -0400 From: Steven Rostedt Subject: [PATCH 1/4] localmodconfig: Comments and cleanup for streamline_config.pl References: <20120730194316.768288008@goodmis.org> Content-Disposition: inline; filename=0001-localmodconfig-Comments-and-cleanup-for-streamline_c.patch Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="00GvhwF7k39YY" Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Linus Torvalds --00GvhwF7k39YY Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: Steven Rostedt Added some more comments and cleaned up part of the the code to use a named variable instead of one of the special $1 perl variables. No functional changes. Signed-off-by: Steven Rostedt --- scripts/kconfig/streamline_config.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streaml= ine_config.pl index bccf07dd..5c1ce87 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -186,6 +186,7 @@ sub read_kconfig { $state =3D "NEW"; $config =3D $2; =20 + # Add depends for 'if' nesting for (my $i =3D 0; $i < $iflevel; $i++) { if ($i) { $depends{$config} .=3D " " . $ifdeps[$i]; @@ -204,10 +205,11 @@ sub read_kconfig { =20 # Get the configs that select this config } elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) { - if (defined($selects{$1})) { - $selects{$1} .=3D " " . $config; + my $conf =3D $1; + if (defined($selects{$conf})) { + $selects{$conf} .=3D " " . $config; } else { - $selects{$1} =3D $config; + $selects{$conf} =3D $config; } =20 # configs without prompts must be selected @@ -250,6 +252,7 @@ if ($kconfig) { read_kconfig($kconfig); } =20 +# Makefiles can use variables to define their dependencies sub convert_vars { my ($line, %vars) =3D @_; =20 @@ -293,6 +296,7 @@ foreach my $makefile (@makefiles) { =20 my $objs; =20 + # Convert variables in a line (could define configs) $_ =3D convert_vars($_, %make_vars); =20 # collect objects after obj-$(CONFIG_FOO_BAR) @@ -373,7 +377,8 @@ while () { close (LIN); =20 # add to the configs hash all configs that are needed to enable -# a loaded module. +# a loaded module. This is a direct obj-${CONFIG_FOO} +=3D bar.o +# where we know we need bar.o so we add FOO to the list. my %configs; foreach my $module (keys(%modules)) { if (defined($objects{$module})) { --=20 1.7.10.4 --00GvhwF7k39YY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAABAgAGBQJQFuQ9AAoJEIy3vGnGbaoAj+cQAI5gIK7hmMdY8NGcCTRKcf3f 4azOMgsgg5HE7D0FbhxFsvfderNDADXw9Gd4Vl21SLFZtTiNuc2u3ib335FdGKjy joGLtbHtMy80/xanxNTnfrk+dvlS7FfB2NgwW9JQIvjggNWlmrd4baN2wTT9NUGi pbN2E5Qe6lKzTNOKNAnOshOkOWz67sdRebjGqDQWRAFO4+JHzclsuRhgvqVY6PJt td1t07E9HosqnJQIIGYGPbi/1AssSXiwrhivYVMHOuJ8xiCmUTOiPjhr/ua/Uqun AQ5qQfKGNsjMRGjq5Laojzf3oYZqlaOyj+i5NIOlTJ88Nq20go01FXiWcenL9czo RkYFYNmpuuOP7GxnBoEWXmVGr2k193E9QgBmdY6YvcB/wak8yaacDnT+9Ex/8Wu2 zg9Q89kIvNUDhNcrDNqFrtI2X2+xWF1l4KU1miPlTSihfuhG+o2NLSe5z0e8Ter3 rJsAzhcWmTmuUqMnSQeZSCyI7G04DfaPvxP0nVnKu+J00mGj3ztg65W7y/TDAIxb GZsS/PX1DQhc320rTLfJuQn47Onag0BNxRcg5ZZJpW9Z4SrxtdchzGfARVnW07kI hNVLYFQQLKF4CFnB6lDYQNknIUtwInO00sdZX6bAcD21vOB8B+teptDJ35tl6KCE g76kcmXm47PFHmFaSZGv =FAmv -----END PGP SIGNATURE----- --00GvhwF7k39YY--