From e86f4987469c26213c6693b35cde3b48a4732524 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] *** THIS REPO IS JUST FOR VIRT-TOP NOW *** - See http://hg.et.redhat.com/applications/virt/ for bindings and the other applications. --- Makefile.in | 75 +------------- README | 246 ++------------------------------------------- TODO.libvirt | 1 - config.h.in | 200 ------------------------------------- configure.ac | 277 ++++++++------------------------------------------- examples/.depend | 4 - libvirt/.depend | 4 - mlvirsh/.depend | 2 - virt-ctrl/.depend | 28 ------ virt-df/.depend | 31 ------ virt-top/.depend | 22 ++-- virt-top/Makefile.in | 11 +- 12 files changed, 66 insertions(+), 835 deletions(-) delete mode 100755 TODO.libvirt delete mode 100644 examples/.depend delete mode 100644 libvirt/.depend delete mode 100644 mlvirsh/.depend delete mode 100644 virt-ctrl/.depend delete mode 100644 virt-df/.depend diff --git a/Makefile.in b/Makefile.in index 52776e0..83fc0cb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# ocaml-libvirt +# virt-top # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones # # This library is free software; you can redistribute it and/or @@ -22,10 +22,7 @@ INSTALL = @INSTALL@ MAKENSIS = @MAKENSIS@ -OCAMLDOC = @OCAMLDOC@ -OCAMLDOCFLAGS := -html -sort - -SUBDIRS = @subdirs@ +SUBDIRS = virt-top all opt depend install: for d in $(SUBDIRS); do \ @@ -37,36 +34,13 @@ clean: for d in . $(SUBDIRS); do \ (cd $$d; rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a *.so *.opt *~ *.dll *.exe core); \ done - rm -f examples/list_domains - rm -f examples/node_info - rm -f mlvirsh/mlvirsh - rm -f virt-ctrl/virt-ctrl rm -f virt-top/virt-top - rm -f virt-df/virt-df distclean: clean rm -f config.h config.log config.status configure rm -rf autom4te.cache - rm -f META - rm -f libvirt/libvirt_version.ml rm -f Makefile - rm -f libvirt/Makefile - rm -f examples/Makefile - rm -f mlvirsh/Makefile - rm -f virt-ctrl/Makefile 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). @@ -82,14 +56,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 +75,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..fc20808 100644 --- a/README +++ b/README @@ -1,147 +1,17 @@ -ocaml-libvirt +virt-top ---------------------------------------------------------------------- Copyright (C) 2007-2008 Richard W.M. Jones, Red Hat Inc. +http://et.redhat.com/~rjones/virt-top/ http://libvirt.org/ocaml/ http://libvirt.org/ -This is a complete set of OCaml bindings around libvirt, exposing all -known functionality to OCaml programs. +virt-top is a top-like utility for showing stats of virtualized +domains. Many keys and command line options are the same as for +ordinary top. - -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 +It uses libvirt so it capable of showing stats across a variety of +different virtualization systems. Building @@ -149,103 +19,7 @@ Building ./configure # Checks that you have all the required bits. - make all # Builds the bytecode version of libs/programs. - make opt # Builds the native code version of libs/programs. - - 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 - - -Windows ----------------------------------------------------------------------- - -I have built libvirt (the bindings), examples, mlvirsh and virt-ctrl -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. - -You should make sure that your $PATH (environment variable) contains -the names of the directories containing all required DLLs, in -particular you will require: - - libvirt-*.dll (from libvirt) - libgnutls-*.dll (from GnuTLS) - libgcrypt-*.dll - libgpg-error-*.dll - libtasn1-*.dll - libxdr.dll (from libxdr) - libxml2-*.dll (from libxml2) - and, a multitude of DLLs from GTK if you want to run virt-ctrl - -You can use a tool such as Dependency Walker to find/check the -locations of dependent libraries. - -To build the Windows installer, you will need NSIS. Then do: - - ./configure --with-nsis=/c/Progra~1/NSIS - make all opt - make wininstaller - -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 ----------------------------------------------------------------------- + make all # Builds the bytecode version of the program. + make opt # Builds the native code version of the program. -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. +Then have a look at the program 'virt-top/virt-top.opt'. diff --git a/TODO.libvirt b/TODO.libvirt deleted file mode 100755 index d87b8b8..0000000 --- a/TODO.libvirt +++ /dev/null @@ -1 +0,0 @@ -Turn VIR_ERR_NO_DOMAIN and NO_NETWORK errors into Not_found exceptions. 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..14314f3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# ocaml-libvirt +# virt-top # Copyright (C) 2007-2008 Red Hat Inc., Richard W.M. Jones # # This library is free software; you can redistribute it and/or @@ -17,250 +17,67 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(ocaml-libvirt,0.4.1.1) - -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, - AC_HELP_STRING([--with-icons=PATH], - [Set path to installed icons @<:@default=/usr/share/icons@:>@]), - [],[with_icons=/usr/share/icons]) -icons="" -if test "x$with_icons" != "xno"; then - for size in 16 24 32 48; do - for f in devices/computer.png; do - fname="${with_icons}/gnome/${size}x${size}/${f}" - AC_MSG_CHECKING([checking for icon $fname]) - if test -f "$fname"; then - AC_MSG_RESULT([yes]) - icons="$size $f $fname $icons" - else - AC_MSG_RESULT([no]) - fi - done - done -fi -AC_SUBST(with_icons) -AC_SUBST(icons) +AC_INIT(virt-top,1.0.0) 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 +if test "x$OCAMLFIND" = "x"; then + AC_MSG_ERROR([OCaml findlib is required]) +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 ... +dnl Use ocamlfind to find the required packages ... - 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 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 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]) +AC_CHECK_OCAML_PKG(extlib) +if test "x$pkg_extlib" != "xyes"; then + AC_MSG_ERROR([Cannot find required OCaml package 'extlib']) 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" + +AC_CHECK_OCAML_PKG(curses) +if test "x$pkg_curses" != "xyes"; then + AC_MSG_ERROR([Cannot find required OCaml package 'curses']) fi -if test "x$pkg_extlib" != "xno" \ - -a "x$pkg_xml_light" != "xno" \ - -a "x$pkg_bitmatch" != "xno"; then - subdirs="$subdirs virt-df" + +dnl Check for optional OCaml packages. +AC_CHECK_OCAML_PKG(gettext) +AC_CHECK_OCAML_PKG(xml-light) +AC_CHECK_OCAML_PKG(csv) + +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(subdirs) + +AC_SUBST(pkg_unix) +AC_SUBST(pkg_extlib) +AC_SUBST(pkg_curses) +AC_SUBST(pkg_gettext) +AC_SUBST(pkg_xml_light) +AC_SUBST(pkg_csv) +AC_SUBST(pkg_calendar) +AC_SUBST(pkg_calendar2) dnl Check for optional perldoc (for building manual pages). AC_CHECK_PROG(HAVE_PERLDOC,perldoc,perldoc) -dnl Check for optional gdk-pixbuf-mlsource (for icons). -AC_CHECK_PROG(HAVE_GDK_PIXBUF_MLSOURCE,gdk-pixbuf-mlsource,gdk-pixbuf-mlsource) - 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 NSIS support is probably broken at the moment XXX AC_ARG_WITH([nsis], [AS_HELP_STRING([--with-nsis], [use NSIS to build a Windows installer])], @@ -351,7 +168,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-top; do f=`echo $d | tr - _`_gettext.ml AC_MSG_NOTICE([creating $d/$f]) rm -f $d/$f @@ -388,22 +205,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]) diff --git a/examples/.depend b/examples/.depend deleted file mode 100644 index 334ba5d..0000000 --- a/examples/.depend +++ /dev/null @@ -1,4 +0,0 @@ -list_domains.cmo: ../libvirt/libvirt.cmi -list_domains.cmx: ../libvirt/libvirt.cmx -node_info.cmo: ../libvirt/libvirt.cmi -node_info.cmx: ../libvirt/libvirt.cmx diff --git a/libvirt/.depend b/libvirt/.depend deleted file mode 100644 index 5556d96..0000000 --- a/libvirt/.depend +++ /dev/null @@ -1,4 +0,0 @@ -libvirt.cmo: libvirt.cmi -libvirt.cmx: libvirt.cmi -libvirt_version.cmo: libvirt_version.cmi -libvirt_version.cmx: libvirt_version.cmi diff --git a/mlvirsh/.depend b/mlvirsh/.depend deleted file mode 100644 index 7dbe514..0000000 --- a/mlvirsh/.depend +++ /dev/null @@ -1,2 +0,0 @@ -mlvirsh.cmo: mlvirsh_gettext.cmo ../libvirt/libvirt.cmi -mlvirsh.cmx: mlvirsh_gettext.cmx ../libvirt/libvirt.cmx diff --git a/virt-ctrl/.depend b/virt-ctrl/.depend deleted file mode 100644 index 84ba14c..0000000 --- a/virt-ctrl/.depend +++ /dev/null @@ -1,28 +0,0 @@ -vc_connections.cmi: ../libvirt/libvirt.cmi -vc_domain_ops.cmi: vc_connections.cmi -vc_helpers.cmi: ../libvirt/libvirt.cmi -vc_mainwindow.cmi: vc_domain_ops.cmi -vc_connection_dlg.cmo: virt_ctrl_gettext.cmo vc_connections.cmi \ - vc_connection_dlg.cmi -vc_connection_dlg.cmx: virt_ctrl_gettext.cmx vc_connections.cmx \ - vc_connection_dlg.cmi -vc_connections.cmo: virt_ctrl_gettext.cmo vc_helpers.cmi \ - ../libvirt/libvirt.cmi vc_connections.cmi -vc_connections.cmx: virt_ctrl_gettext.cmx vc_helpers.cmx \ - ../libvirt/libvirt.cmx vc_connections.cmi -vc_dbus.cmo: virt_ctrl_gettext.cmo vc_connection_dlg.cmi vc_dbus.cmi -vc_dbus.cmx: virt_ctrl_gettext.cmx vc_connection_dlg.cmx vc_dbus.cmi -vc_domain_ops.cmo: virt_ctrl_gettext.cmo vc_connections.cmi \ - ../libvirt/libvirt.cmi vc_domain_ops.cmi -vc_domain_ops.cmx: virt_ctrl_gettext.cmx vc_connections.cmx \ - ../libvirt/libvirt.cmx vc_domain_ops.cmi -vc_helpers.cmo: virt_ctrl_gettext.cmo ../libvirt/libvirt.cmi vc_helpers.cmi -vc_helpers.cmx: virt_ctrl_gettext.cmx ../libvirt/libvirt.cmx vc_helpers.cmi -vc_icons.cmo: vc_connection_dlg.cmi -vc_icons.cmx: vc_connection_dlg.cmx -vc_mainwindow.cmo: virt_ctrl_gettext.cmo vc_connections.cmi \ - vc_connection_dlg.cmi ../libvirt/libvirt.cmi vc_mainwindow.cmi -vc_mainwindow.cmx: virt_ctrl_gettext.cmx vc_connections.cmx \ - vc_connection_dlg.cmx ../libvirt/libvirt.cmx vc_mainwindow.cmi -virt_ctrl.cmo: virt_ctrl_gettext.cmo vc_mainwindow.cmi vc_domain_ops.cmi -virt_ctrl.cmx: virt_ctrl_gettext.cmx vc_mainwindow.cmx vc_domain_ops.cmx diff --git a/virt-df/.depend b/virt-df/.depend deleted file mode 100644 index e7cd81e..0000000 --- a/virt-df/.depend +++ /dev/null @@ -1,31 +0,0 @@ -virt_df_lvm2_parser.cmi: virt_df_lvm2_metadata.cmi -virt_df_ext2.cmo: virt_df_gettext.cmo virt_df.cmi \ - /usr/lib64/ocaml/bitmatch/bitmatch.cmi virt_df_ext2.cmi -virt_df_ext2.cmx: virt_df_gettext.cmx virt_df.cmx \ - /usr/lib64/ocaml/bitmatch/bitmatch.cmi virt_df_ext2.cmi -virt_df_linux_swap.cmo: virt_df_gettext.cmo virt_df.cmi \ - /usr/lib64/ocaml/bitmatch/bitmatch.cmi virt_df_linux_swap.cmi -virt_df_linux_swap.cmx: virt_df_gettext.cmx virt_df.cmx \ - /usr/lib64/ocaml/bitmatch/bitmatch.cmi virt_df_linux_swap.cmi -virt_df_lvm2_lexer.cmo: virt_df_lvm2_parser.cmi virt_df.cmi -virt_df_lvm2_lexer.cmx: virt_df_lvm2_parser.cmx virt_df.cmx -virt_df_lvm2_metadata.cmo: virt_df_lvm2_metadata.cmi -virt_df_lvm2_metadata.cmx: virt_df_lvm2_metadata.cmi -virt_df_lvm2.cmo: virt_df_lvm2_metadata.cmi virt_df_lvm2_lexer.cmo \ - virt_df_gettext.cmo virt_df.cmi /usr/lib64/ocaml/bitmatch/bitmatch.cmi \ - virt_df_lvm2.cmi -virt_df_lvm2.cmx: virt_df_lvm2_metadata.cmx virt_df_lvm2_lexer.cmx \ - virt_df_gettext.cmx virt_df.cmx /usr/lib64/ocaml/bitmatch/bitmatch.cmi \ - virt_df_lvm2.cmi -virt_df_lvm2_parser.cmo: virt_df_lvm2_metadata.cmi virt_df_lvm2_parser.cmi -virt_df_lvm2_parser.cmx: virt_df_lvm2_metadata.cmx virt_df_lvm2_parser.cmi -virt_df_main.cmo: virt_df_gettext.cmo virt_df.cmi \ - ../libvirt/libvirt_version.cmi ../libvirt/libvirt.cmi -virt_df_main.cmx: virt_df_gettext.cmx virt_df.cmx \ - ../libvirt/libvirt_version.cmx ../libvirt/libvirt.cmx -virt_df_mbr.cmo: virt_df_gettext.cmo virt_df.cmi \ - /usr/lib64/ocaml/bitmatch/bitmatch.cmi virt_df_mbr.cmi -virt_df_mbr.cmx: virt_df_gettext.cmx virt_df.cmx \ - /usr/lib64/ocaml/bitmatch/bitmatch.cmi virt_df_mbr.cmi -virt_df.cmo: virt_df_gettext.cmo virt_df.cmi -virt_df.cmx: virt_df_gettext.cmx virt_df.cmi diff --git a/virt-top/.depend b/virt-top/.depend index 3a2985d..15e5c48 100644 --- a/virt-top/.depend +++ b/virt-top/.depend @@ -1,20 +1,14 @@ -virt_top.cmi: ../libvirt/libvirt.cmi -virt_top_utils.cmi: ../libvirt/libvirt.cmi virt_top_calendar1.cmo: virt_top_gettext.cmo virt_top.cmi virt_top_calendar1.cmx: virt_top_gettext.cmx virt_top.cmx virt_top_calendar2.cmo: virt_top_gettext.cmo virt_top.cmi virt_top_calendar2.cmx: virt_top_gettext.cmx virt_top.cmx virt_top_csv.cmo: virt_top_gettext.cmo virt_top.cmi virt_top_csv.cmx: virt_top_gettext.cmx virt_top.cmx -virt_top_main.cmo: virt_top_gettext.cmo virt_top.cmi ../libvirt/libvirt.cmi -virt_top_main.cmx: virt_top_gettext.cmx virt_top.cmx ../libvirt/libvirt.cmx -virt_top.cmo: virt_top_utils.cmi virt_top_gettext.cmo \ - ../libvirt/libvirt_version.cmi ../libvirt/libvirt.cmi virt_top.cmi -virt_top.cmx: virt_top_utils.cmx virt_top_gettext.cmx \ - ../libvirt/libvirt_version.cmx ../libvirt/libvirt.cmx virt_top.cmi -virt_top_utils.cmo: virt_top_gettext.cmo ../libvirt/libvirt.cmi \ - virt_top_utils.cmi -virt_top_utils.cmx: virt_top_gettext.cmx ../libvirt/libvirt.cmx \ - virt_top_utils.cmi -virt_top_xml.cmo: virt_top_gettext.cmo virt_top.cmi ../libvirt/libvirt.cmi -virt_top_xml.cmx: virt_top_gettext.cmx virt_top.cmx ../libvirt/libvirt.cmx +virt_top_main.cmo: virt_top_gettext.cmo virt_top.cmi +virt_top_main.cmx: virt_top_gettext.cmx virt_top.cmx +virt_top.cmo: virt_top_utils.cmi virt_top_gettext.cmo virt_top.cmi +virt_top.cmx: virt_top_utils.cmx virt_top_gettext.cmx virt_top.cmi +virt_top_utils.cmo: virt_top_gettext.cmo virt_top_utils.cmi +virt_top_utils.cmx: virt_top_gettext.cmx virt_top_utils.cmi +virt_top_xml.cmo: virt_top_gettext.cmo virt_top.cmi +virt_top_xml.cmx: virt_top_gettext.cmx virt_top.cmx diff --git a/virt-top/Makefile.in b/virt-top/Makefile.in index 390fc1b..e471f93 100755 --- a/virt-top/Makefile.in +++ b/virt-top/Makefile.in @@ -32,7 +32,7 @@ pkg_calendar = @pkg_calendar@ pkg_calendar2 = @pkg_calendar2@ pkg_gettext = @pkg_gettext@ -OCAMLCPACKAGES := -package unix,extlib,curses,str +OCAMLCPACKAGES := -package unix,extlib,curses,str,libvirt ifeq ($(pkg_gettext),yes) OCAMLCPACKAGES += -package gettext-stub @@ -59,7 +59,6 @@ OBJS += virt_top_main.cmo XOBJS := $(OBJS:.cmo=.cmx) -OCAMLCPACKAGES += -I ../libvirt OCAMLCFLAGS := -g -w s OCAMLCLIBS := -linkpkg @@ -67,9 +66,6 @@ OCAMLOPTPACKAGES := $(OCAMLCPACKAGES) OCAMLOPTFLAGS := -w s OCAMLOPTLIBS := $(OCAMLCLIBS) -export LIBRARY_PATH=../libvirt -export LD_LIBRARY_PATH=../libvirt - BYTE_TARGETS := virt-top OPT_TARGETS := virt-top.opt @@ -82,13 +78,12 @@ all: $(BYTE_TARGETS) opt: $(OPT_TARGETS) virt-top: $(OBJS) - ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \ - ../libvirt/mllibvirt.cma -o $@ $^ + ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) -o $@ $^ virt-top.opt: $(XOBJS) ocamlfind ocamlopt \ $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \ - ../libvirt/mllibvirt.cmxa -cclib -lncurses -o $@ $^ + -cclib -lncurses -o $@ $^ # Manual page. ifeq ($(HAVE_PERLDOC),perldoc) -- 1.8.3.1