Make extlib an optional dependency.
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 4 Jan 2008 16:25:24 +0000 (16:25 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 4 Jan 2008 16:25:24 +0000 (16:25 +0000)
* Makefile.in, README, configure.ac, examples/Makefile.in,
  libvirt/Makefile.in, mlvirtmanager/Makefile.in: Much code
  doesn't really need extlib, so make it optional.
  Bail earlier in configure step if we don't have ocamlfind.

ChangeLog
Makefile.in
README
configure.ac
examples/Makefile.in
libvirt/Makefile.in
mlvirtmanager/Makefile.in

index 6393f1f..9185ccc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-04  Richard Jones  <rjones@redhat.com>
+
+       Make extlib an optional dependency.
+       * Makefile.in, README, configure.ac, examples/Makefile.in,
+         libvirt/Makefile.in, mlvirtmanager/Makefile.in: Much code
+         doesn't really need extlib, so make it optional.
+         Bail earlier in configure step if we don't have ocamlfind.
+
 2007-12-20  Richard Jones  <rjones@redhat.com>
 
        * libvirt/libvirt_c.c: Use enter/leave_blocking_section around
index 1db3843..bd791fc 100644 (file)
@@ -20,23 +20,28 @@ VERSION             = @PACKAGE_VERSION@
 
 INSTALL                = @INSTALL@
 
+pkg_extlib     = @pkg_extlib@
 pkg_lablgtk2   = @pkg_lablgtk2@
 pkg_curses     = @pkg_curses@
 pkg_xml_light  = @pkg_xml_light@
 
 OCAMLDOCFLAGS  := -html -sort
 
-SUBDIRS                := libvirt examples mlvirsh
+SUBDIRS                := libvirt examples
+
+ifeq ($(pkg_extlib),yes)
+SUBDIRS                += mlvirsh
+endif
 
 ifeq ($(pkg_lablgtk2),yes)
 SUBDIRS                += mlvirtmanager
 endif
 
-ifeq ($(pkg_curses),yes)
+ifeq ($(pkg_extlib)$(pkg_curses),yesyes)
 SUBDIRS                += virt-top
 endif
 
-ifeq ($(pkg_xml_light),yes)
+ifeq ($(pkg_extlib)$(pkg_xml_light),yesyes)
 SUBDIRS                += virt-df
 endif
 
@@ -54,6 +59,7 @@ clean:
        rm -f mlvirsh/mlvirsh
        rm -f mlvirtmanager/mlvirtmanager
        rm -f virt-top/virt-top
+       rm -f virt-df/virt-df
 
 distclean: clean
        rm -f config.h config.log config.status configure
diff --git a/README b/README
index 819df41..b56dc49 100644 (file)
--- a/README
+++ b/README
@@ -12,28 +12,33 @@ known functionality to OCaml programs.
 Requirements
 ----------------------------------------------------------------------
 
-To build the bindings and mlvirsh (required):
+To build the bindings (required):
 
   GNU make, gcc
   libvirt >= 0.2.1 (from http://libvirt.org/,
                    get the latest version if you can)
   ocaml >= 3.08 (from http://caml.inria.fr/)
   findlib (from http://www.ocaml-programming.de/packages/)
-  Extlib (from http://ocaml-lib.sourceforge.net/)
 
 To build the OCaml interface documentation (optional):
 
   ocamldoc (part of OCaml itself)
 
+To build mlvirsh (optional):
+
+  Extlib (from http://ocaml-lib.sourceforge.net/)
+
 To build virt-top (optional):
 
   ocaml-curses (from http://www.nongnu.org/ocaml-tmk/)
+  Extlib (from http://ocaml-lib.sourceforge.net/)
   xml-light (from http://tech.motion-twin.com/doc/xml-light/)
   ocaml CSV library (from http://merjis.com/developers/csv)
   ocaml-calendar (http://www.lri.fr/~signoles/prog.en.html)
 
-  [Only ocaml-curses is required for building virt-top.  The other
-  packages are not required, but you will get reduced functionality].
+  [Only ocaml-curses and Extlib are required for building virt-top.
+  The other packages are not required, but you will get reduced
+  functionality].
 
 To build mlvirtmanager (optional):
 
index 8e4c9c9..1fa9361 100644 (file)
@@ -65,18 +65,18 @@ AC_CHECK_LIB(ncurses,initscr)
 dnl Check for basic OCaml environment & findlib.
 AC_PROG_OCAML
 AC_PROG_FINDLIB
+if test "x$OCAMLFIND" = "x"; then
+   AC_MSG_ERROR([Cannot find required program 'ocamlfind' (part of findlib)])
+fi
 
 dnl Check for required OCaml packages.
 AC_CHECK_OCAML_PKG(unix)
 if test "x$pkg_unix" != "xyes"; then
    AC_MSG_ERROR([Cannot find required OCaml package 'unix'])
 fi
-AC_CHECK_OCAML_PKG(extlib)
-if test "x$pkg_extlib" != "xyes"; then
-   AC_MSG_ERROR([Cannot find required OCaml package 'extlib'])
-fi
 
 dnl Check for optional OCaml packages.
+AC_CHECK_OCAML_PKG(extlib)
 AC_CHECK_OCAML_PKG(lablgtk2)
 AC_CHECK_OCAML_PKG(curses)
 AC_CHECK_OCAML_PKG(gettext)
index fde78a6..179b360 100644 (file)
@@ -1,4 +1,4 @@
-OCAMLCPACKAGES := -package extlib,unix -I ../libvirt
+OCAMLCPACKAGES := -package unix -I ../libvirt
 OCAMLCFLAGS    := -g
 OCAMLCLIBS     := -linkpkg
 
index 69afcf1..8eb2f93 100644 (file)
@@ -23,7 +23,7 @@ CFLAGS                := @CFLAGS@ \
                   -g
 LDFLAGS                := @LDFLAGS@
 
-OCAMLCPACKAGES := -package extlib,unix
+OCAMLCPACKAGES := -package unix
 OCAMLCFLAGS    := -g
 OCAMLCLIBS     := -linkpkg
 
index 15e55c6..5bcb84c 100644 (file)
@@ -21,7 +21,7 @@ prefix                = @prefix@
 exec_prefix    = @exec_prefix@
 bindir         = @bindir@
 
-OCAMLCPACKAGES := -package extlib,unix,lablgtk2 -I ../libvirt
+OCAMLCPACKAGES := -package unix,lablgtk2 -I ../libvirt
 OCAMLCFLAGS    := -g
 OCAMLCLIBS     := -linkpkg