History

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.

Steven Rostedt committed 14 years ago

Commit 0b58a991 parent 485802a1 file · +9 −4Browse files

Unified · Split

scripts/kconfig/streamline_config.pl+9−4
@@ -186,6 +186,7 @@ sub read_kconfig { · 185 unmodified lines
186186 $state = "NEW";
187187 $config = $2;
188188
189+ # Add depends for 'if' nesting
189190 for (my $i = 0; $i < $iflevel; $i++) {
190191 if ($i) {
191192 $depends{$config} .= " " . $ifdeps[$i];
@@ -204,10 +205,11 @@ sub read_kconfig { · 12 unmodified lines
204205
205206 # Get the configs that select this config
206207 } elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) {
207− if (defined($selects{$1})) {
208− $selects{$1} .= " " . $config;
208+ my $conf = $1;
209+ if (defined($selects{$conf})) {
210+ $selects{$conf} .= " " . $config;
209211 } else {
210− $selects{$1} = $config;
212+ $selects{$conf} = $config;
211213 }
212214
213215 # configs without prompts must be selected
@@ -250,6 +252,7 @@ if ($kconfig) { · 36 unmodified lines
250252 read_kconfig($kconfig);
251253 }
252254
255+# Makefiles can use variables to define their dependencies
253256 sub convert_vars {
254257 my ($line, %vars) = @_;
255258
@@ -293,6 +296,7 @@ foreach my $makefile (@makefiles) { · 37 unmodified lines
293296
294297 my $objs;
295298
299+ # Convert variables in a line (could define configs)
296300 $_ = convert_vars($_, %make_vars);
297301
298302 # collect objects after obj-$(CONFIG_FOO_BAR)
@@ -373,7 +377,8 @@ while (<LIN>) { · 74 unmodified lines
373377 close (LIN);
374378
375379 # 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.
377382 my %configs;
378383 foreach my $module (keys(%modules)) {
379384 if (defined($objects{$module})) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t