2 # Copyright (C) 2007-2015 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.6.1.4)
22 dnl Check for basic C environment.
28 test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
32 dnl Select some C flags based on the host type.
36 WARNINGS="-Wall -Werror"
41 WARNINGS="$WARNINGS -Wno-unused"
50 dnl Check for libvirt development environment.
52 AC_HELP_STRING([--with-libvirt=PATH],[Set path to installed libvirt]),
53 [if test "x$withval" != "x"; then
54 CFLAGS="$CFLAGS -I$withval/include"
55 LDFLAGS="$LDFLAGS -L$withval/lib"
58 AC_CHECK_LIB(virt,virConnectOpen,
60 AC_MSG_ERROR([You must install libvirt library]))
61 AC_CHECK_HEADER([libvirt/libvirt.h],
63 AC_MSG_ERROR([You must install libvirt development package]))
65 dnl We also use <libvirt/virterror.h>
66 AC_CHECK_HEADER([libvirt/virterror.h],
68 AC_MSG_ERROR([You must install libvirt development package]))
70 dnl Check for basic OCaml environment & findlib.
74 if test "x$OCAMLFIND" = "x"; then
75 AC_MSG_ERROR([OCaml findlib is required])
78 dnl Use ocamlfind to find the required packages ...
80 dnl Check for required OCaml packages.
81 AC_CHECK_OCAML_PKG(unix)
82 if test "x$pkg_unix" != "xyes"; then
83 AC_MSG_ERROR([Cannot find required OCaml package 'unix'])
87 echo "------------------------------------------------------------"
88 echo "Thanks for downloading" $PACKAGE_STRING
89 echo "------------------------------------------------------------"
91 dnl Produce output files.
92 AC_CONFIG_HEADERS([config.h])
94 libvirt/libvirt_version.ml