summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-01-30 18:25:56 -0800
committerTrent Piepho <xyzzy@speakeasy.org>2007-01-30 18:25:56 -0800
commitea1ca65b374ae5ed835fe871a3693885ba574ad1 (patch)
treea761311f13ed590f1a826db369abc7aa4ac97006
parentfca7ef71fcb220fb867d2f6d7e2e691adfa51906 (diff)
downloadmediapointer-dvb-s2-ea1ca65b374ae5ed835fe871a3693885ba574ad1.tar.gz
mediapointer-dvb-s2-ea1ca65b374ae5ed835fe871a3693885ba574ad1.tar.bz2
include config-compat.h with gcc -include command
From: Trent Piepho <xyzzy@speakeasy.org> The kernel's config settings from autoconf.h are overridden by the file config-compat.h, which is included from compat.h. Code compiled before compat.h is included will see the kernel's settings, while code compiled after will see v4l-dvb's version of the settings. This has caused hard to track down bugs on more than one occasion. Always including compat.h first will not work, as some of the compatibility code requires that certain kernel headers be included first in order to work correctly. This patch makes config-compat.h be included second (after the kernel's autoconf.h) for every file by using a gcc "-include" command line option, the same way the kernel autoconf.h file is included. This should eliminate the problem of config-compat.h not being included in the right spot. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
-rw-r--r--v4l/Makefile3
-rw-r--r--v4l/compat.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/v4l/Makefile b/v4l/Makefile
index 7674abd98..b07b592b1 100644
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -102,6 +102,8 @@ EXTRA_CFLAGS += -g
EXTRA_CFLAGS += $(if $(wildcard $(srctree)/.mm), -DMM_KERNEL)
+EXTRA_CFLAGS += -include $(obj)/config-compat.h
+
#################################################
# Kernel 2.4/2.6 specific rules
@@ -241,6 +243,7 @@ config-compat.h:: .myconfig
-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"; }' \
diff --git a/v4l/compat.h b/v4l/compat.h
index 4b5f597fb..6ba49e825 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -10,7 +10,6 @@
#include <linux/version.h>
#include <linux/utsname.h>
#include <linux/sched.h>
-#include "config-compat.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
# define minor(x) MINOR(x)