mlvirtmanager compiles and runs on Windows (MinGW).
authorRichard W.M. Jones <rjones@redhat.com>
Sat, 5 Jan 2008 16:59:48 +0000 (16:59 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Sat, 5 Jan 2008 16:59:48 +0000 (16:59 +0000)
* 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.

ChangeLog
README
configure.ac
mlvirtmanager/Makefile.in

index e1b99ca..9d20229 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-01-05  Richard Jones  <rjones@redhat.com>
 
 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.
        mlvirsh can compile without extlib
        * mlvirsh/mlvirsh.ml: mlvirsh only needed three functions from
          extlib, so copy them in here to avoid the dependency.
diff --git a/README b/README
index 06eb130..b3001a3 100755 (executable)
--- a/README
+++ b/README
@@ -84,9 +84,9 @@ contains the build directory.  eg:
 Windows
 ----------------------------------------------------------------------
 
 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
 
 
 mlvirsh
index a478198..63ef06f 100755 (executable)
@@ -122,13 +122,13 @@ else
     fi
 
     dnl Check for optional OCaml modules.
     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?
 fi
 
 dnl Which subpackages (== subdirs) will we build?
index 5bcb84c..b09cc57 100755 (executable)
@@ -21,13 +21,23 @@ prefix              = @prefix@
 exec_prefix    = @exec_prefix@
 bindir         = @bindir@
 
 exec_prefix    = @exec_prefix@
 bindir         = @bindir@
 
+OCAMLFIND      = @OCAMLFIND@
+
+ifneq ($(OCAMLFIND),)
 OCAMLCPACKAGES := -package unix,lablgtk2 -I ../libvirt
 OCAMLCFLAGS    := -g
 OCAMLCLIBS     := -linkpkg
 OCAMLCPACKAGES := -package unix,lablgtk2 -I ../libvirt
 OCAMLCFLAGS    := -g
 OCAMLCLIBS     := -linkpkg
-
 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
 OCAMLOPTFLAGS  :=
 OCAMLOPTLIBS   := $(OCAMLCLIBS)
 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
 
 export LIBRARY_PATH=../libvirt
 export LD_LIBRARY_PATH=../libvirt
@@ -48,14 +58,25 @@ all: $(BYTE_TARGETS)
 
 opt: $(OPT_TARGETS)
 
 
 opt: $(OPT_TARGETS)
 
+ifneq ($(OCAMLFIND),)
 mlvirtmanager: $(VIRTMANAGER_OBJS)
 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)
 
 mlvirtmanager.opt: $(VIRTMANAGER_XOBJS)
-       ocamlfind ocamlopt \
+       $(OCAMLFIND) ocamlopt \
          $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
          $(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 \
 
 install:
        if [ -x mlvirtmanager.opt ]; then \