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.3.3.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])
57 dnl Check for optional ncurses.
58 AC_CHECK_LIB(ncurses,initscr)
60 dnl Check for basic OCaml environment & findlib.
64 dnl Check for required OCaml packages.
65 AC_CHECK_OCAML_PKG(unix)
66 if test "x$pkg_unix" != "xyes"; then
67 AC_MSG_ERROR([Cannot find required OCaml package 'unix'])
69 AC_CHECK_OCAML_PKG(extlib)
70 if test "x$pkg_extlib" != "xyes"; then
71 AC_MSG_ERROR([Cannot find required OCaml package 'extlib'])
74 dnl Check for optional OCaml packages.
75 AC_CHECK_OCAML_PKG(lablgtk2)
76 AC_CHECK_OCAML_PKG(curses)
77 AC_CHECK_OCAML_PKG(gettext)
78 AC_CHECK_OCAML_PKG(xml-light)
79 AC_CHECK_OCAML_PKG(csv)
81 AC_SUBST(pkg_lablgtk2)
84 AC_SUBST(pkg_xml_light)
87 dnl Check for optional perldoc (for building manual pages).
88 AC_CHECK_PROG(HAVE_PERLDOC,perldoc,perldoc)
91 echo "------------------------------------------------------------"
92 echo "Thanks for downloading" $PACKAGE_STRING
93 echo " OCaml libvirt bindings . yes"
94 echo " example programs . . . . yes"
95 echo " mlvirsh . . . . . . . . yes"
96 echo -n " mlvirtmanager . . . . . "
97 if test "x$pkg_lablgtk2" = "xyes"; then
100 echo "no (needs optional lablgtk2)"
102 echo -n " virt-top . . . . . . . "
103 if test "x$pkg_curses" = "xyes"; then
106 echo "no (needs optional ocaml-curses)"
108 echo -n " virt-df . . . . . . . "
109 if test "x$pkg_xml_light" = "xyes"; then
112 echo "no (needs optional xml-light)"
114 echo "------------------------------------------------------------"
116 dnl Produce output files.
117 AC_CONFIG_HEADERS([config.h])
118 AC_CONFIG_FILES([META
119 libvirt/libvirt_version.ml
124 mlvirtmanager/Makefile