summaryrefslogtreecommitdiff
path: root/package/linux-fusion/linux-fusion-8.0.2-cross-compile.patch
blob: 110e663333a7a48540df7287f77f54c93682fd2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
diff -urN linux-fusion-8.0.2-0rig//linux/drivers/char/fusion/shmpool.c linux-fusion-8.0.2/linux/drivers/char/fusion/shmpool.c
--- linux-fusion-8.0.2-0rig//linux/drivers/char/fusion/shmpool.c	2008-09-29 12:20:44.000000000 +0200
+++ linux-fusion-8.0.2/linux/drivers/char/fusion/shmpool.c	2009-01-11 17:00:19.000000000 +0100
@@ -20,6 +20,8 @@
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/sched.h>
+#include <asm/page.h>
+#include <linux/mm.h>
 
 #include <linux/fusion.h>
 
@@ -28,8 +30,6 @@
 #include "list.h"
 #include "shmpool.h"
 
-
-
 typedef struct {
      FusionLink         link;
      unsigned long      next_base;
diff -urN linux-fusion-8.0.2-0rig//Makefile linux-fusion-8.0.2/Makefile
--- linux-fusion-8.0.2-0rig//Makefile	2008-09-29 12:20:44.000000000 +0200
+++ linux-fusion-8.0.2/Makefile	2009-01-11 18:07:54.000000000 +0100
@@ -17,13 +17,15 @@
 
 
 DESTDIR ?= $(SYSROOT)
-
+HEADERDIR ?= $(SYSROOT)
+# This location is valid for at least 2.6.27.10
+KERNEL_FUSION_LIB=$(KERNEL_MODLIB)/kernel/drivers/char/fusion
 
 SUB = linux/drivers/char/fusion
 
 export CONFIG_FUSION_DEVICE=m
 
-
+ARCH=avr32
 ifeq ($(DEBUG),yes)
   CPPFLAGS += -DFUSION_DEBUG_SKIRMISH_DEADLOCK
 endif
@@ -45,25 +47,41 @@
 	ln -s Makefile-2.$(K_PATCHLEVEL) $(SUB)/Makefile
 ifeq ($(call check-version,2,6,24),1)
 	$(MAKE) -C $(KERNEL_BUILD) \
-		KCPPFLAGS="$(CPPFLAGS) -I`pwd`/linux/include" \
+		ARCH=avr32 \
+		CC=$(CROSS_COMPILE)gcc \
+		AS=$(CROSS_COMPILE)as \
+		KCPPFLAGS="$(CPPFLAGS) \
+			-I`pwd`/linux/include \
+			-I$(KERNEL_SOURCE)/include \
+			-I$(KERNEL_SOURCE)/arch/$(ARCH)/include" \
 		SUBDIRS=`pwd`/$(SUB) modules
 else
 	$(MAKE) -C $(KERNEL_BUILD) \
-		CPPFLAGS="$(CPPFLAGS) -D__KERNEL__ -I`pwd`/linux/include -I$(KERNEL_BUILD)/include -I$(KERNEL_SOURCE)/include $(AUTOCONF_H)" \
+		ARCH=avr32 \
+		CC=$(CROSS_COMPILE)gcc \
+		AS=$(CROSS_COMPILE)as \
+		CPPFLAGS="$(CPPFLAGS) \
+			-I`pwd`/linux/include \
+			-I$(KERNEL_BUILD)/include \
+			-I$(KERNEL_SOURCE)/include \
+			-I$(KERNEL_SOURCE)/arch/$(ARCH)/include \
+			 $(AUTOCONF_H)" \
 		SUBDIRS=`pwd`/$(SUB) modules
 endif
 
-install: all
+#-D__KERNEL__ 
+#-DHAVE_LINUX_CONFIG_H \
+
+install: all install-header
 	install -d $(DESTDIR)/usr/include/linux
 	install -m 644 linux/include/linux/fusion.h $(DESTDIR)/usr/include/linux
-
-	install -d $(DESTDIR)$(KERNEL_MODLIB)/drivers/char/fusion
+	install -d $(DESTDIR)$(KERNEL_FUSION_LIB)
 
 ifeq ($(K_PATCHLEVEL),4)
-	install -m 644 $(SUB)/fusion.o $(DESTDIR)$(KERNEL_MODLIB)/drivers/char/fusion
+	install -m 644 $(SUB)/fusion.o $(DESTDIR)$(KERNEL_FUSION_LIB)
 	rm -f $(DESTDIR)$(KERNEL_MODLIB)/fusion.o
 else
-	install -m 644 $(SUB)/fusion.ko $(DESTDIR)$(KERNEL_MODLIB)/drivers/char/fusion
+	install -m 644 $(SUB)/fusion.ko $(DESTDIR)$(KERNEL_FUSION_LIB)
 	rm -f $(DESTDIR)$(KERNEL_MODLIB)/fusion.ko
 endif
 ifneq ($(strip $(DESTDIR)),)
@@ -72,6 +90,8 @@
 	/sbin/depmod -ae $(KERNEL_VERSION)
 endif
 
+install-header:
+	install -m 644 linux/include/linux/fusion.h $(HEADERDIR)/usr/include/linux
 
 
 clean: