2010-07-31 Robert Millan <rmh@gnu.org>

* configure.ac: Check for `libzfs.h' and `libnvpair.h'.
	
	* include/grub/util/libnvpair.h: Include `<config.h>'.
	[HAVE_LIBNVPAIR_H]: Include `<libnvpair.h>' instead of
	declaring libnvpair prototypes ourselves.
	* include/grub/util/libzfs.h: Include `<config.h>'.
	[HAVE_LIBZFS_H]: Include `<libzfs.h>' instead of
	declaring libzfs prototypes ourselves.
	
	(libzfs_handle): Moved to ...
	* include/grub/util/misc.h (libzfs_handle): ... here.
	Include `<grub/util/libzfs.h>'.
This commit is contained in:
Robert Millan 2010-07-31 12:22:01 +02:00
parent c9a00aeeaa
commit 3169f4c76a
5 changed files with 35 additions and 2 deletions

View file

@ -1,3 +1,18 @@
2010-07-31 Robert Millan <rmh@gnu.org>
* configure.ac: Check for `libzfs.h' and `libnvpair.h'.
* include/grub/util/libnvpair.h: Include `<config.h>'.
[HAVE_LIBNVPAIR_H]: Include `<libnvpair.h>' instead of
declaring libnvpair prototypes ourselves.
* include/grub/util/libzfs.h: Include `<config.h>'.
[HAVE_LIBZFS_H]: Include `<libzfs.h>' instead of
declaring libzfs prototypes ourselves.
(libzfs_handle): Moved to ...
* include/grub/util/misc.h (libzfs_handle): ... here.
Include `<grub/util/libzfs.h>'.
2010-07-30 Robert Millan <rmh@gnu.org>
* include/grub/emu/misc.h: Add missing license header.

View file

@ -246,8 +246,9 @@ else
AC_PATH_PROG(HELP2MAN, help2man)
fi
# Check for functions.
# Check for functions and headers.
AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getfsstat)
AC_CHECK_HEADERS(libzfs.h libnvpair.h)
# For opendisk() and getrawpartition() on NetBSD.
# Used in util/deviceiter.c and in util/hostdisk.c.

View file

@ -19,6 +19,12 @@
#ifndef GRUB_LIBNVPAIR_UTIL_HEADER
#define GRUB_LIBNVPAIR_UTIL_HEADER 1
#include <config.h>
#ifdef HAVE_LIBNVPAIR_H
#include <libnvpair.h>
#else /* ! HAVE_LIBNVPAIR_H */
#include <stdio.h> /* FILE */
typedef void nvlist_t;
@ -28,4 +34,6 @@ int nvlist_lookup_nvlist (nvlist_t *, const char *, nvlist_t **);
int nvlist_lookup_nvlist_array (nvlist_t *, const char *, nvlist_t ***, unsigned int *);
void nvlist_print (FILE *, nvlist_t *);
#endif /* ! HAVE_LIBNVPAIR_H */
#endif

View file

@ -19,6 +19,12 @@
#ifndef GRUB_LIBZFS_UTIL_HEADER
#define GRUB_LIBZFS_UTIL_HEADER 1
#include <config.h>
#ifdef HAVE_LIBZFS_H
#include <libzfs.h>
#else /* ! HAVE_LIBZFS_H */
#include <grub/util/libnvpair.h>
typedef void libzfs_handle_t;
@ -34,6 +40,6 @@ extern int zpool_get_physpath (zpool_handle_t *, const char *);
extern nvlist_t *zpool_get_config (zpool_handle_t *, nvlist_t **);
extern libzfs_handle_t *libzfs_handle;
#endif /* ! HAVE_LIBZFS_H */
#endif

View file

@ -29,6 +29,7 @@
#include <grub/types.h>
#include <grub/symbol.h>
#include <grub/emu/misc.h>
#include <grub/util/libzfs.h>
char *grub_util_get_path (const char *dir, const char *file);
size_t grub_util_get_fp_size (FILE *fp);
@ -59,6 +60,8 @@ char *make_system_path_relative_to_its_root (const char *path);
char *canonicalize_file_name (const char *path);
void grub_util_init_nls (void);
void grub_util_init_libzfs (void);
extern libzfs_handle_t *libzfs_handle;
#endif /* ! GRUB_UTIL_MISC_HEADER */