summaryrefslogtreecommitdiff
path: root/v4l/scripts
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-05-21 12:10:08 -0700
committerTrent Piepho <xyzzy@speakeasy.org>2007-05-21 12:10:08 -0700
commitdb6454131c7fe01249418ecb134a09cc07528be0 (patch)
treea619078677a11ab790a73af5fb25d18a0651f747 /v4l/scripts
parentcac5da1c7c1873320073fccdefc334fc34a745e3 (diff)
downloadmediapointer-dvb-s2-db6454131c7fe01249418ecb134a09cc07528be0.tar.gz
mediapointer-dvb-s2-db6454131c7fe01249418ecb134a09cc07528be0.tar.bz2
build: Update make_kconfig to support depends on in menus
From: Trent Piepho <xyzzy@speakeasy.org> A backported kernel patch added a "depends on" clause to a menu, which wasn't yet handled. Everything in a menu gains implicitly gains a copy of the menu's dependencies We handle this the same way as if/endif is handled. It may not work properly if someone makes a nonsense file like: menu "foo" if X endmenu endif Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-xv4l/scripts/make_kconfig.pl25
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/) {