From: Richard W.M. Jones Date: Wed, 9 Nov 2011 17:53:58 +0000 (+0000) Subject: ocaml: Compile OCaml bindings and tests with -warn-error. X-Git-Tag: 1.14.2~4 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=2a5615372eb3941cb52afd3d2a97ddd4a8489fa9;p=libguestfs.git ocaml: Compile OCaml bindings and tests with -warn-error. (cherry picked from commit 145ed04e41a3fcd3be87c11cae0085f4551f1da8) --- diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index e2fdf43..5287035 100644 --- a/ocaml/Makefile.am +++ b/ocaml/Makefile.am @@ -41,6 +41,9 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(OCAMLLIB) -I$(top_srcdir)/ocaml \ if HAVE_OCAML +OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX +OCAMLOPTFLAGS = $(OCAMLCFLAGS) + noinst_DATA = mlguestfs.cma mlguestfs.cmxa META OBJS = guestfs_c.o guestfs_c_actions.o guestfs.cmo @@ -90,46 +93,46 @@ noinst_DATA += bindtests \ bindtests: bindtests.cmx mlguestfs.cmxa mkdir -p t - $(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ t/guestfs_005_load: t/guestfs_005_load.cmx mlguestfs.cmxa mkdir -p t - $(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ t/guestfs_010_basic: t/guestfs_010_basic.cmx mlguestfs.cmxa mkdir -p t - $(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ t/guestfs_070_threads: t/guestfs_070_threads.cmx mlguestfs.cmxa mkdir -p t - $(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . -package unix,threads -thread -linkpkg mlguestfs.cmxa $< -o $@ + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix,threads -thread -linkpkg mlguestfs.cmxa $< -o $@ t/guestfs_080_optargs: t/guestfs_080_optargs.cmx mlguestfs.cmxa mkdir -p t - $(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ t/guestfs_400_events: t/guestfs_400_events.cmx mlguestfs.cmxa mkdir -p t - $(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ t/guestfs_400_progress: t/guestfs_400_progress.cmx mlguestfs.cmxa mkdir -p t - $(OCAMLFIND) ocamlopt -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@ # Need to rebuild the tests from source if the main library has # changed at all, otherwise we get inconsistent assumptions. t/guestfs_070_threads.cmx: t/guestfs_070_threads.ml mlguestfs.cmxa - $(OCAMLFIND) ocamlopt -package unix,threads -thread -linkpkg -c $< -o $@ + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -package unix,threads -thread -linkpkg -c $< -o $@ t/%.cmx: t/%.ml mlguestfs.cmxa - $(OCAMLFIND) ocamlopt -package unix -linkpkg -c $< -o $(builddir)/$@ + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -package unix -linkpkg -c $< -o $(builddir)/$@ %.cmi: %.mli - $(OCAMLFIND) ocamlc -package unix -c $< -o $(builddir)/$@ + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -package unix -c $< -o $(builddir)/$@ %.cmo: %.ml - $(OCAMLFIND) ocamlc -package unix -c $< -o $(builddir)/$@ + $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -package unix -c $< -o $(builddir)/$@ %.cmx: %.ml - $(OCAMLFIND) ocamlopt -package unix -c $< -o $(builddir)/$@ + $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -package unix -c $< -o $(builddir)/$@ depend: .depend