2 dnl # Supported configure options. When no options are specified support
3 dnl # for ZFS OSDs will be autodetected assuming server support is enabled.
4 dnl # If the ZFS OSD cannot be built support for it is disabled and a
5 dnl # warning is issued but the configure process is allowed to continue.
7 dnl # --without-zfs - Disable zfs support.
10 dnl # --with-zfs - Enable zfs support and attempt to autodetect the zfs
11 dnl # --with-zfs=yes headers in one of the following places. Because zfs
12 dnl # support was explicitly required if the headers cannot
13 dnl # be located it is treated as a fatal error.
15 dnl # * /var/lib/dkms/zfs/${VERSION}/source
16 dnl # * /usr/src/zfs-${VERSION}/${LINUXRELEASE}
17 dnl # * /usr/src/zfs-${VERSION}
21 dnl # --with-zfs-devel=path
22 dnl # - User provided directory where zfs development headers
23 dnl # are located. This option is typically used when user
24 dnl # uses rpm2cpio to unpack src rpm.
25 dnl # Assumes layout of:
26 dnl # ${zfs-devel-path}/usr/include/libzfs
27 dnl # ${zfs-devel-path}/usr/include/libspl
28 dnl # ${zfs-devel-path}/lib64/libzfs.so.* or
29 dnl # ${zfs-devel-path}/lib/libzfs.so.*
31 dnl # --with-zfs=path - Enable zfs support and use the zfs headers in the
32 dnl # provided path. No autodetection is performed and
33 dnl # if no headers are found this is a fatal error.
35 dnl # --with-zfs-obj - When zfs support is enabled the object directory
36 dnl # will be based on the --with-zfs directory. If this
37 dnl # is detected incorrectly it can be explicitly
38 dnl # specified using this option.
40 dnl # --without-spl - Disable spl support.
43 dnl # --with-spl - Enable spl support and attempt to autodetect the spl
44 dnl # --with-spl=yes headers in one of the following places in this order:
45 dnl # * /var/lib/dkms/spl/${VERSION}/source
46 dnl # * /usr/src/spl-${VERSION}/${LINUXRELEASE}
47 dnl # * /usr/src/spl-${VERSION}
51 dnl # --with-spl=path - Enable spl support and use the spl headers in the
52 dnl # provided path. No autodetection is performed.
54 dnl # --with-spl-obj - When spl support is enabled the object directory
55 dnl # will be based on the --with-spl directory. If this
56 dnl # is detected incorrectly it can be explicitly
57 dnl # specified using this option.
61 AS_HELP_STRING([--with-spl=PATH],
62 [Path to spl source]),
65 AC_ARG_WITH([spl-obj],
66 AS_HELP_STRING([--with-spl-obj=PATH],
67 [Path to spl build objects]),
71 dnl # The existence of spl.release[.in] is used to identify a valid
72 dnl # source directory. In order of preference:
74 splver=$(ls -1 /usr/src/ | grep ^spl- | cut -f2 -d'-' |
76 spldkms="/var/lib/dkms/spl/${splver}"
77 splsrc1="/usr/src/spl-${splver}/${LINUXRELEASE}"
78 splsrc2="/usr/src/spl-${splver}"
82 AC_MSG_CHECKING([spl source directory])
83 AS_IF([test -z "${splsrc}"], [
84 AS_IF([test -e "${spldkms}/source/spl.release.in"], [
85 splsrc=${spldkms}/source
86 ], [test -e "${splsrc1}/spl.release.in"], [
88 ], [test -e "${splsrc2}/spl.release.in"], [
90 ], [test -e "${splsrc3}/spl.release.in"], [
91 splsrc=$(readlink -f "${splsrc3}")
92 ], [test -e "${splsrc4}/spl.release.in"], [
98 AC_MSG_RESULT([$splsrc])
100 AS_IF([test ! -e "$splsrc/spl.release" &&
101 test ! -e "$splsrc/spl.release.in"], [
106 dnl # The existence of the spl_config.h is used to identify a valid
107 dnl # spl object directory. In many cases the object and source
108 dnl # directory are the same, however the objects may also reside
109 dnl # is a subdirectory named after the kernel version. When
110 dnl # weak modules are used, the kernel version may not be the
111 dnl # same as the LINUXRELEASE against which we are building lustre.
113 AC_MSG_CHECKING([spl build directory])
114 AS_IF([test -z "$splobj"], [
115 last_spl_obj_dir=$(ls -d ${splsrc}/[[0-9]]*/ 2> /dev/null | tail -n 1 | sed 's|/$||')
116 AS_IF([test "${splsrc}" = "${spldkms}/source"], [
117 AS_IF([test -e "${spldkms}/${LINUXRELEASE}/${target_cpu}/spl_config.h"], [
118 splobj=${spldkms}/${LINUXRELEASE}/${target_cpu}
122 ],[test -e "${splsrc}/${LINUXRELEASE}/spl_config.h"], [
123 splobj="${splsrc}/${LINUXRELEASE}"
124 ], [test -e "${splsrc}/spl_config.h"], [
126 ], [test -e "${last_spl_obj_dir}/spl_config.h"], [
127 splobj="${last_spl_obj_dir}"
132 AC_MSG_RESULT([$splobj])
134 AS_IF([test ! -e "$splobj/spl_config.h"], [
139 dnl # Verify the source version using SPL_META_VERSION in spl_config.h
141 AS_IF([test x$enable_zfs = xyes], [
142 AC_MSG_CHECKING([spl source version])
143 AS_IF([fgrep -q SPL_META_VERSION $splobj/spl_config.h], [
144 splver=$((echo "#include <spl_config.h>";
145 echo "splver=SPL_META_VERSION-SPL_META_RELEASE") |
147 grep "^splver=" | tr -d \" | cut -d= -f2)
152 AC_MSG_RESULT([$splver])
156 dnl # Verify the modules systems exist by the expect name.
158 AS_IF([test x$enable_zfs = xyes], [
159 AC_MSG_CHECKING([spl file name for module symbols])
160 AS_IF([test -r $splobj/$SYMVERFILE], [
162 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $splobj/$SYMVERFILE"
163 ], [test -r $splobj/module/$SYMVERFILE], [
165 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $splobj/module/$SYMVERFILE"
170 AC_MSG_RESULT([$splsym])
173 AS_IF([test x$enable_zfs = xyes], [
176 SPL_VERSION=${splver}
180 AC_SUBST(SPL_VERSION)
181 AC_SUBST(EXTRA_SYMBOLS)
187 AC_ARG_WITH([zfs-obj],
188 AS_HELP_STRING([--with-zfs-obj=PATH],
189 [Path to zfs build objects]),
193 dnl # The existence of zfs.release[.in] is used to identify a valid
194 dnl # source directory. In order of preference:
196 zfsver=$(ls -1 /usr/src/ | grep ^zfs- | cut -f2 -d'-' |
198 zfsdkms="/var/lib/dkms/zfs/${zfsver}"
199 zfssrc1="/usr/src/zfs-${zfsver}/${LINUXRELEASE}"
200 zfssrc2="/usr/src/zfs-${zfsver}"
204 AC_MSG_CHECKING([zfs source directory])
205 AS_IF([test -z "${zfssrc}"], [
206 AS_IF([test -e "${zfsdkms}/source/zfs.release.in"], [
207 zfssrc=${zfsdkms}/source
208 ], [test -e "${zfssrc1}/zfs.release.in"], [
210 ], [test -e "${zfssrc2}/zfs.release.in"], [
212 ], [test -e "${zfssrc3}/zfs.release.in"], [
213 zfssrc=$(readlink -f "${zfssrc3}")
214 ], [test -e "${zfssrc4}/zfs.release.in"], [
220 AC_MSG_RESULT([$zfssrc])
222 AS_IF([test ! -e "$zfssrc/zfs.release.in" &&
223 test ! -e "$zfssrc/zfs.release"], [
228 dnl # The existence of the zfs_config.h is used to identify a valid
229 dnl # zfs object directory. In many cases the object and source
230 dnl # directory are the same, however the objects may also reside
231 dnl # is a subdirectory named after the kernel version. When
232 dnl # weak modules are used, the kernel version may not be the
233 dnl # same as the LINUXRELEASE against which we are building lustre.
235 AC_MSG_CHECKING([zfs build directory])
236 AS_IF([test -z "$zfsobj"], [
237 last_zfs_obj_dir=$(ls -d ${zfssrc}/[[0-9]]*/ 2> /dev/null | tail -n 1 | sed 's|/$||')
238 AS_IF([test "${zfssrc}" = "${zfsdkms}/source"], [
239 AS_IF([test -e "${zfsdkms}/${LINUXRELEASE}/${target_cpu}/zfs_config.h"], [
240 zfsobj=${zfsdkms}/${LINUXRELEASE}/${target_cpu}
244 ], [test -e "${zfssrc}/${LINUXRELEASE}/zfs_config.h"], [
245 zfsobj="${zfssrc}/${LINUXRELEASE}"
246 ], [test -e "${zfssrc}/zfs_config.h"], [
248 ], [test -e "${last_zfs_obj_dir}/zfs_config.h"], [
249 zfsobj="${last_zfs_obj_dir}"
255 AC_MSG_RESULT([$zfsobj])
256 AS_IF([test ! -e "$zfsobj/zfs_config.h"], [
261 dnl # Verify the source version using SPL_META_VERSION in spl_config.h
263 AS_IF([test x$enable_zfs = xyes], [
264 AC_MSG_CHECKING([zfs source version])
265 AS_IF([fgrep -q ZFS_META_VERSION $zfsobj/zfs_config.h], [
266 zfsver=$((echo "#include <zfs_config.h>";
267 echo "zfsver=ZFS_META_VERSION-ZFS_META_RELEASE") |
269 grep "^zfsver=" | tr -d \" | cut -d= -f2)
274 AC_MSG_RESULT([$zfsver])
278 dnl # Verify the modules systems exist by the expect name.
280 AS_IF([test x$enable_zfs = xyes], [
281 AC_MSG_CHECKING([zfs file name for module symbols])
282 AS_IF([test -r $zfsobj/$SYMVERFILE], [
284 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $zfsobj/$SYMVERFILE"
285 ], [test -r $zfsobj/module/$SYMVERFILE], [
287 EXTRA_SYMBOLS="$EXTRA_SYMBOLS $zfsobj/module/$SYMVERFILE"
292 AC_MSG_RESULT([$zfssym])
295 AS_IF([test x$enable_zfs = xyes], [
298 ZFS_VERSION=${zfsver}
302 AC_SUBST(ZFS_VERSION)
303 AC_SUBST(EXTRA_SYMBOLS)
308 AC_DEFUN([LB_ZFS_DEVEL], [
309 AC_ARG_WITH([zfs-devel],
310 [AS_HELP_STRING([--with-zfs-devel=PATH],
311 [Path to zfs development headers])],
312 [zfsdevel="$withval"])
314 AC_MSG_CHECKING([user provided zfs devel headers])
315 AS_IF([test ! -z "${zfsdevel}"], [
316 AS_IF([test -d "${zfsdevel}/usr/include/libspl" && test -d "${zfsdevel}/usr/include/libzfs"], [
317 zfsinc="-I $zfsdevel/usr/include/libspl -I $zfsdevel/usr/include/libzfs"
318 zfslib="-L$zfsdevel/usr/lib64 -L$zfsdevel/usr/lib -L$zfsdevel/lib64 -L$zfsdevel/lib"
320 AC_MSG_ERROR([Path to development headers directory does not exist])
323 AC_MSG_RESULT([$zfsinc])
326 AC_DEFUN([LB_ZFS_USER], [
328 dnl # Detect user space zfs development headers.
330 AC_MSG_CHECKING([zfs devel headers])
331 AS_IF([test -z "${zfsinc}"], [
332 AS_IF([test -e "${zfssrc}/include/libzfs.h" && test -e "${zfssrc}/lib/libspl/include"], [
333 zfsinc="-I $zfssrc/lib/libspl/include -I $zfssrc/lib/libspl/include/os/linux -I $zfssrc/include"
334 zfslib="-L$zfssrc/.libs/ -L$zfssrc/lib/libzfs/.libs/ -L$zfssrc/lib/libnvpair/.libs/ -L$zfssrc/lib/libzpool/.libs/"
335 ], [test -d /usr/include/libzfs && test -d /usr/include/libspl], [
336 zfsinc="-I/usr/include/libspl -I /usr/include/libzfs"
344 AC_MSG_RESULT([$zfsinc])
346 ZFS_LIBZFS_INCLUDE=${zfsinc}
347 ZFS_LIBZFS_LDFLAGS=${zfslib}
348 ZFS_LIBZFS_LIBS="-lzfs -lnvpair -lzpool"
349 AC_SUBST(ZFS_LIBZFS_INCLUDE)
350 AC_SUBST(ZFS_LIBZFS_LDFLAGS)
351 AC_SUBST(ZFS_LIBZFS_LIBS)
354 AC_DEFUN([LB_CONFIG_ZFS], [
356 [AS_HELP_STRING([--with-zfs=PATH], [Path to zfs source])],
358 AS_IF([test x$withval = xno], [
362 ], [test x$withval = xyes], [
373 AS_IF([test x$enable_server != xno], [
384 AC_MSG_CHECKING([whether to enable zfs])
385 AC_MSG_RESULT([$enable_zfs])
387 AS_IF([test x$enable_zfs = xyes], [
388 AS_IF([test x$enable_modules = xyes], [
395 dnl # Define zfs source code version
397 ZFS_MAJOR=$(echo $zfsver | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\1/'])
398 ZFS_MINOR=$(echo $zfsver | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\2/'])
399 ZFS_PATCH=$(echo $zfsver | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\3/'])
400 ZFS_FIX=$(echo $zfsver | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\5/'])
401 AS_IF([test -z "$ZFS_FIX"], [ZFS_FIX="0"])
403 AC_DEFINE_UNQUOTED([ZFS_MAJOR], [$ZFS_MAJOR], [zfs major version])
404 AC_DEFINE_UNQUOTED([ZFS_MINOR], [$ZFS_MINOR], [zfs minor version])
405 AC_DEFINE_UNQUOTED([ZFS_PATCH], [$ZFS_PATCH], [zfs patch version])
406 AC_DEFINE_UNQUOTED([ZFS_FIX], [$ZFS_FIX], [zfs fix version])
409 dnl # SPL is only needed if ZFS is prior to 0.8.0
411 AS_IF([test x$enable_modules = xyes && test -n "$ZFS_MAJOR" &&
412 test $ZFS_MAJOR -eq 0 && test $ZFS_MINOR -lt 8], [
419 dnl # enable_zfs will be set to no in LB_SPL or LB_ZFS if
420 dnl # one of more of the build requirements is not met.
422 AS_IF([test x$enable_zfs = xyes], [
423 AC_DEFINE(HAVE_ZFS_OSD, 1, Enable zfs osd)
425 AS_IF([test x$require_zfs = xyes], [
428 Required zfs osd cannot be built due to missing zfs development headers.
430 Support for zfs can be enabled by downloading the required packages for your
431 distribution. See http://zfsonlinux.org/ to determine is zfs is supported by
437 Disabling optional zfs osd due to missing development headers.
439 Support for zfs can be enabled by downloading the required packages for your
440 distribution. See http://zfsonlinux.org/ to determine is zfs is supported by
448 AS_IF([test "x$enable_zfs" = xyes], [
449 LB_CHECK_COMPILE([if zfs defines dsl_pool_config_enter/exit],
450 dsl_pool_config_enter, [
451 #include <sys/dsl_pool.h>
453 dsl_pool_config_enter(NULL, FTAG);
455 AC_DEFINE(HAVE_DSL_POOL_CONFIG, 1,
456 [Have dsl_pool_config_enter/exit in ZFS])
458 LB_CHECK_COMPILE([if zfs defines dsl_sync_task_do_nowait],
459 dsl_sync_task_do_nowait, [
460 #include <sys/dsl_synctask.h>
462 dsl_sync_task_do_nowait(NULL, NULL, NULL, NULL, NULL, 0, NULL);
464 AC_DEFINE(HAVE_DSL_SYNC_TASK_DO_NOWAIT, 1,
465 [Have dsl_sync_task_do_nowait in ZFS])
467 LB_CHECK_COMPILE([if zfs defines sa_spill_alloc],
469 #include <sys/kmem.h>
474 ptr = sa_spill_alloc(KM_SLEEP);
477 AC_DEFINE(HAVE_SA_SPILL_ALLOC, 1,
478 [Have sa_spill_alloc in ZFS])
480 LB_CHECK_COMPILE([if zfs defines spa_maxblocksize],
487 size = spa_maxblocksize(spa);
489 AC_DEFINE(HAVE_SPA_MAXBLOCKSIZE, 1,
490 [Have spa_maxblocksize in ZFS])
494 dnl # ZFS 0.7.x adds support for large dnodes. This
495 dnl # allows Lustre to optionally specify the size of a
496 dnl # dnode which ZFS will then use to store metadata such
497 dnl # as xattrs. The default dnode size specified by the
498 dnl # 'dnodesize' dataset property will be used unless a
499 dnl # specific value is provided.
501 LB_CHECK_COMPILE([if zfs defines dmu_object_alloc_dnsize],
502 dmu_object_alloc_dnsize, [
504 #include <sys/dnode.h>
507 dmu_object_type_t objtype = DMU_OT_NONE;
509 dmu_object_type_t bonustype = DMU_OT_SA;
510 int dnodesize = DNODE_MIN_SIZE;
514 id = dmu_object_alloc_dnsize(os, objtype, blocksize,
516 DN_BONUS_SIZE(dnodesize),
519 AC_DEFINE(HAVE_DMU_OBJECT_ALLOC_DNSIZE, 1,
520 [Have dmu_object_alloc_dnsize in ZFS])
524 dnl # ZFS 0.7.x extended dmu_prefetch() to take an additional
525 dnl # 'level' and 'priority' argument. Use a level of 0 and a
526 dnl # priority of ZIO_PRIORITY_SYNC_READ to replicate the
527 dnl # behavior of the four argument version.
529 LB_CHECK_COMPILE([if ZFS has 'dmu_prefetch' with 6 args],
538 enum zio_priority pri = ZIO_PRIORITY_SYNC_READ;
540 dmu_prefetch(os, object, level, offset, len, pri);
542 AC_DEFINE(HAVE_DMU_PREFETCH_6ARG, 1,
543 [Have 6 argument dmu_pretch in ZFS])
546 dnl # ZFS 0.7.0 feature: SPA_FEATURE_USEROBJ_ACCOUNTING
548 LB_CHECK_COMPILE([if ZFS has native dnode accounting supported],
549 dmu_objset_userobjused_enabled, [
550 #include <sys/dmu_objset.h>
552 dmu_objset_userobjused_enabled(NULL);
554 AC_DEFINE(HAVE_DMU_USEROBJ_ACCOUNTING, 1,
555 [Have native dnode accounting in ZFS])
558 dnl # ZFS 0.7.0 feature: MULTIHOST
560 restore_CFLAGS=$CFLAGS
561 CFLAGS="$CFLAGS $ZFS_LIBZFS_INCLUDE -Werror"
562 AC_MSG_CHECKING([[if ZFS has multihost protection]])
566 #define _LARGEFILE64_SOURCE 1
567 #include <sys/sysmacros.h>
573 AC_DEFINE(HAVE_ZFS_MULTIHOST, 1,
574 [Have multihost protection in ZFS])
575 spa_multihost_fn="yes"],[spa_multihost_fn="no"]),
576 AC_MSG_RESULT([$spa_multihost_fn])
577 CFLAGS=$restore_CFLAGS
579 dnl # ZFS 0.7.x adds new method zap_lookup_by_dnode
581 LB_CHECK_COMPILE([if ZFS has 'zap_lookup_by_dnode'],
582 zap_lookup_by_dnode, [
584 #include <sys/dnode.h>
587 zap_lookup_by_dnode(dn, NULL, 1, 1, NULL);
589 AC_DEFINE(HAVE_ZAP_LOOKUP_BY_DNODE, 1,
590 [Have zap_lookup_by_dnode() in ZFS])
593 dnl # ZFS 0.7.x adds new method zap_add_by_dnode
595 LB_CHECK_COMPILE([if ZFS has 'zap_add_by_dnode'],
598 #include <sys/dnode.h>
601 zap_add_by_dnode(dn, NULL, 1, 1, NULL, NULL);
603 AC_DEFINE(HAVE_ZAP_ADD_BY_DNODE, 1,
604 [Have zap_add_by_dnode() in ZFS])
607 dnl # ZFS 0.7.x adds new method zap_remove_by_dnode
609 LB_CHECK_COMPILE([if ZFS has 'zap_remove_by_dnode'],
610 zap_remove_by_dnode, [
612 #include <sys/dnode.h>
615 zap_remove_by_dnode(dn, NULL, NULL);
617 AC_DEFINE(HAVE_ZAP_REMOVE_ADD_BY_DNODE, 1,
618 [Have zap_remove_by_dnode() in ZFS])
621 dnl # ZFS 0.7.x adds new method dmu_tx_hold_zap_by_dnode
623 LB_CHECK_COMPILE([if ZFS has 'dmu_tx_hold_zap_by_dnode'],
624 dmu_tx_hold_zap_by_dnode, [
626 #include <sys/dnode.h>
629 dmu_tx_hold_zap_by_dnode(NULL, dn, TRUE, NULL);
631 AC_DEFINE(HAVE_DMU_TX_HOLD_ZAP_BY_DNODE, 1,
632 [Have dmu_tx_hold_zap_by_dnode() in ZFS])
635 dnl # ZFS 0.7.x adds new method dmu_tx_hold_write_by_dnode
637 LB_CHECK_COMPILE([if ZFS has 'dmu_tx_hold_write_by_dnode'],
638 dmu_tx_hold_write_by_dnode, [
640 #include <sys/dnode.h>
643 dmu_tx_hold_write_by_dnode(NULL, dn, 0, 0);
645 AC_DEFINE(HAVE_DMU_TX_HOLD_WRITE_BY_DNODE, 1,
646 [Have dmu_tx_hold_write_by_dnode() in ZFS])
649 dnl # ZFS 0.7.x adds new method dmu_write_by_dnode
651 LB_CHECK_COMPILE([if ZFS has 'dmu_write_by_dnode'],
652 dmu_write_by_dnode, [
654 #include <sys/dnode.h>
657 dmu_write_by_dnode(dn, 0, 0, NULL, NULL);
659 AC_DEFINE(HAVE_DMU_WRITE_BY_DNODE, 1,
660 [Have dmu_write_by_dnode() in ZFS])
663 dnl # ZFS 0.7.x adds new method dmu_read_by_dnode
665 LB_CHECK_COMPILE([if ZFS has 'dmu_read_by_dnode'],
668 #include <sys/dnode.h>
671 dmu_read_by_dnode(dn, 0, 0, NULL, 0);
673 AC_DEFINE(HAVE_DMU_READ_BY_DNODE, 1,
674 [Have dmu_read_by_dnode() in ZFS])
677 dnl # ZFS 0.7.2 adds new method dmu_tx_mark_netfree
679 LB_CHECK_COMPILE([if ZFS has 'dmu_tx_mark_netfree'],
680 dmu_tx_mark_netfree, [
684 dmu_tx_mark_netfree(tx);
686 AC_DEFINE(HAVE_DMU_TX_MARK_NETFREE, 1,
687 [Have dmu_tx_mark_netfree])
690 dnl # ZFS 0.7.10 changes timestruc_t to inode_timespec_t
692 LB_CHECK_COMPILE([if SPL has 'inode_timespec_t'],
693 zfs_have_inode_timespec, [
694 #include <sys/fs/zfs.h>
696 inode_timespec_t now;
699 AC_DEFINE(HAVE_ZFS_INODE_TIMESPEC, 1,
700 [Have inode_timespec_t])
702 dnl # ZFS 0.7.12/0.8.x uses zfs_refcount_add() instead of
703 dnl # refcount_add(). ZFS 2.0 renamed sys/refcount.h to
704 dnl # sys/zfs_refcount.h, rather the add another check to
705 dnl # determine the correct header name include it
706 dnl # indirectly through sys/dnode.h.
708 LB_CHECK_COMPILE([if ZFS has 'zfs_refcount_add'],
710 #include <sys/dnode.h>
712 zfs_refcount_add((zfs_refcount_t *) NULL, NULL);
714 AC_DEFINE(HAVE_ZFS_REFCOUNT_ADD, 1,
715 [Have zfs_refcount_add])
718 dnl # ZFS 0.8.x changes dmu_objset_own for encryption
720 LB_CHECK_COMPILE([if ZFS has 'dmu_objset_own' with 6 args],
722 #include <sys/dmu_objset.h>
725 dmu_objset_type_t type = DMU_OST_ANY;
726 dmu_objset_own(NULL, type, B_FALSE, B_TRUE, FTAG, &os);
728 AC_DEFINE(HAVE_DMU_OBJSET_OWN_6ARG, 1,
729 [Have dmu_objset_own() with 6 args])
732 dnl # ZFS 0.8.x changes dmu_objset_disown for encryption
734 LB_CHECK_COMPILE([if ZFS has 'dmu_objset_disown' with 3 args],
736 #include <sys/dmu_objset.h>
739 dmu_objset_disown(os, B_TRUE, FTAG);
741 AC_DEFINE(HAVE_DMU_OBJSET_DISOWN_3ARG, 1,
742 [Have dmu_objset_disown() with 3 args])
745 dnl # ZFS exports dmu_offet_next
747 AC_CACHE_CHECK([if ZFS exports 'dmu_offset_next'],
748 [lb_cv_dmu_offset_next], [
749 lb_cv_dmu_offset_next="no"
750 AS_IF([grep -q -E "EXPORT_SYMBOL.*\(dmu_offset_next\)" "$zfssrc/module/zfs/dmu.c" 2>/dev/null],
751 [lb_cv_dmu_offset_next="yes"])
753 AS_IF([test "x$lb_cv_dmu_offset_next" = "xyes"], [
754 AC_DEFINE(HAVE_DMU_OFFSET_NEXT, 1,
755 [Have dmu_offset_next() exported])
758 dnl # ZFS 2.0 replaced .db_last_dirty / .dr_next with a list_t
759 dnl # and list_node_t named .db_dirty_records / .dr_dbuf_node.
761 LB_CHECK_COMPILE([if ZFS has 'db_dirty_records' list_t],
763 #include <sys/dbuf.h>
766 dbuf_dirty_record_t *dr;
767 dr = list_head(&db.db_dirty_records);
769 AC_DEFINE(HAVE_DB_DIRTY_RECORDS_LIST, 1,
770 [Have db_dirty_records list_t])
773 dnl # ZFS 2.0 renamed sys/refcount.h to zfs_refcount.h
774 dnl # This build issue shows up with ZFS 2.0.7 and Lustre 2.12 LTS
776 LB_CHECK_COMPILE([if ZFS renamed sys/refcount to zfs_refcount.h],
778 #include <sys/zfs_refcount.h>
780 zfs_refcount_add((zfs_refcount_t *) NULL, NULL);
782 AC_DEFINE(HAVE_ZFS_REFCOUNT_HEADER, 1,
783 [Have zfs_refcount.h])
787 AS_IF([test "x$enable_zfs" = xyes], [
788 AC_SUBST(ENABLE_ZFS, yes)
790 AC_SUBST(ENABLE_ZFS, no)
792 AM_CONDITIONAL(ZFS_ENABLED, [test "x$enable_zfs" = xyes])
793 AM_CONDITIONAL(SPL_ENABLED, [test "x$enable_spl" = xyes])