summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
Diffstat (limited to 'v4l')
-rw-r--r--v4l/Makefile17
-rwxr-xr-xv4l/scripts/gentree.pl5
-rw-r--r--v4l/scripts/make_config_compat.pl60
-rwxr-xr-xv4l/scripts/make_makefile.pl19
4 files changed, 79 insertions, 22 deletions
diff --git a/v4l/Makefile b/v4l/Makefile
index ad499751d..954d5227e 100644
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -238,21 +238,8 @@ links::
oss:
ln -sf . oss
-config-compat.h:: .myconfig
- @perl \
- -e 'print "#ifndef __CONFIG_COMPAT_H__\n";' \
- -e 'print "#define __CONFIG_COMPAT_H__\n\n";' \
- -e 'print "#include <linux/autoconf.h>\n\n";' \
- -e 'while(<>) {' \
- -e ' next unless /^(\S+)\s*:= (\S+)$$/;' \
- -e ' print "#undef $$1\n";' \
- -e ' print "#undef $$1_MODULE\n";' \
- -e ' if($$2 eq "n") { next; }' \
- -e ' elsif($$2 eq "m") { print "#define $$1_MODULE 1\n"; }' \
- -e ' elsif($$2 eq "y") { print "#define $$1 1\n"; }' \
- -e ' else { print "#define $$1 $$2\n"; }' \
- -e '} print "\n#endif\n";' \
- < .myconfig > config-compat.h
+config-compat.h:: $(obj)/.version .myconfig
+ perl scripts/make_config_compat.pl $(KDIR) $(obj)/.myconfig $(obj)/config-compat.h
kernel-links makelinks::
cd ..; v4l/scripts/makelinks.sh $(KDIR)
diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl
index f9f56bd7c..08969dab3 100755
--- a/v4l/scripts/gentree.pl
+++ b/v4l/scripts/gentree.pl
@@ -64,7 +64,10 @@ my %defs = (
'CONFIG_XC3028' => 0,
'CONFIG_TUNER_TEA5761' => 0,
'I2C_CLASS_TV_ANALOG' => 1,
- 'I2C_CLASS_TV_DIGITAL' => 1);
+ 'I2C_CLASS_TV_DIGITAL' => 1,
+ 'OLD_XMIT_LOCK' => 0,
+ 'CONFIG_VIVI_SCATTER' => 0,
+);
#################################################################
# helpers
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl
new file mode 100644
index 000000000..be577d247
--- /dev/null
+++ b/v4l/scripts/make_config_compat.pl
@@ -0,0 +1,60 @@
+#!/usr/bin/perl
+use strict;
+
+my $kdir=shift or die "should specify a kernel dir";
+my $infile=shift or die "should specify an input config file";
+my $outfile=shift or die "should specify an output config file";
+
+my $out;
+
+sub check_spin_lock()
+{
+ my $file = "$kdir/include/linux/netdevice.h";
+ my $old_syntax = 1;
+
+ open INNET, "<$file" or die "File not found: $file";
+ while (<INNET>) {
+ if (m/netif_tx_lock_bh/) {
+ $old_syntax = 0;
+ last;
+ }
+ }
+
+ if ($old_syntax) {
+ $out.= "\n#define OLD_XMIT_LOCK 1\n";
+ }
+ close INNET;
+}
+
+sub check_other_dependencies()
+{
+ check_spin_lock();
+}
+
+# Do the basic rules
+open IN, "<$infile" or die "File not found: $infile";
+
+$out.= "#ifndef __CONFIG_COMPAT_H__\n";
+$out.= "#define __CONFIG_COMPAT_H__\n\n";
+$out.= "#include <linux/autoconf.h>\n\n";
+while(<IN>) {
+ next unless /^(\S+)\s*:= (\S+)$/;
+ $out.= "#undef $1\n";
+ $out.= "#undef $1_MODULE\n";
+ if($2 eq "n") {
+ next;
+ } elsif($2 eq "m") {
+ $out.= "#define $1_MODULE 1\n";
+ } elsif($2 eq "y") {
+ $out.= "#define $1 1\n";
+ } else {
+ $out.= "#define $1 $2\n";
+ }
+}
+close IN;
+
+check_other_dependencies();
+
+open OUT, ">$outfile" or die 'Unable to write $outfile';
+print OUT "$out\n#endif\n";
+close OUT
diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl
index 8711cc5a8..8a31c025c 100755
--- a/v4l/scripts/make_makefile.pl
+++ b/v4l/scripts/make_makefile.pl
@@ -129,16 +129,23 @@ open_makefile('../linux/drivers/media/Makefile');
# Creating Install rule
print OUT "media-install::\n";
-print OUT "\t\@echo \"Stripping debug info from files:\"\n";
+print OUT "\t\@echo \"Stripping debug info from files\"\n";
print OUT "\t\@strip --strip-debug \$(inst-m)\n\n";
+print OUT "\t\@echo \"Installing kernel modules under \$(DESTDIR)\$(KDIR26)/:\"\n";
while (my ($dir, $files) = each %instdir) {
- print OUT "\t\@echo -e \"\\nInstalling \$(KDIR26)/$dir files:\"\n";
- print OUT "\t\@install -d \$(DESTDIR)\$(KDIR26)/$dir\n";
- print OUT "\t\@for i in ", join(' ', keys %$files), ";do ";
- print OUT "if [ -e \"\$\$i\" ]; then echo -n \"\$\$i \";";
- print OUT " install -m 644 -c \$\$i \$(DESTDIR)\$(KDIR26)/$dir; fi; done; echo;\n\n";
+ print OUT "\t\@n=0;for i in ", join(' ', keys %$files), ";do ";
+ print OUT "if [ -e \"\$\$i\" ]; then ";
+ print OUT "if [ \$\$n -eq 0 ]; then ";
+ print OUT "echo -n \"\t$dir/: \"; ";
+ print OUT "install -d \$(DESTDIR)\$(KDIR26)/$dir; fi; ";
+ print OUT "n=\$\$\(\(\$\$n+1\)\); ";
+ print OUT "if [ \$\$n -eq 4 ]; then echo; echo -n \"\t\t\"; n=1; fi; ";
+ print OUT "echo -n \"\$\$i \"; ";
+ print OUT "install -m 644 -c \$\$i \$(DESTDIR)\$(KDIR26)/$dir; fi; done; ";
+ print OUT "if [ \$\$n -ne 0 ]; then echo; fi;\n\n";
}
+print OUT "\t@echo\n";
print OUT "\t/sbin/depmod -a \$(KERNELRELEASE) \$(if \$(DESTDIR),-b \$(DESTDIR))\n\n";
# Creating Remove rule