X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=configure.ac;h=aa2d694342894763f6bb8000a5c37062270517c8;hb=737ffdb932c89d8ec0b2c3d9731ca325da9d84f3;hp=3ba89585bf496f998f739eceddcf24fd5033bc04;hpb=8f509fea52826d18df504f18ad0e702f54320f48;p=mclu.git diff --git a/configure.ac b/configure.ac index 3ba8958..aa2d694 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ -# mclu (mini cluster) -# Copyright (C) 2014 Red Hat Inc. +# mclu: Mini Cloud +# Copyright (C) 2014-2015 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,33 +15,49 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -AC_INIT([mclu],1.0) +AC_INIT([mclu],[2.0]) AM_INIT_AUTOMAKE([foreign]) + AC_CONFIG_MACRO_DIR([m4]) -dnl Python 2.x (required). -AC_PATH_PROG([PYTHON],[python]) -if test "x$PYTHON" = "xno"; then - AC_MSG_ERROR([Python 2.x is required]) -fi +dnl Check for basic C environment. +AC_PROG_CC_STDC +AM_PROG_CC_C_O +AC_PROG_CPP -AC_MSG_CHECKING([Python version]) -PYTHON_VERSION_MAJOR=`$PYTHON -c "import sys; print (sys.version_info@<:@0@:>@)"` -PYTHON_VERSION_MINOR=`$PYTHON -c "import sys; print (sys.version_info@<:@1@:>@)"` -AC_MSG_RESULT([$PYTHON_VERSION_MAJOR.$PYTHON_VERSION_MINOR]) +AC_C_PROTOTYPES +test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant]) -if test $PYTHON_VERSION_MAJOR -ne 2; then - AC_MSG_ERROR([Python version 2 is required, found $PYTHON_VERSION_MAJOR]) -fi +AC_PROG_INSTALL -dnl SSH client (required). -AC_PATH_PROG([SSH],[ssh],[no]) -if test "x$SSH" = "xno"; then - AC_MSG_ERROR([SSH client is required]) -fi +dnl Define GNU_SOURCE etc. +AC_USE_SYSTEM_EXTENSIONS -dnl Wake-on-LAN client (optional). -AC_PATH_PROG([WOL],[wol],[no]) +dnl Need libtool for creating the shared library. +AC_PROG_LIBTOOL + +dnl Check for OCaml. +AC_PROG_OCAML +AS_IF([test "x$OCAMLOPT" = "xno"],[ + AC_MSG_ERROR([OCaml native compiler is required]) +]) +AC_PROG_FINDLIB +AS_IF([test "x$OCAMLFIND" = "xno"],[ + AC_MSG_ERROR([ocamlfind (findlib) is required]) +]) + +dnl OCaml packages (all required). +AC_CHECK_OCAML_PKG(pcre) +AS_IF([test "x$OCAML_PKG_pcre" = "xno"],[ + AC_MSG_ERROR([OCaml library 'pcre' is required]) +]) + +AC_CHECK_OCAML_PKG(libvirt) +AS_IF([test "x$OCAML_PKG_libvirt" = "xno"],[ + AC_MSG_ERROR([OCaml library 'ocaml-libvirt' is required]) +]) + +AM_CONDITIONAL([HAVE_OCAMLOPT], [test "x$OCAMLOPT" != "xno"]) dnl virt-builder (optional). AC_PATH_PROG([VIRT_BUILDER],[virt-builder],[no]) @@ -49,6 +65,19 @@ AC_PATH_PROG([VIRT_BUILDER],[virt-builder],[no]) dnl virt-viewer (optional). AC_PATH_PROG([VIRT_VIEWER],[virt-viewer],[no]) +dnl Wake-on-LAN client (optional). +AC_PATH_PROG([WOL],[wol],[no]) + +dnl Check for pod2man (from Perl, for the manual). +AC_CHECK_PROG([POD2MAN], [pod2man], [pod2man], [no]) +if test "x$POD2MAN" = "xno"; then + AC_MSG_ERROR([pod2man was not found. This is needed to build man pages.]) +fi + +dnl Produce output files. +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([Makefile config.ml]) +AC_CONFIG_FILES([link.sh], [chmod +x,-w link.sh]) AC_CONFIG_FILES([run], [chmod +x,-w run]) -AC_CONFIG_FILES([Makefile config.py mclu mclu.spec]) + AC_OUTPUT