summaryrefslogtreecommitdiff
blob: d4e2013cbb31a857dbab3ac07c10526564feaa9b (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
--- Makefile.kbuild.old	2004-07-01 13:54:56.542258768 +1000
+++ Makefile.kbuild	2004-07-01 13:57:04.861751240 +1000
@@ -93,14 +93,23 @@
 ifdef SYSSRC
   KERNEL_SOURCES := $(SYSSRC)
   KERNEL_HEADERS := $(KERNEL_SOURCES)/include
+  ifdef KVOUT
+    ifneq ($(SYSSRC),$(KVOUT))
+      KOUTPUT_HEADERS := $(KVOUT)/include
+    endif
+  endif
+  ifndef KOUTPUT_HEADERS
+    KOUTPUT_HEADERS := $(KERNEL_HEADERS)
+  endif
 else
-  KERNEL_UNAME   := $(shell uname -r)
-  KERNEL_SOURCES := /lib/modules/$(KERNEL_UNAME)/build
-  KERNEL_HEADERS := $(KERNEL_SOURCES)/include
+  KERNEL_UNAME    := $(shell uname -r)
+  KERNEL_SOURCES  := /lib/modules/$(KERNEL_UNAME)/build
+  KERNEL_HEADERS  := $(KERNEL_SOURCES)/include
+  KOUTPUT_HEADERS := $(KERNEL_HEADERS)
 endif
 
 CC ?= gcc
-CONFTEST := sh $(src)/conftest.sh "$(CC)" $(KERNEL_HEADERS)
+CONFTEST := sh $(src)/conftest.sh "$(CC)" $(KERNEL_HEADERS) $(KOUTPUT_HEADERS)
 
 KERNEL_UNAME ?= $(shell $(CONFTEST) get_uname)
 MODULE_ROOT  := /lib/modules/$(KERNEL_UNAME)/kernel/drivers
--- Makefile.nvidia.old	2004-07-01 13:55:03.054268792 +1000
+++ Makefile.nvidia	2004-07-01 13:55:17.799027248 +1000
@@ -21,6 +21,14 @@
 ifdef SYSSRC
   KERNEL_SOURCES := $(SYSSRC)
   KERNEL_HEADERS := $(KERNEL_SOURCES)/include
+  ifdef KVOUT
+    ifneq ($(SYSSRC),$(KVOUT))
+      KOUTPUT_HEADERS := $(KVOUT)/include
+    endif
+  endif
+  ifndef KOUTPUT_HEADERS
+    KOUTPUT_HEADERS := $(KERNEL_SOURCES)
+  endif
 else
   ifdef SYSINCLUDE
     KERNEL_HEADERS := $(SYSINCLUDE)
@@ -28,10 +35,11 @@
     KERNEL_UNAME   := $(shell uname -r)
     KERNEL_HEADERS := /lib/modules/$(KERNEL_UNAME)/build/include
   endif
+  KOUTPUT_HEADERS := $(KERNEL_SOURCES)
 endif
 
 CC ?= cc
-CONFTEST := sh ./conftest.sh "$(CC)" $(KERNEL_HEADERS)
+CONFTEST := sh ./conftest.sh "$(CC)" $(KERNEL_HEADERS) $(KOUTPUT_HEADERS)
 
 KERNEL_UNAME ?= $(shell $(CONFTEST) get_uname)
 MODULE_ROOT  := /lib/modules/$(KERNEL_UNAME)/kernel/drivers
--- makefile.old	2004-07-01 13:54:48.070546664 +1000
+++ makefile	2004-07-01 13:55:13.966609864 +1000
@@ -11,12 +11,21 @@
   else
     KERNEL_HEADERS := /lib/modules/$(shell uname -r)/build/include
   endif
+  KOUTPUT_HEADERS := $(KERNEL_HEADERS)
 else
     KERNEL_HEADERS := $(SYSSRC)/include
+    ifdef KVOUT
+      ifneq ($(SYSSRC),$(KVOUT))
+        KOUTPUT_HEADERS := $(KVOUT)/include
+      endif
+    endif
+    ifndef KOUTPUT_HEADERS
+      KOUTPUT_HEADERS := $(KERNEL_HEADERS)
+    endif
 endif
 
 CC ?= cc
-CONFTEST := sh ./conftest.sh "$(CC)" $(KERNEL_HEADERS)
+CONFTEST := sh ./conftest.sh "$(CC)" $(KERNEL_HEADERS) $(KOUTPUT_HEADERS)
 
 .PHONY: select_makefile
 select_makefile:
--- conftest.sh.old	2004-07-01 13:54:41.750507456 +1000
+++ conftest.sh	2004-07-01 13:55:08.910378528 +1000
@@ -7,16 +7,19 @@
 
 CC="$1"
 ISYSTEM=`$CC -print-file-name=include`
-HEADERS=$2
+SOURCE_HEADERS=$2
+BUILT_HEADERS=$3
 
 CFLAGS="-D__KERNEL__ \
 -Werror \
 -nostdinc \
 -isystem $ISYSTEM \
--I $HEADERS -I $HEADERS/asm/mach-default \
+-I $SOURCE_HEADERS -I $SOURCE_HEADERS/asm/mach-default \
+-I $BUILT_HEADERS -I $BUILT_HEADERS/../include2/asm/mach-default \
+-I $BUILT_HEADERS/../include2 \
 -Wimplicit-function-declaration"
 
-case "$3" in
+case "$4" in
     remap_page_range)
         #
         # Determine the number of arguments expected by remap_page_range.
