Add TODO list.
[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 Define the host CPU architecture (defines host_cpu).
37 AC_CANONICAL_HOST
38
39 dnl Need libtool for creating the shared library.
40 AC_PROG_LIBTOOL
41
42 dnl Check for OCaml.
43 AC_PROG_OCAML
44 AS_IF([test "x$OCAMLOPT" = "xno"],[
45     AC_MSG_ERROR([OCaml native compiler is required])
46 ])
47 AC_PROG_FINDLIB
48 AS_IF([test "x$OCAMLFIND" = "xno"],[
49     AC_MSG_ERROR([ocamlfind (findlib) is required])
50 ])
51
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])
56 ])
57
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])
61 ])
62
63 AM_CONDITIONAL([HAVE_OCAMLOPT], [test "x$OCAMLOPT" != "xno"])
64
65 dnl virt-builder (optional).
66 AC_PATH_PROG([VIRT_BUILDER],[virt-builder],[no])
67
68 dnl virt-viewer (optional).
69 AC_PATH_PROG([VIRT_VIEWER],[virt-viewer],[no])
70
71 dnl Wake-on-LAN client (optional).
72 AC_PATH_PROG([WOL],[wol],[no])
73
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.])
78 fi
79
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])
85
86 AC_OUTPUT