diff options
author | Steven Rostedt <srostedt@redhat.com> | 2012-06-18 14:09:22 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2012-06-19 15:03:05 -0400 |
commit | 0b58a99eb27aa522a3cd16ece09c8045b322b9ce (patch) | |
tree | d202a48fb2e658e8970fde79c1fcf7a40a76df05 /scripts/kconfig | |
parent | 485802a6c524e62b5924849dd727ddbb1497cc71 (diff) |
localmodconfig: Comments and cleanup for streamline_config.pl
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 <rostedt@goodmis.org>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r-- | scripts/kconfig/streamline_config.pl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index bccf07ddd0b6..5c1ce8761205 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl | |||
@@ -186,6 +186,7 @@ sub read_kconfig { | |||
186 | $state = "NEW"; | 186 | $state = "NEW"; |
187 | $config = $2; | 187 | $config = $2; |
188 | 188 | ||
189 | # Add depends for 'if' nesting | ||
189 | for (my $i = 0; $i < $iflevel; $i++) { | 190 | for (my $i = 0; $i < $iflevel; $i++) { |
190 | if ($i) { | 191 | if ($i) { |
191 | $depends{$config} .= " " . $ifdeps[$i]; | 192 | $depends{$config} .= " " . $ifdeps[$i]; |
@@ -204,10 +205,11 @@ sub read_kconfig { | |||
204 | 205 | ||
205 | # Get the configs that select this config | 206 | # Get the configs that select this config |
206 | } elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) { | 207 | } elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) { |
207 | if (defined($selects{$1})) { | 208 | my $conf = $1; |
208 | $selects{$1} .= " " . $config; | 209 | if (defined($selects{$conf})) { |
210 | $selects{$conf} .= " " . $config; | ||
209 | } else { | 211 | } else { |
210 | $selects{$1} = $config; | 212 | $selects{$conf} = $config; |
211 | } | 213 | } |
212 | 214 | ||
213 | # configs without prompts must be selected | 215 | # configs without prompts must be selected |
@@ -250,6 +252,7 @@ if ($kconfig) { | |||
250 | read_kconfig($kconfig); | 252 | read_kconfig($kconfig); |
251 | } | 253 | } |
252 | 254 | ||
255 | # Makefiles can use variables to define their dependencies | ||
253 | sub convert_vars { | 256 | sub convert_vars { |
254 | my ($line, %vars) = @_; | 257 | my ($line, %vars) = @_; |
255 | 258 | ||
@@ -293,6 +296,7 @@ foreach my $makefile (@makefiles) { | |||
293 | 296 | ||
294 | my $objs; | 297 | my $objs; |
295 | 298 | ||
299 | # Convert variables in a line (could define configs) | ||
296 | $_ = convert_vars($_, %make_vars); | 300 | $_ = convert_vars($_, %make_vars); |
297 | 301 | ||
298 | # collect objects after obj-$(CONFIG_FOO_BAR) | 302 | # collect objects after obj-$(CONFIG_FOO_BAR) |
@@ -373,7 +377,8 @@ while (<LIN>) { | |||
373 | close (LIN); | 377 | close (LIN); |
374 | 378 | ||
375 | # add to the configs hash all configs that are needed to enable | 379 | # add to the configs hash all configs that are needed to enable |
376 | # a loaded module. | 380 | # a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o |
381 | # where we know we need bar.o so we add FOO to the list. | ||
377 | my %configs; | 382 | my %configs; |
378 | foreach my $module (keys(%modules)) { | 383 | foreach my $module (keys(%modules)) { |
379 | if (defined($objects{$module})) { | 384 | if (defined($objects{$module})) { |