2 dnl # Commands common to multiple platforms. They generally behave
3 dnl # in the same way and take similar options.
5 AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS_COMMON], [
6 AC_PATH_TOOL(AWK, awk, "")
7 AC_PATH_TOOL(BASENAME, basename, "")
8 AC_PATH_TOOL(BC, bc, "")
9 AC_PATH_TOOL(BUNZIP2, bunzip2, "")
10 AC_PATH_TOOL(BZCAT, bzcat, "")
11 AC_PATH_TOOL(CAT, cat, "")
12 AC_PATH_TOOL(CD, cd, "cd") dnl # Builtin in bash
13 AC_PATH_TOOL(CHGRP, chgrp, "")
14 AC_PATH_TOOL(CHMOD, chmod, "")
15 AC_PATH_TOOL(CHOWN, chown, "")
16 AC_PATH_TOOL(CKSUM, cksum, "")
17 AC_PATH_TOOL(CMP, cmp, "")
18 AC_PATH_TOOL(CP, cp, "")
19 AC_PATH_TOOL(CPIO, cpio, "")
20 AC_PATH_TOOL(CUT, cut, "")
21 AC_PATH_TOOL(DATE, date, "")
22 AC_PATH_TOOL(DD, dd, "")
23 AC_PATH_TOOL(DF, df, "")
24 AC_PATH_TOOL(DIFF, diff, "")
25 AC_PATH_TOOL(DIRNAME, dirname, "")
26 AC_PATH_TOOL(DU, du, "")
27 AC_PATH_TOOL(ECHO, echo, "")
28 AC_PATH_TOOL(EGREP, egrep, "")
29 AC_PATH_TOOL(FALSE, false, "")
30 AC_PATH_TOOL(FDISK, fdisk, "")
31 AC_PATH_TOOL(FGREP, fgrep, "")
32 AC_PATH_TOOL(FILE, file, "")
33 AC_PATH_TOOL(FIND, find, "")
34 AC_PATH_TOOL(FIO, fio, "")
35 AC_PATH_TOOL(FSCK, fsck, "")
36 AC_PATH_TOOL(GNUDD, dd, "")
37 AC_PATH_TOOL(GETCONF, getconf, "")
38 AC_PATH_TOOL(GETENT, getent, "")
39 AC_PATH_TOOL(GREP, grep, "")
40 dnl # Due to permissions unpriviledged users may not detect group*.
41 AC_PATH_TOOL(GROUPADD, groupadd, "/usr/sbin/groupadd")
42 AC_PATH_TOOL(GROUPDEL, groupdel, "/usr/sbin/groupdel")
43 AC_PATH_TOOL(GROUPMOD, groupmod, "/usr/sbin/groupmod")
44 AC_PATH_TOOL(HEAD, head, "")
45 AC_PATH_TOOL(HOSTNAME, hostname, "")
46 AC_PATH_TOOL(ID, id, "")
47 AC_PATH_TOOL(KILL, kill, "")
48 AC_PATH_TOOL(KSH, ksh, "")
49 AC_PATH_TOOL(LOGNAME, logname, "")
50 AC_PATH_TOOL(LS, ls, "")
51 AC_PATH_TOOL(MD5SUM, md5sum, "")
52 AC_PATH_TOOL(MKDIR, mkdir, "")
53 AC_PATH_TOOL(MKNOD, mknod, "")
54 AC_PATH_TOOL(MKTEMP, mktemp, "")
55 AC_PATH_TOOL(MODINFO, modinfo, "")
56 AC_PATH_TOOL(MOUNT, mount, "")
57 AC_PATH_TOOL(MV, mv, "")
58 AC_PATH_TOOL(NAWK, nawk, "")
59 AC_PATH_TOOL(PGREP, pgrep, "")
60 AC_PATH_TOOL(PING, ping, "")
61 AC_PATH_TOOL(PKILL, pkill, "")
62 AC_PATH_TOOL(PRINTF, printf, "")
63 AC_PATH_TOOL(PS, ps, "")
64 AC_PATH_TOOL(PYTHON, python, "")
65 AC_PATH_TOOL(REBOOT, reboot, "")
66 AC_PATH_TOOL(RMDIR, rmdir, "")
67 AC_PATH_TOOL(RSH, rsh, "")
68 AC_PATH_TOOL(SED, sed, "")
69 AC_PATH_TOOL(SHUF, shuf, "")
70 AC_PATH_TOOL(SLEEP, sleep, "")
71 AC_PATH_TOOL(SORT, sort, "")
72 AC_PATH_TOOL(STAT, stat, "")
73 AC_PATH_TOOL(STRINGS, strings, "")
74 AC_PATH_TOOL(SU, su, "")
75 AC_PATH_TOOL(SUM, sum, "")
76 AC_PATH_TOOL(SYNC, sync, "")
77 AC_PATH_TOOL(TAIL, tail, "")
78 AC_PATH_TOOL(TAR, tar, "")
79 AC_PATH_TOOL(TIMEOUT, timeout, "")
80 AC_PATH_TOOL(TOUCH, touch, "")
81 AC_PATH_TOOL(TR, tr, "")
82 AC_PATH_TOOL(TRUNCATE, truncate, "")
83 AC_PATH_TOOL(TRUE, true, "")
84 AC_PATH_TOOL(UMASK, umask, "")
85 AC_PATH_TOOL(UMOUNT, umount, "")
86 AC_PATH_TOOL(UNAME, uname, "")
87 AC_PATH_TOOL(UNIQ, uniq, "")
88 dnl # Due to permissions unpriviledged users may not detect user*.
89 AC_PATH_TOOL(USERADD, useradd, "/usr/sbin/useradd")
90 AC_PATH_TOOL(USERDEL, userdel, "/usr/sbin/userdel")
91 AC_PATH_TOOL(USERMOD, usermod, "/usr/sbin/usermod")
92 AC_PATH_TOOL(WAIT, wait, "wait") dnl # Builtin in bash
93 AC_PATH_TOOL(WC, wc, "")
97 dnl # Linux commands, used withing 'is_linux' blocks of test scripts.
98 dnl # These commands may take different command line arguments.
100 AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS_LINUX], [
101 AC_PATH_TOOL(BLOCKDEV, blockdev, "")
102 AC_PATH_TOOL(CHACL, chacl, "")
103 AC_PATH_TOOL(COMPRESS, gzip, "")
104 AC_PATH_TOOL(FORMAT, parted, "")
105 AC_PATH_TOOL(FREE, free, "")
106 AC_PATH_TOOL(GETFACL, getfacl, "")
107 AC_PATH_TOOL(IOSTAT, iostat, "")
108 AC_PATH_TOOL(LOCKFS, lsof, "")
109 AC_PATH_TOOL(LSBLK, lsblk, "")
110 AC_PATH_TOOL(MODUNLOAD, rmmod, "")
111 AC_PATH_TOOL(MPSTAT, mpstat, "")
112 AC_PATH_TOOL(NEWFS, mke2fs, "")
113 AC_PATH_TOOL(NPROC, nproc, "")
114 AC_PATH_TOOL(PFEXEC, sudo, "")
115 AC_PATH_TOOL(READLINK, readlink, "")
116 AC_PATH_TOOL(SETFACL, setfacl, "")
117 AC_PATH_TOOL(SHARE, exportfs, "")
118 AC_PATH_TOOL(SWAP, swapon, "")
119 AC_PATH_TOOL(SWAPADD, swapon, "")
120 AC_PATH_TOOL(UDEVADM, udevadm, "")
121 AC_PATH_TOOL(UFSDUMP, dump, "")
122 AC_PATH_TOOL(UFSRESTORE, restore, "")
123 AC_PATH_TOOL(UNCOMPRESS, gunzip, "")
124 AC_PATH_TOOL(UNSHARE, exportfs, "")
125 AC_PATH_TOOL(VMSTAT, vmstat, "")
127 PAGESIZE=$($GETCONF PAGESIZE)
130 MNTTAB=/proc/self/mounts
135 dnl # BSD style commands, these have been kept in case at some point
136 dnl # we want to build these packages on a BSD style systems. Otherwise
137 dnl # they are unused and should be treated as such.
139 AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS_BSD], [
140 AC_PATH_TOOL(COMPRESS, compress, "")
141 AC_PATH_TOOL(COREADM, coreadm, "")
142 AC_PATH_TOOL(DIRCMP, dircmp, "")
143 AC_PATH_TOOL(DUMPADM, dumpadm, "")
144 AC_PATH_TOOL(FORMAT, format, "")
145 AC_PATH_TOOL(GETMAJOR, getmajor, "")
146 AC_PATH_TOOL(ISAINFO, isainfo, "")
147 AC_PATH_TOOL(KSTAT, kstat, "")
148 AC_PATH_TOOL(LOCKFS, lockfs, "")
149 AC_PATH_TOOL(LOFIADM, lofiadm, "")
150 AC_PATH_TOOL(MODUNLOAD, modunload, "")
151 AC_PATH_TOOL(NEWFS, newfs, "")
152 AC_PATH_TOOL(PAGESIZE, pagesize, "")
153 AC_PATH_TOOL(PFEXEC, pfexec, "")
154 AC_PATH_TOOL(PKGINFO, pkginfo, "")
155 AC_PATH_TOOL(PRTVTOC, prtvtoc, "")
156 AC_PATH_TOOL(PSRINFO, psrinfo, "")
157 AC_PATH_TOOL(SHARE, share, "")
158 AC_PATH_TOOL(SVCADM, svcadm, "")
159 AC_PATH_TOOL(SVCS, svcs, "")
160 AC_PATH_TOOL(SWAP, swap, "")
161 AC_PATH_TOOL(SWAPADD, swapadd, "")
162 AC_PATH_TOOL(UFSDUMP, ufsdump, "")
163 AC_PATH_TOOL(UFSRESTORE, ufsrestore, "")
164 AC_PATH_TOOL(UMOUNTALL, umountall, "")
165 AC_PATH_TOOL(UNCOMPRESS, uncompress, "")
166 AC_PATH_TOOL(UNSHARE, unshare, "")
167 AC_PATH_TOOL(ZONEADM, zoneadm, "")
168 AC_PATH_TOOL(ZONECFG, zonecfg, "")
169 AC_PATH_TOOL(ZONENAME, zonename, "")
172 AC_DEFUN([ZFS_AC_CONFIG_USER_COMMANDS], [
173 ZFS_AC_CONFIG_USER_COMMANDS_COMMON
176 AS_IF([test "$OS" == "GNU/Linux"], [
177 ZFS_AC_CONFIG_USER_COMMANDS_LINUX
179 ZFS_AC_CONFIG_USER_COMMANDS_BSD