From ea1ca65b374ae5ed835fe871a3693885ba574ad1 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Tue, 30 Jan 2007 18:25:56 -0800 Subject: include config-compat.h with gcc -include command From: Trent Piepho 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 --- v4l/Makefile | 3 +++ v4l/compat.h | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) 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 #include #include -#include "config-compat.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18) # define minor(x) MINOR(x) -- cgit v1.2.3