]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
build: Rename HAVE_LIBZFS to USE_LIBZFS
authorVladimir Serbinenko <phcoder@gmail.com>
Thu, 24 Aug 2023 21:24:30 +0000 (23:24 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 12 Dec 2023 17:01:55 +0000 (18:01 +0100)
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>
configure.ac
grub-core/osdep/unix/getroot.c
util/getroot.c

index c19779c14d08c9f51c5d46d8d522e679813d6b4e..5e6e7d377aaac93a5737a8fe24eea6fc8de404c5 100644 (file)
@@ -2008,11 +2008,9 @@ fi
 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])
index cde821eb9bfabb3cf0b4895f18bd609e0d0985c6..71cdf2e86b58944ccbbf9ce6447e22bbfb2a755e 100644 (file)
@@ -53,7 +53,7 @@
 
 #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
@@ -158,7 +158,7 @@ grub_util_find_root_devices_from_poolname (char *poolname)
   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;
index 086581998c80e7a6e1fb9b1cb6fb634acf32ee25..75a7d5f21b00b8fe0ade23e6aa74a120449dfca3 100644 (file)
@@ -47,7 +47,7 @@
 
 #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
@@ -456,7 +456,7 @@ grub_util_biosdisk_is_present (const char *os_dev)
   return ret;
 }
 
-#ifdef HAVE_LIBZFS
+#ifdef USE_LIBZFS
 static libzfs_handle_t *__libzfs_handle;
 
 static void
@@ -478,5 +478,5 @@ grub_get_libzfs_handle (void)
 
   return __libzfs_handle;
 }
-#endif /* HAVE_LIBZFS */
+#endif /* USE_LIBZFS */