@@ -124,7 +126,7 @@
         # Determine the kernel's major patch level; this is only done if we
         # aren't told by KBUILD.
         #
-        SOURCES=$HEADERS/..
+        SOURCES=$SOURCE_HEADERS/..
 
         echo $(grep "^PATCHLEVEL =" $SOURCES/Makefile | cut -d " " -f 3)
         exit 0
@@ -193,7 +195,7 @@
         RET=1
         OUTPUT=$4
 
-        if [ -f $HEADERS/linux/version.h ]; then
+        if [ -f $BUILT_HEADERS/linux/version.h ]; then
             #
             # We are either looking at a configured kernel source
             # tree or at headers shipped for a specific kernel.
@@ -208,7 +210,7 @@
               }
             }" > conftest$$.c
 
-            $CC conftest$$.c -o conftest$$ -nostdinc -I $HEADERS > /dev/null 2>&1
+            $CC conftest$$.c -o conftest$$ -nostdinc -I $BUILT_HEADERS > /dev/null 2>&1
             rm -f conftest$$.c
 
             if [ -f conftest$$ ]; then
@@ -222,8 +224,8 @@
                 RET=0
             fi
         else
-            MAKEFILE=$HEADERS/../Makefile
-            CONFIG=$HEADERS/../.config
+            MAKEFILE=$SOURCE_HEADERS/../Makefile
+            CONFIG=$BUILT_HEADERS/../.config
 
             if [ -f $MAKEFILE -a -f $CONFIG ]; then
                 #
@@ -275,7 +277,7 @@
             return 0;
         }" > conftest$$.c
 
-        $CC conftest$$.c -o conftest$$ -nostdinc -I $HEADERS > /dev/null 2>&1
+        $CC conftest$$.c -o conftest$$ -nostdinc -I $BUILT_HEADERS > /dev/null 2>&1
         rm -f conftest$$.c
 
         if [ -f conftest$$ ]; then
@@ -296,7 +298,7 @@
         RET=1
         OUTPUT=$4
 
-        if [ -f $HEADERS/linux/autoconf.h ]; then
+        if [ -f $BUILT_HEADERS/linux/autoconf.h ]; then
             #
             # We are looking at a configured source tree; verify
             # that its configuration doesn't include rivafb using
@@ -308,7 +310,7 @@
             #endif
             " > conftest$$.c
 
-            $CC -c conftest$$.c -nostdinc -I $HEADERS > /dev/null 2>&1
+            $CC -c conftest$$.c -nostdinc -I $BUILT_HEADERS > /dev/null 2>&1
             rm -f conftest$$.c
 
             if [ -f conftest$$.o ]; then
@@ -316,7 +318,7 @@
                 RET=0
             fi
         else
-            CONFIG=$HEADERS/../.config
+            CONFIG=$BUILT_HEADERS/../.config
             if [ -f $CONFIG ]; then
                 if [ -z "$(grep "^CONFIG_FB_RIVA=y" $CONFIG)" ]; then
                     RET=0
@@ -352,7 +354,7 @@
         RET=1
         OUTPUT=$4
 
-        if [ -f $HEADERS/linux/autoconf.h ]; then
+        if [ -f $BUILT_HEADERS/linux/autoconf.h ]; then
             #
             # We are looking at a configured source tree; verify
             # that its configuration doesn't include rivafb using
@@ -364,7 +366,7 @@
             #endif
             " > conftest$$.c
 
-            $CC -c conftest$$.c -nostdinc -I $HEADERS > /dev/null 2>&1
+            $CC -c conftest$$.c -nostdinc -I $BUILT_HEADERS > /dev/null 2>&1
             rm -f conftest$$.c
 
             if [ -f conftest$$.o ]; then
@@ -372,7 +374,7 @@
                 RET=0
             fi
         else
-            CONFIG=$HEADERS/../.config
+            CONFIG=$BUILT_HEADERS/../.config
             if [ -f $CONFIG ]; then
                 if [ -z "$(grep "^CONFIG_FB_RIVA=m" $CONFIG)" ]; then
                     RET=0