From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Wed, 16 Apr 2008 13:46:07 +0000 (+0100) Subject: Fixed build. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=2756390750d79836e7b101b41920e3ba288cbc0a;p=virt-df.git Fixed build. --- diff --git a/Makefile.in b/Makefile.in index 52776e0..24bb596 100644 --- a/Makefile.in +++ b/Makefile.in @@ -20,12 +20,7 @@ VERSION = @PACKAGE_VERSION@ INSTALL = @INSTALL@ -MAKENSIS = @MAKENSIS@ - -OCAMLDOC = @OCAMLDOC@ -OCAMLDOCFLAGS := -html -sort - -SUBDIRS = @subdirs@ +SUBDIRS = virt-df all opt depend install: for d in $(SUBDIRS); do \ @@ -37,59 +32,14 @@ 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). - -WININSTALLER := $(PACKAGE)-$(VERSION).exe - -ifneq ($(MAKENSIS),) -wininstaller: $(WININSTALLER) - -$(WININSTALLER): wininstaller.nsis all opt - "$(MAKENSIS)" \ - //DPACKAGE=$(PACKAGE) //DVERSION=$(VERSION) \ - //DOUTFILE=$@ $< - 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 +59,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..75f5d76 100644 --- a/README +++ b/README @@ -1,148 +1,11 @@ -ocaml-libvirt +virt-df ---------------------------------------------------------------------- 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 - +'df' for virtual domains. Building ---------------------------------------------------------------------- @@ -155,97 +18,4 @@ 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 - - -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 ----------------------------------------------------------------------- - -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-df.opt'. 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..8f655f2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# ocaml-libvirt +# virt-df # Copyright (C) 2007-2008 Red Hat Inc., Richard W.M. Jones # # This library is free software; you can redistribute it and/or @@ -17,341 +17,64 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(ocaml-libvirt,0.4.1.1) +AC_INIT(virt-df,2.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, - 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) 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(xml-light) +if test "x$pkg_xml_light" != "xyes"; then + AC_MSG_ERROR([Cannot find required OCaml package 'xml-light']) 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(bitmatch) +if test "x$pkg_bitmatch" != "xyes"; then + AC_MSG_ERROR([Cannot find required OCaml package 'bitmatch']) fi -AC_SUBST(subdirs) + +dnl Check for optional OCaml packages. +AC_CHECK_OCAML_PKG(gettext) + +AC_SUBST(pkg_unix) +AC_SUBST(pkg_extlib) +AC_SUBST(pkg_gettext) +AC_SUBST(pkg_xml_light) +AC_SUBST(pkg_bitmatch) 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). -AC_ARG_WITH([nsis], - [AS_HELP_STRING([--with-nsis], - [use NSIS to build a Windows installer])], - [], - [with_nsis=no]) - -MAKENSIS= -LIBVIRT_DLL_PATH= -LIBXDR_DLL_PATH= -LIBXML2_DLL_PATH= -GNUTLS_DLL_PATH= -GTK_PATH= -GTK_DLL_PATH= - -[ -msys_to_win_dir () { - eval pushd "\$$1" > /dev/null - eval $1=`pwd -W` - popd > /dev/null -} -] - -if test "x$with_nsis" != "xno"; then - AC_PATH_PROG(MAKENSIS,makensis,[],[$with_nsis:$PATH]) - if test "x$MAKENSIS" = "x"; then - AC_MSG_FAILURE([--with-nsis was given, but could not find MAKENSIS.EXE]) - fi - - # MAKENSIS is set so we will build a rule for making a Windows - # installer. To support this, generate wininstaller.nsis. - saved_IFS=$IFS - IFS=$PATH_SEPARATOR - for d in $PATH; do - IFS=$saved_IFS - echo Checking $d for DLLs ... >&5 - if test -f "$d/libvirt-0.dll"; then - LIBVIRT_DLL_PATH="$d" - fi - if test -f "$d/libxdr.dll"; then - LIBXDR_DLL_PATH="$d" - fi - if test -f "$d/libxml2-2.dll"; then - LIBXML2_DLL_PATH="$d" - fi - if test -f "$d/libgpg-error-0.dll"; then - GNUTLS_DLL_PATH="$d" - fi - if test -f "$d/libgtk-win32-2.0-0.dll"; then - GTK_DLL_PATH="$d" - GTK_PATH="$d/.." - fi - done - IFS=$saved_IFS - - if test "x$LIBVIRT_DLL_PATH" = "x"; then - AC_MSG_FAILURE([cannot find libvirt-0.dll in PATH]) - fi - if test "x$LIBXDR_DLL_PATH" = "x"; then - AC_MSG_FAILURE([cannot find libxdr.dll in PATH]) - fi - if test "x$LIBXML2_DLL_PATH" = "x"; then - AC_MSG_FAILURE([cannot find libxml2-2.dll in PATH]) - fi - if test "x$GNUTLS_DLL_PATH" = "x"; then - AC_MSG_FAILURE([cannot find GnuTLS DLLs in PATH]) - fi - if test "x$GTK_DLL_PATH" = "x"; then - AC_MSG_WARN([cannot find GTK DLLs in PATH]) - fi - - # Change the paths to Windows paths. - msys_to_win_dir LIBVIRT_DLL_PATH - msys_to_win_dir LIBXDR_DLL_PATH - msys_to_win_dir LIBXML2_DLL_PATH - msys_to_win_dir GNUTLS_DLL_PATH - if test "x$GTK_DLL_PATH" != "x"; then - msys_to_win_dir GTK_DLL_PATH - msys_to_win_dir GTK_PATH - fi -fi -AC_SUBST(MAKENSIS) -AC_SUBST(LIBVIRT_DLL_PATH) -AC_SUBST(LIBXDR_DLL_PATH) -AC_SUBST(LIBXML2_DLL_PATH) -AC_SUBST(GNUTLS_DLL_PATH) -AC_SUBST(GTK_DLL_PATH) -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-df; do f=`echo $d | tr - _`_gettext.ml AC_MSG_NOTICE([creating $d/$f]) rm -f $d/$f @@ -388,24 +111,13 @@ 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]) -fi AC_OUTPUT diff --git a/virt-df/.depend b/virt-df/.depend index e7cd81e..e7a7f26 100644 --- a/virt-df/.depend +++ b/virt-df/.depend @@ -7,22 +7,16 @@ 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.cmo: virt_df_lvm2_metadata.cmi 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_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_main.cmo: virt_df_gettext.cmo virt_df.cmi +virt_df_main.cmx: virt_df_gettext.cmx virt_df.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 \ diff --git a/virt-df/Makefile.in b/virt-df/Makefile.in index 4fb088c..0cc51a0 100644 --- a/virt-df/Makefile.in +++ b/virt-df/Makefile.in @@ -28,7 +28,7 @@ bindir = @bindir@ pkg_gettext = @pkg_gettext@ #OCAMLCPACKAGES := -package unix,extlib,xml-light,bitmatch -OCAMLCPACKAGES := -package unix,extlib,xml-light -I +bitmatch +OCAMLCPACKAGES := -package unix,extlib,xml-light,libvirt -I +bitmatch ifneq ($(pkg_gettext),no) OCAMLCPACKAGES += -package gettext-stub @@ -50,7 +50,6 @@ XOBJS := $(OBJS:.cmo=.cmx) SYNTAX := -pp "camlp4o -I`ocamlc -where`/bitmatch pa_bitmatch.cmo" -OCAMLCPACKAGES += -I ../libvirt OCAMLCFLAGS := -g -w s $(SYNTAX) #OCAMLCLIBS := -linkpkg OCAMLCLIBS := -linkpkg bitmatch.cma @@ -62,9 +61,6 @@ OCAMLOPTLIBS := -linkpkg bitmatch.cmxa OCAMLDEPFLAGS := $(SYNTAX) -export LIBRARY_PATH=../libvirt -export LD_LIBRARY_PATH=../libvirt - BYTE_TARGETS := virt-df OPT_TARGETS := virt-df.opt @@ -78,15 +74,16 @@ opt: $(OPT_TARGETS) virt-df: $(OBJS) ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \ - ../libvirt/mllibvirt.cma -o $@ $^ + -o $@ $^ virt-df.opt: $(XOBJS) ocamlfind ocamlopt \ $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \ - ../libvirt/mllibvirt.cmxa -o $@ $^ + -o $@ $^ # 'make depend' doesn't catch these dependencies because the .mli file # is auto-generated. +virt_df_lvm2_parser.cmi: virt_df_lvm2_parser.mli virt_df_lvm2_parser.cmo: virt_df_lvm2_parser.mli virt_df_lvm2_parser.cmx: virt_df_lvm2_parser.mli