08e0c974bb450acf9e5510dc7bba866bc0e23919
[openafs.git] / src / cf / linux-test4.m4
1 AC_DEFUN([LINUX_COMPLETION_H_EXISTS], [
2 AC_MSG_CHECKING(for linux/completion.h existance)
3 save_CPPFLAGS="$CPPFLAGS"
4 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
5 AC_CACHE_VAL(ac_cv_linux_completion_h_exists,
6 [
7 AC_TRY_COMPILE(
8 [#include <linux/completion.h>
9 #include <linux/version.h>],
10 [struct completion _c;
11 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8)
12 lose
13 #endif
14 ],
15 ac_cv_linux_completion_h_exists=yes,
16 ac_cv_linux_completion_h_exists=no)])
17 AC_MSG_RESULT($ac_cv_linux_completion_h_exists)
18 CPPFLAGS="$save_CPPFLAGS"])
19
20
21 AC_DEFUN([LINUX_DEFINES_FOR_EACH_PROCESS], [
22 AC_MSG_CHECKING(for defined for_each_process)
23 save_CPPFLAGS="$CPPFLAGS"
24 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
25 AC_CACHE_VAL(ac_cv_linux_defines_for_each_process,
26 [
27 AC_TRY_COMPILE(
28 [#include <linux/sched.h>],
29 [#ifndef for_each_process(p)
30 #error for_each_process not defined
31 #endif],
32 ac_cv_linux_defines_for_each_process=yes,
33 ac_cv_linux_defines_for_each_process=no)])
34 AC_MSG_RESULT($ac_cv_linux_defines_for_each_process)
35 CPPFLAGS="$save_CPPFLAGS"])
36
37
38 AC_DEFUN([LINUX_DEFINES_PREV_TASK], [
39 AC_MSG_CHECKING(for defined prev_task)
40 save_CPPFLAGS="$CPPFLAGS"
41 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
42 AC_CACHE_VAL(ac_cv_linux_defines_prev_task,
43 [
44 AC_TRY_COMPILE(
45 [#include <linux/sched.h>],
46 [#ifndef prev_task(p)
47 #error prev_task not defined
48 #endif],
49 ac_cv_linux_defines_prev_task=yes,
50 ac_cv_linux_defines_prev_task=no)])
51 AC_MSG_RESULT($ac_cv_linux_defines_prev_task)
52 CPPFLAGS="$save_CPPFLAGS"])
53
54
55 AC_DEFUN([LINUX_EXPORTS_INIT_MM], [
56 AC_MSG_CHECKING(for exported init_mm)
57 save_CPPFLAGS="$CPPFLAGS"
58 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
59 AC_CACHE_VAL(ac_cv_linux_exports_init_mm,
60 [
61 AC_TRY_COMPILE(
62 [#include <linux/modversions.h>],
63 [#ifndef __ver_init_mm
64 #error init_mm not exported
65 #endif],
66 ac_cv_linux_exports_init_mm=yes,
67 ac_cv_linux_exports_init_mm=no)])
68 AC_MSG_RESULT($ac_cv_linux_exports_init_mm)
69 CPPFLAGS="$save_CPPFLAGS"])
70
71
72 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_ADDRESS], [
73 AC_MSG_CHECKING(for exported kallsyms_address_to_symbol)
74 save_CPPFLAGS="$CPPFLAGS"
75 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
76 AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_address,
77 [
78 AC_TRY_COMPILE(
79 [#include <linux/modversions.h>],
80 [#ifndef __ver_kallsyms_address_to_symbol
81 #error kallsyms_address_to_symbol not exported
82 #endif],
83 ac_cv_linux_exports_kallsyms_address=yes,
84 ac_cv_linux_exports_kallsyms_address=no)])
85 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address)
86 CPPFLAGS="$save_CPPFLAGS"])
87
88
89 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_SYMBOL], [
90 AC_MSG_CHECKING(for exported kallsyms_symbol_to_address)
91 save_CPPFLAGS="$CPPFLAGS"
92 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
93 AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_symbol,
94 [
95 AC_TRY_COMPILE(
96 [#include <linux/modversions.h>],
97 [#ifndef __ver_kallsyms_symbol_to_address
98 #error kallsyms_symbol_to_address not exported
99 #endif],
100 ac_cv_linux_exports_kallsyms_symbol=yes,
101 ac_cv_linux_exports_kallsyms_symbol=no)])
102 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol)
103 CPPFLAGS="$save_CPPFLAGS"])
104
105
106 AC_DEFUN([LINUX_EXPORTS_SYS_CALL_TABLE], [
107 AC_MSG_CHECKING(for exported sys_call_table)
108 save_CPPFLAGS="$CPPFLAGS"
109 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
110 AC_CACHE_VAL(ac_cv_linux_exports_sys_call_table,
111 [
112 AC_TRY_COMPILE(
113 [#include <linux/modversions.h>],
114 [#ifndef __ver_sys_call_table
115 #error sys_call_table not exported
116 #endif],
117 ac_cv_linux_exports_sys_call_table=yes,
118 ac_cv_linux_exports_sys_call_table=no)])
119 AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)
120 CPPFLAGS="$save_CPPFLAGS"])
121
122
123 AC_DEFUN([LINUX_EXPORTS_IA32_SYS_CALL_TABLE], [
124 AC_MSG_CHECKING(for exported ia32_sys_call_table)
125 save_CPPFLAGS="$CPPFLAGS"
126 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
127 AC_CACHE_VAL(ac_cv_linux_exports_ia32_sys_call_table,
128 [
129 AC_TRY_COMPILE(
130 [#include <linux/modversions.h>],
131 [#ifndef __ver_ia32_sys_call_table
132 #error ia32_sys_call_table not exported
133 #endif],
134 ac_cv_linux_exports_ia32_sys_call_table=yes,
135 ac_cv_linux_exports_ia32_sys_call_table=no)])
136 AC_MSG_RESULT($ac_cv_linux_exports_ia32_sys_call_table)
137 CPPFLAGS="$save_CPPFLAGS"])
138
139
140 AC_DEFUN([LINUX_EXPORTS_SYS_CHDIR], [
141 AC_MSG_CHECKING(for exported sys_chdir)
142 save_CPPFLAGS="$CPPFLAGS"
143 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
144 AC_CACHE_VAL(ac_cv_linux_exports_sys_chdir,
145 [
146 AC_TRY_COMPILE(
147 [#include <linux/modversions.h>],
148 [#ifndef __ver_sys_chdir
149 #error sys_chdir not exported
150 #endif],
151 ac_cv_linux_exports_sys_chdir=yes,
152 ac_cv_linux_exports_sys_chdir=no)])
153 AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir)
154 CPPFLAGS="$save_CPPFLAGS"])
155
156
157 AC_DEFUN([LINUX_EXPORTS_SYS_CLOSE], [
158 AC_MSG_CHECKING(for exported sys_close)
159 save_CPPFLAGS="$CPPFLAGS"
160 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
161 AC_CACHE_VAL(ac_cv_linux_exports_sys_close,
162 [
163 AC_TRY_COMPILE(
164 [#include <linux/modversions.h>],
165 [#ifndef __ver_sys_close
166 #error sys_close not exported
167 #endif],
168 ac_cv_linux_exports_sys_close=yes,
169 ac_cv_linux_exports_sys_close=no)])
170 AC_MSG_RESULT($ac_cv_linux_exports_sys_close)
171 CPPFLAGS="$save_CPPFLAGS"])
172
173
174 AC_DEFUN([LINUX_EXPORTS_SYS_WAIT4], [
175 AC_MSG_CHECKING(for exported sys_wait4)
176 save_CPPFLAGS="$CPPFLAGS"
177 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
178 AC_CACHE_VAL(ac_cv_linux_exports_sys_wait4,
179 [
180 AC_TRY_COMPILE(
181 [#include <linux/modversions.h>],
182 [#ifndef __ver_sys_wait4
183 #error sys_wait4 not exported
184 #endif],
185 ac_cv_linux_exports_sys_wait4=yes,
186 ac_cv_linux_exports_sys_wait4=no)])
187 AC_MSG_RESULT($ac_cv_linux_exports_sys_wait4)
188 CPPFLAGS="$save_CPPFLAGS"])
189
190
191 AC_DEFUN([LINUX_EXPORTS_TASKLIST_LOCK], [
192 AC_MSG_CHECKING(for exported tasklist_lock)
193 save_CPPFLAGS="$CPPFLAGS"
194 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
195 AC_CACHE_VAL(ac_cv_linux_exports_tasklist_lock,
196 [
197 AC_TRY_COMPILE(
198 [#include <linux/modversions.h>],
199 [#ifndef __ver_tasklist_lock
200 #error tasklist_lock not exported
201 #endif],
202 ac_cv_linux_exports_tasklist_lock=yes,
203 ac_cv_linux_exports_tasklist_lock=no)])
204 AC_MSG_RESULT($ac_cv_linux_exports_tasklist_lock)
205 CPPFLAGS="$save_CPPFLAGS"])
206
207
208 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_CDEV], [
209 AC_MSG_CHECKING(for i_cdev in struct inode)
210 save_CPPFLAGS="$CPPFLAGS"
211 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
212 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
213 [
214 AC_TRY_COMPILE(
215 [#include <linux/fs.h>],
216 [struct inode _inode;
217 printf("%d\n", _inode.i_cdev);], 
218 ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
219 ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
220 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)
221 CPPFLAGS="$save_CPPFLAGS"])
222
223
224 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DEVICES], [
225 AC_MSG_CHECKING(for i_devices in struct inode)
226 save_CPPFLAGS="$CPPFLAGS"
227 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
228 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
229 [
230 AC_TRY_COMPILE(
231 [#include <linux/fs.h>],
232 [struct inode _inode;
233 printf("%d\n", _inode.i_devices);], 
234 ac_cv_linux_fs_struct_inode_has_i_devices=yes,
235 ac_cv_linux_fs_struct_inode_has_i_devices=no)])
236 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)
237 CPPFLAGS="$save_CPPFLAGS"])
238
239
240 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS], [
241 AC_MSG_CHECKING(for i_dirty_data_buffers in struct inode)
242 save_CPPFLAGS="$CPPFLAGS"
243 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
244 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers, 
245 [
246 AC_TRY_COMPILE(
247 [#include <linux/fs.h>],
248 [struct inode _inode;
249 printf("%d\n", _inode.i_dirty_data_buffers);], 
250 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes,
251 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)])
252 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers)
253 CPPFLAGS="$save_CPPFLAGS"])
254
255
256 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD], [
257 AC_MSG_CHECKING(for i_mapping_overload in struct inode)
258 save_CPPFLAGS="$CPPFLAGS"
259 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
260 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mapping_overload, 
261 [
262 AC_TRY_COMPILE(
263 [#include <linux/fs.h>],
264 [struct inode _inode;
265 printf("%d\n", _inode.i_mapping_overload);], 
266 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
267 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
268 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)
269 CPPFLAGS="$save_CPPFLAGS"])
270
271
272 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED], [
273 AC_MSG_CHECKING(for i_mmap_shared in struct inode)
274 save_CPPFLAGS="$CPPFLAGS"
275 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
276 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mmap_shared,
277 [
278 AC_TRY_COMPILE(
279 [#include <linux/fs.h>],
280 [struct inode _inode;
281 printf("%d\n", _inode.i_mmap_shared);],
282 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
283 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
284 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)
285 CPPFLAGS="$save_CPPFLAGS"])
286
287
288 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SECURITY], [
289 AC_MSG_CHECKING(for i_security in struct inode)
290 save_CPPFLAGS="$CPPFLAGS"
291 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
292 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_security, 
293 [
294 AC_TRY_COMPILE(
295 [#include <linux/fs.h>],
296 [struct inode _inode;
297 printf("%d\n", _inode.i_security);], 
298 ac_cv_linux_fs_struct_inode_has_i_security=yes,
299 ac_cv_linux_fs_struct_inode_has_i_security=no)])
300 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_security)
301 CPPFLAGS="$save_CPPFLAGS"])
302
303
304 AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE],[
305 AC_MSG_CHECKING(for recalc_sigpending arg type)
306 save_CPPFLAGS="$CPPFLAGS"
307 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
308 AC_CACHE_VAL(ac_cv_linux_func_recalc_sigpending_takes_void,
309 [
310 AC_TRY_COMPILE(
311 [#include <linux/sched.h>],
312 [recalc_sigpending();],
313 ac_cv_linux_func_recalc_sigpending_takes_void=yes,
314 ac_cv_linux_func_recalc_sigpending_takes_void=no)])
315 AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)
316 CPPFLAGS="$save_CPPFLAGS"])
317
318
319 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT], [
320 AC_MSG_CHECKING(for parent in struct task_struct)
321 save_CPPFLAGS="$CPPFLAGS"
322 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
323 AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_parent,
324 [
325 AC_TRY_COMPILE(
326 [#include <linux/sched.h>],
327 [struct task_struct _tsk;
328 printf("%d\n", _tsk.parent);],
329 ac_cv_linux_sched_struct_task_struct_has_parent=yes,
330 ac_cv_linux_sched_struct_task_struct_has_parent=no)])
331 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)
332 CPPFLAGS="$save_CPPFLAGS"])
333
334
335 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT], [
336 AC_MSG_CHECKING(for real_parent in struct task_struct)
337 save_CPPFLAGS="$CPPFLAGS"
338 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
339 AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_real_parent,
340 [
341 AC_TRY_COMPILE(
342 [#include <linux/sched.h>],
343 [struct task_struct _tsk;
344 printf("%d\n", _tsk.real_parent);],
345 ac_cv_linux_sched_struct_task_struct_has_real_parent=yes,
346 ac_cv_linux_sched_struct_task_struct_has_real_parent=no)])
347 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent)
348 CPPFLAGS="$save_CPPFLAGS"])
349
350
351 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG], [
352 AC_MSG_CHECKING(for sig in struct task_struct)
353 save_CPPFLAGS="$CPPFLAGS"
354 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
355 AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sig,
356 [
357 AC_TRY_COMPILE(
358 [#include <linux/sched.h>],
359 [struct task_struct _tsk;
360 printf("%d\n", _tsk.sig);],
361 ac_cv_linux_sched_struct_task_struct_has_sig=yes,
362 ac_cv_linux_sched_struct_task_struct_has_sig=no)])
363 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sig)
364 CPPFLAGS="$save_CPPFLAGS"])
365
366 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK], [
367 AC_MSG_CHECKING(for sigmask_lock in struct task_struct)
368 save_CPPFLAGS="$CPPFLAGS"
369 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
370 AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sigmask_lock,
371 [
372 AC_TRY_COMPILE(
373 [#include <linux/sched.h>],
374 [struct task_struct _tsk;
375 printf("%d\n", _tsk.sigmask_lock);],
376 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes,
377 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)])
378 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock)
379 CPPFLAGS="$save_CPPFLAGS"])
380
381 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND], [
382 AC_MSG_CHECKING(for sighand in struct task_struct)
383 save_CPPFLAGS="$CPPFLAGS"
384 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
385 AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sighand,
386 [
387 AC_TRY_COMPILE(
388 [#include <linux/sched.h>],
389 [struct task_struct _tsk;
390 printf("%d\n", _tsk.sighand);],
391 ac_cv_linux_sched_struct_task_struct_has_sighand=yes,
392 ac_cv_linux_sched_struct_task_struct_has_sighand=no)])
393 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand)
394 CPPFLAGS="$save_CPPFLAGS"])