diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/streamline_config.pl | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index 0d800820c3cd..9e66fa8dc52e 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl | |||
@@ -121,6 +121,8 @@ my %prompts; | |||
121 | my %objects; | 121 | my %objects; |
122 | my $var; | 122 | my $var; |
123 | my $cont = 0; | 123 | my $cont = 0; |
124 | my $iflevel = 0; | ||
125 | my @ifdeps; | ||
124 | 126 | ||
125 | # prevent recursion | 127 | # prevent recursion |
126 | my %read_kconfigs; | 128 | my %read_kconfigs; |
@@ -146,6 +148,15 @@ sub read_kconfig { | |||
146 | $state = "NEW"; | 148 | $state = "NEW"; |
147 | $config = $1; | 149 | $config = $1; |
148 | 150 | ||
151 | for (my $i = 0; $i < $iflevel; $i++) { | ||
152 | if ($i) { | ||
153 | $depends{$config} .= " " . $ifdeps[$i]; | ||
154 | } else { | ||
155 | $depends{$config} = $ifdeps[$i]; | ||
156 | } | ||
157 | $state = "DEP"; | ||
158 | } | ||
159 | |||
149 | # collect the depends for the config | 160 | # collect the depends for the config |
150 | } elsif ($state eq "NEW" && /^\s*depends\s+on\s+(.*)$/) { | 161 | } elsif ($state eq "NEW" && /^\s*depends\s+on\s+(.*)$/) { |
151 | $state = "DEP"; | 162 | $state = "DEP"; |
@@ -166,6 +177,21 @@ sub read_kconfig { | |||
166 | # note if the config has a prompt | 177 | # note if the config has a prompt |
167 | $prompt{$config} = 1; | 178 | $prompt{$config} = 1; |
168 | 179 | ||
180 | # Check for if statements | ||
181 | } elsif (/^if\s+(.*\S)\s*$/) { | ||
182 | my $deps = $1; | ||
183 | # remove beginning and ending non text | ||
184 | $deps =~ s/^[^a-zA-Z0-9_]*//; | ||
185 | $deps =~ s/[^a-zA-Z0-9_]*$//; | ||
186 | |||
187 | my @deps = split /[^a-zA-Z0-9_]+/, $deps; | ||
188 | |||
189 | $ifdeps[$iflevel++] = join ':', @deps; | ||
190 | |||
191 | } elsif (/^endif/) { | ||
192 | |||
193 | $iflevel-- if ($iflevel); | ||
194 | |||
169 | # stop on "help" | 195 | # stop on "help" |
170 | } elsif (/^\s*help\s*$/) { | 196 | } elsif (/^\s*help\s*$/) { |
171 | $state = "NONE"; | 197 | $state = "NONE"; |