From 599566a6b844b0086539e650336feada4b3e5bbb Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Sat, 26 May 2007 17:58:20 -0700 Subject: build: Put check in make_kconfig for pre 2.6.22 kernels From: Trent Piepho Most of the v4l-dvb drivers now depend on the kernel Kconfig option HAS_IOMEM, which isn't defined by kernels older than 2.6.22. Assume HAS_IOMEM is true for older kernels to make the v4l-dvb Kconfig files work. Signed-off-by: Trent Piepho --- v4l/scripts/make_kconfig.pl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index d558aaeb6..7cb258d86 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -475,6 +475,10 @@ sub cmp_ver($$) return $v1_sublevel <=> $v2_sublevel; } +# Get kernel version +get_version(); +print "Preparing to compile for kernel version $kernver\n"; + # Get Kernel's config settings %kernopts = process_config("$kernel/.config"); @@ -492,14 +496,14 @@ EOF exit -1; } +# Kernel < 2.6.22 is missing the HAS_IOMEM option +if (!defined $kernopts{HAS_IOMEM} && cmp_ver($kernver, '2.6.22') < 0) { + $kernopts{HAS_IOMEM} = 2; +} + # Get minimum kernel version for our variables parse_versions(); -# Get kernel version -get_version(); - -print "Preparing to compile for kernel version $kernver\n"; - kernelcheck(); open OUT, ">Kconfig" or die "Cannot write Kconfig file"; -- cgit v1.2.3 From 916fd2c97dfa82ccaa90177b8419a72469bf034b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 31 May 2007 14:04:16 -0300 Subject: Simplifies make install logs From: Mauro Carvalho Chehab Installation logs were very prolific. This patch makes the installation message cleaner, while preserving all information. The generated log is now much more clear, especially if compiling just a few device drivers. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_makefile.pl | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index 8711cc5a8..d684fdc45 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 = 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 == 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 != 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 -- cgit v1.2.3 From 1774b82f8341f6d5e8bdb5933f5fd6e2cca2aa15 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 31 May 2007 15:16:24 -0300 Subject: Script updated to support a more generic shell language From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_makefile.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index d684fdc45..8a31c025c 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -136,14 +136,14 @@ print OUT "\t\@echo \"Installing kernel modules under \$(DESTDIR)\$(KDIR26)/:\"\ while (my ($dir, $files) = each %instdir) { print OUT "\t\@n=0;for i in ", join(' ', keys %$files), ";do "; print OUT "if [ -e \"\$\$i\" ]; then "; - print OUT "if [ \$\$n = 0 ]; 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 == 4 ]; then echo; echo -n \"\t\t\"; n=1; 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 != 0 ]; then echo; fi\n\n"; + 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"; -- cgit v1.2.3 From 8391e4a8e4148d94a9eaecf3fbd242d959ace901 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 1 Jun 2007 20:15:26 -0300 Subject: saa7134-tvaudio: kthread conversion From: Christoph Hellwig Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Acked-by: Hermann Pitton Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/gentree.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'v4l/scripts') 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 -- cgit v1.2.3 From 4e4c168746908b7dc88bb1fe46b7308164fb145c Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 1 Jun 2007 20:18:52 -0300 Subject: Reverting last changeset. There were two different patches merged together From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/gentree.pl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl index 08969dab3..f9f56bd7c 100755 --- a/v4l/scripts/gentree.pl +++ b/v4l/scripts/gentree.pl @@ -64,10 +64,7 @@ my %defs = ( 'CONFIG_XC3028' => 0, 'CONFIG_TUNER_TEA5761' => 0, 'I2C_CLASS_TV_ANALOG' => 1, - 'I2C_CLASS_TV_DIGITAL' => 1, - 'OLD_XMIT_LOCK' => 0, - 'CONFIG_VIVI_SCATTER' => 0, -); + 'I2C_CLASS_TV_DIGITAL' => 1); ################################################################# # helpers -- cgit v1.2.3 From 4beebf752c257b99d8df832083d0ce9655ed017c Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 1 Jun 2007 20:27:57 -0300 Subject: Improve compatibility handling From: Mauro Carvalho Chehab V4L/DVB tree keeps backward compatibility with vanilla 2.6.x kernels. However, if some API changes happens on 2.6.x.y, this wouldn't be handled. This patch improves the compatibility capabilities of the tree by allowing customized scripts to be added on make_config_compat.pl. So, when generating config-compat.h, some compat checks can be done against the kernel tree. The practical effect is allowing compilation on 2.6.17.x trees, used by several distros, where some changes on netdevice.h affects dvb-net, stopping its compilation. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/gentree.pl | 5 +++- v4l/scripts/make_config_compat.pl | 60 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 v4l/scripts/make_config_compat.pl (limited to 'v4l/scripts') 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 () { + 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 \n\n"; +while() { + 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 -- cgit v1.2.3