More fixes for situations where ocamlopt is not available

- run bindtests.opt only if available
- use ocamlc -custom
- Don't try to install native code if it hasn't been built (Thanks to Olaf Hering)
This commit is contained in:
Hilko Bengen
2014-02-28 19:58:04 +01:00
parent 0b285e07a0
commit 876983365a
4 changed files with 13 additions and 9 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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