Use new paths for generated header files with Linux >= 2.6.33

On Linux >= 2.6.33, use <generated/autoconf.h> instead of
<linux/autoconf.h>. Include it after <linux/version.h>.
Use generated/utsrelease.h as VERSION_HEADER if present instead of
linux/utsrelease.h or linux/version.h.
This commit is contained in:
guillemj
2011-05-27 05:06:11 +00:00
parent f4f0afe53d
commit d0db8256e4
3 changed files with 17 additions and 1 deletions

View File

@@ -27,13 +27,18 @@
/*
* Include this first as it defines things that affect the kernel headers.
*/
#include <linux/autoconf.h>
#include <linux/version.h>
#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 <generated/autoconf.h>
#else
#include <linux/autoconf.h>
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,115)
/*
* It might work with smaller kernels, but I never tested that.

View File

@@ -1,3 +1,10 @@
2011-05-27 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c: On Linux >= 2.6.33, use <generated/autoconf.h>
instead of <linux/autoconf.h>. Include it after <linux/version.h>.
* Makefile (VERSION_HEADER): Use generated/utsrelease.h if present
instead of linux/utsrelease.h or linux/version.h.
2011-05-27 Guillem Jover <guillem@hadrons.org>
* Makefile: Do not use negative exit codes.

View File

@@ -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.