xref: /freebsd/sys/contrib/openzfs/config/kernel.m4 (revision 8f76bb7dad48538c6832c2fb466a433d2a3f8cd5)
1dnl #
2dnl # Default ZFS kernel configuration
3dnl #
4AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
5	AM_COND_IF([BUILD_LINUX], [
6		dnl # Setup the kernel build environment.
7		ZFS_AC_KERNEL
8		ZFS_AC_QAT
9
10		dnl # Sanity checks for module building and CONFIG_* defines
11		ZFS_AC_KERNEL_CONFIG_DEFINED
12		ZFS_AC_MODULE_SYMVERS
13
14		dnl # Sequential ZFS_LINUX_TRY_COMPILE tests
15		ZFS_AC_KERNEL_FPU_HEADER
16		ZFS_AC_KERNEL_OBJTOOL_HEADER
17		ZFS_AC_KERNEL_WAIT_QUEUE_ENTRY_T
18		ZFS_AC_KERNEL_MISC_MINOR
19		ZFS_AC_KERNEL_DECLARE_EVENT_CLASS
20
21		dnl # Parallel ZFS_LINUX_TEST_SRC / ZFS_LINUX_TEST_RESULT tests
22		ZFS_AC_KERNEL_TEST_SRC
23		ZFS_AC_KERNEL_TEST_RESULT
24
25		AS_IF([test "$LINUX_OBJ" != "$LINUX"], [
26			KERNEL_MAKE="$KERNEL_MAKE O=$LINUX_OBJ"
27		])
28
29		AC_SUBST(KERNEL_MAKE)
30	])
31])
32
33dnl #
34dnl # Generate and compile all of the kernel API test cases to determine
35dnl # which interfaces are available.  By invoking the kernel build system
36dnl # only once the compilation can be done in parallel significantly
37dnl # speeding up the process.
38dnl #
39AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
40	ZFS_AC_KERNEL_SRC_OBJTOOL
41	ZFS_AC_KERNEL_SRC_GLOBAL_PAGE_STATE
42	ZFS_AC_KERNEL_SRC_ACCESS_OK_TYPE
43	ZFS_AC_KERNEL_SRC_PDE_DATA
44	ZFS_AC_KERNEL_SRC_FALLOCATE
45	ZFS_AC_KERNEL_SRC_FADVISE
46	ZFS_AC_KERNEL_SRC_GENERIC_FADVISE
47	ZFS_AC_KERNEL_SRC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
48	ZFS_AC_KERNEL_SRC_RWSEM
49	ZFS_AC_KERNEL_SRC_SCHED
50	ZFS_AC_KERNEL_SRC_USLEEP_RANGE
51	ZFS_AC_KERNEL_SRC_KMEM_CACHE
52	ZFS_AC_KERNEL_SRC_KVMALLOC
53	ZFS_AC_KERNEL_SRC_VMALLOC_PAGE_KERNEL
54	ZFS_AC_KERNEL_SRC_WAIT
55	ZFS_AC_KERNEL_SRC_INODE_TIMES
56	ZFS_AC_KERNEL_SRC_INODE_LOCK
57	ZFS_AC_KERNEL_SRC_GROUP_INFO_GID
58	ZFS_AC_KERNEL_SRC_RW
59	ZFS_AC_KERNEL_SRC_TIMER_SETUP
60	ZFS_AC_KERNEL_SRC_SUPER_USER_NS
61	ZFS_AC_KERNEL_SRC_PROC_OPERATIONS
62	ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS
63	ZFS_AC_KERNEL_SRC_BIO
64	ZFS_AC_KERNEL_SRC_BLKDEV
65	ZFS_AC_KERNEL_SRC_BLK_QUEUE
66	ZFS_AC_KERNEL_SRC_GENHD_FLAGS
67	ZFS_AC_KERNEL_SRC_REVALIDATE_DISK
68	ZFS_AC_KERNEL_SRC_GET_DISK_RO
69	ZFS_AC_KERNEL_SRC_GENERIC_READLINK_GLOBAL
70	ZFS_AC_KERNEL_SRC_DISCARD_GRANULARITY
71	ZFS_AC_KERNEL_SRC_INODE_OWNER_OR_CAPABLE
72	ZFS_AC_KERNEL_SRC_XATTR
73	ZFS_AC_KERNEL_SRC_ACL
74	ZFS_AC_KERNEL_SRC_INODE_SETATTR
75	ZFS_AC_KERNEL_SRC_INODE_GETATTR
76	ZFS_AC_KERNEL_SRC_INODE_SET_FLAGS
77	ZFS_AC_KERNEL_SRC_INODE_SET_IVERSION
78	ZFS_AC_KERNEL_SRC_SHOW_OPTIONS
79	ZFS_AC_KERNEL_SRC_FILE_INODE
80	ZFS_AC_KERNEL_SRC_FILE_DENTRY
81	ZFS_AC_KERNEL_SRC_FSYNC
82	ZFS_AC_KERNEL_SRC_AIO_FSYNC
83	ZFS_AC_KERNEL_SRC_EVICT_INODE
84	ZFS_AC_KERNEL_SRC_DIRTY_INODE
85	ZFS_AC_KERNEL_SRC_SHRINKER
86	ZFS_AC_KERNEL_SRC_MKDIR
87	ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS
88	ZFS_AC_KERNEL_SRC_CREATE
89	ZFS_AC_KERNEL_SRC_PERMISSION
90	ZFS_AC_KERNEL_SRC_GET_LINK
91	ZFS_AC_KERNEL_SRC_PUT_LINK
92	ZFS_AC_KERNEL_SRC_TMPFILE
93	ZFS_AC_KERNEL_SRC_AUTOMOUNT
94	ZFS_AC_KERNEL_SRC_ENCODE_FH_WITH_INODE
95	ZFS_AC_KERNEL_SRC_COMMIT_METADATA
96	ZFS_AC_KERNEL_SRC_CLEAR_INODE
97	ZFS_AC_KERNEL_SRC_SETATTR_PREPARE
98	ZFS_AC_KERNEL_SRC_INSERT_INODE_LOCKED
99	ZFS_AC_KERNEL_SRC_DENTRY
100	ZFS_AC_KERNEL_SRC_DENTRY_ALIAS_D_U
101	ZFS_AC_KERNEL_SRC_TRUNCATE_SETSIZE
102	ZFS_AC_KERNEL_SRC_SECURITY_INODE
103	ZFS_AC_KERNEL_SRC_FST_MOUNT
104	ZFS_AC_KERNEL_SRC_BDI
105	ZFS_AC_KERNEL_SRC_SET_NLINK
106	ZFS_AC_KERNEL_SRC_SGET
107	ZFS_AC_KERNEL_SRC_LSEEK_EXECUTE
108	ZFS_AC_KERNEL_SRC_VFS_FILEMAP_DIRTY_FOLIO
109	ZFS_AC_KERNEL_SRC_VFS_READ_FOLIO
110	ZFS_AC_KERNEL_SRC_VFS_GETATTR
111	ZFS_AC_KERNEL_SRC_VFS_FSYNC_2ARGS
112	ZFS_AC_KERNEL_SRC_VFS_ITERATE
113	ZFS_AC_KERNEL_SRC_VFS_DIRECT_IO
114	ZFS_AC_KERNEL_SRC_VFS_READPAGES
115	ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS
116	ZFS_AC_KERNEL_SRC_VFS_RW_ITERATE
117	ZFS_AC_KERNEL_SRC_VFS_GENERIC_WRITE_CHECKS
118	ZFS_AC_KERNEL_SRC_VFS_IOV_ITER
119	ZFS_AC_KERNEL_SRC_VFS_COPY_FILE_RANGE
120	ZFS_AC_KERNEL_SRC_VFS_GENERIC_COPY_FILE_RANGE
121	ZFS_AC_KERNEL_SRC_VFS_REMAP_FILE_RANGE
122	ZFS_AC_KERNEL_SRC_VFS_CLONE_FILE_RANGE
123	ZFS_AC_KERNEL_SRC_VFS_DEDUPE_FILE_RANGE
124	ZFS_AC_KERNEL_SRC_VFS_FILE_OPERATIONS_EXTEND
125	ZFS_AC_KERNEL_SRC_KMAP_ATOMIC_ARGS
126	ZFS_AC_KERNEL_SRC_FOLLOW_DOWN_ONE
127	ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN
128	ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT
129	ZFS_AC_KERNEL_SRC_FPU
130	ZFS_AC_KERNEL_SRC_FMODE_T
131	ZFS_AC_KERNEL_SRC_KUIDGID_T
132	ZFS_AC_KERNEL_SRC_KUID_HELPERS
133	ZFS_AC_KERNEL_SRC_RENAME
134	ZFS_AC_KERNEL_SRC_CURRENT_TIME
135	ZFS_AC_KERNEL_SRC_USERNS_CAPABILITIES
136	ZFS_AC_KERNEL_SRC_IN_COMPAT_SYSCALL
137	ZFS_AC_KERNEL_SRC_KTIME
138	ZFS_AC_KERNEL_SRC_TOTALRAM_PAGES_FUNC
139	ZFS_AC_KERNEL_SRC_TOTALHIGH_PAGES
140	ZFS_AC_KERNEL_SRC_KSTRTOUL
141	ZFS_AC_KERNEL_SRC_PERCPU
142	ZFS_AC_KERNEL_SRC_CPU_HOTPLUG
143	ZFS_AC_KERNEL_SRC_GENERIC_FILLATTR
144	ZFS_AC_KERNEL_SRC_MKNOD
145	ZFS_AC_KERNEL_SRC_SYMLINK
146	ZFS_AC_KERNEL_SRC_BIO_MAX_SEGS
147	ZFS_AC_KERNEL_SRC_SIGNAL_STOP
148	ZFS_AC_KERNEL_SRC_SIGINFO
149	ZFS_AC_KERNEL_SRC_SYSFS
150	ZFS_AC_KERNEL_SRC_SET_SPECIAL_STATE
151	ZFS_AC_KERNEL_SRC_STANDALONE_LINUX_STDARG
152	ZFS_AC_KERNEL_SRC_PAGEMAP_FOLIO_WAIT_BIT
153	ZFS_AC_KERNEL_SRC_ADD_DISK
154	ZFS_AC_KERNEL_SRC_KTHREAD
155	ZFS_AC_KERNEL_SRC_ZERO_PAGE
156	ZFS_AC_KERNEL_SRC___COPY_FROM_USER_INATOMIC
157	ZFS_AC_KERNEL_SRC_USER_NS_COMMON_INUM
158	ZFS_AC_KERNEL_SRC_IDMAP_MNT_API
159	ZFS_AC_KERNEL_SRC_IATTR_VFSID
160	ZFS_AC_KERNEL_SRC_FILEMAP
161	ZFS_AC_KERNEL_SRC_WRITEPAGE_T
162	ZFS_AC_KERNEL_SRC_RECLAIMED
163	ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE
164	ZFS_AC_KERNEL_SRC_COPY_SPLICE_READ
165	case "$host_cpu" in
166		powerpc*)
167			ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE
168			ZFS_AC_KERNEL_SRC_FLUSH_DCACHE_PAGE
169			;;
170	esac
171
172	AC_MSG_CHECKING([for available kernel interfaces])
173	ZFS_LINUX_TEST_COMPILE_ALL([kabi])
174	AC_MSG_RESULT([done])
175])
176
177dnl #
178dnl # Check results of kernel interface tests.
179dnl #
180AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
181	ZFS_AC_KERNEL_ACCESS_OK_TYPE
182	ZFS_AC_KERNEL_GLOBAL_PAGE_STATE
183	ZFS_AC_KERNEL_OBJTOOL
184	ZFS_AC_KERNEL_PDE_DATA
185	ZFS_AC_KERNEL_FALLOCATE
186	ZFS_AC_KERNEL_FADVISE
187	ZFS_AC_KERNEL_GENERIC_FADVISE
188	ZFS_AC_KERNEL_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
189	ZFS_AC_KERNEL_RWSEM
190	ZFS_AC_KERNEL_SCHED
191	ZFS_AC_KERNEL_USLEEP_RANGE
192	ZFS_AC_KERNEL_KMEM_CACHE
193	ZFS_AC_KERNEL_KVMALLOC
194	ZFS_AC_KERNEL_VMALLOC_PAGE_KERNEL
195	ZFS_AC_KERNEL_WAIT
196	ZFS_AC_KERNEL_INODE_TIMES
197	ZFS_AC_KERNEL_INODE_LOCK
198	ZFS_AC_KERNEL_GROUP_INFO_GID
199	ZFS_AC_KERNEL_RW
200	ZFS_AC_KERNEL_TIMER_SETUP
201	ZFS_AC_KERNEL_SUPER_USER_NS
202	ZFS_AC_KERNEL_PROC_OPERATIONS
203	ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS
204	ZFS_AC_KERNEL_BIO
205	ZFS_AC_KERNEL_BLKDEV
206	ZFS_AC_KERNEL_BLK_QUEUE
207	ZFS_AC_KERNEL_GENHD_FLAGS
208	ZFS_AC_KERNEL_REVALIDATE_DISK
209	ZFS_AC_KERNEL_GET_DISK_RO
210	ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL
211	ZFS_AC_KERNEL_DISCARD_GRANULARITY
212	ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE
213	ZFS_AC_KERNEL_XATTR
214	ZFS_AC_KERNEL_ACL
215	ZFS_AC_KERNEL_INODE_SETATTR
216	ZFS_AC_KERNEL_INODE_GETATTR
217	ZFS_AC_KERNEL_INODE_SET_FLAGS
218	ZFS_AC_KERNEL_INODE_SET_IVERSION
219	ZFS_AC_KERNEL_SHOW_OPTIONS
220	ZFS_AC_KERNEL_FILE_INODE
221	ZFS_AC_KERNEL_FILE_DENTRY
222	ZFS_AC_KERNEL_FSYNC
223	ZFS_AC_KERNEL_AIO_FSYNC
224	ZFS_AC_KERNEL_EVICT_INODE
225	ZFS_AC_KERNEL_DIRTY_INODE
226	ZFS_AC_KERNEL_SHRINKER
227	ZFS_AC_KERNEL_MKDIR
228	ZFS_AC_KERNEL_LOOKUP_FLAGS
229	ZFS_AC_KERNEL_CREATE
230	ZFS_AC_KERNEL_PERMISSION
231	ZFS_AC_KERNEL_GET_LINK
232	ZFS_AC_KERNEL_PUT_LINK
233	ZFS_AC_KERNEL_TMPFILE
234	ZFS_AC_KERNEL_AUTOMOUNT
235	ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE
236	ZFS_AC_KERNEL_COMMIT_METADATA
237	ZFS_AC_KERNEL_CLEAR_INODE
238	ZFS_AC_KERNEL_SETATTR_PREPARE
239	ZFS_AC_KERNEL_INSERT_INODE_LOCKED
240	ZFS_AC_KERNEL_DENTRY
241	ZFS_AC_KERNEL_DENTRY_ALIAS_D_U
242	ZFS_AC_KERNEL_TRUNCATE_SETSIZE
243	ZFS_AC_KERNEL_SECURITY_INODE
244	ZFS_AC_KERNEL_FST_MOUNT
245	ZFS_AC_KERNEL_BDI
246	ZFS_AC_KERNEL_SET_NLINK
247	ZFS_AC_KERNEL_SGET
248	ZFS_AC_KERNEL_LSEEK_EXECUTE
249	ZFS_AC_KERNEL_VFS_FILEMAP_DIRTY_FOLIO
250	ZFS_AC_KERNEL_VFS_READ_FOLIO
251	ZFS_AC_KERNEL_VFS_GETATTR
252	ZFS_AC_KERNEL_VFS_FSYNC_2ARGS
253	ZFS_AC_KERNEL_VFS_ITERATE
254	ZFS_AC_KERNEL_VFS_DIRECT_IO
255	ZFS_AC_KERNEL_VFS_READPAGES
256	ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS
257	ZFS_AC_KERNEL_VFS_RW_ITERATE
258	ZFS_AC_KERNEL_VFS_GENERIC_WRITE_CHECKS
259	ZFS_AC_KERNEL_VFS_IOV_ITER
260	ZFS_AC_KERNEL_VFS_COPY_FILE_RANGE
261	ZFS_AC_KERNEL_VFS_GENERIC_COPY_FILE_RANGE
262	ZFS_AC_KERNEL_VFS_REMAP_FILE_RANGE
263	ZFS_AC_KERNEL_VFS_CLONE_FILE_RANGE
264	ZFS_AC_KERNEL_VFS_DEDUPE_FILE_RANGE
265	ZFS_AC_KERNEL_VFS_FILE_OPERATIONS_EXTEND
266	ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS
267	ZFS_AC_KERNEL_FOLLOW_DOWN_ONE
268	ZFS_AC_KERNEL_MAKE_REQUEST_FN
269	ZFS_AC_KERNEL_GENERIC_IO_ACCT
270	ZFS_AC_KERNEL_FPU
271	ZFS_AC_KERNEL_FMODE_T
272	ZFS_AC_KERNEL_KUIDGID_T
273	ZFS_AC_KERNEL_KUID_HELPERS
274	ZFS_AC_KERNEL_RENAME
275	ZFS_AC_KERNEL_CURRENT_TIME
276	ZFS_AC_KERNEL_USERNS_CAPABILITIES
277	ZFS_AC_KERNEL_IN_COMPAT_SYSCALL
278	ZFS_AC_KERNEL_KTIME
279	ZFS_AC_KERNEL_TOTALRAM_PAGES_FUNC
280	ZFS_AC_KERNEL_TOTALHIGH_PAGES
281	ZFS_AC_KERNEL_KSTRTOUL
282	ZFS_AC_KERNEL_PERCPU
283	ZFS_AC_KERNEL_CPU_HOTPLUG
284	ZFS_AC_KERNEL_GENERIC_FILLATTR
285	ZFS_AC_KERNEL_MKNOD
286	ZFS_AC_KERNEL_SYMLINK
287	ZFS_AC_KERNEL_BIO_MAX_SEGS
288	ZFS_AC_KERNEL_SIGNAL_STOP
289	ZFS_AC_KERNEL_SIGINFO
290	ZFS_AC_KERNEL_SYSFS
291	ZFS_AC_KERNEL_SET_SPECIAL_STATE
292	ZFS_AC_KERNEL_STANDALONE_LINUX_STDARG
293	ZFS_AC_KERNEL_PAGEMAP_FOLIO_WAIT_BIT
294	ZFS_AC_KERNEL_ADD_DISK
295	ZFS_AC_KERNEL_KTHREAD
296	ZFS_AC_KERNEL_ZERO_PAGE
297	ZFS_AC_KERNEL___COPY_FROM_USER_INATOMIC
298	ZFS_AC_KERNEL_USER_NS_COMMON_INUM
299	ZFS_AC_KERNEL_IDMAP_MNT_API
300	ZFS_AC_KERNEL_IATTR_VFSID
301	ZFS_AC_KERNEL_FILEMAP
302	ZFS_AC_KERNEL_WRITEPAGE_T
303	ZFS_AC_KERNEL_RECLAIMED
304	ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE
305	ZFS_AC_KERNEL_COPY_SPLICE_READ
306	case "$host_cpu" in
307		powerpc*)
308			ZFS_AC_KERNEL_CPU_HAS_FEATURE
309			ZFS_AC_KERNEL_FLUSH_DCACHE_PAGE
310			;;
311	esac
312])
313
314dnl #
315dnl # Detect name used for Module.symvers file in kernel
316dnl #
317AC_DEFUN([ZFS_AC_MODULE_SYMVERS], [
318	modpost=$LINUX/scripts/Makefile.modpost
319	AC_MSG_CHECKING([kernel file name for module symbols])
320	AS_IF([test "x$enable_linux_builtin" != xyes -a -f "$modpost"], [
321		AS_IF([grep -q Modules.symvers $modpost], [
322			LINUX_SYMBOLS=Modules.symvers
323		], [
324			LINUX_SYMBOLS=Module.symvers
325		])
326
327		AS_IF([test ! -f "$LINUX_OBJ/$LINUX_SYMBOLS"], [
328			AC_MSG_ERROR([
329	*** Please make sure the kernel devel package for your distribution
330	*** is installed.  If you are building with a custom kernel, make sure
331	*** the kernel is configured, built, and the '--with-linux=PATH'
332	*** configure option refers to the location of the kernel source.
333			])
334		])
335	], [
336		LINUX_SYMBOLS=NONE
337	])
338	AC_MSG_RESULT($LINUX_SYMBOLS)
339	AC_SUBST(LINUX_SYMBOLS)
340])
341
342dnl #
343dnl # Detect the kernel to be built against
344dnl #
345dnl # Most modern Linux distributions have separate locations for bare
346dnl # source (source) and prebuilt (build) files. Additionally, there are
347dnl # `source` and `build` symlinks in `/lib/modules/$(KERNEL_VERSION)`
348dnl # pointing to them. The directory search order is now:
349dnl #
350dnl # - `configure` command line values if both `--with-linux` and
351dnl #   `--with-linux-obj` were defined
352dnl #
353dnl # - If only `--with-linux` was defined, `--with-linux-obj` is assumed
354dnl #   to have the same value as `--with-linux`
355dnl #
356dnl # - If neither `--with-linux` nor `--with-linux-obj` were defined
357dnl #   autodetection is used:
358dnl #
359dnl #   - `/lib/modules/$(uname -r)/{source,build}` respectively, if exist.
360dnl #
361dnl #   - If only `/lib/modules/$(uname -r)/build` exists, it is assumed
362dnl #     to be both source and build directory.
363dnl #
364dnl #   - The first directory in `/lib/modules` with the highest version
365dnl #     number according to `sort -V` which contains both `source` and
366dnl #     `build` symlinks/directories. If module directory contains only
367dnl #     `build` component, it is assumed to be both source and build
368dnl #     directory.
369dnl #
370dnl #   - Last resort: the first directory matching `/usr/src/kernels/*`
371dnl #     and `/usr/src/linux-*` with the highest version number according
372dnl #     to `sort -V` is assumed to be both source and build directory.
373dnl #
374AC_DEFUN([ZFS_AC_KERNEL], [
375	AC_ARG_WITH([linux],
376		AS_HELP_STRING([--with-linux=PATH],
377		[Path to kernel source]),
378		[kernelsrc="$withval"])
379
380	AC_ARG_WITH(linux-obj,
381		AS_HELP_STRING([--with-linux-obj=PATH],
382		[Path to kernel build objects]),
383		[kernelbuild="$withval"])
384
385	AC_MSG_CHECKING([kernel source and build directories])
386	AS_IF([test -n "$kernelsrc" && test -z "$kernelbuild"], [
387		kernelbuild="$kernelsrc"
388	], [test -z "$kernelsrc"], [
389		AS_IF([test -e "/lib/modules/$(uname -r)/source" && \
390		       test -e "/lib/modules/$(uname -r)/build"], [
391			src="/lib/modules/$(uname -r)/source"
392			build="/lib/modules/$(uname -r)/build"
393		], [test -e "/lib/modules/$(uname -r)/build"], [
394			build="/lib/modules/$(uname -r)/build"
395			src="$build"
396		], [
397			src=
398
399			for d in $(ls -1d /lib/modules/* 2>/dev/null | sort -Vr); do
400				if test -e "$d/source" && test -e "$d/build"; then
401					src="$d/source"
402					build="$d/build"
403					break
404				fi
405
406				if test -e "$d/build"; then
407					src="$d/build"
408					build="$d/build"
409					break
410				fi
411			done
412
413			# the least reliable method
414			if test -z "$src"; then
415				src=$(ls -1d /usr/src/kernels/* /usr/src/linux-* \
416				      2>/dev/null | grep -v obj | sort -Vr | head -1)
417				build="$src"
418			fi
419		])
420
421		AS_IF([test -n "$src" && test -e "$src"], [
422			kernelsrc=$(readlink -e "$src")
423		], [
424			kernelsrc="[Not found]"
425		])
426		AS_IF([test -n "$build" && test -e "$build"], [
427			kernelbuild=$(readlink -e "$build")
428		], [
429			kernelbuild="[Not found]"
430		])
431	], [
432		AS_IF([test "$kernelsrc" = "NONE"], [
433			kernsrcver=NONE
434		])
435		withlinux=yes
436	])
437
438	AC_MSG_RESULT([done])
439	AC_MSG_CHECKING([kernel source directory])
440	AC_MSG_RESULT([$kernelsrc])
441	AC_MSG_CHECKING([kernel build directory])
442	AC_MSG_RESULT([$kernelbuild])
443	AS_IF([test ! -d "$kernelsrc" || test ! -d "$kernelbuild"], [
444		AC_MSG_ERROR([
445	*** Please make sure the kernel devel package for your distribution
446	*** is installed and then try again.  If that fails, you can specify the
447	*** location of the kernel source and build with the '--with-linux=PATH' and
448	*** '--with-linux-obj=PATH' options respectively.])
449	])
450
451	AC_MSG_CHECKING([kernel source version])
452	utsrelease1=$kernelbuild/include/linux/version.h
453	utsrelease2=$kernelbuild/include/linux/utsrelease.h
454	utsrelease3=$kernelbuild/include/generated/utsrelease.h
455	AS_IF([test -r $utsrelease1 && grep -qF UTS_RELEASE $utsrelease1], [
456		utsrelease=$utsrelease1
457	], [test -r $utsrelease2 && grep -qF UTS_RELEASE $utsrelease2], [
458		utsrelease=$utsrelease2
459	], [test -r $utsrelease3 && grep -qF UTS_RELEASE $utsrelease3], [
460		utsrelease=$utsrelease3
461	])
462
463	AS_IF([test -n "$utsrelease"], [
464		kernsrcver=$($AWK '/UTS_RELEASE/ { gsub(/"/, "", $[3]); print $[3] }' $utsrelease)
465		AS_IF([test -z "$kernsrcver"], [
466			AC_MSG_RESULT([Not found])
467			AC_MSG_ERROR([
468	*** Cannot determine kernel version.
469			])
470		])
471	], [
472		AC_MSG_RESULT([Not found])
473		if test "x$enable_linux_builtin" != xyes; then
474			AC_MSG_ERROR([
475	*** Cannot find UTS_RELEASE definition.
476			])
477		else
478			AC_MSG_ERROR([
479	*** Cannot find UTS_RELEASE definition.
480	*** Please run 'make prepare' inside the kernel source tree.])
481		fi
482	])
483
484	AC_MSG_RESULT([$kernsrcver])
485
486	AS_VERSION_COMPARE([$kernsrcver], [$ZFS_META_KVER_MIN], [
487		 AC_MSG_ERROR([
488	*** Cannot build against kernel version $kernsrcver.
489	*** The minimum supported kernel version is $ZFS_META_KVER_MIN.
490		])
491	])
492
493	LINUX=${kernelsrc}
494	LINUX_OBJ=${kernelbuild}
495	LINUX_VERSION=${kernsrcver}
496
497	AC_SUBST(LINUX)
498	AC_SUBST(LINUX_OBJ)
499	AC_SUBST(LINUX_VERSION)
500])
501
502dnl #
503dnl # Detect the QAT module to be built against, QAT provides hardware
504dnl # acceleration for data compression:
505dnl #
506dnl # https://01.org/intel-quickassist-technology
507dnl #
508dnl # 1) Download and install QAT driver from the above link
509dnl # 2) Start QAT driver in your system:
510dnl # 	 service qat_service start
511dnl # 3) Enable QAT in ZFS, e.g.:
512dnl # 	 ./configure --with-qat=<qat-driver-path>/QAT1.6
513dnl # 	 make
514dnl # 4) Set GZIP compression in ZFS dataset:
515dnl # 	 zfs set compression = gzip <dataset>
516dnl #
517dnl # Then the data written to this ZFS pool is compressed by QAT accelerator
518dnl # automatically, and de-compressed by QAT when read from the pool.
519dnl #
520dnl # 1) Get QAT hardware statistics with:
521dnl #	 cat /proc/icp_dh895xcc_dev/qat
522dnl # 2) To disable QAT:
523dnl # 	 insmod zfs.ko zfs_qat_disable=1
524dnl #
525AC_DEFUN([ZFS_AC_QAT], [
526	AC_ARG_WITH([qat],
527		AS_HELP_STRING([--with-qat=PATH],
528		[Path to qat source]),
529		AS_IF([test "$withval" = "yes"],
530			AC_MSG_ERROR([--with-qat=PATH requires a PATH]),
531			[qatsrc="$withval"]))
532
533	AC_ARG_WITH([qat-obj],
534		AS_HELP_STRING([--with-qat-obj=PATH],
535		[Path to qat build objects]),
536		[qatbuild="$withval"])
537
538	AS_IF([test ! -z "${qatsrc}"], [
539		AC_MSG_CHECKING([qat source directory])
540		AC_MSG_RESULT([$qatsrc])
541		QAT_SRC="${qatsrc}/quickassist"
542		AS_IF([ test ! -e "$QAT_SRC/include/cpa.h"], [
543			AC_MSG_ERROR([
544	*** Please make sure the qat driver package is installed
545	*** and specify the location of the qat source with the
546	*** '--with-qat=PATH' option then try again. Failed to
547	*** find cpa.h in:
548	${QAT_SRC}/include])
549		])
550	])
551
552	AS_IF([test ! -z "${qatsrc}"], [
553		AC_MSG_CHECKING([qat build directory])
554		AS_IF([test -z "$qatbuild"], [
555			qatbuild="${qatsrc}/build"
556		])
557
558		AC_MSG_RESULT([$qatbuild])
559		QAT_OBJ=${qatbuild}
560		AS_IF([ ! test -e "$QAT_OBJ/icp_qa_al.ko" && ! test -e "$QAT_OBJ/qat_api.ko"], [
561			AC_MSG_ERROR([
562	*** Please make sure the qat driver is installed then try again.
563	*** Failed to find icp_qa_al.ko or qat_api.ko in:
564	$QAT_OBJ])
565		])
566
567		AC_SUBST(QAT_SRC)
568		AC_SUBST(QAT_OBJ)
569
570		AC_DEFINE(HAVE_QAT, 1,
571		[qat is enabled and existed])
572	])
573
574	dnl #
575	dnl # Detect the name used for the QAT Module.symvers file.
576	dnl #
577	AS_IF([test ! -z "${qatsrc}"], [
578		AC_MSG_CHECKING([qat file for module symbols])
579		QAT_SYMBOLS=$QAT_SRC/lookaside/access_layer/src/Module.symvers
580
581		AS_IF([test -r $QAT_SYMBOLS], [
582			AC_MSG_RESULT([$QAT_SYMBOLS])
583			AC_SUBST(QAT_SYMBOLS)
584		],[
585			AC_MSG_ERROR([
586	*** Please make sure the qat driver is installed then try again.
587	*** Failed to find Module.symvers in:
588	$QAT_SYMBOLS
589			])
590		])
591	])
592])
593
594dnl #
595dnl # ZFS_LINUX_CONFTEST_H
596dnl #
597AC_DEFUN([ZFS_LINUX_CONFTEST_H], [
598test -d build/$2 || mkdir -p build/$2
599cat - <<_ACEOF >build/$2/$2.h
600$1
601_ACEOF
602])
603
604dnl #
605dnl # ZFS_LINUX_CONFTEST_C
606dnl #
607AC_DEFUN([ZFS_LINUX_CONFTEST_C], [
608test -d build/$2 || mkdir -p build/$2
609cat confdefs.h - <<_ACEOF >build/$2/$2.c
610$1
611_ACEOF
612])
613
614dnl #
615dnl # ZFS_LINUX_CONFTEST_MAKEFILE
616dnl #
617dnl # $1 - test case name
618dnl # $2 - add to top-level Makefile
619dnl # $3 - additional build flags
620dnl #
621AC_DEFUN([ZFS_LINUX_CONFTEST_MAKEFILE], [
622	test -d build || mkdir -p build
623	test -d build/$1 || mkdir -p build/$1
624
625	file=build/$1/Makefile
626
627	dnl # Example command line to manually build source.
628	cat - <<_ACEOF >$file
629# Example command line to manually build source
630# make modules -C $LINUX_OBJ $ARCH_UM M=$PWD/build/$1
631
632ccflags-y := -Werror $FRAME_LARGER_THAN
633_ACEOF
634
635	dnl # Additional custom CFLAGS as requested.
636	m4_ifval($3, [echo "ccflags-y += $3" >>$file], [])
637
638	dnl # Test case source
639	echo "obj-m := $1.o" >>$file
640
641	AS_IF([test "x$2" = "xyes"], [echo "obj-m += $1/" >>build/Makefile], [])
642])
643
644dnl #
645dnl # ZFS_LINUX_TEST_PROGRAM(C)([PROLOGUE], [BODY])
646dnl #
647m4_define([ZFS_LINUX_TEST_PROGRAM], [
648#include <linux/module.h>
649$1
650
651int
652main (void)
653{
654$2
655	;
656	return 0;
657}
658
659MODULE_DESCRIPTION("conftest");
660MODULE_AUTHOR(ZFS_META_AUTHOR);
661MODULE_VERSION(ZFS_META_VERSION "-" ZFS_META_RELEASE);
662MODULE_LICENSE($3);
663])
664
665dnl #
666dnl # ZFS_LINUX_TEST_REMOVE
667dnl #
668dnl # Removes the specified test source and results.
669dnl #
670AC_DEFUN([ZFS_LINUX_TEST_REMOVE], [
671	test -d build/$1 && rm -Rf build/$1
672	test -f build/Makefile && sed '/$1/d' build/Makefile
673])
674
675dnl #
676dnl # ZFS_LINUX_COMPILE
677dnl #
678dnl # $1 - build dir
679dnl # $2 - test command
680dnl # $3 - pass command
681dnl # $4 - fail command
682dnl # $5 - set KBUILD_MODPOST_NOFINAL='yes'
683dnl # $6 - set KBUILD_MODPOST_WARN='yes'
684dnl #
685dnl # Used internally by ZFS_LINUX_TEST_{COMPILE,MODPOST}
686dnl #
687AC_DEFUN([ZFS_LINUX_COMPILE], [
688	AC_ARG_VAR([KERNEL_CC], [C compiler for
689		building kernel modules])
690	AC_ARG_VAR([KERNEL_LD], [Linker for
691		building kernel modules])
692	AC_ARG_VAR([KERNEL_LLVM], [Binary option to
693		build kernel modules with LLVM/CLANG toolchain])
694	AC_TRY_COMMAND([
695	    KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6"
696	    make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC}
697	    ${KERNEL_LD:+LD=$KERNEL_LD} ${KERNEL_LLVM:+LLVM=$KERNEL_LLVM}
698	    CONFIG_MODULES=y CFLAGS_MODULE=-DCONFIG_MODULES
699	    -C $LINUX_OBJ $ARCH_UM M=$PWD/$1 >$1/build.log 2>&1])
700	AS_IF([AC_TRY_COMMAND([$2])], [$3], [$4])
701])
702
703dnl #
704dnl # ZFS_LINUX_TEST_COMPILE
705dnl #
706dnl # Perform a full compile excluding the final modpost phase.
707dnl #
708AC_DEFUN([ZFS_LINUX_TEST_COMPILE], [
709	ZFS_LINUX_COMPILE([$2], [test -f $2/build.log], [
710		mv $2/Makefile $2/Makefile.compile.$1
711		mv $2/build.log $2/build.log.$1
712	],[
713	        AC_MSG_ERROR([
714        *** Unable to compile test source to determine kernel interfaces.])
715	], [yes], [])
716])
717
718dnl #
719dnl # ZFS_LINUX_TEST_MODPOST
720dnl #
721dnl # Perform a full compile including the modpost phase.  This may
722dnl # be an incremental build if the objects have already been built.
723dnl #
724AC_DEFUN([ZFS_LINUX_TEST_MODPOST], [
725	ZFS_LINUX_COMPILE([$2], [test -f $2/build.log], [
726		mv $2/Makefile $2/Makefile.modpost.$1
727		cat $2/build.log >>build/build.log.$1
728	],[
729	        AC_MSG_ERROR([
730        *** Unable to modpost test source to determine kernel interfaces.])
731	], [], [yes])
732])
733
734dnl #
735dnl # Perform the compilation of the test cases in two phases.
736dnl #
737dnl # Phase 1) attempt to build the object files for all of the tests
738dnl #          defined by the ZFS_LINUX_TEST_SRC macro.  But do not
739dnl #          perform the final modpost stage.
740dnl #
741dnl # Phase 2) disable all tests which failed the initial compilation,
742dnl #          then invoke the final modpost step for the remaining tests.
743dnl #
744dnl # This allows us efficiently build the test cases in parallel while
745dnl # remaining resilient to build failures which are expected when
746dnl # detecting the available kernel interfaces.
747dnl #
748dnl # The maximum allowed parallelism can be controlled by setting the
749dnl # TEST_JOBS environment variable.  Otherwise, it default to $(nproc).
750dnl #
751AC_DEFUN([ZFS_LINUX_TEST_COMPILE_ALL], [
752	dnl # Phase 1 - Compilation only, final linking is skipped.
753	ZFS_LINUX_TEST_COMPILE([$1], [build])
754
755	dnl #
756	dnl # Phase 2 - When building external modules disable test cases
757	dnl # which failed to compile and invoke modpost to verify the
758	dnl # final linking.
759	dnl #
760	dnl # Test names suffixed with '_license' call modpost independently
761	dnl # to ensure that a single incompatibility does not result in the
762	dnl # modpost phase exiting early.  This check is not performed on
763	dnl # every symbol since the majority are compatible and doing so
764	dnl # would significantly slow down this phase.
765	dnl #
766	dnl # When configuring for builtin (--enable-linux-builtin)
767	dnl # fake the linking step artificially create the expected .ko
768	dnl # files for tests which did compile.  This is required for
769	dnl # kernels which do not have loadable module support or have
770	dnl # not yet been built.
771	dnl #
772	AS_IF([test "x$enable_linux_builtin" = "xno"], [
773		for dir in $(awk '/^obj-m/ { print [$]3 }' \
774		    build/Makefile.compile.$1); do
775			name=${dir%/}
776			AS_IF([test -f build/$name/$name.o], [
777				AS_IF([test "${name##*_}" = "license"], [
778					ZFS_LINUX_TEST_MODPOST([$1],
779					    [build/$name])
780					echo "obj-n += $dir" >>build/Makefile
781				], [
782					echo "obj-m += $dir" >>build/Makefile
783				])
784			], [
785				echo "obj-n += $dir" >>build/Makefile
786			])
787		done
788
789		ZFS_LINUX_TEST_MODPOST([$1], [build])
790	], [
791		for dir in $(awk '/^obj-m/ { print [$]3 }' \
792		    build/Makefile.compile.$1); do
793			name=${dir%/}
794			AS_IF([test -f build/$name/$name.o], [
795				touch build/$name/$name.ko
796			])
797		done
798	])
799])
800
801dnl #
802dnl # ZFS_LINUX_TEST_SRC
803dnl #
804dnl # $1 - name
805dnl # $2 - global
806dnl # $3 - source
807dnl # $4 - extra cflags
808dnl # $5 - check license-compatibility
809dnl #
810dnl # Check if the test source is buildable at all and then if it is
811dnl # license compatible.
812dnl #
813dnl # N.B because all of the test cases are compiled in parallel they
814dnl # must never depend on the results of previous tests.  Each test
815dnl # needs to be entirely independent.
816dnl #
817AC_DEFUN([ZFS_LINUX_TEST_SRC], [
818	ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM([[$2]], [[$3]],
819	    [["Dual BSD/GPL"]])], [$1])
820	ZFS_LINUX_CONFTEST_MAKEFILE([$1], [yes], [$4])
821
822	AS_IF([ test -n "$5" ], [
823		ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM(
824		    [[$2]], [[$3]], [[$5]])], [$1_license])
825		ZFS_LINUX_CONFTEST_MAKEFILE([$1_license], [yes], [$4])
826	])
827])
828
829dnl #
830dnl # ZFS_LINUX_TEST_RESULT
831dnl #
832dnl # $1 - name of a test source (ZFS_LINUX_TEST_SRC)
833dnl # $2 - run on success (valid .ko generated)
834dnl # $3 - run on failure (unable to compile)
835dnl #
836AC_DEFUN([ZFS_LINUX_TEST_RESULT], [
837	AS_IF([test -d build/$1], [
838		AS_IF([test -f build/$1/$1.ko], [$2], [$3])
839	], [
840		AC_MSG_ERROR([
841	*** No matching source for the "$1" test, check that
842	*** both the test source and result macros refer to the same name.
843		])
844	])
845])
846
847dnl #
848dnl # ZFS_LINUX_TEST_ERROR
849dnl #
850dnl # Generic error message which can be used when none of the expected
851dnl # kernel interfaces were detected.
852dnl #
853AC_DEFUN([ZFS_LINUX_TEST_ERROR], [
854	AC_MSG_ERROR([
855	*** None of the expected "$1" interfaces were detected.
856	*** This may be because your kernel version is newer than what is
857	*** supported, or you are using a patched custom kernel with
858	*** incompatible modifications.
859	***
860	*** ZFS Version: $ZFS_META_ALIAS
861	*** Compatible Kernels: $ZFS_META_KVER_MIN - $ZFS_META_KVER_MAX
862	])
863])
864
865dnl #
866dnl # ZFS_LINUX_TEST_RESULT_SYMBOL
867dnl #
868dnl # Like ZFS_LINUX_TEST_RESULT except ZFS_CHECK_SYMBOL_EXPORT is called to
869dnl # verify symbol exports, unless --enable-linux-builtin was provided to
870dnl # configure.
871dnl #
872AC_DEFUN([ZFS_LINUX_TEST_RESULT_SYMBOL], [
873	AS_IF([ ! test -f build/$1/$1.ko], [
874		$5
875	], [
876		AS_IF([test "x$enable_linux_builtin" != "xyes"], [
877			ZFS_CHECK_SYMBOL_EXPORT([$2], [$3], [$4], [$5])
878		], [
879			$4
880		])
881	])
882])
883
884dnl #
885dnl # ZFS_LINUX_COMPILE_IFELSE
886dnl #
887AC_DEFUN([ZFS_LINUX_COMPILE_IFELSE], [
888	ZFS_LINUX_TEST_REMOVE([conftest])
889
890	m4_ifvaln([$1], [ZFS_LINUX_CONFTEST_C([$1], [conftest])])
891	m4_ifvaln([$5], [ZFS_LINUX_CONFTEST_H([$5], [conftest])],
892	    [ZFS_LINUX_CONFTEST_H([], [conftest])])
893
894	ZFS_LINUX_CONFTEST_MAKEFILE([conftest], [no],
895	    [m4_ifvaln([$5], [-I$PWD/build/conftest], [])])
896	ZFS_LINUX_COMPILE([build/conftest], [$2], [$3], [$4], [], [])
897])
898
899dnl #
900dnl # ZFS_LINUX_TRY_COMPILE
901dnl #
902dnl # $1 - global
903dnl # $2 - source
904dnl # $3 - run on success (valid .ko generated)
905dnl # $4 - run on failure (unable to compile)
906dnl #
907dnl # When configuring as builtin (--enable-linux-builtin) for kernels
908dnl # without loadable module support (CONFIG_MODULES=n) only the object
909dnl # file is created.  See ZFS_LINUX_TEST_COMPILE_ALL for details.
910dnl #
911AC_DEFUN([ZFS_LINUX_TRY_COMPILE], [
912	AS_IF([test "x$enable_linux_builtin" = "xyes"], [
913		ZFS_LINUX_COMPILE_IFELSE(
914		    [ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
915		    [[ZFS_META_LICENSE]])],
916		    [test -f build/conftest/conftest.o], [$3], [$4])
917	], [
918		ZFS_LINUX_COMPILE_IFELSE(
919		    [ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
920		    [[ZFS_META_LICENSE]])],
921		    [test -f build/conftest/conftest.ko], [$3], [$4])
922	])
923])
924
925dnl #
926dnl # ZFS_CHECK_SYMBOL_EXPORT
927dnl #
928dnl # Check if a symbol is exported on not by consulting the symbols
929dnl # file, or optionally the source code.
930dnl #
931AC_DEFUN([ZFS_CHECK_SYMBOL_EXPORT], [
932	grep -q -E '[[[:space:]]]$1[[[:space:]]]' \
933		$LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
934	rc=$?
935	if test $rc -ne 0; then
936		export=0
937		for file in $2; do
938			grep -q -E "EXPORT_SYMBOL.*($1)" \
939				"$LINUX/$file" 2>/dev/null
940			rc=$?
941			if test $rc -eq 0; then
942				export=1
943				break;
944			fi
945		done
946		if test $export -eq 0; then :
947			$4
948		else :
949			$3
950		fi
951	else :
952		$3
953	fi
954])
955
956dnl #
957dnl # ZFS_LINUX_TRY_COMPILE_SYMBOL
958dnl #
959dnl # Like ZFS_LINUX_TRY_COMPILER except ZFS_CHECK_SYMBOL_EXPORT is called
960dnl # to verify symbol exports, unless --enable-linux-builtin was provided
961dnl # to configure.
962dnl #
963AC_DEFUN([ZFS_LINUX_TRY_COMPILE_SYMBOL], [
964	ZFS_LINUX_TRY_COMPILE([$1], [$2], [rc=0], [rc=1])
965	if test $rc -ne 0; then :
966		$6
967	else
968		if test "x$enable_linux_builtin" != xyes; then
969			ZFS_CHECK_SYMBOL_EXPORT([$3], [$4], [rc=0], [rc=1])
970		fi
971		if test $rc -ne 0; then :
972			$6
973		else :
974			$5
975		fi
976	fi
977])
978
979dnl #
980dnl # ZFS_LINUX_TRY_COMPILE_HEADER
981dnl # like ZFS_LINUX_TRY_COMPILE, except the contents conftest.h are
982dnl # provided via the fifth parameter
983dnl #
984AC_DEFUN([ZFS_LINUX_TRY_COMPILE_HEADER], [
985	AS_IF([test "x$enable_linux_builtin" = "xyes"], [
986		ZFS_LINUX_COMPILE_IFELSE(
987		    [ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
988		    [[ZFS_META_LICENSE]])],
989		    [test -f build/conftest/conftest.o], [$3], [$4], [$5])
990	], [
991		ZFS_LINUX_COMPILE_IFELSE(
992		    [ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
993		    [[ZFS_META_LICENSE]])],
994		    [test -f build/conftest/conftest.ko], [$3], [$4], [$5])
995	])
996])
997
998dnl #
999dnl # AS_VERSION_COMPARE_LE
1000dnl # like AS_VERSION_COMPARE_LE, but runs $3 if (and only if) $1 <= $2
1001dnl # AS_VERSION_COMPARE_LE (version-1, version-2, [action-if-less-or-equal], [action-if-greater])
1002dnl #
1003AC_DEFUN([AS_VERSION_COMPARE_LE], [
1004	AS_VERSION_COMPARE([$1], [$2], [$3], [$3], [$4])
1005])
1006
1007dnl #
1008dnl # ZFS_LINUX_REQUIRE_API
1009dnl # like ZFS_LINUX_TEST_ERROR, except only fails if the kernel is
1010dnl # at least some specified version.
1011dnl #
1012AC_DEFUN([ZFS_LINUX_REQUIRE_API], [
1013	AS_VERSION_COMPARE_LE([$2], [$kernsrcver], [
1014		AC_MSG_ERROR([
1015		*** None of the expected "$1" interfaces were detected. This
1016		*** interface is expected for kernels version "$2" and above.
1017		*** This may be because your kernel version is newer than what is
1018		*** supported, or you are using a patched custom kernel with
1019		*** incompatible modifications.  Newer kernels may have incompatible
1020		*** APIs.
1021		***
1022		*** ZFS Version: $ZFS_META_ALIAS
1023		*** Compatible Kernels: $ZFS_META_KVER_MIN - $ZFS_META_KVER_MAX
1024		])
1025	], [
1026		AC_MSG_RESULT(no)
1027	])
1028])
1029