diff options
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-x | v4l/scripts/make_kconfig.pl | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 5e9e416d1..3bfc26a18 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/) { |