3ba89585bf496f998f739eceddcf24fd5033bc04
[mclu.git] / configure.ac
1 # mclu (mini cluster)
2 # Copyright (C) 2014 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],1.0)
19 AM_INIT_AUTOMAKE([foreign])
20 AC_CONFIG_MACRO_DIR([m4])
21
22 dnl Python 2.x (required).
23 AC_PATH_PROG([PYTHON],[python])
24 if test "x$PYTHON" = "xno"; then
25     AC_MSG_ERROR([Python 2.x is required])
26 fi
27
28 AC_MSG_CHECKING([Python version])
29 PYTHON_VERSION_MAJOR=`$PYTHON -c "import sys; print (sys.version_info@<:@0@:>@)"`
30 PYTHON_VERSION_MINOR=`$PYTHON -c "import sys; print (sys.version_info@<:@1@:>@)"`
31 AC_MSG_RESULT([$PYTHON_VERSION_MAJOR.$PYTHON_VERSION_MINOR])
32
33 if test $PYTHON_VERSION_MAJOR -ne 2; then
34     AC_MSG_ERROR([Python version 2 is required, found $PYTHON_VERSION_MAJOR])
35 fi
36
37 dnl SSH client (required).
38 AC_PATH_PROG([SSH],[ssh],[no])
39 if test "x$SSH" = "xno"; then
40     AC_MSG_ERROR([SSH client is required])
41 fi
42
43 dnl Wake-on-LAN client (optional).
44 AC_PATH_PROG([WOL],[wol],[no])
45
46 dnl virt-builder (optional).
47 AC_PATH_PROG([VIRT_BUILDER],[virt-builder],[no])
48
49 dnl virt-viewer (optional).
50 AC_PATH_PROG([VIRT_VIEWER],[virt-viewer],[no])
51
52 AC_CONFIG_FILES([run], [chmod +x,-w run])
53 AC_CONFIG_FILES([Makefile config.py mclu mclu.spec])
54 AC_OUTPUT