From d0db8256e421bdde2c75c7d2937ba34ef19d2a98 Mon Sep 17 00:00:00 2001 From: guillemj <> Date: Fri, 27 May 2011 05:06:11 +0000 Subject: [PATCH] Use new paths for generated header files with Linux >= 2.6.33 On Linux >= 2.6.33, use instead of . Include it after . Use generated/utsrelease.h as VERSION_HEADER if present instead of linux/utsrelease.h or linux/version.h. --- Device3Dfx/3dfx_driver.c | 7 ++++++- Device3Dfx/ChangeLog | 7 +++++++ Device3Dfx/Makefile | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Device3Dfx/3dfx_driver.c b/Device3Dfx/3dfx_driver.c index 7dcf4f5..71b4f4d 100644 --- a/Device3Dfx/3dfx_driver.c +++ b/Device3Dfx/3dfx_driver.c @@ -27,13 +27,18 @@ /* * Include this first as it defines things that affect the kernel headers. */ -#include #include #ifndef KERNEL_VERSION #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) +#include +#else +#include +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,115) /* * It might work with smaller kernels, but I never tested that. diff --git a/Device3Dfx/ChangeLog b/Device3Dfx/ChangeLog index 3e3e288..d597114 100644 --- a/Device3Dfx/ChangeLog +++ b/Device3Dfx/ChangeLog @@ -1,3 +1,10 @@ +2011-05-27 Guillem Jover + + * 3dfx_driver.c: On Linux >= 2.6.33, use + instead of . Include it after . + * Makefile (VERSION_HEADER): Use generated/utsrelease.h if present + instead of linux/utsrelease.h or linux/version.h. + 2011-05-27 Guillem Jover * Makefile: Do not use negative exit codes. diff --git a/Device3Dfx/Makefile b/Device3Dfx/Makefile index b128e71..b6de2cb 100644 --- a/Device3Dfx/Makefile +++ b/Device3Dfx/Makefile @@ -26,11 +26,15 @@ ALL_CFLAGS := -DMODULE -D__KERNEL__ \ -I$(KHEADERS) -I$(KHEADERS)/asm/mach-default \ $(CFLAGS) +ifneq ($(wildcard $(KHEADERS)/generated/utsrelease.h),) +VERSION_HEADER := $(KHEADERS)/generated/utsrelease.h +else ifneq ($(wildcard $(KHEADERS)/linux/utsrelease.h),) VERSION_HEADER := $(KHEADERS)/linux/utsrelease.h else VERSION_HEADER := $(KHEADERS)/linux/version.h endif +endif ############################################################################### # You should never need to change anything below.