Skip to content

Commit

Permalink
localmodconfig: Comments and cleanup for streamline_config.pl
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Jun 19, 2012
1 parent 485802a commit 0b58a99
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/kconfig/streamline_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ sub read_kconfig {
$state = "NEW";
$config = $2;

# Add depends for 'if' nesting
for (my $i = 0; $i < $iflevel; $i++) {
if ($i) {
$depends{$config} .= " " . $ifdeps[$i];
Expand All @@ -204,10 +205,11 @@ sub read_kconfig {

# Get the configs that select this config
} elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) {
if (defined($selects{$1})) {
$selects{$1} .= " " . $config;
my $conf = $1;
if (defined($selects{$conf})) {
$selects{$conf} .= " " . $config;
} else {
$selects{$1} = $config;
$selects{$conf} = $config;
}

# configs without prompts must be selected
Expand Down Expand Up @@ -250,6 +252,7 @@ sub read_kconfig {
read_kconfig($kconfig);
}

# Makefiles can use variables to define their dependencies
sub convert_vars {
my ($line, %vars) = @_;

Expand Down Expand Up @@ -293,6 +296,7 @@ sub convert_vars {

my $objs;

# Convert variables in a line (could define configs)
$_ = convert_vars($_, %make_vars);

# collect objects after obj-$(CONFIG_FOO_BAR)
Expand Down Expand Up @@ -373,7 +377,8 @@ sub convert_vars {
close (LIN);

# 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} += 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})) {
Expand Down

0 comments on commit 0b58a99

Please sign in to comment.