summaryrefslogtreecommitdiff
path: root/v4l/scripts/make_noconfig.pl
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-06-08 12:12:07 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-08 12:12:07 -0300
commitea9723bc221278765e75d0362ce36881285ee241 (patch)
tree5f183261b3196b1c4f8c00f36920ba0bdbb79695 /v4l/scripts/make_noconfig.pl
parentcc64aacbe823925c5cd8593e2f0e0fe7ba896053 (diff)
downloadmediapointer-dvb-s2-ea9723bc221278765e75d0362ce36881285ee241.tar.gz
mediapointer-dvb-s2-ea9723bc221278765e75d0362ce36881285ee241.tar.bz2
Improve v4l configuration scripts, handle versions.txt differently
From: Trent Piepho <xyzzy@speakeasy.org> This mainly changes the way make_kconfig.pl handles config options that require a newer kernel, as defined by versions.txt. Currently it outputs a blank config stanza defining the variable and setting it to 'n'. These show up as mysterious un-named grayed out options in xconfig, or just don't appear at all in menuconfig. The new method outputs an extra config stanza to the top of v4l/Kconfig, VIDEO_KERNEL_VERSION. This boolean variable defaults to 'n', and if enabled, allows selecting drivers that are listed as needing a newer kernel. Config options that need a newer kernel still apear in v4l/Kconfig with their names and help text, but they now have an additional dependency on VIDEO_KERNEL_VERSION, and an extra bit in the help text warning that they need a newer kernel. They will appear greyed out in xconfig, but will still have their proper names and help text. If the user turns VIDEO_KERNEL_VERSION on, then they can be enabled. The kernel version in versions.txt tends to be somewhat conservative. The default v4l/.config file generated by make_kconfig.pl will have these options set to no, instead of yes/module as it did before. make_noconfig.pl will no longer look at versions.txt, or deal with kernel version detection. It will get a list of all config options by reading v4l/Kconfig, and produce .myconfig by setting all bool/tristate options to their value from v4l/.config, or 'n' if not listed. A few bugs have been fixed, and the regexs adjusted. They were making a few mistakes before, or were otherwise flawed. The scripts do more error checking that the files they parse conform to the expected syntax. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvaho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/scripts/make_noconfig.pl')
-rwxr-xr-xv4l/scripts/make_noconfig.pl57
1 files changed, 20 insertions, 37 deletions
diff --git a/v4l/scripts/make_noconfig.pl b/v4l/scripts/make_noconfig.pl
index a81e157e2..cb3ea9627 100755
--- a/v4l/scripts/make_noconfig.pl
+++ b/v4l/scripts/make_noconfig.pl
@@ -1,57 +1,40 @@
#!/usr/bin/perl
-my $config = ();
+my %config = ();
+my %allconfig = ();
open IN,".config";
while (<IN>) {
- if (m/\s*([\d\w_]+)[=](.*)\n/) {
+ if (m/\s*(\w+)=\s*(\S*)/) {
#printf "%s=%s\n",$1,$2;
$config { $1 } = $2;
}
}
close IN;
-open IN,".version";
+# Build table of _all_ bool and tristate config variables
+open IN,"Kconfig";
while (<IN>) {
- if (m/KERNELRELEASE\s*[:]*[=]+\s*(\d+)\.(\d+)\.(\d+)/) {
- $version=$1;
- $level=$2;
- $sublevel=$3;
- }
-}
-close IN;
-
-open IN,"versions.txt";
-while (<IN>) {
- if (m/\[(\d+)\.(\d+)\.(\d+)\]/) {
- $minversion=$1;
- $minlevel=$2;
- $minsublevel=$3;
- next;
- }
- s/\n//;
-
- if (m/DVB_AV7110_FIRMWARE_FILE/) {
- next;
- }
- if (m/^\s*([\w\d_]+)/) {
- if ( ($version < $minversion) |
- ($level < $minlevel) |
- ($sublevel < $minsublevel) ) {
- $config { "CONFIG_$1" } = 'n';
-#print "CONFIG_$1 version is not supported\n";
- next;
- }
- if (!($config { "CONFIG_$1" } ) ) {
-print "CONFIG_$1 is unset\n";
- $config { "CONFIG_$1" } = 'n';
- }
+ if (/^config\s+(\w+)\s*$/) {
+ $key = "CONFIG_$1";
+ } elsif (/^\s+bool(ean)?\s/) {
+ $allconfig{$key} = 'bool';
+ $key = 0;
+ } elsif (/^\s+tristate\s/) {
+ $allconfig{$key} = 'tristate';
+ $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
open OUT,">.myconfig";
-while ( my ($key, $value) = each(%config) ) {
+while ( my ($key, $value) = each(%allconfig) ) {
+ $value = exists $config{$key} ? $config{$key} : 'n';
printf OUT "%-44s := %s\n",$key,$value;
}
close OUT;