diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-05-03 11:06:10 -0700 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2007-05-03 11:06:10 -0700 |
commit | 42bc9b89509b57c5c67c9588e7c37fea83989529 (patch) | |
tree | aff14d66bea083464d4025efac5978fe3377430d /v4l | |
parent | 4408f03fed048fabc1d1cbbd2914924b31ed78b5 (diff) | |
download | mediapointer-dvb-s2-42bc9b89509b57c5c67c9588e7c37fea83989529.tar.gz mediapointer-dvb-s2-42bc9b89509b57c5c67c9588e7c37fea83989529.tar.bz2 |
build: Handle string options
From: Trent Piepho <xyzzy@speakeasy.org>
Deal with string options and the default values.
There is only one string option, and it's disabled, but someone could
always add more.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'v4l')
-rwxr-xr-x | v4l/scripts/make_kconfig.pl | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 8ed189aef..5e9e416d1 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -5,6 +5,7 @@ use strict; my %depend = (); my %minver = (); my %config = (); +my %stringopt = (); my %intopt = (); my %hexopt = (); my %tristate = (); @@ -70,6 +71,7 @@ sub add_int($) { my $arg=shift; + print "Int: $arg\n" if $debug; exists $config{$arg} or die "Adding unknown int '$arg'"; $intopt{$arg} = 0; } @@ -78,10 +80,20 @@ sub add_hex($) { my $arg=shift; + print "Hex: $arg\n" if $debug; exists $config{$arg} or die "Adding unknown hex '$arg'"; $hexopt{$arg} = 0; } +sub add_string($) +{ + my $arg=shift; + + print "String: $arg\n" if $debug; + exists $config{$arg} or die "Adding unknown string '$arg'"; + $stringopt{$arg} = ""; +} + sub set_int_value($$) { my $key = shift; @@ -100,6 +112,15 @@ sub set_hex_value($$) $hexopt{$key} = "0x$val"; } +sub set_string_value($$) +{ + my $key = shift; + my $val = shift; + + exists $stringopt{$key} or die "Default for unknown string option '$key'"; + $stringopt{$key} = "\"$val\""; +} + sub add_config($) { my $arg = shift; @@ -349,6 +370,8 @@ sub open_kconfig($$) { add_int($key); } elsif (/^\s*hex\s/) { add_hex($key); + } elsif (/^\s*string\s/) { + add_string($key); # select and depend lines } elsif (m|^\s*depends on\s+(.+?)\s*$|) { @@ -365,6 +388,9 @@ sub open_kconfig($$) { # Get default for hex options } elsif ($o =~ m|^"(0x)?([[:xdigit:]]+)"$| && exists $hexopt{$key}) { set_hex_value($key, $2); + # Get default for string options + } elsif ($o =~ m|^"(.*)"$| && exists $stringopt{$key}) { + set_string_value($key, $1); # Override default for disabled tri/bool options # We don't care about the default for tri/bool options otherwise @@ -537,6 +563,9 @@ if ($force_kconfig==1 || !-e '.config') { while (my ($key,$value) = each %hexopt) { print OUT "CONFIG_$key=$value\n" if($config{$key}); } + while (my ($key,$value) = each %stringopt) { + print OUT "CONFIG_$key=$value\n" if($config{$key}); + } close OUT; print "Created default (all yes) .config file\n"; } |