diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2010-01-06 17:56:12 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2010-01-06 17:56:12 -0500 |
| commit | 13d7e9385644d376a0816ad663ba3dfc45359f2f (patch) | |
| tree | e0455cd16c1d24338f24d23214dd41e6aaa6347d | |
| parent | 17263baf958b7ab1d8c60445f412a1080362c88c (diff) | |
kconfig: Check for if conditions in Kconfig for localmodconfig
The streamline_config.pl misses the if conditions for checking
dependencies. For Kconfigs with the following construct:
if MEDIA_SUPPORT
config VIDEO_DEV
[...]
If VIDEO_DEV was enabled, the script will miss the fact that MEDIA_SUPPORT
is also needed.
This patch changes streamline_config.pl to include if conditions into
the dependencies of configs.
Reported-by: Anton Blanchard <anton@sambo.org>
Tested-by: Anton Blanchard <anton@sambo.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| -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"; |
