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 Define the host CPU architecture (defines host_cpu).
39 dnl Need libtool for creating the shared library.
44 AS_IF([test "x$OCAMLOPT" = "xno"],[
45 AC_MSG_ERROR([OCaml native compiler is required])
48 AS_IF([test "x$OCAMLFIND" = "xno"],[
49 AC_MSG_ERROR([ocamlfind (findlib) is required])
52 dnl OCaml packages (all required).
53 AC_CHECK_OCAML_PKG(pcre)
54 AS_IF([test "x$OCAML_PKG_pcre" = "xno"],[
55 AC_MSG_ERROR([OCaml library 'pcre' is required])
58 AC_CHECK_OCAML_PKG(libvirt)
59 AS_IF([test "x$OCAML_PKG_libvirt" = "xno"],[
60 AC_MSG_ERROR([OCaml library 'ocaml-libvirt' is required])
63 AM_CONDITIONAL([HAVE_OCAMLOPT], [test "x$OCAMLOPT" != "xno"])
65 dnl virt-builder (optional).
66 AC_PATH_PROG([VIRT_BUILDER],[virt-builder],[no])
68 dnl virt-viewer (optional).
69 AC_PATH_PROG([VIRT_VIEWER],[virt-viewer],[no])
71 dnl Wake-on-LAN client (optional).
72 AC_PATH_PROG([WOL],[wol],[no])
74 dnl Check for pod2man (from Perl, for the manual).
75 AC_CHECK_PROG([POD2MAN], [pod2man], [pod2man], [no])
76 if test "x$POD2MAN" = "xno"; then
77 AC_MSG_ERROR([pod2man was not found. This is needed to build man pages.])
80 dnl Produce output files.
81 AC_CONFIG_HEADERS([config.h])
82 AC_CONFIG_FILES([Makefile config.ml])
83 AC_CONFIG_FILES([link.sh], [chmod +x,-w link.sh])
84 AC_CONFIG_FILES([run], [chmod +x,-w run])