+dnl OCaml compiler.
+AC_PROG_OCAML
+if test "$OCAMLC" = "no"; then
+ AC_MSG_ERROR([You must install the OCaml compiler])
+fi
+
+AM_CONDITIONAL([HAVE_OCAMLOPT], [test "x$OCAMLOPT" != "xno"])
+
+dnl Camlp4 is required.
+AC_PROG_CAMLP4
+if test "x$CAMLP4" = "xno"; then
+ AC_MSG_ERROR([You must install camlp4 (the OCaml macro preprocessor)])
+fi
+
+dnl OCaml findlib ("ocamlfind") is required.
+AC_PROG_FINDLIB
+if test "x$OCAMLFIND" = "xno"; then
+ AC_MSG_ERROR([You must install OCaml findlib (the ocamlfind command)])
+fi
+
+dnl OCaml calendar library is required.
+AC_CHECK_OCAML_PKG(calendar)
+if test "x$OCAML_PKG_calendar" = "xno"; then
+ AC_MSG_ERROR([You must install OCaml calendar library version 2])
+fi
+
+dnl OCaml ocamlnet RPC library + dependencies (version 3) is required.
+AC_CHECK_OCAML_PKG(rpc)
+if test "x$OCAML_PKG_rpc" = "x"; then
+ AC_MSG_ERROR([You must install OCaml ocamlnet library version 3])
+fi
+
+AC_CHECK_PROG(OCAMLRPCGEN,ocamlrpcgen,ocamlrpcgen)
+if test "x$OCAMLRPCGEN" = "x"; then
+ AC_MSG_ERROR([You must install the ocamlrpcgen program])
+fi
+
+dnl Check for POD (for manual pages).
+AC_CHECK_PROG(PERLDOC,perldoc,perldoc)
+if test "x$PERLDOC" = "x"; then
+ AC_MSG_ERROR([You must install the perldoc program])
+fi
+
+dnl Check for mailx (for sending email).
+AC_CHECK_PROG(MAILX,mailx,mailx)
+if test "x$MAILX" = "x"; then
+ AC_MSG_ERROR([You must install the mailx program])
+fi