Browse files

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)
  • Loading branch information...
1 parent 0b285e0 commit 876983365a508ad0aac7cddab8c5badfb1da2988 @hillu hillu committed Feb 28, 2014
Showing with 13 additions and 9 deletions.
  1. +1 −1 mllib/Makefile.am
  2. +6 −1 ocaml/Makefile.am
  3. +4 −7 ocaml/examples/Makefile.am
  4. +2 −0 ocaml/run-bindtests
View
2 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
View
7 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
View
11 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
View
2 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

0 comments on commit 8769833

Please sign in to comment.