diff options
-rwxr-xr-x | v4l/scripts/make_kconfig.pl | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 5e9e416d1..d558aaeb6 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -219,6 +219,7 @@ sub checkdeps() my $key = shift; my $deps = $depends{$key}; foreach (@$deps) { + next if($_ eq ''); if (!eval(toperl($_))) { print "Disabling $key, dependency '$_' not met\n" if $debug; $allconfig{$key} = 0; @@ -343,10 +344,13 @@ sub open_kconfig($$) { $key = 'comment'; } elsif (m|^\s*menu\s+"[^"]*"\s*$|) { $key = 'menu'; + push @kifs, ''; # placeholder for any depends on clauses } elsif (m|^\s*if\s+(.+?)\s*$|) { push @kifs, $1; - } elsif (m|^\s*endif\s*(?:#.*)?$|) { - $#kifs >= 0 or die "Unmatched endif at $file:$.\n"; + } elsif (/^\s*end(if|menu)\s*(?:#.*)?$/) { + # Won't handle menu/if blocks that aren't strictly + # nested, but no one should do that! + $#kifs >= 0 or die "Unmatched end$1 at $file:$.\n"; pop @kifs; } else { $nothandled = 1; @@ -358,8 +362,21 @@ sub open_kconfig($$) { next; } - # Don't process any directives in comment blocks (or menus) - next if ($key eq 'comment' || $key eq 'menu'); + # Don't process any directives in comment blocks + next if ($key eq 'comment'); + + # Only depends on lines are accepted in menus + if ($key eq 'menu') { + if (m|^\s*depends on\s+(.+?)\s*$|) { + my $x = pop @kifs; + $x .= ' && ' if($x ne ''); + $x .= "($1)"; + push @kifs, $x; + } else { + print "Skipping unexpected line in menu stanza $file:$.$_" if $debug; + } + next; + } # config type if(/^\s*bool(ean)?\s/) { @@ -518,6 +535,7 @@ close OUT; disable_config('DVB_AV7110_FIRMWARE'); disable_config('DVB_CINERGYT2_TUNING'); disable_config('DVB_FE_CUSTOMISE'); +disable_config('VIDEO_HELPER_CHIPS_AUTO'); # ACI needs some kernel includes that might not be there disable_config('SOUND_ACI_MIXER') if (! -e "$kernel/sound/oss/sound_config.h"); |