Fix comparisons in 'increases' and 'decreases' functions.
[whenjobs.git] / configure.ac
1 # whenjobs
2 # Copyright (C) 2012 Red Hat Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 AC_INIT([whenjobs],0.0.1)
19 AM_INIT_AUTOMAKE([foreign])
20
21 AC_CONFIG_MACRO_DIR([m4])
22
23 dnl Allow all GNU/Linux functions.
24 dnl autoconf complains unless this is very early in the file.
25 AC_USE_SYSTEM_EXTENSIONS
26
27 AC_PROG_LIBTOOL
28
29 dnl Check for basic C environment.
30 AC_PROG_CC_STDC
31 AC_PROG_INSTALL
32 AC_PROG_CPP
33
34 AC_C_PROTOTYPES
35 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
36
37 AM_PROG_CC_C_O
38
39 AC_ARG_ENABLE([gcc-warnings],
40     [AS_HELP_STRING([--enable-gcc-warnings],
41                     [turn on lots of GCC warnings (for developers)])],
42     [case $enableval in
43        yes|no) ;;
44        *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
45      esac
46      gcc_warnings=$enableval],
47     [gcc_warnings=no]
48 )
49
50 if test "$gcc_warnings" = yes; then
51     # XXX With gnulib we can improve this in future.
52     WARN_CFLAGS="-Wall"
53     AC_SUBST([WARN_CFLAGS])
54     WERROR_CFLAGS="-Werror"
55     AC_SUBST([WERROR_CFLAGS])
56 fi
57
58 dnl Check support for 64 bit file offsets.
59 AC_SYS_LARGEFILE
60
61 dnl OCaml compiler.
62 AC_PROG_OCAML
63 if test "$OCAMLC" = "no"; then
64     AC_MSG_ERROR([You must install the OCaml compiler])
65 fi
66
67 AM_CONDITIONAL([HAVE_OCAMLOPT], [test "x$OCAMLOPT" != "xno"])
68
69 dnl Camlp4 is required.
70 AC_PROG_CAMLP4
71 if test "x$CAMLP4" = "xno"; then
72     AC_MSG_ERROR([You must install camlp4 (the OCaml macro preprocessor)])
73 fi
74
75 dnl OCaml findlib ("ocamlfind") is required.
76 AC_PROG_FINDLIB
77 if test "x$OCAMLFIND" = "xno"; then
78     AC_MSG_ERROR([You must install OCaml findlib (the ocamlfind command)])
79 fi
80
81 dnl OCaml calendar library is required.
82 AC_CHECK_OCAML_PKG(calendar)
83 if test "x$OCAML_PKG_calendar" = "xno"; then
84     AC_MSG_ERROR([You must install OCaml calendar library version 2])
85 fi
86
87 dnl OCaml ocamlnet RPC library + dependencies (version 3) is required.
88 AC_CHECK_OCAML_PKG(rpc)
89 if test "x$OCAML_PKG_rpc" = "x"; then
90     AC_MSG_ERROR([You must install OCaml ocamlnet library version 3])
91 fi
92
93 AC_CHECK_PROG(OCAMLRPCGEN,ocamlrpcgen,ocamlrpcgen)
94 if test "x$OCAMLRPCGEN" = "x"; then
95     AC_MSG_ERROR([You must install the ocamlrpcgen program])
96 fi
97
98 dnl Check for POD (for manual pages).
99 AC_CHECK_PROG(PERLDOC,perldoc,perldoc)
100 if test "x$PERLDOC" = "xno"; then
101     AC_MSG_ERROR([You must install the perldoc program])
102 fi
103
104 AC_CONFIG_HEADERS([config.h])
105 AC_CONFIG_FILES([Makefile
106                  daemon/Makefile
107                  lib/config.ml
108                  lib/Makefile
109                  tests/jobs/Makefile
110                  tests/parsing/Makefile
111                  tools/Makefile
112                  whenjobs.spec])
113 AC_OUTPUT