From a9f25b4215fa710a1e0074888d2aab5a168d4d78 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 19 May 2006 12:11:42 -0300 Subject: Have make_kconfig.pl output int config vars with their default value From: Trent Piepho A few drivers have integer config variables defined in their Kconfig file which must be set for them to compile. make_kconfig.pl would just ignore int variables and not put them into .config at all. This change will put them into .config set to their default values. Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_kconfig.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 04430ccf2..a95e4512a 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -4,6 +4,7 @@ use FileHandle; my %depend = (); my %minver = (); my %config = (); +my %intopt = (); my %tristate = (); my $version, $level, $sublevel; @@ -25,6 +26,19 @@ sub add_tristate($) # printf "Tristate:%s\n",$arg; } +sub add_int($) +{ + $intopt{$_[0]} = '0'; +} + +sub set_int_value($$) +{ + my $key = shift; + my $val = shift; + + $intopt{$key} = $val; +} + sub add_config($) { my $arg=shift; @@ -77,6 +91,12 @@ sub open_kconfig($$) { if (m|^\s*tristate\s+|) { add_tristate($key); } + if (m|^\s*int\s|) { + add_int($key); + } + if (m|^\s*default "(\d+)"| && exists $intopt{$key}) { + set_int_value($key, $1); + } if (m|^\s*config (.*)\n|) { $key=$1; add_config ($1); @@ -185,5 +205,8 @@ if (($force_kconfig eq 1) || !open IN,".config") { } } } + while ( my ($key,$value) = each(%intopt) ) { + print OUT "CONFIG_$key=$value\n"; + } close OUT; } -- cgit v1.2.3