Don't build packages that haven't been selected.
[zfs.git] / config / kernel-fsync.m4
1 dnl #
2 dnl # Linux 2.6.x - 2.6.34 API
3 dnl #
4 AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITH_DENTRY], [
5         ZFS_LINUX_TRY_COMPILE([
6                 #include <linux/fs.h>
7         ],[
8                 int (*fsync) (struct file *, struct dentry *, int) = NULL;
9                 struct file_operations fops __attribute__ ((unused));
10
11                 fops.fsync = fsync;
12         ],[
13                 AC_MSG_RESULT([dentry])
14                 AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1,
15                         [fops->fsync() with dentry])
16         ],[
17         ])
18 ])
19
20 dnl #
21 dnl # Linux 2.6.35 - Linux 3.0 API
22 dnl #
23 AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY], [
24         ZFS_LINUX_TRY_COMPILE([
25                 #include <linux/fs.h>
26         ],[
27                 int (*fsync) (struct file *, int) = NULL;
28                 struct file_operations fops __attribute__ ((unused));
29
30                 fops.fsync = fsync;
31         ],[
32                 AC_MSG_RESULT([no dentry])
33                 AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
34                         [fops->fsync() without dentry])
35         ],[
36         ])
37 ])
38
39 dnl #
40 dnl # Linux 3.1 - 3.x API
41 dnl #
42 AC_DEFUN([ZFS_AC_KERNEL_FSYNC_RANGE], [
43         ZFS_LINUX_TRY_COMPILE([
44                 #include <linux/fs.h>
45         ],[
46                 int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
47                 struct file_operations fops __attribute__ ((unused));
48
49                 fops.fsync = fsync;
50         ],[
51                 AC_MSG_RESULT([range])
52                 AC_DEFINE(HAVE_FSYNC_RANGE, 1,
53                         [fops->fsync() with range])
54         ],[
55         ])
56 ])
57
58 dnl #
59 dnl # PaX Linux 2.6.x - 2.6.34 API
60 dnl #
61 AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_WITH_DENTRY], [
62         ZFS_LINUX_TRY_COMPILE([
63                 #include <linux/fs.h>
64         ],[
65                 int (*fsync) (struct file *, struct dentry *, int) = NULL;
66                 file_operations_no_const fops __attribute__ ((unused));
67
68                 fops.fsync = fsync;
69         ],[
70                 AC_MSG_RESULT([dentry])
71                 AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1,
72                         [fops->fsync() with dentry])
73         ],[
74         ])
75 ])
76
77 dnl #
78 dnl # PaX Linux 2.6.35 - Linux 3.0 API
79 dnl #
80 AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_WITHOUT_DENTRY], [
81         ZFS_LINUX_TRY_COMPILE([
82                 #include <linux/fs.h>
83         ],[
84                 int (*fsync) (struct file *, int) = NULL;
85                 file_operations_no_const fops __attribute__ ((unused));
86
87                 fops.fsync = fsync;
88         ],[
89                 AC_MSG_RESULT([no dentry])
90                 AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
91                         [fops->fsync() without dentry])
92         ],[
93         ])
94 ])
95
96 dnl #
97 dnl # PaX Linux 3.1 - 3.x API
98 dnl #
99 AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_RANGE], [
100         ZFS_LINUX_TRY_COMPILE([
101                 #include <linux/fs.h>
102         ],[
103                 int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
104                 file_operations_no_const fops __attribute__ ((unused));
105
106                 fops.fsync = fsync;
107         ],[
108                 AC_MSG_RESULT([range])
109                 AC_DEFINE(HAVE_FSYNC_RANGE, 1,
110                         [fops->fsync() with range])
111         ],[
112         ])
113 ])
114
115 AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [
116         AC_MSG_CHECKING([whether fops->fsync() wants])
117         ZFS_AC_KERNEL_FSYNC_WITH_DENTRY
118         ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY
119         ZFS_AC_KERNEL_FSYNC_RANGE
120         ZFS_AC_PAX_KERNEL_FSYNC_WITH_DENTRY
121         ZFS_AC_PAX_KERNEL_FSYNC_WITHOUT_DENTRY
122         ZFS_AC_PAX_KERNEL_FSYNC_RANGE
123 ])