From 3ca0bf3bc155f5b99b87fb7ca3524a984d2cb4e4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 17 Jun 2006 07:48:38 -0300 Subject: integer/hex/string options need to appear in .myconfig From: Trent Piepho integer/hex/string options were getting omitted from .myconfig, produced by make_noconfig.pl. They don't need to be there for the Makefile that includes .myconfig, it only uses the bool/tristate options. They need to be there for compat-config.h, which is generated from .myconfig and so will only have the #define statements for options that appear in .myconfig. Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_noconfig.pl | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'v4l') diff --git a/v4l/scripts/make_noconfig.pl b/v4l/scripts/make_noconfig.pl index cb3ea9627..7323f419c 100755 --- a/v4l/scripts/make_noconfig.pl +++ b/v4l/scripts/make_noconfig.pl @@ -1,5 +1,13 @@ #!/usr/bin/perl +# The purpose of this script is to produce a file named '.myconfig', in +# the same style as the '.config' file. Except .myconfig has disabled +# options explicitly set to 'n' rather than just omitted. This is to +# make sure they override any corresponding options that may be turned on +# in the Kernel's config files. +# The .myconfig file is what will be included in the v4l-dvb Makefile +# to control which drivers are built. + my %config = (); my %allconfig = (); @@ -13,9 +21,11 @@ while () { close IN; # Build table of _all_ bool and tristate config variables +my $key = 0; open IN,"Kconfig"; while () { if (/^config\s+(\w+)\s*$/) { + $key == 0 or die "Couldn't find type of config '$key'"; $key = "CONFIG_$1"; } elsif (/^\s+bool(ean)?\s/) { $allconfig{$key} = 'bool'; @@ -23,18 +33,26 @@ while () { } elsif (/^\s+tristate\s/) { $allconfig{$key} = 'tristate'; $key = 0; + } elsif (/^\s+(int|hex|string)\s/) { + $allconfig{$key} = 'data'; + $key = 0; } - # else, must be int or string, ignore } close IN; exists $allconfig{0} and die "Unable to correctly parse Kconfig file"; # Produce output for including in a Makefile -# Explicitly set options that didn't appear in .config to n +# Explicitly set bool/tri options that didn't appear in .config to n +# 'data' options are only output if they appeared in .config open OUT,">.myconfig"; while ( my ($key, $value) = each(%allconfig) ) { - $value = exists $config{$key} ? $config{$key} : 'n'; + if ($value eq 'data') { + next unless (exists $config{$key}); + $value = $config{$key}; + } else { + $value = exists $config{$key} ? $config{$key} : 'n'; + } printf OUT "%-44s := %s\n",$key,$value; } close OUT; -- cgit v1.2.3