Use %global instead of %define in spec file (thanks Michael Scherer).
[whenjobs.git] / configure.ac
index f192971..7c99e34 100644 (file)
 # 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([whenjobs],0.0.1)
+AC_INIT([whenjobs],[0.7.1])
 AM_INIT_AUTOMAKE([foreign])
 
+dnl Only used temporarily while whenjobs.spec is contained in the
+dnl tarball.  We will remove this later.
+AC_SUBST([RPM_RELEASE],[1])
+
 AC_CONFIG_MACRO_DIR([m4])
 
 dnl Allow all GNU/Linux functions.
@@ -58,12 +62,62 @@ fi
 dnl Check support for 64 bit file offsets.
 AC_SYS_LARGEFILE
 
-dnl lex and yacc, or hopefully GNU equivalents.
-AC_PROG_LEX
-AC_PROG_YACC
+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
 
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES([Makefile
                  daemon/Makefile
-                 tools/Makefile])
+                 lib/config.ml
+                 lib/Makefile
+                 tests/jobs/Makefile
+                 tests/parsing/Makefile
+                 tools/Makefile
+                 whenjobs.spec])
 AC_OUTPUT