Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284995
b: refs/heads/master
c: 364212f
h: refs/heads/master
i:
  284993: 50d11d2
  284991: 9ba1a5e
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Jan 13, 2012
1 parent e031663 commit 1126a14
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d060d963e88f3e990cec2fe5214de49de9a49eca
refs/heads/master: 364212fddaaa60c5a64f67a0f5624ad996ecc8a0
29 changes: 29 additions & 0 deletions trunk/scripts/kconfig/streamline_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,33 @@ sub read_kconfig {
read_kconfig($kconfig);
}

sub convert_vars {
my ($line, %vars) = @_;

my $process = "";

while ($line =~ s/^(.*?)(\$\((.*?)\))//) {
my $start = $1;
my $variable = $2;
my $var = $3;

if (defined($vars{$var})) {
$process .= $start . $vars{$var};
} else {
$process .= $start . $variable;
}
}

$process .= $line;

return $process;
}

# Read all Makefiles to map the configs to the objects
foreach my $makefile (@makefiles) {

my $line = "";
my %make_vars;

open(MIN,$makefile) || die "Can't open $makefile";
while (<MIN>) {
Expand All @@ -270,10 +293,16 @@ sub read_kconfig {

my $objs;

$_ = convert_vars($_, %make_vars);

# collect objects after obj-$(CONFIG_FOO_BAR)
if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) {
$var = $1;
$objs = $2;

# check if variables are set
} elsif (/^\s*(\S+)\s*[:]?=\s*(.*\S)/) {
$make_vars{$1} = $2;
}
if (defined($objs)) {
foreach my $obj (split /\s+/,$objs) {
Expand Down

0 comments on commit 1126a14

Please sign in to comment.