summaryrefslogtreecommitdiff
path: root/v4l/scripts/make_noconfig.pl
diff options
context:
space:
mode:
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;