On distros with OCaml < 4.02 we need to create a compatibility Bytes
module.  However we didn't create the interface file (bytes.mli) which
would mean that dependencies wouldn't be created correctly for
parallel builds.  This commit uses ‘ocaml -i’ to create an interface
file which exports everything.
---
 .gitignore          | 1 +
 m4/guestfs-ocaml.m4 | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 233a8c536..bb7026537 100644
--- a/.gitignore
+++ b/.gitignore
@@ -139,6 +139,7 @@ Makefile.in
 /common/mlprogress/.depend
 /common/mlstdutils/.depend
 /common/mlstdutils/bytes.ml
+/common/mlstdutils/bytes.mli
 /common/mlstdutils/guestfs_config.ml
 /common/mlstdutils/oUnit-*
 /common/mlstdutils/std_utils_tests
diff --git a/m4/guestfs-ocaml.m4 b/m4/guestfs-ocaml.m4
index 94c24bc04..e08f40a02 100644
--- a/m4/guestfs-ocaml.m4
+++ b/m4/guestfs-ocaml.m4
@@ -175,7 +175,7 @@ AM_CONDITIONAL([HAVE_OCAML_GETTEXT],
 
 dnl Create the backwards compatibility Bytes module for OCaml < 4.02.
 mkdir -p common/mlstdutils
-rm -f common/mlstdutils/bytes.ml
+rm -f common/mlstdutils/bytes.ml common/mlstdutils/bytes.mli
 AS_IF([test "x$have_Bytes_module" = "xno"],[
     cat > common/mlstdutils/bytes.ml <<EOF
 include String
@@ -183,6 +183,7 @@ let of_string = String.copy
 let to_string = String.copy
 let sub_string = String.sub
 EOF
+    $OCAMLC -i common/mlstdutils/bytes.ml > common/mlstdutils/bytes.mli
     OCAML_BYTES_COMPAT_CMO='$(top_builddir)/common/mlstdutils/bytes.cmo'
     OCAML_BYTES_COMPAT_ML='$(top_builddir)/common/mlstdutils/bytes.ml'
     safe_string_option=
-- 
2.14.3

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to