The patch number 8848 was added via Hans Verkuil <[EMAIL PROTECTED]> to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward compatible with older kernels. Compatibility modifications will be removed before inclusion into the mainstream Kernel If anyone has any objections, please let us know by sending a message to: [EMAIL PROTECTED] ------ From: Hans Verkuil <[EMAIL PROTECTED]> v4l2-apps: fix v4l2-apps build and 'make firmware' warnings - fix some warnings when creating/removing directories when running 'make firmware' - fix v4l2-apps build: copy and strip the linux/include headers first to avoid the kernel-specific constructs in the original headers. Update the include paths to point to the copy. Priority: normal Signed-off-by: Hans Verkuil <[EMAIL PROTECTED]> --- v4l/firmware/Makefile | 11 +++---- v4l/scripts/headers_convert.pl | 30 ++++++++++++++++++++ v4l2-apps/Makefile | 17 ++++++++++- v4l2-apps/lib/Makefile | 2 - v4l2-apps/lib/frequencies.c | 2 - v4l2-apps/lib/libv4l/libv4l1/Makefile | 2 - v4l2-apps/lib/libv4l/libv4l2/Makefile | 2 - v4l2-apps/lib/libv4l/libv4lconvert/Makefile | 2 - v4l2-apps/test/Makefile | 2 - v4l2-apps/test/ioctl-test.c | 2 - v4l2-apps/util/Makefile | 10 +++--- v4l2-apps/util/qv4l2/qv4l2.pro | 2 - v4l2-apps/util/rds/Makefile | 2 - v4l2-apps/util/xc3028-firmware/Makefile | 2 - 14 files changed, 65 insertions(+), 23 deletions(-) diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l/firmware/Makefile --- a/v4l/firmware/Makefile Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l/firmware/Makefile Fri Aug 29 23:36:14 2008 +0200 @@ -7,27 +7,26 @@ default: $(TARGETS) default: $(TARGETS) clean: - @for i in $(TARGETS); do if [ -e $$i ]; then rm $$i; fi; done + -rm -f $(TARGETS) distclean: clean - @for i in $(DIR); do if [ -d $$i ]; then rmdir $$i; fi; done + -for i in $(DIRS); do if [ -d $$i ]; then rmdir $$i; fi; done install: default - -for i in $(DIRS); do if mkdir /lib/firmware/$$i; done + -for i in $(DIRS); do if [ ! -d /lib/firmware/$$i ]; then mkdir -p /lib/firmware/$$i; fi; done -for i in $(TARGETS); do cp $$i /lib/firmware/$$i; done - + ###### mkdir: - -mkdir $(DIRS) + -for i in $(DIRS); do if [ ! -d $$i ]; then mkdir -p $$i; fi; done ihex2fw: ../../linux/firmware/ihex2fw.c gcc -Wall -o $@ $< vicam/firmware.fw: ../../linux/firmware/vicam/firmware.H16 mkdir - -mkdir vicam ./ihex2fw -w $< $@ dabusb/firmware.fw: ../../linux/firmware/dabusb/firmware.HEX mkdir diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l/scripts/headers_convert.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/v4l/scripts/headers_convert.pl Fri Aug 29 23:36:14 2008 +0200 @@ -0,0 +1,30 @@ +#!/usr/bin/perl +# +# headers_install prepare the listed header files for use in +# user space and copy the files to their destination. +# + +use strict; +use warnings; + +foreach (@ARGV) { + my $file = $_; + my $tmpfile = $file . ".tmp"; + + open(my $infile, '<', "$file") + or die "$file: $!\n"; + open(my $outfile, '>', "$tmpfile") or die "$tmpfile: $!\n"; + while (my $line = <$infile>) { + $line =~ s/([\s(])__user\s/$1/g; + $line =~ s/([\s(])__force\s/$1/g; + $line =~ s/([\s(])__iomem\s/$1/g; + $line =~ s/\s__attribute_const__\s/ /g; + $line =~ s/\s__attribute_const__$//g; + $line =~ s/^#include <linux\/compiler.h>//; + printf $outfile "%s", $line; + } + close $outfile; + close $infile; + system "mv $tmpfile $file"; +} +exit 0; diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l2-apps/Makefile --- a/v4l2-apps/Makefile Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l2-apps/Makefile Fri Aug 29 23:36:14 2008 +0200 @@ -1,11 +1,24 @@ # Makefile for linuxtv.org v4l2-apps -.PHONY: all clean install +.PHONY: all distclean clean install -all clean install: +all:: prepare-includes + +all clean install:: $(MAKE) -C lib $@ $(MAKE) -C util $@ $(MAKE) -C test $@ %: make -C .. $(MAKECMDGOALS) + +clean:: + -$(RM) -rf include + +distclean:: clean + +prepare-includes: + -if [ ! -d include ]; then \ + cp -r ../linux/include include ; \ + ../v4l/scripts/headers_convert.pl `find include -type f` ; \ + fi diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l2-apps/lib/Makefile --- a/v4l2-apps/lib/Makefile Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l2-apps/lib/Makefile Fri Aug 29 23:36:14 2008 +0200 @@ -1,6 +1,6 @@ # Makefile for linuxtv.org v4l2-apps/lib -CPPFLAGS += -I../../linux/include -I.. +CPPFLAGS += -I../include -I.. includes = v4l2.h diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l2-apps/lib/frequencies.c --- a/v4l2-apps/lib/frequencies.c Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l2-apps/lib/frequencies.c Fri Aug 29 23:36:14 2008 +0200 @@ -21,7 +21,7 @@ #include <stdlib.h> -#include "linux/videodev2.h" +#include <linux/videodev2.h> #include "v4l2.h" /* This source was originally written by Nathan Laredo <[EMAIL PROTECTED]>. diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l2-apps/lib/libv4l/libv4l1/Makefile --- a/v4l2-apps/lib/libv4l/libv4l1/Makefile Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l2-apps/lib/libv4l/libv4l1/Makefile Fri Aug 29 23:36:14 2008 +0200 @@ -1,4 +1,4 @@ override CPPFLAGS += -I../include -I../. -override CPPFLAGS += -I../include -I../../../../linux/include -fvisibility=hidden +override CPPFLAGS += -I../include -I../../../include -fvisibility=hidden CFLAGS := -g -O1 CFLAGS += -Wall -Wno-unused -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l2-apps/lib/libv4l/libv4l2/Makefile --- a/v4l2-apps/lib/libv4l/libv4l2/Makefile Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l2-apps/lib/libv4l/libv4l2/Makefile Fri Aug 29 23:36:14 2008 +0200 @@ -1,4 +1,4 @@ override CPPFLAGS += -I../include -I../. -override CPPFLAGS += -I../include -I../../../../linux/include -fvisibility=hidden +override CPPFLAGS += -I../include -I../../../include -fvisibility=hidden CFLAGS := -g -O1 CFLAGS += -Wall -Wno-unused -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l2-apps/lib/libv4l/libv4lconvert/Makefile --- a/v4l2-apps/lib/libv4l/libv4lconvert/Makefile Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l2-apps/lib/libv4l/libv4lconvert/Makefile Fri Aug 29 23:36:14 2008 +0200 @@ -1,4 +1,4 @@ override CPPFLAGS += -I../include -I../. -override CPPFLAGS += -I../include -I../../../../linux/include -fvisibility=hidden +override CPPFLAGS += -I../include -I../../../include -fvisibility=hidden CFLAGS := -g -O1 CFLAGS += -Wall -Wno-unused -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l2-apps/test/Makefile --- a/v4l2-apps/test/Makefile Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l2-apps/test/Makefile Fri Aug 29 23:36:14 2008 +0200 @@ -1,6 +1,6 @@ # Makefile for linuxtv.org v4l2-apps/test -CPPFLAGS += -I../../linux/include +CPPFLAGS += -I../include binaries = ioctl-test \ sliced-vbi-test \ diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l2-apps/test/ioctl-test.c --- a/v4l2-apps/test/ioctl-test.c Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l2-apps/test/ioctl-test.c Fri Aug 29 23:36:14 2008 +0200 @@ -42,7 +42,7 @@ typedef __u8 u8; typedef __u8 u8; typedef __u32 u32; #include <linux/version.h> -#include "../linux/include/media/v4l2-common.h" +#include <media/v4l2-common.h> #include <linux/video_decoder.h> #else typedef u_int32_t u32; diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l2-apps/util/Makefile --- a/v4l2-apps/util/Makefile Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l2-apps/util/Makefile Fri Aug 29 23:36:14 2008 +0200 @@ -4,7 +4,7 @@ ifeq ($(KERNEL_DIR),) KERNEL_DIR = /usr endif -CPPFLAGS += -I../../linux/include -D_GNU_SOURCE +CPPFLAGS += -I../include -D_GNU_SOURCE LDFLAGS += -lm binaries = v4l2-ctl v4l2-dbg ivtv-ctl cx18-ctl v4l-board-dbg @@ -26,8 +26,8 @@ clean:: rm -rf keycodes parse.h keytable qv4l2: - if [ ! -f qv4l2/Makefile ]; then (cd qv4l2; qmake); fi - make -C qv4l2 + -if [ ! -f qv4l2/Makefile ]; then (cd qv4l2; qmake); fi + $(MAKE) -C qv4l2 v4l2-dbg: v4l2-dbg.o v4l2-driverids.o v4l2-chipids.o $(CXX) $^ -o $@ @@ -59,12 +59,12 @@ keytable: keytable.c parse.h keytables v4l-board-dbg: v4l-board-dbg.c bttv-dbg.h saa7134-dbg.h em28xx-dbg.h -v4l2-driverids.cpp: ../../linux/include/linux/i2c-id.h +v4l2-driverids.cpp: ../include/linux/i2c-id.h @echo "struct driverid { const char *name; unsigned id; } driverids[] = {" >$@ @grep I2C_DRIVERID_ $^ | sed -e 's/.*I2C_DRIVERID_\([0-9A-Z_]*\)[^0-9]*\([0-9]*\).*/{ "\1", \2 },/' | tr A-Z a-z >>$@ @echo "{ 0, 0 }};" >>$@ -v4l2-chipids.cpp: ../../linux/include/media/v4l2-chip-ident.h +v4l2-chipids.cpp: ../include/media/v4l2-chip-ident.h @echo "struct chipid { const char *name; unsigned id; } chipids[] = {" >$@ @grep V4L2_IDENT_ $^ | sed -e 's/.*V4L2_IDENT_\([0-9A-Z_]*\)[^=]*=[^0-9]*\([0-9]*\).*/{ "\1", \2 },/' | tr A-Z a-z >>$@ @echo "{ 0, 0 }};" >>$@ diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l2-apps/util/qv4l2/qv4l2.pro --- a/v4l2-apps/util/qv4l2/qv4l2.pro Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l2-apps/util/qv4l2/qv4l2.pro Fri Aug 29 23:36:14 2008 +0200 @@ -3,7 +3,7 @@ ###################################################################### TEMPLATE = app -INCLUDEPATH += . ../../../linux/include ../../lib +INCLUDEPATH += . ../../include ../../lib CONFIG += debug # Input diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l2-apps/util/rds/Makefile --- a/v4l2-apps/util/rds/Makefile Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l2-apps/util/rds/Makefile Fri Aug 29 23:36:14 2008 +0200 @@ -1,6 +1,6 @@ # Makefile for linuxtv.org v4l2-apps/util/xc3028-firmware -CPPFLAGS += -I../../../linux/include +CPPFLAGS += -I../../include binaries = rds-saa6588 diff -r 45cc017bd761 -r 1a28ba7ddb1d v4l2-apps/util/xc3028-firmware/Makefile --- a/v4l2-apps/util/xc3028-firmware/Makefile Fri Aug 29 11:33:19 2008 -0700 +++ b/v4l2-apps/util/xc3028-firmware/Makefile Fri Aug 29 23:36:14 2008 +0200 @@ -1,6 +1,6 @@ # Makefile for linuxtv.org v4l2-apps/util/xc3028-firmware -CPPFLAGS += -I../../../linux/include +CPPFLAGS += -I../../include binaries = firmware-tool --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/1a28ba7ddb1ddf3a18265c50e5a70b8b42eacb9d _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits