2 # Copyright (C) 2014-2015 Red Hat Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program 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
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 AM_INIT_AUTOMAKE([foreign])
21 AC_CONFIG_MACRO_DIR([m4])
23 dnl Check for basic C environment.
29 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
33 dnl Define GNU_SOURCE etc.
34 AC_USE_SYSTEM_EXTENSIONS
36 dnl Need libtool for creating the shared library.
41 AS_IF([test "x$OCAMLOPT" = "xno"],[
42 AC_MSG_ERROR([OCaml native compiler is required])
45 AS_IF([test "x$OCAMLFIND" = "xno"],[
46 AC_MSG_ERROR([ocamlfind (findlib) is required])
49 dnl OCaml packages (all required).
50 AC_CHECK_OCAML_PKG(pcre)
51 AS_IF([test "x$OCAML_PKG_pcre" = "xno"],[
52 AC_MSG_ERROR([OCaml library 'pcre' is required])
55 AC_CHECK_OCAML_PKG(libvirt)
56 AS_IF([test "x$OCAML_PKG_libvirt" = "xno"],[
57 AC_MSG_ERROR([OCaml library 'ocaml-libvirt' is required])
60 AM_CONDITIONAL([HAVE_OCAMLOPT], [test "x$OCAMLOPT" != "xno"])
62 dnl virt-builder (optional).
63 AC_PATH_PROG([VIRT_BUILDER],[virt-builder],[no])
65 dnl virt-viewer (optional).
66 AC_PATH_PROG([VIRT_VIEWER],[virt-viewer],[no])
68 dnl Wake-on-LAN client (optional).
69 AC_PATH_PROG([WOL],[wol],[no])
71 dnl Check for pod2man (from Perl, for the manual).
72 AC_CHECK_PROG([POD2MAN], [pod2man], [pod2man], [no])
73 if test "x$POD2MAN" = "xno"; then
74 AC_MSG_ERROR([pod2man was not found. This is needed to build man pages.])
77 dnl Produce output files.
78 AC_CONFIG_HEADERS([config.h])
79 AC_CONFIG_FILES([Makefile config.ml])
80 AC_CONFIG_FILES([link.sh], [chmod +x,-w link.sh])
81 AC_CONFIG_FILES([run], [chmod +x,-w run])