[Libguestfs] [PATCH] build: require ocaml-hivex for the daemon

Pino Toscano ptoscano at redhat.com
Mon Jul 31 08:19:26 UTC 2017


Since commit d5b6f1df5ff2d387a5dfc89b8316c0dff67ce2c9, the daemon
requires ocaml-hivex; OTOH, nothing checks it is actually available, so
the build of the daemon will fail with a semi-cryptic error about the
lack of a directory in the OCaml install prefix.

As fix, check for the presence of the hivex module at build time,
failing earlier if not present.  The check is performed only when the
daemon is enabled, as ocaml-hivex is not used for anything else than the
daemon.
---
 m4/guestfs_ocaml.m4 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/m4/guestfs_ocaml.m4 b/m4/guestfs_ocaml.m4
index d0f3349..e577b31 100644
--- a/m4/guestfs_ocaml.m4
+++ b/m4/guestfs_ocaml.m4
@@ -56,6 +56,14 @@ AM_CONDITIONAL([HAVE_OCAMLOPT],
 AM_CONDITIONAL([HAVE_OCAMLDOC],
                [test "x$OCAMLDOC" != "xno"])
 
+if test "x$enable_daemon" = "xyes"; then
+    OCAML_PKG_hivex=no
+    AC_CHECK_OCAML_PKG(hivex)
+    if test "x$OCAML_PKG_hivex" = "xno"; then
+        AC_MSG_ERROR([the OCaml module 'hivex' is required])
+    fi
+fi
+
 OCAML_PKG_gettext=no
 OCAML_PKG_libvirt=no
 OCAML_PKG_oUnit=no
-- 
2.9.4




More information about the Libguestfs mailing list