updated on Sun Jan 15 16:02:00 UTC 2012
[aur-mirror.git] / rr62x / kernel3.patch
blob22829a476858cb781d60c39abb5c405881171767
1 --- inc/linux/Makefile.def.orig 2011-12-18 21:39:11.479542795 -0600
2 +++ inc/linux/Makefile.def 2011-12-18 21:44:40.631193634 -0600
3 @@ -74,7 +74,9 @@
4 KERNELDIR := /lib/modules/$(shell uname -r)/build
5 endif
7 -KERNEL_VER := 2.$(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\ -f3` / 256 % 256)
8 +KERNEL_MAJ_VER := $(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\ -f3` / 65536 % 65536)
10 +KERNEL_VER := $(KERNEL_MAJ_VER).$(shell expr `grep LINUX_VERSION_CODE $(KERNELDIR)/include/linux/version.h | cut -d\ -f3` / 256 % 256)
12 ifeq ($(KERNEL_VER),)
13 $(error Cannot find kernel version. Check $(KERNELDIR)/include/linux/version.h.)
14 @@ -82,11 +84,27 @@
16 ifneq ($(KERNEL_VER), 2.6)
17 ifneq ($(KERNEL_VER), 2.4)
18 -$(error Only kernel 2.4/2.6 is supported but you use $(KERNEL_VER))
19 +ifneq ($(KERNEL_MAJ_VER), 3)
20 +$(error Only kernel 2.4/2.6/3 is supported but you use $(KERNEL_VER))
21 +endif
22 endif
23 endif
25 -ifeq ($(KERNEL_VER), 2.6)
26 +ifeq ($(KERNEL_VER), 2.4)
28 +HPT_LIB := $(HPT_LIB)-regparm0
29 +_TARGETMODS := $(addprefix $(HPT_LIB)/,$(TARGETMODS))
31 +VPATH := .. $(HPT_ROOT)/osm/linux
32 +TARGET := $(TARGETNAME).o
34 +C_INCLUDES += -I$(HPT_ROOT)/osm/linux -I$(KERNELDIR)/include -I$(KERNELDIR)/drivers/scsi
36 +$(TARGET): $(TARGETOBJS) $(_TARGETMODS)
37 + @echo $(if $V,,[LD] $@)
38 + $(if $V,,@)$(CROSS_COMPILE)$(LD) -r -o $@ $^
40 +else # for kernel >= 2.6
42 TARGET := $(TARGETNAME).ko
44 @@ -119,20 +137,6 @@
45 @echo '$$(addprefix $$(obj)/,$$(TARGETMODS)): $$(obj)/%.o: $$(HPT_LIB)/%.o' >>$@
46 @echo ' @cp -f $$< $$@' >>$@
48 -else # for kernel 2.4 modules
50 -HPT_LIB := $(HPT_LIB)-regparm0
51 -_TARGETMODS := $(addprefix $(HPT_LIB)/,$(TARGETMODS))
53 -VPATH := .. $(HPT_ROOT)/osm/linux
54 -TARGET := $(TARGETNAME).o
56 -C_INCLUDES += -I$(HPT_ROOT)/osm/linux -I$(KERNELDIR)/include -I$(KERNELDIR)/drivers/scsi
58 -$(TARGET): $(TARGETOBJS) $(_TARGETMODS)
59 - @echo $(if $V,,[LD] $@)
60 - $(if $V,,@)$(CROSS_COMPILE)$(LD) -r -o $@ $^
62 endif # KERNEL_VER
64 endif # KMOD