1f47ca48c282eca6b0022d4ddcafce5309e7e7bb
[openafs.git] / src / cf / linux-test2.m4
1 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK], [
2 AC_MSG_CHECKING(for gfp_mask in struct address_space)
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_fs_struct_address_space_has_gfp_mask, 
6 [
7 AC_TRY_COMPILE(
8 [#include <linux/fs.h>],
9 [struct address_space _a;
10 printf("%d\n", _a.gfp_mask);], 
11 ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes,
12 ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)])
13 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask)
14 CPPFLAGS="$save_CPPFLAGS"])
15
16 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BYTES], [
17 AC_MSG_CHECKING(for i_bytes in struct inode)
18 save_CPPFLAGS="$CPPFLAGS"
19 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
20 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_bytes, 
21 [
22 AC_TRY_COMPILE(
23 [#include <linux/fs.h>],
24 [struct inode _inode;
25 printf("%d\n", _inode.i_bytes);], 
26 ac_cv_linux_fs_struct_inode_has_i_bytes=yes,
27 ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
28 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)
29 CPPFLAGS="$save_CPPFLAGS"])
30
31 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM], [
32 AC_MSG_CHECKING(for i_alloc_sem in struct inode)
33 save_CPPFLAGS="$CPPFLAGS"
34 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
35 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_alloc_sem,
36 [
37 AC_TRY_COMPILE(
38 [#include <linux/fs.h>],
39 [struct inode _i;
40 printf("%x\n", _i.i_alloc_sem);], 
41 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes,
42 ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no)])
43 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_alloc_sem)
44 CPPFLAGS="$save_CPPFLAGS"])
45
46 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM], [
47 AC_MSG_CHECKING(for i_truncate_sem in struct inode)
48 save_CPPFLAGS="$CPPFLAGS"
49 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
50 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_truncate_sem,
51 [
52 AC_TRY_COMPILE(
53 [#include <linux/fs.h>],
54 [struct inode _i;
55 printf("%x\n", _i.i_truncate_sem);], 
56 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes,
57 ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)])
58 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem)
59 CPPFLAGS="$save_CPPFLAGS"])
60
61 AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK], [
62 AC_MSG_CHECKING(for page_lock in struct address_space)
63 save_CPPFLAGS="$CPPFLAGS"
64 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
65 AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_page_lock, 
66 [
67 AC_TRY_COMPILE(
68 [#include <linux/fs.h>],
69 [struct address_space _a_s;
70 printf("%x\n", _a_s.page_lock);], 
71 ac_cv_linux_fs_struct_address_space_has_page_lock=yes,
72 ac_cv_linux_fs_struct_address_space_has_page_lock=no)])
73 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock)
74 CPPFLAGS="$save_CPPFLAGS"])
75
76
77 dnl LINUX_BUILD_VNODE_FROM_INODE (configdir, outputdir, tmpldir)
78 dnl             defaults: (src/config, src/afs/LINUX, src/afs/linux)
79
80 AC_DEFUN([LINUX_BUILD_VNODE_FROM_INODE], [
81 AC_MSG_CHECKING(whether to build osi_vfs.h)
82 configdir=ifelse([$1], ,[src/config],$1)
83 outputdir=ifelse([$2], ,[src/afs/LINUX],$2)
84 tmpldir=ifelse([$3], ,[src/afs/LINUX],$3)
85 mkdir -p $outputdir
86 cp  $tmpldir/osi_vfs.hin $outputdir/osi_vfs.h
87 # chmod +x $configdir/make_vnode.pl
88 # $configdir/make_vnode.pl -i $LINUX_KERNEL_PATH -t ${tmpldir} -o $outputdir
89 ])