X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=config%2Flustre-build-zfs.m4;h=b6d56dd64e539fb782e068901ef039f434821a3d;hb=b4b00be8a93cf06f232d3edc613f03d06b112d32;hp=507afd80216bc19852eba966ffcb9dfea38bbf8e;hpb=a6c26e19f7f189c78c7efa9e682b78e0e5f80d73;p=fs%2Flustre-release.git diff --git a/config/lustre-build-zfs.m4 b/config/lustre-build-zfs.m4 index 507afd8..b6d56dd 100644 --- a/config/lustre-build-zfs.m4 +++ b/config/lustre-build-zfs.m4 @@ -18,6 +18,16 @@ dnl # * /usr/src/zfs-${VERSION} dnl # * ../spl/ dnl # * $LINUX dnl # +dnl # --with-zfs-devel=path +dnl # - User provided directory where zfs development headers +dnl # are located. This option is typically used when user +dnl # uses rpm2cpio to unpack src rpm. +dnl # Assumes layout of: +dnl # ${zfs-devel-path}/usr/include/libzfs +dnl # ${zfs-devel-path}/usr/include/libspl +dnl # ${zfs-devel-path}/lib64/libzfs.so.* or +dnl # ${zfs-devel-path}/lib/libzfs.so.* +dnl # dnl # --with-zfs=path - Enable zfs support and use the zfs headers in the dnl # provided path. No autodetection is performed and dnl # if no headers are found this is a fatal error. @@ -263,24 +273,51 @@ AC_DEFUN([LB_ZFS], [ AC_SUBST(ZFS_SYMBOLS) ]) +AC_DEFUN([LB_ZFS_DEVEL], [ + AC_ARG_WITH([zfs-devel], + [AS_HELP_STRING([--with-zfs-devel=PATH], + [Path to zfs development headers])], + [zfsdevel="$withval"]) + + AC_MSG_CHECKING([user provided zfs devel headers]) + AS_IF([test ! -z "${zfsdevel}"], [ + AS_IF([test -d "${zfsdevel}/usr/include/libspl" && test -d "${zfsdevel}/usr/include/libzfs"], [ + zfsinc="-I $zfsdevel/usr/include/libspl -I $zfsdevel/usr/include/libzfs" + zfslib="-L$zfsdevel/usr/lib64 -L$zfsdevel/usr/lib -L$zfsdevel/lib64 -L$zfsdevel/lib" + ], [ + AC_MSG_ERROR([Path to development headers directory does not exist]) + ]) + ]) + AC_MSG_RESULT([$zfsinc]) +]) + AC_DEFUN([LB_ZFS_USER], [ dnl # dnl # Detect user space zfs development headers. dnl # AC_MSG_CHECKING([zfs devel headers]) - AS_IF([test -d /usr/include/libzfs && test -d /usr/include/libspl], [ - zfslib="-I /usr/include/libspl -I /usr/include/libzfs" - ], [ - zfslib="[Not found]" - enable_zfs=no + AS_IF([test -z "${zfsinc}"], [ + AS_IF([test -e "${zfssrc}/include/libzfs.h" && test -e "${zfssrc}/lib/libspl/include"], [ + zfsinc="-I $zfssrc/lib/libspl/include -I $zfssrc/include" + zfslib="-L$zfssrc/lib/libzfs/.libs/" + ], [test -d /usr/include/libzfs && test -d /usr/include/libspl], [ + zfsinc="-I/usr/include/libspl -I /usr/include/libzfs" + zfslib="" + ], [ + zfsinc="[Not Found]" + zfslib="" + enable_zfs=no + ]) ]) - AC_MSG_RESULT([$zfslib]) + AC_MSG_RESULT([$zfsinc]) - ZFS_LIBZFS_INCLUDE=${zfslib} + ZFS_LIBZFS_INCLUDE=${zfsinc} + ZFS_LIBZFS_LDFLAGS="-lzfs ${zfslib}" AC_SUBST(ZFS_LIBZFS_INCLUDE) + AC_SUBST(ZFS_LIBZFS_LDFLAGS) ]) -AC_DEFUN([LB_PATH_ZFS], [ +AC_DEFUN([LB_CONFIG_ZFS], [ AC_ARG_WITH([zfs], [AS_HELP_STRING([--with-zfs=PATH], [Path to zfs source])], [ @@ -296,8 +333,7 @@ AC_DEFUN([LB_PATH_ZFS], [ zfssrc="$withval" ]) ], [ - AS_IF([test x$enable_server = xyes && - test x$enable_dist = xno], [ + AS_IF([test x$enable_server != xno], [ require_zfs=no enable_zfs=yes ], [ @@ -314,7 +350,7 @@ AC_DEFUN([LB_PATH_ZFS], [ LB_SPL LB_ZFS ]) - + LB_ZFS_DEVEL LB_ZFS_USER dnl # @@ -346,5 +382,26 @@ your distribution. ]) ]) - AM_CONDITIONAL(ZFS_ENABLED, test x$enable_zfs = xyes) + AS_IF([test "x$enable_zfs" = xyes], [ + LB_CHECK_COMPILE([if zfs defines dsl_pool_config_enter/exit], + dsl_pool_config_enter, [ + #include + ],[ + dsl_pool_config_enter(NULL, FTAG); + ],[ + AC_DEFINE(HAVE_DSL_POOL_CONFIG, 1, + [Have dsl_pool_config_enter/exit in ZFS]) + ]) + LB_CHECK_COMPILE([if zfs defines dsl_sync_task_do_nowait], + dsl_sync_task_do_nowait, [ + #include + ],[ + dsl_sync_task_do_nowait(NULL, NULL, NULL, NULL, NULL, 0, NULL); + ],[ + AC_DEFINE(HAVE_DSL_SYNC_TASK_DO_NOWAIT, 1, + [Have dsl_sync_task_do_nowait in ZFS]) + ]) + ]) + + AM_CONDITIONAL(ZFS_ENABLED, [test "x$enable_zfs" = xyes]) ])