diff options
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/Makefile | 2 | ||||
-rw-r--r-- | v4l/compat.h | 5 | ||||
-rw-r--r-- | v4l/firmware/Makefile | 11 | ||||
-rwxr-xr-x | v4l/scripts/headers_convert.pl | 30 |
4 files changed, 41 insertions, 7 deletions
diff --git a/v4l/Makefile b/v4l/Makefile index 04e74e8e5..2aa856974 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -117,7 +117,7 @@ EXTRA_CFLAGS += $(if $(wildcard $(srctree)/.mm), -DMM_KERNEL) EXTRA_CFLAGS += -include $(obj)/config-compat.h # Allow kernel version compat tests without adding #include's -EXTRA_CFLAGS += -include linux/version.h +EXTRA_CFLAGS += -include include/linux/version.h ################################################# # Kernel 2.4/2.6 specific rules diff --git a/v4l/compat.h b/v4l/compat.h index 6df2f6f13..6e90c0e63 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -230,6 +230,11 @@ static inline int list_is_singular(const struct list_head *head) { return !list_empty(head) && (head->next == head->prev); } + +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +#define current_uid() (current->uid) #endif #endif diff --git a/v4l/firmware/Makefile b/v4l/firmware/Makefile index e018ad92a..272b2e668 100644 --- a/v4l/firmware/Makefile +++ b/v4l/firmware/Makefile @@ -7,27 +7,26 @@ TARGETS = ihex2fw vicam/firmware.fw dabusb/firmware.fw dabusb/bitstream.bin ttus default: $(TARGETS) clean: - -rm $(TARGETS) + -rm -f $(TARGETS) distclean: clean - -rmdir $(DIRS) + -for i in $(DIRS); do if [ -d $$i ]; then rmdir $$i; fi; done install: default - -for i in $(DIRS); do 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 --git a/v4l/scripts/headers_convert.pl b/v4l/scripts/headers_convert.pl new file mode 100755 index 000000000..800a453e1 --- /dev/null +++ b/v4l/scripts/headers_convert.pl @@ -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; |