2008-01-05 Richard Jones <rjones@redhat.com>
+ mlvirtmanager compiles and runs on Windows (MinGW).
+ * configure.ac: Directories to search for optional modules were
+ specified incorrectly - fixed.
+ * mlvirtmanager/Makefile.in: Changed so can build without
+ ocamlfind, and checked it can build on Windows.
+
mlvirsh can compile without extlib
* mlvirsh/mlvirsh.ml: mlvirsh only needed three functions from
extlib, so copy them in here to avoid the dependency.
Windows
----------------------------------------------------------------------
-I have built libvirt (the bindings) and examples on Windows using the
-MinGW port of OCaml. It's quite likely that it will also work under
-VC++, but I have not tested this.
+I have built libvirt (the bindings), examples, mlvirsh and
+mlvirtmanager on Windows using the MinGW port of OCaml. It's quite
+likely that it will also work under VC++, but I have not tested this.
mlvirsh
fi
dnl Check for optional OCaml modules.
- AC_CHECK_OCAML_MODULE(extlib,pkg_extlib,ExtString,[extlib])
- AC_CHECK_OCAML_MODULE(lablgtk2,pkg_lablgtk2,GMain,[lablgtk2])
- AC_CHECK_OCAML_MODULE(curses,pkg_curses,Curses,[curses])
- AC_CHECK_OCAML_MODULE(gettext,pkg_gettext,Gettext,[gettext]) dnl XXX
- AC_CHECK_OCAML_MODULE(xml-light,pkg_xml_light,Xml,[xml-light])
- AC_CHECK_OCAML_MODULE(csv,pkg_csv,Csv,[csv])
- AC_CHECK_OCAML_MODULE(calendar,pkg_calendar,Calendar,[calendar])
+ AC_CHECK_OCAML_MODULE(extlib,pkg_extlib,ExtString,[+extlib])
+ AC_CHECK_OCAML_MODULE(lablgtk2,pkg_lablgtk2,GMain,[+lablgtk2])
+ AC_CHECK_OCAML_MODULE(curses,pkg_curses,Curses,[+curses])
+ AC_CHECK_OCAML_MODULE(gettext,pkg_gettext,Gettext,[+gettext]) dnl XXX
+ AC_CHECK_OCAML_MODULE(xml-light,pkg_xml_light,Xml,[+xml-light])
+ AC_CHECK_OCAML_MODULE(csv,pkg_csv,Csv,[+csv])
+ AC_CHECK_OCAML_MODULE(calendar,pkg_calendar,Calendar,[+calendar])
fi
dnl Which subpackages (== subdirs) will we build?
exec_prefix = @exec_prefix@
bindir = @bindir@
+OCAMLFIND = @OCAMLFIND@
+
+ifneq ($(OCAMLFIND),)
OCAMLCPACKAGES := -package unix,lablgtk2 -I ../libvirt
OCAMLCFLAGS := -g
OCAMLCLIBS := -linkpkg
-
OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
OCAMLOPTFLAGS :=
OCAMLOPTLIBS := $(OCAMLCLIBS)
+else
+OCAMLCINCS := -I @pkg_lablgtk2@ -I ../libvirt
+OCAMLCFLAGS := -g
+OCAMLCLIBS := unix.cma lablgtk.cma
+OCAMLOPTINCS := $(OCAMLCINCS)
+OCAMLOPTFLAGS :=
+OCAMLOPTLIBS := unix.cmxa lablgtk.cmxa
+endif
export LIBRARY_PATH=../libvirt
export LD_LIBRARY_PATH=../libvirt
opt: $(OPT_TARGETS)
+ifneq ($(OCAMLFIND),)
mlvirtmanager: $(VIRTMANAGER_OBJS)
- ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
- ../libvirt/mllibvirt.cma gtkInit.cmo -o $@ $<
+ $(OCAMLFIND) ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
+ ../libvirt/mllibvirt.cma gtkInit.cmo -o $@ $^
mlvirtmanager.opt: $(VIRTMANAGER_XOBJS)
- ocamlfind ocamlopt \
+ $(OCAMLFIND) ocamlopt \
$(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
- ../libvirt/mllibvirt.cmxa gtkInit.cmx -o $@ $<
+ ../libvirt/mllibvirt.cmxa gtkInit.cmx -o $@ $^
+else
+mlvirtmanager: $(VIRTMANAGER_OBJS)
+ $(OCAMLC) $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
+ ../libvirt/mllibvirt.cma gtkInit.cmo -o $@ $^
+
+mlvirtmanager.opt: $(VIRTMANAGER_XOBJS)
+ $(OCAMLOPT) \
+ $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
+ ../libvirt/mllibvirt.cmxa gtkInit.cmx -o $@ $^
+endif
install:
if [ -x mlvirtmanager.opt ]; then \