summaryrefslogtreecommitdiff
path: root/v4l/scripts
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-05-19 12:11:42 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-05-19 12:11:42 -0300
commita9f25b4215fa710a1e0074888d2aab5a168d4d78 (patch)
treeb34cc4e831a39e69f7b06bf780da08d780753941 /v4l/scripts
parent4cac5256e71021e5bd26eff40f465a6f41fe4b1a (diff)
downloadmediapointer-dvb-s2-a9f25b4215fa710a1e0074888d2aab5a168d4d78.tar.gz
mediapointer-dvb-s2-a9f25b4215fa710a1e0074888d2aab5a168d4d78.tar.bz2
Have make_kconfig.pl output int config vars with their default value
From: Trent Piepho <xyzzy@speakeasy.org> 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 <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-xv4l/scripts/make_kconfig.pl23
1 files changed, 23 insertions, 0 deletions
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;
}