From 91a3da5165321c89bb4a35937d47f19ac53f8899 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 2 May 2006 09:29:34 -0300 Subject: Fix checking logic for a broken xawtv version From: Mauro Carvalho Chehab moved from if to ifndef. Also added such tests at gentree script. Gentree updated to its latest version. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/gentree.pl | 77 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 27 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl index 0ae296b93..de91722a7 100755 --- a/v4l/scripts/gentree.pl +++ b/v4l/scripts/gentree.pl @@ -2,12 +2,10 @@ use strict; use File::Find; use Fcntl ':mode'; -use Cwd; my $VER = shift; my $SRC = shift; my $DESTDIR = shift; -my $cwd; my $extra; @@ -70,9 +68,9 @@ sub filter_source ($$) { if ($line =~ m/^#include \"compat.h\"/) { next; } - if ($line =~ m/[\$]Id:/) { - next; - } +# if ($line =~ m/[\$]Id:/) { +# next; +# } if ($line =~ /^#ifdef MM_KERNEL/) { chomp($line); $state{$level} = "if"; @@ -81,8 +79,12 @@ sub filter_source ($$) { $level++; next; } - if ($line =~ /^\s*#if 0\s.*[Kk][Ee][Ee][Pp].*/) { - print OUT "#if 0\n"; + if ($line =~ m|^\s*\#if\s+0\s*\/[\*]\s*[Kk][Ee].[Pp]\s*[\*]\/(.*)|) { + if ($1 eq ";") { + print OUT "#if 0\n"; + } else { + print OUT "#if 0$1\n"; + } chomp($line); $state{$level} = "ifother"; $if{$level} = 0; @@ -90,6 +92,30 @@ sub filter_source ($$) { $level++; next; } + if ($line =~ /^#ifdef\sSTV0297_CS2/) { + chomp($line); + $state{$level} = "if"; + $if{$level} = 0; + print STDERR "/* BP #if 0 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; + $level++; + next; + } + if ($line =~ /^#ifndef\sBROKEN_XAWTV/) { + chomp($line); + $state{$level} = "if"; + $if{$level} = 1; + print STDERR "/* BP #if 0 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; + $level++; + next; + } + if ($line =~ /^#ifndef\sSTV0297_CS2/) { + chomp($line); + $state{$level} = "if"; + $if{$level} = 1; + print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; + $level++; + next; + } if ($line =~ /^#if 0/) { chomp($line); $state{$level} = "if"; @@ -98,8 +124,8 @@ sub filter_source ($$) { $level++; next; } - if ($line =~ /^#if 1\s.*[Kk][Ee][Ee][Pp].*/) { - print OUT "#if 1\n"; + if ($line =~ m|^\s*\#if\s+1\s*\/[\*]\s*[Kk][Ee].[Pp]\s*[\*]\/(.*)|) { + print OUT "#if 1$1\n"; $state{$level} = "ifother"; $if{$level} = 1; print STDERR "/* BP #if 1 (keep) state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; @@ -122,15 +148,15 @@ sub filter_source ($$) { $level++; next; } - if ($line =~ /^#if.*I2C_CLASS_TV_ANALOG/) { + if ($line =~ /^#if.*CONFIG_XC3028/) { chomp($line); $state{$level} = "if"; - $if{$level} = 1; + $if{$level} = 0; print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; $level++; next; } - if ($line =~ /^#ifndef.\s*I2C_DF_DUMMY/) { + if ($line =~ /^#if.*I2C_CLASS_TV_ANALOG/) { chomp($line); $state{$level} = "if"; $if{$level} = 1; @@ -138,22 +164,22 @@ sub filter_source ($$) { $level++; next; } - if ($line =~ /^#if.*I2C_CLASS_TV_DIGITAL/) { + if ($line =~ /^#ifndef.\s*I2C_PEC/) { chomp($line); $state{$level} = "if"; - $if{$level} = 1; + $if{$level} = 0; print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; $level++; next; } - if ($line =~ /^#if.*CONFIG_XC3028/) { + if ($line =~ /^#if.*I2C_CLASS_TV_DIGITAL/) { chomp($line); $state{$level} = "if"; - $if{$level} = 0; - print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level$ + $if{$level} = 1; + print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG; $level++; next; - } + } if ($line =~ /^#if.*BTTV_VERSION_CODE/) { chomp($line); $line =~ s@^#if\s*@@; @@ -280,9 +306,7 @@ sub parse_dir { return; } - my $mode = (lstat("$cwd/$file"))[2]; - -# printf "Permissions of %s/%s are %04o (dir=%s\n", $cwd,$file, $mode, cwd; + my $mode = (lstat("$file"))[2]; if ($mode & S_IFDIR) { return; @@ -291,14 +315,14 @@ sub parse_dir { $srcdir =~ s/(.)/\[$1\]/g; my $f2 = $file; - $f2 =~ s,^$srcdir,$cwd/$DESTDIR/,; + $f2 =~ s,^$srcdir,$DESTDIR/,; print "from $file to $f2\n"; my $tmp = "/tmp/src.$$"; if ($file =~ m/.*\.[ch]$/) { - filter_source("$cwd/$file","$tmp"); + filter_source("$file","$tmp"); } else { - system("cp $cwd/$file $tmp"); + system("cp $file $tmp"); } my $dir = $f2; @@ -315,12 +339,11 @@ sub parse_dir { my $patchtmploc = "/tmp/temp.patch"; -printf STDERR < Date: Sun, 7 May 2006 18:29:49 -0400 Subject: fix ability to pass compile-time build options when building from the hg repo From: Michael Krufky When building in-kernel, compile-time build options are passed into the compiler using '#include ' . This file #include's , which is created on the fly by the kbuild system. However, this does not work correctly when building from the mercurial repository, since the kernel is built indepentently of v4l/.myconfig This creates a "config-compat.h", which will be #include'd by compat.h and will emulate for the local build. Signed-off-by: Michael Krufky --- v4l/scripts/makelinks.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'v4l/scripts') diff --git a/v4l/scripts/makelinks.sh b/v4l/scripts/makelinks.sh index a66989771..03fd48849 100755 --- a/v4l/scripts/makelinks.sh +++ b/v4l/scripts/makelinks.sh @@ -39,10 +39,12 @@ done for x in `find include -type d | grep -v CVS` ; do ln -f -s $PWD/../v4l/compat.h $1/$x/compat.h + touch $1/$x/config-compat.h done for x in `find drivers/media -type d | grep -v CVS` ; do ln -f -s $PWD/../v4l/compat.h $1/$x/compat.h + touch $1/$x/config-compat.h done cd .. -- cgit v1.2.3