-dnl Wake-on-LAN client (optional).
-AC_PATH_PROG([WOL],[wol],[no])
+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"])