Handle Linux kernels that don't export sys_call_table.
[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 [struct completion _c;],
90 ac_cv_linux_completion_h_exists=yes,
91 ac_cv_linux_completion_h_exists=no)])
92 AC_MSG_RESULT($ac_cv_linux_completion_h_exists)
93 CPPFLAGS="$save_CPPFLAGS"])
94
95 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED, [
96 AC_MSG_CHECKING(for i_mmap_shared in struct inode)
97 save_CPPFLAGS="$CPPFLAGS"
98 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
99 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mmap_shared,
100 [
101 AC_TRY_COMPILE(
102 [#include <linux/fs.h>],
103 [struct inode _inode;
104 printf("%d\n", _inode.i_mmap_shared);],
105 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
106 ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
107 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)
108 CPPFLAGS="$save_CPPFLAGS"])
109
110 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, [
111 AC_MSG_CHECKING(for i_dirty_data_buffers in struct inode)
112 save_CPPFLAGS="$CPPFLAGS"
113 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
114 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers, 
115 [
116 AC_TRY_COMPILE(
117 [#include <linux/fs.h>],
118 [struct inode _inode;
119 printf("%d\n", _inode.i_dirty_data_buffers);], 
120 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes,
121 ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)])
122 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers)
123 CPPFLAGS="$save_CPPFLAGS"])
124
125 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD, [
126 AC_MSG_CHECKING(for i_mapping_overload in struct inode)
127 save_CPPFLAGS="$CPPFLAGS"
128 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
129 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mapping_overload, 
130 [
131 AC_TRY_COMPILE(
132 [#include <linux/fs.h>],
133 [struct inode _inode;
134 printf("%d\n", _inode.i_mapping_overload);], 
135 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
136 ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
137 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)
138 CPPFLAGS="$save_CPPFLAGS"])
139
140 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_CDEV, [
141 AC_MSG_CHECKING(for i_cdev in struct inode)
142 save_CPPFLAGS="$CPPFLAGS"
143 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
144 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
145 [
146 AC_TRY_COMPILE(
147 [#include <linux/fs.h>],
148 [struct inode _inode;
149 printf("%d\n", _inode.i_cdev);], 
150 ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
151 ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
152 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)
153 CPPFLAGS="$save_CPPFLAGS"])
154
155 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DEVICES, [
156 AC_MSG_CHECKING(for i_devices in struct inode)
157 save_CPPFLAGS="$CPPFLAGS"
158 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
159 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
160 [
161 AC_TRY_COMPILE(
162 [#include <linux/fs.h>],
163 [struct inode _inode;
164 printf("%d\n", _inode.i_devices);], 
165 ac_cv_linux_fs_struct_inode_has_i_devices=yes,
166 ac_cv_linux_fs_struct_inode_has_i_devices=no)])
167 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)
168 CPPFLAGS="$save_CPPFLAGS"])
169