Allow an external kernel to be used to boot guests.
[mclu.git] / configure.ac
index 3ba8958..aa2d694 100644 (file)
@@ -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
 # 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