b5df711c5db443d2d93cbcd6f699316a0ea688a0
[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 -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 -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 -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 -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 -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 -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 -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_SYS_CHDIR, [
124 AC_MSG_CHECKING(for exported sys_chdir)
125 save_CPPFLAGS="$CPPFLAGS"
126 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
127 AC_CACHE_VAL(ac_cv_linux_exports_sys_chdir,
128 [
129 AC_TRY_COMPILE(
130 [#include <linux/modversions.h>],
131 [#ifndef __ver_sys_chdir
132 #error sys_chdir not exported
133 #endif],
134 ac_cv_linux_exports_sys_chdir=yes,
135 ac_cv_linux_exports_sys_chdir=no)])
136 AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir)
137 CPPFLAGS="$save_CPPFLAGS"])
138
139
140 AC_DEFUN(LINUX_EXPORTS_SYS_CLOSE, [
141 AC_MSG_CHECKING(for exported sys_close)
142 save_CPPFLAGS="$CPPFLAGS"
143 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
144 AC_CACHE_VAL(ac_cv_linux_exports_sys_close,
145 [
146 AC_TRY_COMPILE(
147 [#include <linux/modversions.h>],
148 [#ifndef __ver_sys_close
149 #error sys_close not exported
150 #endif],
151 ac_cv_linux_exports_sys_close=yes,
152 ac_cv_linux_exports_sys_close=no)])
153 AC_MSG_RESULT($ac_cv_linux_exports_sys_close)
154 CPPFLAGS="$save_CPPFLAGS"])
155
156
157 AC_DEFUN(LINUX_EXPORTS_TASKLIST_LOCK, [
158 AC_MSG_CHECKING(for exported tasklist_lock)
159 save_CPPFLAGS="$CPPFLAGS"
160 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
161 AC_CACHE_VAL(ac_cv_linux_exports_tasklist_lock,
162 [
163 AC_TRY_COMPILE(
164 [#include <linux/modversions.h>],
165 [#ifndef __ver_tasklist_lock
166 #error tasklist_lock not exported
167 #endif],
168 ac_cv_linux_exports_tasklist_lock=yes,
169 ac_cv_linux_exports_tasklist_lock=no)])
170 AC_MSG_RESULT($ac_cv_linux_exports_tasklist_lock)
171 CPPFLAGS="$save_CPPFLAGS"])
172
173
174 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_CDEV, [
175 AC_MSG_CHECKING(for i_cdev in struct inode)
176 save_CPPFLAGS="$CPPFLAGS"
177 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
178 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
179 [
180 AC_TRY_COMPILE(
181 [#include <linux/fs.h>],
182 [struct inode _inode;
183 printf("%d\n", _inode.i_cdev);], 
184 ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
185 ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
186 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)
187 CPPFLAGS="$save_CPPFLAGS"])
188
189
190 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DEVICES, [
191 AC_MSG_CHECKING(for i_devices in struct inode)
192 save_CPPFLAGS="$CPPFLAGS"
193 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
194 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
195 [
196 AC_TRY_COMPILE(
197 [#include <linux/fs.h>],
198 [struct inode _inode;
199 printf("%d\n", _inode.i_devices);], 
200 ac_cv_linux_fs_struct_inode_has_i_devices=yes,
201 ac_cv_linux_fs_struct_inode_has_i_devices=no)])
202 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)
203 CPPFLAGS="$save_CPPFLAGS"])
204
205
206 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, [
207 AC_MSG_CHECKING(for i_dirty_data_buffers in struct inode)
208 save_CPPFLAGS="$CPPFLAGS"
209 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
210 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers, 
211 [
212 AC_TRY_COMPILE(
213 [#include <linux/fs.h>],
214 [struct inode _inode;
215 printf("%d\n", _inode.i_dirty_data_buffers);], 
216 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes,
217 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)])
218 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers)
219 CPPFLAGS="$save_CPPFLAGS"])
220
221
222 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD, [
223 AC_MSG_CHECKING(for i_mapping_overload in struct inode)
224 save_CPPFLAGS="$CPPFLAGS"
225 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
226 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mapping_overload, 
227 [
228 AC_TRY_COMPILE(
229 [#include <linux/fs.h>],
230 [struct inode _inode;
231 printf("%d\n", _inode.i_mapping_overload);], 
232 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
233 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
234 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)
235 CPPFLAGS="$save_CPPFLAGS"])
236
237
238 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED, [
239 AC_MSG_CHECKING(for i_mmap_shared in struct inode)
240 save_CPPFLAGS="$CPPFLAGS"
241 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
242 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mmap_shared,
243 [
244 AC_TRY_COMPILE(
245 [#include <linux/fs.h>],
246 [struct inode _inode;
247 printf("%d\n", _inode.i_mmap_shared);],
248 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
249 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
250 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)
251 CPPFLAGS="$save_CPPFLAGS"])
252
253
254 AC_DEFUN(LINUX_RECALC_SIGPENDING_ARG_TYPE,[
255 AC_MSG_CHECKING(for recalc_sigpending arg type)
256 save_CPPFLAGS="$CPPFLAGS"
257 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
258 AC_CACHE_VAL(ac_cv_linux_func_recalc_sigpending_takes_void,
259 [
260 AC_TRY_COMPILE(
261 [#include <linux/sched.h>],
262 [recalc_sigpending();],
263 ac_cv_linux_func_recalc_sigpending_takes_void=yes,
264 ac_cv_linux_func_recalc_sigpending_takes_void=no)])
265 AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)
266 CPPFLAGS="$save_CPPFLAGS"])
267
268
269 AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT, [
270 AC_MSG_CHECKING(for parent in struct task_struct)
271 save_CPPFLAGS="$CPPFLAGS"
272 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
273 AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_parent,
274 [
275 AC_TRY_COMPILE(
276 [#include <linux/sched.h>],
277 [struct task_struct _tsk;
278 printf("%d\n", _tsk.parent);],
279 ac_cv_linux_sched_struct_task_struct_has_parent=yes,
280 ac_cv_linux_sched_struct_task_struct_has_parent=no)])
281 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)
282 CPPFLAGS="$save_CPPFLAGS"])
283
284
285 AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT, [
286 AC_MSG_CHECKING(for real_parent in struct task_struct)
287 save_CPPFLAGS="$CPPFLAGS"
288 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
289 AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_real_parent,
290 [
291 AC_TRY_COMPILE(
292 [#include <linux/sched.h>],
293 [struct task_struct _tsk;
294 printf("%d\n", _tsk.real_parent);],
295 ac_cv_linux_sched_struct_task_struct_has_real_parent=yes,
296 ac_cv_linux_sched_struct_task_struct_has_real_parent=no)])
297 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent)
298 CPPFLAGS="$save_CPPFLAGS"])
299
300
301 AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK, [
302 AC_MSG_CHECKING(for sigmask_lock in struct task_struct)
303 save_CPPFLAGS="$CPPFLAGS"
304 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
305 AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sigmask_lock,
306 [
307 AC_TRY_COMPILE(
308 [#include <linux/sched.h>],
309 [struct task_struct _tsk;
310 printf("%d\n", _tsk.sigmask_lock);],
311 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes,
312 ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)])
313 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock)
314 CPPFLAGS="$save_CPPFLAGS"])
315
316 AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND, [
317 AC_MSG_CHECKING(for sighand in struct task_struct)
318 save_CPPFLAGS="$CPPFLAGS"
319 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
320 AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sighand,
321 [
322 AC_TRY_COMPILE(
323 [#include <linux/sched.h>],
324 [struct task_struct _tsk;
325 printf("%d\n", _tsk.sighand);],
326 ac_cv_linux_sched_struct_task_struct_has_sighand=yes,
327 ac_cv_linux_sched_struct_task_struct_has_sighand=no)])
328 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand)
329 CPPFLAGS="$save_CPPFLAGS"])