X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=configure.ac;h=4d16153aab748c1cdf3fb4cb5601eb839304715b;hb=837399023dce58f8fdd9a3c6c5e39af087bacceb;hp=de668bcd0168d103dc376820c154fdd547665ea4;hpb=2a55aedad2ca66ede45f62ca0b55b7e6dddc736f;p=mclu.git diff --git a/configure.ac b/configure.ac index de668bc..4d16153 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,41 +15,52 @@ # 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 Ansible client (required). -dnl Actually the ansible command line tool is not used, but we do use -dnl the Python library. XXX Should check for that instead. -AC_PATH_PROG([ANSIBLE],[ansible],[no]) -if test "x$ANSIBLE" = "xno"; then - AC_MSG_ERROR([ansible is required]) -fi +dnl Define the host CPU architecture (defines host_cpu). +AC_CANONICAL_HOST -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]) @@ -57,6 +68,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