From 1e65c6c293a0f7917e87438330e2583bd38758dd Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH 1/1] 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. --- ChangeLog | 8 ++++++++ Makefile.in | 12 +++++++++--- README | 13 +++++++++---- configure.ac | 8 ++++---- examples/Makefile.in | 2 +- libvirt/Makefile.in | 2 +- mlvirtmanager/Makefile.in | 2 +- 7 files changed, 33 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6393f1f..9185ccc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-01-04 Richard Jones + + 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 * libvirt/libvirt_c.c: Use enter/leave_blocking_section around diff --git a/Makefile.in b/Makefile.in index 1db3843..bd791fc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 --- 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): diff --git a/configure.ac b/configure.ac index 8e4c9c9..1fa9361 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/examples/Makefile.in b/examples/Makefile.in index fde78a6..179b360 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -1,4 +1,4 @@ -OCAMLCPACKAGES := -package extlib,unix -I ../libvirt +OCAMLCPACKAGES := -package unix -I ../libvirt OCAMLCFLAGS := -g OCAMLCLIBS := -linkpkg diff --git a/libvirt/Makefile.in b/libvirt/Makefile.in index 69afcf1..8eb2f93 100644 --- a/libvirt/Makefile.in +++ b/libvirt/Makefile.in @@ -23,7 +23,7 @@ CFLAGS := @CFLAGS@ \ -g LDFLAGS := @LDFLAGS@ -OCAMLCPACKAGES := -package extlib,unix +OCAMLCPACKAGES := -package unix OCAMLCFLAGS := -g OCAMLCLIBS := -linkpkg diff --git a/mlvirtmanager/Makefile.in b/mlvirtmanager/Makefile.in index 15e55c6..5bcb84c 100644 --- a/mlvirtmanager/Makefile.in +++ b/mlvirtmanager/Makefile.in @@ -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 -- 1.8.3.1