From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Wed, 16 Apr 2008 13:33:39 +0000 (+0100) Subject: Fixed to build virt-ctrl. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=d9538f5354d91e7da44fa54eadc6e3be760a7139;p=virt-ctrl.git Fixed to build virt-ctrl. --- diff --git a/Makefile.in b/Makefile.in index 52776e0..199daf5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -57,17 +57,6 @@ distclean: clean rm -f virt-top/Makefile rm -f virt-df/Makefile -# Developer documentation (in html/ subdirectory). - -ifneq ($(OCAMLDOC),) -doc: - rm -rf html - mkdir html - -cd libvirt; \ - $(OCAMLDOC) $(OCAMLDOCFLAGS) -d ../html \ - libvirt.{ml,mli} libvirt_version.{ml,mli} -endif - # Windows installer (requires NSIS). WININSTALLER := $(PACKAGE)-$(VERSION).exe @@ -82,14 +71,6 @@ $(WININSTALLER): wininstaller.nsis all opt ls -l $@ endif -# Update configure and rerun. - -configure: force - autoreconf - CFLAGS=-g \ - ./configure \ - --enable-debug=yes --with-libvirt=/home/rjones/local - # Distribution. dist: @@ -109,42 +90,5 @@ check-manifest: rm -f .orig-manifest .check-manifest; \ exit $$rv -# Do a release (update the website). - -release: configure - $(MAKE) release_stage_2 - -release_stage_2: clean all opt doc dist - $(MAKE) release_stage_3 - -WEBSITE = ../redhat/websites - -release_stage_3: - rm -f $(WEBSITE)/ocaml-libvirt/html/*.{html,css} - cp html/*.{html,css} $(WEBSITE)/ocaml-libvirt/html/ - cp README $(WEBSITE)/ocaml-libvirt/README.txt - cp ChangeLog $(WEBSITE)/ocaml-libvirt/ChangeLog.txt -# cp virt-top/virt-top.txt $(WEBSITE)/virt-top/ -# cp ChangeLog $(WEBSITE)/virt-top/ChangeLog.txt - -# Upload to main website. - -upload: - cd $(WEBSITE)/ocaml-libvirt && \ - scp ChangeLog.txt index.html README.txt Screenshot*.png \ - libvirt.org:/data/www/libvirt.org/ocaml && \ - scp css/*.css \ - libvirt.org:/data/www/libvirt.org/ocaml/css/ && \ - scp html/*.html html/*.css \ - libvirt.org:/data/www/libvirt.org/ocaml/html/ - scp $(PACKAGE)-$(VERSION).tar.gz libvirt.org:/data/ftp/libvirt/ocaml/ - -# Upload Windows binary installer to main website. - -winupload: - scp $(WININSTALLER) libvirt.org:/data/ftp/libvirt/ocaml/ - -force: - .PHONY: all opt depend install clean distclean configure dist check-manifest \ release release_stage_2 release_stage_3 force \ No newline at end of file diff --git a/README b/README index 7fb9726..d42a1ba 100644 --- a/README +++ b/README @@ -5,143 +5,12 @@ Copyright (C) 2007-2008 Richard W.M. Jones, Red Hat Inc. http://libvirt.org/ocaml/ http://libvirt.org/ -This is a complete set of OCaml bindings around libvirt, exposing all -known functionality to OCaml programs. - - -Requirements ----------------------------------------------------------------------- - -PLEASE NOTE: The list of requirements looks long but you DO NOT NEED -all of these packages, so pay careful attention to what is required -('R') and what is optional ('O'). - -ALSO NOTE: Binaries are available for many platforms. You only need -the packages below if you want to build from source. - - W h a t y o u w a n t t o b u i l d - - |Bindings, |Docs, |virt-top |virt-ctrl |virt-df |Windows - |examples, |manpages | | | |version - |mlvirsh | | | | | - --------------+----------+---------+---------+----------+----------+------ - GNU make | R | R | R | R | R | R - | | | | | | - gcc | R | | R | R | R | R - | | | | | | - libvirt | R | | R | R | R | R - | >= 0.2.1 | | | | | - | | | | | | - ocaml | R | | R | R | R | R - | >= 3.08 | | | | >= 3.10 | - | | | | | | - findlib | HR | R | HR | HR | HR | Note [1] - | | | | | | - ocaml-gettext | O | O | O | O | O | Note [2] - | | | | | | - MinGW + MSYS | | | | | | R - --------------+----------+---------+---------+----------+----------+------ - ocamldoc | | R | | | | O - | | | | | | - perldoc | | O | | | | - --------------+----------+---------+---------+----------+----------+------ - ocaml-curses | | | R | | | - | | | | | | - Extlib | | | R | | R | - | | | | | | - xml-light | | | O | | R | - | | | | | | - ocaml-calendar| | | O | | | - | | | | | | - ocaml CSV | | | O | | | - | | | | | | - bitmatch | | | | | R | - --------------+----------+---------+---------+----------+----------+------ - GTK2 | | | | R | | O - | | | | | | - lablgtk2 | | | | R | | O - | | | | >= 2.10.0| | - ocaml-dbus | | | | O | | - | | | | >= 0.06 | | - gnome-icon-theme | | | O | | - --------------+----------+---------+---------+----------+----------+------ - NSIS | | | | | | O - --------------+----------+---------+---------+----------+----------+------ - - R = required - HR = highly recommended (use if possible) - O = optional (just improves functionality, but not required) - n/a = not available - -Note [1]: Findlib was recently ported to Windows and in future we may -require it because it will let us remove a lot of hacks from the -Makefiles. - -Note [2]: It's not clear if ocaml-gettext works on Windows. - -Where to get the packages: - - libvirt >= 0.2.1 from http://libvirt.org/ (get the latest version available) - or packaged in Debian, Ubuntu and Fedora - - ocaml >= 3.08 from http://caml.inria.fr/ - or packaged in Debian, Ubuntu and Fedora - - findlib from http://www.ocaml-programming.de/packages/ - or packaged in Debian, Ubuntu and Fedora as 'ocaml-findlib' - - ocaml-gettext from http://www.le-gall.net/sylvain+violaine/ocaml-gettext.html - + patch for OCaml 3.10: - http://www.annexia.org/tmp/ocaml-gettext-0.2.0-20080321.patch - (This should appear in ocaml-gettext 0.3.0 shortly). - - MinGW + MSYS from http://www.mingw.org/ (only needed for Windows) - - ocamldoc part of OCaml itself - or part of the ocaml package in Debian, Ubuntu - or packaged in Fedora as 'ocaml-ocamldoc' - - perldoc part of Perl - or packaged in Debian, Ubuntu and Fedora - - ocaml-curses from http://www.nongnu.org/ocaml-tmk/ - or packaged in Debian, Ubuntu as 'libcurses-ocaml-dev' - or packaged in Fedora as 'ocaml-curses-devel' - - Extlib from http://ocaml-lib.sourceforge.net/ - or packaged in Debian, Unbuntu as 'libextlib-ocaml-dev' - or packaged in Fedora as 'ocaml-extlib-devel' - - xml-light from http://tech.motion-twin.com/doc/xml-light/ - or packaged in Debian, Ubuntu as 'libxml-light-ocaml-dev' - or packaged in Fedora as 'ocaml-xml-light-devel' - - ocaml CSV from http://merjis.com/developers/csv - or packaged in Debian, Ubuntu as 'libcsv-ocaml-dev' - or packaged in Fedora as 'ocaml-csv-devel' - - ocaml-calendar from http://www.lri.fr/~signoles/prog.en.html - or packaged in Debian, Ubuntu as 'libcalendar-ocaml-dev' - or packaged in Fedora as 'ocaml-calendar-devel' - - bitmatch from http://et.redhat.com/~rjones/bitmatch/ - - GTK2 from http://gtk.org/ - or packaged in Debian, Ubuntu and Fedora - - lablgtk2 >= 2.10.0 - from http://wwwfun.kurims.kyoto-u.ac.jp/soft/lsl/lablgtk.html - or packaged in Debian, Ubuntu as 'liblablgtk2-ocaml-dev' - or packaged in Fedora 9 as 'ocaml-lablgtk-devel' - - gnome-icon-theme part of GNOME - - ocaml-dbus >= 0.06 - from http://tab.snarc.org/projects/ocaml_dbus/ - or packaged in Fedora 9 as 'ocaml-dbus-devel' - (not yet available for Debian or Ubuntu AFAIK) - - NSIS from http://nsis.sf.net +'virt-ctrl' (originally called 'mlvirtmanager') is a reimplementation +of virt-manager in OCaml. It is not feature-complete by any means, +but does allow you to show the running domains and start and stop +defined domains. The main functionality _missing_ is the ability to +define new virtual machines, change the resources allocated to +domains, or show the machine console. Building @@ -155,16 +24,7 @@ Building make install # Install in OCaml directory, and the binaries # in $prefix/bin. - make doc # Build HTML documentation in html/ subdirectory. - -Then have a look at the programs 'mlvirsh.opt', 'virt-top.opt' -and 'virt-ctrl.opt'. - -Note: If you want to run the programs without first installing, you -may need to set your $LD_LIBRARY_PATH environment variable so it -contains the build directory. eg: - - LD_LIBRARY_PATH=libvirt/ mlvirsh/mlvirsh.opt +Then have a look at the program 'virt-ctrl.opt'. Windows @@ -199,53 +59,3 @@ To build the Windows installer, you will need NSIS. Then do: This should build a Windows binary installer called ocaml-libvirt-$VERSION.exe which includes the bindings, all required DLLs and all programs that can be built under Windows. - - -mlvirsh ----------------------------------------------------------------------- - -'mlvirsh' is an almost complete reimplementation of virsh, which is -mostly command compatible (there are a very few commands missing, and -some commands have a slightly different syntax, but broadly speaking -they are equivalent programs except that one is written in C and the -other in OCaml). - -At the time of writing: - - wc -c wc -l - - virsh 126,056 4,641 - mlvirsh 19,427 598 - - % size 15% 13% - - -virt-ctrl ----------------------------------------------------------------------- - -'virt-ctrl' (originally called 'mlvirtmanager') is a reimplementation -of virt-manager in OCaml. It is not feature-complete by any means, -but does allow you to show the running domains and start and stop -defined domains. The main functionality _missing_ is the ability to -define new virtual machines, change the resources allocated to -domains, or show the machine console. - - -Programming ----------------------------------------------------------------------- - -For documentation on these bindings, read libvirt.mli and/or 'make -doc' and browse the HTML documentation in the html/ subdirectory. - -For documentation on libvirt itself, see http://libvirt.org/html/ - - -Subdirectories ----------------------------------------------------------------------- - -libvirt/ The OCaml bindings. -examples/ Some example programs using the bindings. -mlvirsh/ 'mlvirsh' command line tool. -virt-ctrl/ 'virt-ctrl' graphical tool. -virt-top/ 'virt-top' tool. -virt-df/ 'virt-df' tool. diff --git a/config.h.in b/config.h.in index ab90ff8..989ed53 100644 --- a/config.h.in +++ b/config.h.in @@ -1,196 +1,5 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `ncurses' library (-lncurses). */ -#undef HAVE_LIBNCURSES - -/* Define to 1 if you have the `virt' library (-lvirt). */ -#undef HAVE_LIBVIRT - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `virConnectGetHostname' function. */ -#undef HAVE_VIRCONNECTGETHOSTNAME - -/* Define to 1 if you have the `virConnectGetURI' function. */ -#undef HAVE_VIRCONNECTGETURI - -/* Define to 1 if you have the `virConnectListDefinedStoragePools' function. - */ -#undef HAVE_VIRCONNECTLISTDEFINEDSTORAGEPOOLS - -/* Define to 1 if you have the `virConnectListStoragePools' function. */ -#undef HAVE_VIRCONNECTLISTSTORAGEPOOLS - -/* Define to 1 if you have the `virConnectNumOfDefinedStoragePools' function. - */ -#undef HAVE_VIRCONNECTNUMOFDEFINEDSTORAGEPOOLS - -/* Define to 1 if you have the `virConnectNumOfStoragePools' function. */ -#undef HAVE_VIRCONNECTNUMOFSTORAGEPOOLS - -/* Define to 1 if you have the `virDomainBlockStats' function. */ -#undef HAVE_VIRDOMAINBLOCKSTATS - -/* Define to 1 if you have the `virDomainGetSchedulerParameters' function. */ -#undef HAVE_VIRDOMAINGETSCHEDULERPARAMETERS - -/* Define to 1 if you have the `virDomainGetSchedulerType' function. */ -#undef HAVE_VIRDOMAINGETSCHEDULERTYPE - -/* Define to 1 if you have the `virDomainInterfaceStats' function. */ -#undef HAVE_VIRDOMAININTERFACESTATS - -/* Define to 1 if you have the `virDomainMigrate' function. */ -#undef HAVE_VIRDOMAINMIGRATE - -/* Define to 1 if you have the `virDomainSetSchedulerParameters' function. */ -#undef HAVE_VIRDOMAINSETSCHEDULERPARAMETERS - -/* Define to 1 if the system has the type `virJobPtr'. */ -#undef HAVE_VIRJOBPTR - -/* Define to 1 if you have the `virNodeGetCellsFreeMemory' function. */ -#undef HAVE_VIRNODEGETCELLSFREEMEMORY - -/* Define to 1 if you have the `virNodeGetFreeMemory' function. */ -#undef HAVE_VIRNODEGETFREEMEMORY - -/* Define to 1 if you have the `virStoragePoolBuild' function. */ -#undef HAVE_VIRSTORAGEPOOLBUILD - -/* Define to 1 if you have the `virStoragePoolCreate' function. */ -#undef HAVE_VIRSTORAGEPOOLCREATE - -/* Define to 1 if you have the `virStoragePoolCreateXML' function. */ -#undef HAVE_VIRSTORAGEPOOLCREATEXML - -/* Define to 1 if you have the `virStoragePoolDefineXML' function. */ -#undef HAVE_VIRSTORAGEPOOLDEFINEXML - -/* Define to 1 if you have the `virStoragePoolDelete' function. */ -#undef HAVE_VIRSTORAGEPOOLDELETE - -/* Define to 1 if you have the `virStoragePoolDestroy' function. */ -#undef HAVE_VIRSTORAGEPOOLDESTROY - -/* Define to 1 if you have the `virStoragePoolFree' function. */ -#undef HAVE_VIRSTORAGEPOOLFREE - -/* Define to 1 if you have the `virStoragePoolGetAutostart' function. */ -#undef HAVE_VIRSTORAGEPOOLGETAUTOSTART - -/* Define to 1 if you have the `virStoragePoolGetConnect' function. */ -#undef HAVE_VIRSTORAGEPOOLGETCONNECT - -/* Define to 1 if you have the `virStoragePoolGetInfo' function. */ -#undef HAVE_VIRSTORAGEPOOLGETINFO - -/* Define to 1 if you have the `virStoragePoolGetName' function. */ -#undef HAVE_VIRSTORAGEPOOLGETNAME - -/* Define to 1 if you have the `virStoragePoolGetUUID' function. */ -#undef HAVE_VIRSTORAGEPOOLGETUUID - -/* Define to 1 if you have the `virStoragePoolGetUUIDString' function. */ -#undef HAVE_VIRSTORAGEPOOLGETUUIDSTRING - -/* Define to 1 if you have the `virStoragePoolGetXMLDesc' function. */ -#undef HAVE_VIRSTORAGEPOOLGETXMLDESC - -/* Define to 1 if you have the `virStoragePoolListVolumes' function. */ -#undef HAVE_VIRSTORAGEPOOLLISTVOLUMES - -/* Define to 1 if you have the `virStoragePoolLookupByName' function. */ -#undef HAVE_VIRSTORAGEPOOLLOOKUPBYNAME - -/* Define to 1 if you have the `virStoragePoolLookupByUUID' function. */ -#undef HAVE_VIRSTORAGEPOOLLOOKUPBYUUID - -/* Define to 1 if you have the `virStoragePoolLookupByUUIDString' function. */ -#undef HAVE_VIRSTORAGEPOOLLOOKUPBYUUIDSTRING - -/* Define to 1 if you have the `virStoragePoolLookupByVolume' function. */ -#undef HAVE_VIRSTORAGEPOOLLOOKUPBYVOLUME - -/* Define to 1 if you have the `virStoragePoolNumOfVolumes' function. */ -#undef HAVE_VIRSTORAGEPOOLNUMOFVOLUMES - -/* Define to 1 if the system has the type `virStoragePoolPtr'. */ -#undef HAVE_VIRSTORAGEPOOLPTR - -/* Define to 1 if you have the `virStoragePoolRefresh' function. */ -#undef HAVE_VIRSTORAGEPOOLREFRESH - -/* Define to 1 if you have the `virStoragePoolSetAutostart' function. */ -#undef HAVE_VIRSTORAGEPOOLSETAUTOSTART - -/* Define to 1 if you have the `virStoragePoolUndefine' function. */ -#undef HAVE_VIRSTORAGEPOOLUNDEFINE - -/* Define to 1 if you have the `virStorageVolCreateXML' function. */ -#undef HAVE_VIRSTORAGEVOLCREATEXML - -/* Define to 1 if you have the `virStorageVolDelete' function. */ -#undef HAVE_VIRSTORAGEVOLDELETE - -/* Define to 1 if you have the `virStorageVolFree' function. */ -#undef HAVE_VIRSTORAGEVOLFREE - -/* Define to 1 if you have the `virStorageVolGetInfo' function. */ -#undef HAVE_VIRSTORAGEVOLGETINFO - -/* Define to 1 if you have the `virStorageVolGetKey' function. */ -#undef HAVE_VIRSTORAGEVOLGETKEY - -/* Define to 1 if you have the `virStorageVolGetName' function. */ -#undef HAVE_VIRSTORAGEVOLGETNAME - -/* Define to 1 if you have the `virStorageVolGetPath' function. */ -#undef HAVE_VIRSTORAGEVOLGETPATH - -/* Define to 1 if you have the `virStorageVolGetXMLDesc' function. */ -#undef HAVE_VIRSTORAGEVOLGETXMLDESC - -/* Define to 1 if you have the `virStorageVolLookupByKey' function. */ -#undef HAVE_VIRSTORAGEVOLLOOKUPBYKEY - -/* Define to 1 if you have the `virStorageVolLookupByName' function. */ -#undef HAVE_VIRSTORAGEVOLLOOKUPBYNAME - -/* Define to 1 if you have the `virStorageVolLookupByPath' function. */ -#undef HAVE_VIRSTORAGEVOLLOOKUPBYPATH - -/* Define to 1 if the system has the type `virStorageVolPtr'. */ -#undef HAVE_VIRSTORAGEVOLPTR - -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT @@ -205,12 +14,3 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION - -/* Define to 1 if the C compiler supports function prototypes. */ -#undef PROTOTYPES - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define like PROTOTYPES; this can be used by system headers. */ -#undef __PROTOTYPES diff --git a/configure.ac b/configure.ac index 09d5505..d777be6 100644 --- a/configure.ac +++ b/configure.ac @@ -17,135 +17,9 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(ocaml-libvirt,0.4.1.1) +AC_INIT(virt-ctrl,1.0.0) -dnl Check for basic C environment. -AC_PROG_CC AC_PROG_INSTALL -AC_PROG_CPP - -AC_C_PROTOTYPES -test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant) - -AC_PROG_CC_C_O - -dnl Select some C flags based on the host type. -AC_CANONICAL_HOST - -DEBUG="-g" -WARNINGS="-Wall -Werror" -CFLAGS_FPIC="-fPIC" -WIN32=no -case "$host" in - *-*-mingw*) - WARNINGS="$WARNINGS -Wno-unused" - CFLAGS_FPIC="" - WIN32=yes -esac -AC_SUBST(DEBUG) -AC_SUBST(WARNINGS) -AC_SUBST(CFLAGS_FPIC) -AC_SUBST(WIN32) - -dnl Check for libvirt development environment. -AC_ARG_WITH(libvirt, - AC_HELP_STRING([--with-libvirt=PATH],[Set path to installed libvirt]), - [if test "x$withval" != "x"; then - CFLAGS="$CFLAGS -I$withval/include" - LDFLAGS="$LDFLAGS -L$withval/lib" - fi - ]) -AC_CHECK_LIB(virt,virConnectOpen, - [], - AC_MSG_ERROR([You must install libvirt library])) -AC_CHECK_HEADER([libvirt/libvirt.h], - [], - AC_MSG_ERROR([You must install libvirt development package])) - -dnl We also use -AC_CHECK_HEADER([libvirt/virterror.h], - [], - AC_MSG_ERROR([You must install libvirt development package])) - -dnl Check for libvirt >= 0.2.1 (our minimum supported version). -dnl See: http://libvirt.org/hvsupport.html -AC_CHECK_FUNC(virConnectGetCapabilities, - [], - AC_MSG_ERROR([You must have libvirt >= 0.2.1])) - -dnl Check for optional libvirt functions added since 0.2.1. -dnl See: http://libvirt.org/hvsupport.html -AC_CHECK_FUNCS([virConnectGetHostname \ - virConnectGetURI \ - virDomainBlockStats \ - virDomainGetSchedulerParameters \ - virDomainGetSchedulerType \ - virDomainInterfaceStats \ - virDomainMigrate \ - virDomainSetSchedulerParameters \ - virNodeGetFreeMemory \ - virNodeGetCellsFreeMemory \ - virStoragePoolGetConnect \ - virConnectNumOfStoragePools \ - virConnectListStoragePools \ - virConnectNumOfDefinedStoragePools \ - virConnectListDefinedStoragePools \ - virStoragePoolLookupByName \ - virStoragePoolLookupByUUID \ - virStoragePoolLookupByUUIDString \ - virStoragePoolLookupByVolume \ - virStoragePoolCreateXML \ - virStoragePoolDefineXML \ - virStoragePoolBuild \ - virStoragePoolUndefine \ - virStoragePoolCreate \ - virStoragePoolDestroy \ - virStoragePoolDelete \ - virStoragePoolFree \ - virStoragePoolRefresh \ - virStoragePoolGetName \ - virStoragePoolGetUUID \ - virStoragePoolGetUUIDString \ - virStoragePoolGetInfo \ - virStoragePoolGetXMLDesc \ - virStoragePoolGetAutostart \ - virStoragePoolSetAutostart \ - virStoragePoolNumOfVolumes \ - virStoragePoolListVolumes \ - virStorageVolLookupByName \ - virStorageVolLookupByKey \ - virStorageVolLookupByPath \ - virStorageVolGetName \ - virStorageVolGetKey \ - virStorageVolCreateXML \ - virStorageVolDelete \ - virStorageVolFree \ - virStorageVolGetInfo \ - virStorageVolGetXMLDesc \ - virStorageVolGetPath \ -]) - -# This jobs API was never published and is due to get overhauled -# in the near future: -# virJobGetInfo -# virJobGetDomain -# virJobGetNetwork -# virJobCancel -# virJobFree -# virDomainCreateLinuxJob -# virDomainSaveJob -# virDomainRestoreJob -# virDomainCoreDumpJob -# virDomainCreateJob -# virNetworkCreateXMLJob -# virNetworkCreateJob - -dnl Check for optional types added since 0.2.1. -AC_CHECK_TYPES([virJobPtr, virStoragePoolPtr, virStorageVolPtr],,, - [#include ]) - -dnl Check for optional ncurses. -AC_CHECK_LIB(ncurses,initscr) dnl Check for optional GNOME icons (from gnome-icon-theme package). AC_ARG_WITH(icons, @@ -171,88 +45,39 @@ AC_SUBST(with_icons) AC_SUBST(icons) dnl Check for basic OCaml environment & findlib. -dnl Note that findlib is not necessary, but things will work better -dnl if it is present. AC_PROG_OCAML AC_PROG_FINDLIB -if test "x$OCAMLFIND" != "x"; then - dnl Use ocamlfind to find the required packages ... - - 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 - - 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) - AC_CHECK_OCAML_PKG(xml-light) - AC_CHECK_OCAML_PKG(csv) - AC_CHECK_OCAML_PKG(dbus) - AC_CHECK_OCAML_PKG(gettext) - AC_CHECK_OCAML_PKG(bitmatch) - - dnl Need to check which version of calendar is installed. - AC_CHECK_OCAML_MODULE(calendar,pkg_calendar2,CalendarLib.Date,[+calendar]) - if test "x$pkg_calendar2" = "xno"; then - AC_CHECK_OCAML_PKG(calendar) - fi - - AC_SUBST(pkg_unix) - AC_SUBST(pkg_extlib) - AC_SUBST(pkg_lablgtk2) - AC_SUBST(pkg_curses) - AC_SUBST(pkg_gettext) - AC_SUBST(pkg_xml_light) - AC_SUBST(pkg_csv) - AC_SUBST(pkg_dbus) - AC_SUBST(pkg_gettext) - AC_SUBST(pkg_calendar) - AC_SUBST(pkg_calendar2) -else - dnl Use a basic module test if there is no findlib ... +if test "x$OCAMLFIND" = "x"; then + AC_MSG_ERROR([OCaml findlib is required]) +fi - dnl Check for required OCaml modules. - AC_CHECK_OCAML_MODULE(unix,pkg_unix,Unix,[.]) - if test "x$pkg_unix" = "xno"; then - AC_MSG_ERROR([Cannot find required OCaml package 'unix']) - fi +dnl Use ocamlfind to find the required packages ... - 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(dbus,pkg_dbus,DBus,[+dbus]) - AC_CHECK_OCAML_MODULE(gettext,pkg_gettext,Gettext,[+gettext]) - AC_CHECK_OCAML_MODULE(bitmatch,pkg_bitmatch,Bitmatch,[+bitmatch]) - dnl XXX Version check - see above. - AC_CHECK_OCAML_MODULE(calendar,pkg_calendar,Calendar,[+calendar]) +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 -dnl Which subpackages (== subdirs) will we build? -subdirs="libvirt examples mlvirsh" -if test "x$pkg_lablgtk2" != "xno"; then - subdirs="$subdirs virt-ctrl" +AC_CHECK_OCAML_PKG(libvirt) +if test "x$pkg_libvirt" != "xyes"; then + AC_MSG_ERROR([Cannot find required OCaml package 'libvirt']) fi -if test "x$pkg_extlib" != "xno" -a "x$pkg_curses" != "xno"; then - subdirs="$subdirs virt-top" -fi -if test "x$pkg_extlib" != "xno" \ - -a "x$pkg_xml_light" != "xno" \ - -a "x$pkg_bitmatch" != "xno"; then - subdirs="$subdirs virt-df" + +AC_CHECK_OCAML_PKG(lablgtk2) +if test "x$pkg_lablgtk2" != "xyes"; then + AC_MSG_ERROR([Cannot find required OCaml package 'lablgtk2']) fi -AC_SUBST(subdirs) -dnl Check for optional perldoc (for building manual pages). -AC_CHECK_PROG(HAVE_PERLDOC,perldoc,perldoc) +dnl Check for optional OCaml packages. +AC_CHECK_OCAML_PKG(gettext) +AC_CHECK_OCAML_PKG(dbus) + +AC_SUBST(pkg_unix) +AC_SUBST(pkg_lablgtk2) +AC_SUBST(pkg_gettext) +AC_SUBST(pkg_dbus) dnl Check for optional gdk-pixbuf-mlsource (for icons). AC_CHECK_PROG(HAVE_GDK_PIXBUF_MLSOURCE,gdk-pixbuf-mlsource,gdk-pixbuf-mlsource) @@ -261,6 +86,7 @@ dnl Check for recommended ocaml-gettext tool. AC_CHECK_PROG(OCAML_GETTEXT,ocaml-gettext,ocaml-gettext) dnl Check for optional NSIS (for building a Windows installer). +dnl XXX This probably needs some attention XXX AC_ARG_WITH([nsis], [AS_HELP_STRING([--with-nsis], [use NSIS to build a Windows installer])], @@ -351,7 +177,7 @@ AC_SUBST(GTK_PATH) dnl Write gettext modules for the programs. dnl http://www.le-gall.net/sylvain+violaine/documentation/ocaml-gettext/html/reference-manual/ch03s04.html -for d in mlvirsh virt-ctrl virt-df virt-top; do +for d in virt-ctrl; do f=`echo $d | tr - _`_gettext.ml AC_MSG_NOTICE([creating $d/$f]) rm -f $d/$f @@ -388,22 +214,14 @@ done dnl Summary. echo "------------------------------------------------------------" echo "Thanks for downloading" $PACKAGE_STRING -echo " subpackages to build : $subdirs" echo "------------------------------------------------------------" dnl Produce output files. AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([META - libvirt/libvirt_version.ml - Makefile +AC_CONFIG_FILES([Makefile Make.rules po/Makefile - libvirt/Makefile - examples/Makefile - mlvirsh/Makefile virt-ctrl/Makefile - virt-top/Makefile - virt-df/Makefile ]) if test "x$MAKENSIS" != "x"; then AC_CONFIG_FILES([wininstaller.nsis])