diff --git a/mllib/Makefile.am b/mllib/Makefile.am index 2e35d1e77..0e317b277 100644 --- a/mllib/Makefile.am +++ b/mllib/Makefile.am @@ -176,7 +176,7 @@ common_utils_tests: common_gettext.cmx common_utils.cmx common_utils_tests.cmx else common_utils_tests: common_gettext.cmo common_utils.cmo common_utils_tests.cmo $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) \ - mlguestfs.cma -linkpkg $^ -cclib -lncurses -o $@ + mlguestfs.cma -linkpkg $^ -cclib -lncurses -custom -o $@ endif TESTS_ENVIRONMENT = $(top_builddir)/run --test diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index 708b2e7c8..7c8e515c7 100644 --- a/ocaml/Makefile.am +++ b/ocaml/Makefile.am @@ -171,13 +171,18 @@ depend: .depend SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly # Do the installation by hand, because we want to run ocamlfind. +data_hook_files = META *.so *.a *.cma *.cmi $(srcdir)/*.mli +if HAVE_OCAMLOPT +data_hook_files += *.cmx *.cmxa +endif + install-data-hook: mkdir -p $(DESTDIR)$(OCAMLLIB) mkdir -p $(DESTDIR)$(OCAMLLIB)/stublibs $(OCAMLFIND) install \ -ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \ guestfs \ - META *.so *.a *.cma *.cmx *.cmxa *.cmi $(srcdir)/*.mli + $(data_hook_files) rm $(DESTDIR)$(OCAMLLIB)/guestfs/bindtests.* rm $(DESTDIR)$(OCAMLLIB)/guestfs/libguestfsocaml.a diff --git a/ocaml/examples/Makefile.am b/ocaml/examples/Makefile.am index 472e180d7..de647fc1a 100644 --- a/ocaml/examples/Makefile.am +++ b/ocaml/examples/Makefile.am @@ -58,16 +58,13 @@ inspect_vm: inspect_vm.ml $(OCAMLFIND) ocamlopt $(OCAMLFINDFLAGS) -package unix -linkpkg \ -warn-error A -I .. mlguestfs.cmxa $< -o $@ else - -# This avoids: -# Error: Error on dynamically loaded library: ../dllmlguestfs.so: libguestfs.so.0: cannot open shared object file: No such file or directory create_disk: create_disk.ml - $(top_builddir)/run $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \ - -warn-error A -I .. mlguestfs.cma $< -o $@ + $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \ + -warn-error A -I .. mlguestfs.cma -custom $< -o $@ inspect_vm: inspect_vm.ml - $(top_builddir)/run $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \ - -warn-error A -I .. mlguestfs.cma $< -o $@ + $(OCAMLFIND) ocamlc $(OCAMLFINDFLAGS) -package unix -linkpkg \ + -warn-error A -I .. mlguestfs.cma -custom $< -o $@ endif endif diff --git a/ocaml/run-bindtests b/ocaml/run-bindtests index 3b73e8d35..1fa54ec93 100755 --- a/ocaml/run-bindtests +++ b/ocaml/run-bindtests @@ -21,5 +21,7 @@ set -e ./bindtests.bc > bindtests.tmp diff -u $srcdir/../bindtests bindtests.tmp +test -x ./bindtests.opt || exit 0 + ./bindtests.opt > bindtests.tmp diff -u $srcdir/../bindtests bindtests.tmp