initial-objdir-support-20011017
[openafs.git] / src / cf / linux-test2.m4
1 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_BYTES, [
2 AC_MSG_CHECKING(for i_bytes in struct inode)
3 save_CPPFLAGS="$CPPFLAGS"
4 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
5 AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_bytes, 
6 [
7 AC_TRY_COMPILE(
8 [#include <linux/fs.h>],
9 [struct inode _inode;
10 printf("%d\n", _inode.i_bytes);], 
11 ac_cv_linux_fs_struct_inode_has_i_bytes=yes,
12 ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
13 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)
14 CPPFLAGS="$save_CPPFLAGS"])
15
16 AC_DEFUN(LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, [
17 AC_MSG_CHECKING(for page_lock in struct address_space)
18 save_CPPFLAGS="$CPPFLAGS"
19 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
20 AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_page_lock, 
21 [
22 AC_TRY_COMPILE(
23 [#include <linux/fs.h>],
24 [struct address_space _a_s;
25 printf("%x\n", _a_s.page_lock);], 
26 ac_cv_linux_fs_struct_address_space_has_page_lock=yes,
27 ac_cv_linux_fs_struct_address_space_has_page_lock=no)])
28 AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock)
29 CPPFLAGS="$save_CPPFLAGS"])
30
31
32 dnl LINUX_BUILD_VNODE_FROM_INODE (configdir, outputdir, tmpldir)
33 dnl             defaults: (src/config, src/afs/LINUX, src/afs/linux)
34
35 AC_DEFUN(LINUX_BUILD_VNODE_FROM_INODE, [
36 AC_MSG_CHECKING(whether to build osi_vfs.h)
37 configdir=ifelse([$1], ,[src/config],$1)
38 outputdir=ifelse([$2], ,[src/afs/LINUX],$2)
39 tmpldir=ifelse([$3], ,[src/afs/LINUX],$3)
40 chmod +x $configdir/make_vnode.pl
41 $configdir/make_vnode.pl -i $LINUX_KERNEL_PATH -t ${tmpldir} -o $outputdir
42 ])