Fix minor autoconf error message inconsistencies
[zfs.git] / config / kernel-blk-end-request.m4
1 dnl #
2 dnl # 2.6.31 API change
3 dnl # In 2.6.29 kernels blk_end_request() was a GPL-only symbol, this was
4 dnl # changed in 2.6.31 so it may be used by non-GPL modules.
5 dnl #
6 AC_DEFUN([ZFS_AC_KERNEL_BLK_END_REQUEST], [
7         AC_MSG_CHECKING([whether blk_end_request() is available])
8         ZFS_LINUX_TRY_COMPILE([
9                 #include <linux/blkdev.h>
10         ],[
11                 struct request *req = NULL;
12                 (void) blk_end_request(req, 0, 0);
13         ],[
14                 AC_MSG_RESULT(yes)
15                 AC_DEFINE(HAVE_BLK_END_REQUEST, 1,
16                           [blk_end_request() is available])
17         ],[
18                 AC_MSG_RESULT(no)
19         ])
20
21         AC_MSG_CHECKING([whether blk_end_request() is GPL-only])
22         ZFS_LINUX_TRY_COMPILE([
23                 #include <linux/module.h>
24                 #include <linux/blkdev.h>
25                 
26                 MODULE_LICENSE("CDDL");
27         ],[
28                 struct request *req = NULL;
29                 (void) blk_end_request(req, 0, 0);
30         ],[
31                 AC_MSG_RESULT(no)
32         ],[
33                 AC_MSG_RESULT(yes)
34                 AC_DEFINE(HAVE_BLK_END_REQUEST_GPL_ONLY, 1,
35                           [blk_end_request() is GPL-only])
36         ])
37 ])