boot: Allow template to specify custom libvirt XML.
[mclu.git] / configure.ac
1 # mclu: Mini Cloud
2 # Copyright (C) 2014-2015 Red Hat Inc.
3 #
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.
8 #
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.
13 #
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.
17
18 AC_INIT([mclu],[2.0])
19 AM_INIT_AUTOMAKE([foreign])
20
21 AC_CONFIG_MACRO_DIR([m4])
22
23 dnl Check for basic C environment.
24 AC_PROG_CC_STDC
25 AM_PROG_CC_C_O
26 AC_PROG_CPP
27
28 AC_C_PROTOTYPES
29 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
30
31 AC_PROG_INSTALL
32
33 dnl Define GNU_SOURCE etc.
34 AC_USE_SYSTEM_EXTENSIONS
35
36 dnl Need libtool for creating the shared library.
37 AC_PROG_LIBTOOL
38
39 dnl Check for OCaml.
40 AC_PROG_OCAML
41 AS_IF([test "x$OCAMLOPT" = "xno"],[
42     AC_MSG_ERROR([OCaml native compiler is required])
43 ])
44 AC_PROG_FINDLIB
45 AS_IF([test "x$OCAMLFIND" = "xno"],[
46     AC_MSG_ERROR([ocamlfind (findlib) is required])
47 ])
48
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])
53 ])
54
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])
58 ])
59
60 AM_CONDITIONAL([HAVE_OCAMLOPT], [test "x$OCAMLOPT" != "xno"])
61
62 dnl virt-builder (optional).
63 AC_PATH_PROG([VIRT_BUILDER],[virt-builder],[no])
64
65 dnl virt-viewer (optional).
66 AC_PATH_PROG([VIRT_VIEWER],[virt-viewer],[no])
67
68 dnl Wake-on-LAN client (optional).
69 AC_PATH_PROG([WOL],[wol],[no])
70
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.])
75 fi
76
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])
82
83 AC_OUTPUT