Add -p switch to "zpool get"
[zfs.git] / config / user-ioctl.m4
1 dnl #
2 dnl # Check for ioctl()
3 dnl #
4 AC_DEFUN([ZFS_AC_CONFIG_USER_IOCTL], [
5         AC_MSG_CHECKING(for ioctl())
6         AC_EGREP_HEADER(ioctl, unistd.h, is_unistd=yes, is_unistd=no)
7         AC_EGREP_HEADER(ioctl, sys/ioctl.h, is_sys_ioctl=yes, is_sys_ioctl=no)
8         AC_EGREP_HEADER(ioctl, stropts.h, is_stropts=yes, is_stropts=no)
9
10         if test $is_unistd = yes; then
11                 result=unistd.h
12                 AC_DEFINE([HAVE_IOCTL_IN_UNISTD_H], 1,
13                 [Define to 1 if ioctl() defined in <unistd.h>])
14         else
15
16                 if test $is_sys_ioctl = yes; then
17                         result=sys/ioctl.h
18                         AC_DEFINE([HAVE_IOCTL_IN_SYS_IOCTL_H], 1,
19                         [Define to 1 if ioctl() defined in <sys/ioctl.h>])
20                 elif test $is_stropts = yes; then
21                         AC_DEFINE([HAVE_IOCTL_IN_STROPTS_H], 1,
22                         result=stropts.h
23                         [Define to 1 if ioctl() defined in <stropts.h>])
24                 else
25                         result=no
26                 fi
27         fi
28
29         if test $result = no; then
30                 AC_MSG_RESULT([no])
31                 AC_MSG_ERROR([*** Cannot locate ioctl() definition])
32         else
33                 AC_MSG_RESULT(yes)
34         fi
35 ])