The HAVE_LIBZFS is defined by libzfs test and hence conflicts with
manual definition. On NetBSD it ends up detecting zfs but not detecting
nvpair and creates confusion. Split them.
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
if test x"$libzfs_excuse" = x ; then
# We need both libzfs and libnvpair for a successful build.
LIBZFS="-lzfs"
- AC_DEFINE([HAVE_LIBZFS], [1],
- [Define to 1 if you have the ZFS library.])
LIBNVPAIR="-lnvpair"
- AC_DEFINE([HAVE_LIBNVPAIR], [1],
- [Define to 1 if you have the NVPAIR library.])
+ AC_DEFINE([USE_LIBZFS], [1],
+ [Define to 1 if ZFS library should be used.])
fi
AC_SUBST([LIBZFS])
#include <grub/osdep/major.h>
-#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
+#ifdef USE_LIBZFS
# include <grub/util/libzfs.h>
# include <grub/util/libnvpair.h>
#endif
size_t ndevices = 0;
size_t devices_allocated = 0;
-#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
+#ifdef USE_LIBZFS
zpool_handle_t *zpool;
libzfs_handle_t *libzfs;
nvlist_t *config, *vdev_tree;
#include <sys/types.h>
-#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
+#ifdef USE_LIBZFS
# include <grub/util/libzfs.h>
# include <grub/util/libnvpair.h>
#endif
return ret;
}
-#ifdef HAVE_LIBZFS
+#ifdef USE_LIBZFS
static libzfs_handle_t *__libzfs_handle;
static void
return __libzfs_handle;
}
-#endif /* HAVE_LIBZFS */
+#endif /* USE_LIBZFS */