2 # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 dnl Process this file with autoconf to produce a configure script.
20 AC_INIT(ocaml-libvirt,0.4.0.0)
22 dnl Check for basic C environment.
28 test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
32 dnl Check for libvirt development environment.
34 AC_HELP_STRING([--with-libvirt=PATH],[Set path to installed libvirt]),
35 [if test "x$withval" != "x"; then
36 CFLAGS="$CFLAGS -I$withval/include"
37 LDFLAGS="$LDFLAGS -L$withval/lib"
40 AC_CHECK_LIB(virt,virConnectOpen,
42 AC_MSG_ERROR([You must install libvirt library]))
43 AC_CHECK_HEADER([libvirt/libvirt.h],
45 AC_MSG_ERROR([You must install libvirt development package]))
47 dnl Check for libvirt >= 0.2.1 (our minimum supported version).
48 dnl See: http://libvirt.org/hvsupport.html
49 AC_CHECK_FUNC(virConnectGetCapabilities,
51 AC_MSG_ERROR([You must have libvirt >= 0.2.1]))
53 dnl Check for optional libvirt functions added since 0.2.1.
54 dnl See: http://libvirt.org/hvsupport.html
55 AC_CHECK_FUNCS([virConnectGetHostname virConnectGetURI virDomainBlockStats virDomainGetSchedulerParameters virDomainGetSchedulerType virDomainInterfaceStats virDomainMigrate virDomainSetSchedulerParameters virNodeGetFreeMemory virNodeGetCellsFreeMemory])
57 dnl We also use <libvirt/virterror.h>
58 AC_CHECK_HEADER([libvirt/virterror.h],
60 AC_MSG_ERROR([You must install libvirt development package]))
62 dnl Check for optional ncurses.
63 AC_CHECK_LIB(ncurses,initscr)
65 dnl Check for basic OCaml environment & findlib.
68 if test "x$OCAMLFIND" = "x"; then
69 AC_MSG_ERROR([Cannot find required program 'ocamlfind' (part of findlib)])
72 dnl Check for required OCaml packages.
73 AC_CHECK_OCAML_PKG(unix)
74 if test "x$pkg_unix" != "xyes"; then
75 AC_MSG_ERROR([Cannot find required OCaml package 'unix'])
78 dnl Check for optional OCaml packages.
79 AC_CHECK_OCAML_PKG(extlib)
80 AC_CHECK_OCAML_PKG(lablgtk2)
81 AC_CHECK_OCAML_PKG(curses)
82 AC_CHECK_OCAML_PKG(gettext)
83 AC_CHECK_OCAML_PKG(xml-light)
84 AC_CHECK_OCAML_PKG(csv)
85 AC_CHECK_OCAML_PKG(calendar)
87 AC_SUBST(pkg_lablgtk2)
90 AC_SUBST(pkg_xml_light)
92 AC_SUBST(pkg_calendar)
94 dnl Check for optional perldoc (for building manual pages).
95 AC_CHECK_PROG(HAVE_PERLDOC,perldoc,perldoc)
98 echo "------------------------------------------------------------"
99 echo "Thanks for downloading" $PACKAGE_STRING
100 echo " OCaml libvirt bindings . yes"
101 echo " example programs . . . . yes"
102 echo " mlvirsh . . . . . . . . yes"
103 echo -n " mlvirtmanager . . . . . "
104 if test "x$pkg_lablgtk2" = "xyes"; then
107 echo "no (needs optional lablgtk2)"
109 echo -n " virt-top . . . . . . . "
110 if test "x$pkg_curses" = "xyes"; then
113 echo "no (needs optional ocaml-curses)"
115 echo -n " virt-df . . . . . . . "
116 if test "x$pkg_xml_light" = "xyes"; then
119 echo "no (needs optional xml-light)"
121 echo "------------------------------------------------------------"
123 dnl Produce output files.
124 AC_CONFIG_HEADERS([config.h])
125 AC_CONFIG_FILES([META
126 libvirt/libvirt_version.ml
131 mlvirtmanager/Makefile