From 4908980b241bc639b71ef47b727b4bc7c0174afe Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Fri, 29 Oct 2010 00:56:46 -0400 Subject: kconfig: Make localmodconfig handle environment variables The commit 838a2e55e6a4e9e8a10451ed2ef0f7a08dabdb04 kbuild: migrate all arch to the kconfig mainmenu upgrade Broke make localmodconfig. The reason was that it added a environment variable to the kconfig source, which the streamline_config.pl could not handle. This patch changes streamline_config.pl to handle kconfig sources using environment variables in their names. Cc: Arnaud Lacombe Cc: Sam Ravnborg Cc: Michal Marek Signed-off-by: Steven Rostedt --- scripts/kconfig/streamline_config.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index c70a27d924f0..cc10bcfda64f 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -137,7 +137,17 @@ sub read_kconfig { my $config; my @kconfigs; - open(KIN, "$ksource/$kconfig") || die "Can't open $kconfig"; + my $source = "$ksource/$kconfig"; + my $last_source = ""; + + # Check for any environment variables used + while ($source =~ /\$(\w+)/ && $last_source ne $source) { + my $env = $1; + $last_source = $source; + $source =~ s/\$$env/$ENV{$env}/; + } + + open(KIN, "$source") || die "Can't open $kconfig"; while () { chomp; -- cgit v1.2.3 From ccece60ac69608c496b07c0d31a68894db0a22b3 Mon Sep 17 00:00:00 2001 From: hiromu yagura Date: Sun, 15 Aug 2010 13:13:17 +0900 Subject: kconfig: Fix variable name typo %prompts in streamline_config.pl When I added "use strict;" to streamline_config.pl, I saw the following warnings: > Global symbol "%prompt" requires explicit package name at scripts/kconfig/streamline_config.pl line 183. > Global symbol "%prompt" requires explicit package name at scripts/kconfig/streamline_config.pl line 368. The declaration of %prompt was incorrect, and should have been %prompts. Cc: Toralf Foerster Cc: KAMEZAWA Hiroyuki Cc: YOSHIFUJI Hideaki Signed-off-by: Hiromu Yakura LKML-Reference: <1281845597.11566.5.camel@camp10-laptop> Signed-off-by: Steven Rostedt --- scripts/kconfig/streamline_config.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index cc10bcfda64f..3c63aa943ee3 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -188,7 +188,7 @@ sub read_kconfig { # configs without prompts must be selected } elsif ($state ne "NONE" && /^\s*tristate\s\S/) { # note if the config has a prompt - $prompt{$config} = 1; + $prompts{$config} = 1; # Check for if statements } elsif (/^if\s+(.*\S)\s*$/) { @@ -373,7 +373,7 @@ while ($repeat) { parse_config_dep_select $depends{$config}; } - if (defined($prompt{$config}) || !defined($selects{$config})) { + if (defined($prompts{$config}) || !defined($selects{$config})) { next; } -- cgit v1.2.3 From cf5a189d4a02efb3712cfb424452f4ce3ab7c4a2 Mon Sep 17 00:00:00 2001 From: hiromu Date: Tue, 17 Aug 2010 19:49:18 +0900 Subject: kconfig: Fix missing declaration of variable $dir in streamline_config.pl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Fri, Aug 17, 2010 at 01:43PM +0800, Américo Wang wrote: > Acked-by: WANG Cong > > BTW, I think we should add "use strict;" too. Then I added "use strict;" to streamline_config.pl, I saw another warning. > Global symbol "$dir" requires explicit package name at scripts/kconfig/streamline_config.pl line 286. > Global symbol "$dir" requires explicit package name at scripts/kconfig/streamline_config.pl line 287. > Global symbol "$dir" requires explicit package name at scripts/kconfig/streamline_config.pl line 288. Then I added "my $dir;" to line 285. Cc: Américo Wang Cc: Toralf Foerster Cc: KAMEZAWA Hiroyuki Cc: YOSHIFUJI Hideaki Signed-off-by: Hiromu Yakura LKML-Reference: <1282042158.7160.9.camel@hiromu-Macbook> [ changed to just add my in front of $dir instead of new line ] Signed-off-by: Steven Rostedt --- scripts/kconfig/streamline_config.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index 3c63aa943ee3..883748c70d28 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -42,6 +42,8 @@ # mv config_strip .config # make oldconfig # +use strict; + my $config = ".config"; my $uname = `uname -r`; @@ -291,7 +293,7 @@ if (defined($lsmod_file)) { # see what modules are loaded on this system my $lsmod; - foreach $dir ( ("/sbin", "/bin", "/usr/sbin", "/usr/bin") ) { + foreach my $dir ( ("/sbin", "/bin", "/usr/sbin", "/usr/bin") ) { if ( -x "$dir/lsmod" ) { $lsmod = "$dir/lsmod"; last; -- cgit v1.2.3 From 20d190473328b90755eb2434cf2d26b73a53ef23 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Thu, 28 Oct 2010 22:13:51 -0400 Subject: kconfig: Fix streamline_config to read multi line deps in Kconfig files I noticed that some Kconfig files have multi line dependencies that continue with a backslash. Those dependencies on the next line will be missed by streamline_config. For example: config CS89x0 tristate "CS89x0 support" depends on NET_ETHERNET && (ISA || EISA || MACH_IXDP2351 \ || ARCH_IXDP2X01 || MACH_MX31ADS) The "|| ARCH_IXDP2X01 || MACH_MX31ADS)" will not be processed. This patch adds code to handle this case. Signed-off-by: Steven Rostedt --- scripts/kconfig/streamline_config.pl | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index 883748c70d28..ebba407ac5eb 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -125,7 +125,6 @@ my %selects; my %prompts; my %objects; my $var; -my $cont = 0; my $iflevel = 0; my @ifdeps; @@ -139,6 +138,9 @@ sub read_kconfig { my $config; my @kconfigs; + my $cont = 0; + my $line; + my $source = "$ksource/$kconfig"; my $last_source = ""; @@ -153,6 +155,19 @@ sub read_kconfig { while () { chomp; + # Make sure that lines ending with \ continue + if ($cont) { + $_ = $line . " " . $_; + } + + if (s/\\$//) { + $cont = 1; + $line = $_; + next; + } + + $cont = 0; + # collect any Kconfig sources if (/^source\s*"(.*)"/) { $kconfigs[$#kconfigs+1] = $1; @@ -230,6 +245,8 @@ if ($kconfig) { # Read all Makefiles to map the configs to the objects foreach my $makefile (@makefiles) { + my $cont = 0; + open(MIN,$makefile) || die "Can't open $makefile"; while () { my $objs; -- cgit v1.2.3 From 8ef17fa2ef8be74b946e725c2afb0e2a54981da1 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Thu, 28 Oct 2010 22:21:57 -0400 Subject: kconfig: Have streamline_config process menuconfigs too Some menuconfigs in the Kconfig files have prompts and dependencies. Currently, streamline_config misses these, and this can cause streamline_config to keep modules enabled that should not be, and even worse, not enable those that should. This patch makes streamline_config process menuconfigs just like it would process a config. Reported-by: member graysky Signed-off-by: Steven Rostedt --- scripts/kconfig/streamline_config.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index ebba407ac5eb..fd81fc33d633 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -174,9 +174,9 @@ sub read_kconfig { } # configs found - if (/^\s*config\s+(\S+)\s*$/) { + if (/^\s*(menu)?config\s+(\S+)\s*$/) { $state = "NEW"; - $config = $1; + $config = $2; for (my $i = 0; $i < $iflevel; $i++) { if ($i) { -- cgit v1.2.3