diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-17 07:48:38 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-17 07:48:38 -0300 |
commit | 3ca0bf3bc155f5b99b87fb7ca3524a984d2cb4e4 (patch) | |
tree | b0be5c2ba90d8680c899cff44ce76b44f9f32c13 /v4l/scripts/make_noconfig.pl | |
parent | bc8ffa59a8ca28d18784da684563210ceb5acd22 (diff) | |
download | mediapointer-dvb-s2-3ca0bf3bc155f5b99b87fb7ca3524a984d2cb4e4.tar.gz mediapointer-dvb-s2-3ca0bf3bc155f5b99b87fb7ca3524a984d2cb4e4.tar.bz2 |
integer/hex/string options need to appear in .myconfig
From: Trent Piepho <xyzzy@speakeasy.org>
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 <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/scripts/make_noconfig.pl')
-rwxr-xr-x | v4l/scripts/make_noconfig.pl | 24 |
1 files changed, 21 insertions, 3 deletions
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 (<IN>) { close IN; # Build table of _all_ bool and tristate config variables +my $key = 0; open IN,"Kconfig"; while (<IN>) { 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 (<IN>) { } 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; |