This is a first attempt to build libguestfs with just a ocaml bytecode compiler. The three tools written in ocaml will be build only when an ocamlopt compiler is available.
Olaf --- Makefile.am | 5 ++++- configure.ac | 2 ++ ocaml/Makefile.am | 20 +++++++++++++++++--- resize/Makefile.am | 2 +- sparsify/Makefile.am | 2 +- sysprep/Makefile.am | 2 +- 6 files changed, 26 insertions(+), 7 deletions(-) Index: libguestfs-1.20.1/Makefile.am =================================================================== --- libguestfs-1.20.1.orig/Makefile.am +++ libguestfs-1.20.1/Makefile.am @@ -74,7 +74,10 @@ if HAVE_PERL SUBDIRS += perl perl/examples endif if HAVE_OCAML -SUBDIRS += ocaml ocaml/examples +SUBDIRS += ocaml +endif +if HAVE_OCAMLOPT +SUBDIRS += ocaml/examples endif if HAVE_PYTHON SUBDIRS += python python/examples Index: libguestfs-1.20.1/configure.ac =================================================================== --- libguestfs-1.20.1.orig/configure.ac +++ libguestfs-1.20.1/configure.ac @@ -865,6 +865,8 @@ AS_IF([test "x$enable_ocaml" != "xno"], ]) AM_CONDITIONAL([HAVE_OCAML], [test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno"]) +AM_CONDITIONAL([HAVE_OCAMLOPT], + [test "x$OCAMLOPT" != "xno" && test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno"]) AM_CONDITIONAL([HAVE_OCAMLDOC], [test "x$OCAMLDOC" != "xno"]) Index: libguestfs-1.20.1/ocaml/Makefile.am =================================================================== --- libguestfs-1.20.1.orig/ocaml/Makefile.am +++ libguestfs-1.20.1/ocaml/Makefile.am @@ -43,10 +43,20 @@ CLEANFILES += t/*.cmi t/*.cmo t/*.cmx t/ if HAVE_OCAML +DATA_HOOK_FILES = META *.so *.a *.cma \ + *.cmi $(srcdir)/*.mli +if HAVE_OCAMLOPT +DATA_HOOK_FILES += *.cmx *.cmxa +endif + OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX OCAMLOPTFLAGS = $(OCAMLCFLAGS) -noinst_DATA = mlguestfs.cma mlguestfs.cmxa META +noinst_DATA = mlguestfs.cma +if HAVE_OCAMLOPT +noinst_DATA += mlguestfs.cmxa +endif +noinst_DATA += META # Build the C part into a library, so that automake handles the C # compilation step for us. Note that we don't directly use this @@ -101,9 +111,13 @@ TESTS = run-bindtests \ $(patsubst %,%.opt,$(test_progs))) noinst_DATA += \ - bindtests.bc bindtests.opt \ + bindtests.bc +if HAVE_OCAMLOPT +noinst_DATA += \ + bindtests.opt \ $(test_progs:%=%.bc) \ $(test_progs:%=%.opt) +endif bindtests.bc: bindtests.cmo mlguestfs.cma mkdir -p t @@ -217,7 +231,7 @@ install-data-hook: $(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 Index: libguestfs-1.20.1/resize/Makefile.am =================================================================== --- libguestfs-1.20.1.orig/resize/Makefile.am +++ libguestfs-1.20.1/resize/Makefile.am @@ -40,7 +40,7 @@ SOURCES = \ resize_utils.ml \ resize_utils_tests.ml -if HAVE_OCAML +if HAVE_OCAMLOPT # Note this list must be in dependency order. OBJECTS = \ Index: libguestfs-1.20.1/sparsify/Makefile.am =================================================================== --- libguestfs-1.20.1.orig/sparsify/Makefile.am +++ libguestfs-1.20.1/sparsify/Makefile.am @@ -36,7 +36,7 @@ SOURCES = \ sparsify_gettext.ml \ sparsify_utils.ml -if HAVE_OCAML +if HAVE_OCAMLOPT # Note this list must be in dependency order. OBJECTS = \ Index: libguestfs-1.20.1/sysprep/Makefile.am =================================================================== --- libguestfs-1.20.1.orig/sysprep/Makefile.am +++ libguestfs-1.20.1/sysprep/Makefile.am @@ -86,7 +86,7 @@ SOURCES = \ utils.ml \ utils.mli -if HAVE_OCAML +if HAVE_OCAMLOPT # Note this list must be in dependency order. OBJECTS = \ _______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs