disable-new-afs-thread-model-in-old-kernels-20021126
[openafs.git] / src / cf / linux-test4.m4
1 AC_DEFUN(LINUX_EXPORTS_TASKLIST_LOCK, [
2 AC_MSG_CHECKING(for exported tasklist_lock)
3 save_CPPFLAGS="$CPPFLAGS"
4 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
5 AC_CACHE_VAL(ac_cv_linux_exports_tasklist_lock,
6 [
7 AC_TRY_COMPILE(
8 [#include <linux/modversions.h>],
9 [#ifndef __ver_tasklist_lock
10 #error tasklist_lock not exported
11 #endif],
12 ac_cv_linux_exports_tasklist_lock=yes,
13 ac_cv_linux_exports_tasklist_lock=no)])
14 AC_MSG_RESULT($ac_cv_linux_exports_tasklist_lock)
15 CPPFLAGS="$save_CPPFLAGS"])
16
17 AC_DEFUN(LINUX_EXPORTS_SYS_CALL_TABLE, [
18 AC_MSG_CHECKING(for exported sys_call_table)
19 save_CPPFLAGS="$CPPFLAGS"
20 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
21 AC_CACHE_VAL(ac_cv_linux_exports_sys_call_table,
22 [
23 AC_TRY_COMPILE(
24 [#include <linux/modversions.h>],
25 [#ifndef __ver_sys_call_table
26 #error sys_call_table not exported
27 #endif],
28 ac_cv_linux_exports_sys_call_table=yes,
29 ac_cv_linux_exports_sys_call_table=no)])
30 AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)
31 CPPFLAGS="$save_CPPFLAGS"])
32
33 AC_DEFUN(LINUX_EXPORTS_INIT_MM, [
34 AC_MSG_CHECKING(for exported init_mm)
35 save_CPPFLAGS="$CPPFLAGS"
36 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
37 AC_CACHE_VAL(ac_cv_linux_exports_init_mm,
38 [
39 AC_TRY_COMPILE(
40 [#include <linux/modversions.h>],
41 [#ifndef __ver_init_mm
42 #error init_mm not exported
43 #endif],
44 ac_cv_linux_exports_init_mm=yes,
45 ac_cv_linux_exports_init_mm=no)])
46 AC_MSG_RESULT($ac_cv_linux_exports_init_mm)
47 CPPFLAGS="$save_CPPFLAGS"])
48
49 AC_DEFUN(LINUX_EXPORTS_KALLSYMS_SYMBOL, [
50 AC_MSG_CHECKING(for exported kallsyms_symbol_to_address)
51 save_CPPFLAGS="$CPPFLAGS"
52 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
53 AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_symbol,
54 [
55 AC_TRY_COMPILE(
56 [#include <linux/modversions.h>],
57 [#ifndef __ver_kallsyms_symbol_to_address
58 #error kallsyms_symbol_to_address not exported
59 #endif],
60 ac_cv_linux_exports_kallsyms_symbol=yes,
61 ac_cv_linux_exports_kallsyms_symbol=no)])
62 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol)
63 CPPFLAGS="$save_CPPFLAGS"])
64
65 AC_DEFUN(LINUX_EXPORTS_KALLSYMS_ADDRESS, [
66 AC_MSG_CHECKING(for exported kallsyms_address_to_symbol)
67 save_CPPFLAGS="$CPPFLAGS"
68 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
69 AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_address,
70 [
71 AC_TRY_COMPILE(
72 [#include <linux/modversions.h>],
73 [#ifndef __ver_kallsyms_address_to_symbol
74 #error kallsyms_address_to_symbol not exported
75 #endif],
76 ac_cv_linux_exports_kallsyms_address=yes,
77 ac_cv_linux_exports_kallsyms_address=no)])
78 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address)
79 CPPFLAGS="$save_CPPFLAGS"])
80
81 AC_DEFUN(LINUX_COMPLETION_H_EXISTS, [
82 AC_MSG_CHECKING(for linux/completion.h existance)
83 save_CPPFLAGS="$CPPFLAGS"
84 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
85 AC_CACHE_VAL(ac_cv_linux_completion_h_exists,
86 [
87 AC_TRY_COMPILE(
88 [#include <linux/completion.h>
89 #include <linux/version.h?],
90 [struct completion _c;
91 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8)
92 lose
93 #endif
94 ],
95 ac_cv_linux_completion_h_exists=yes,
96 ac_cv_linux_completion_h_exists=no)])
97 AC_MSG_RESULT($ac_cv_linux_completion_h_exists)
98 CPPFLAGS="$save_CPPFLAGS"])
99
100 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED, [
101 AC_MSG_CHECKING(for i_mmap_shared in struct inode)
102 save_CPPFLAGS="$CPPFLAGS"
103 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
104 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mmap_shared,
105 [
106 AC_TRY_COMPILE(
107 [#include <linux/fs.h>],
108 [struct inode _inode;
109 printf("%d\n", _inode.i_mmap_shared);],
110 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
111 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
112 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)
113 CPPFLAGS="$save_CPPFLAGS"])
114
115 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, [
116 AC_MSG_CHECKING(for i_dirty_data_buffers in struct inode)
117 save_CPPFLAGS="$CPPFLAGS"
118 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
119 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers, 
120 [
121 AC_TRY_COMPILE(
122 [#include <linux/fs.h>],
123 [struct inode _inode;
124 printf("%d\n", _inode.i_dirty_data_buffers);], 
125 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes,
126 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)])
127 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers)
128 CPPFLAGS="$save_CPPFLAGS"])
129
130 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD, [
131 AC_MSG_CHECKING(for i_mapping_overload in struct inode)
132 save_CPPFLAGS="$CPPFLAGS"
133 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
134 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mapping_overload, 
135 [
136 AC_TRY_COMPILE(
137 [#include <linux/fs.h>],
138 [struct inode _inode;
139 printf("%d\n", _inode.i_mapping_overload);], 
140 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
141 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
142 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)
143 CPPFLAGS="$save_CPPFLAGS"])
144
145 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_CDEV, [
146 AC_MSG_CHECKING(for i_cdev in struct inode)
147 save_CPPFLAGS="$CPPFLAGS"
148 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
149 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
150 [
151 AC_TRY_COMPILE(
152 [#include <linux/fs.h>],
153 [struct inode _inode;
154 printf("%d\n", _inode.i_cdev);], 
155 ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
156 ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
157 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)
158 CPPFLAGS="$save_CPPFLAGS"])
159
160 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DEVICES, [
161 AC_MSG_CHECKING(for i_devices in struct inode)
162 save_CPPFLAGS="$CPPFLAGS"
163 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
164 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
165 [
166 AC_TRY_COMPILE(
167 [#include <linux/fs.h>],
168 [struct inode _inode;
169 printf("%d\n", _inode.i_devices);], 
170 ac_cv_linux_fs_struct_inode_has_i_devices=yes,
171 ac_cv_linux_fs_struct_inode_has_i_devices=no)])
172 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)
173 CPPFLAGS="$save_CPPFLAGS"])
174