[Libguestfs] [libnbd PATCH] build: Fix OCaml build on Fedora 29

Eric Blake eblake at redhat.com
Sat Jun 15 21:56:37 UTC 2019


Once ocamlfind is installed, 'make' failed for me with:

ocamlfind ocamlc -g -annot -safe-string -warn-error CDEFLMPSUVYZX+52-3 -ccopt '-gdwarf' -package unix -c NBD.ml -o NBD.cmo
File "NBD.ml", line 1:
Error: Could not find the .cmi file for interface NBD.mli.
make[2]: *** [Makefile:823: NBD.cmo] Error 2

I'm not positive that this is the perfect fix, but it at least got the
build working for me, and copies from idioms in
nbdkit/plugins/ocaml/Makefile.am.
---
 ocaml/Makefile.am | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index 0d876bb..557151c 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -32,6 +32,11 @@ if HAVE_OCAML
 OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
 OCAMLPACKAGES = -package unix

+NBD.cmi: NBD.mli
+	$(OCAMLC) -c $< -o $@
+
+NBD.cmo: NBD.cmi
+
 noinst_DATA = mlnbd.cma META
 if HAVE_OCAMLOPT
 noinst_DATA += mlnbd.cmxa
-- 
2.20.1




More information about the Libguestfs mailing list