From 643aa9f6fea233073384cdb01e8b23c693bf50e6 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ README | 6 +++--- configure.ac | 14 +++++++------- mlvirtmanager/Makefile.in | 31 ++++++++++++++++++++++++++----- 4 files changed, 42 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1b99ca..9d20229 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-01-05 Richard Jones + 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. diff --git a/README b/README index 06eb130..b3001a3 100755 --- a/README +++ b/README @@ -84,9 +84,9 @@ contains the build directory. eg: 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 diff --git a/configure.ac b/configure.ac index a478198..63ef06f 100755 --- a/configure.ac +++ b/configure.ac @@ -122,13 +122,13 @@ else 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? diff --git a/mlvirtmanager/Makefile.in b/mlvirtmanager/Makefile.in index 5bcb84c..b09cc57 100755 --- a/mlvirtmanager/Makefile.in +++ b/mlvirtmanager/Makefile.in @@ -21,13 +21,23 @@ prefix = @prefix@ 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 @@ -48,14 +58,25 @@ all: $(BYTE_TARGETS) 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 \ -- 1.8.3.1