rpm: Add BR pcre-devel.
[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.7.0])
19 AM_INIT_AUTOMAKE([foreign])
20
21 dnl Only used temporarily while whenjobs.spec is contained in the
22 dnl tarball.  We will remove this later.
23 AC_SUBST([RPM_RELEASE],[1])
24
25 AC_CONFIG_MACRO_DIR([m4])
26
27 dnl Allow all GNU/Linux functions.
28 dnl autoconf complains unless this is very early in the file.
29 AC_USE_SYSTEM_EXTENSIONS
30
31 AC_PROG_LIBTOOL
32
33 dnl Check for basic C environment.
34 AC_PROG_CC_STDC
35 AC_PROG_INSTALL
36 AC_PROG_CPP
37
38 AC_C_PROTOTYPES
39 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
40
41 AM_PROG_CC_C_O
42
43 AC_ARG_ENABLE([gcc-warnings],
44     [AS_HELP_STRING([--enable-gcc-warnings],
45                     [turn on lots of GCC warnings (for developers)])],
46     [case $enableval in
47        yes|no) ;;
48        *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
49      esac
50      gcc_warnings=$enableval],
51     [gcc_warnings=no]
52 )
53
54 if test "$gcc_warnings" = yes; then
55     # XXX With gnulib we can improve this in future.
56     WARN_CFLAGS="-Wall"
57     AC_SUBST([WARN_CFLAGS])
58     WERROR_CFLAGS="-Werror"
59     AC_SUBST([WERROR_CFLAGS])
60 fi
61
62 dnl Check support for 64 bit file offsets.
63 AC_SYS_LARGEFILE
64
65 dnl OCaml compiler.
66 AC_PROG_OCAML
67 if test "$OCAMLC" = "no"; then
68     AC_MSG_ERROR([You must install the OCaml compiler])
69 fi
70
71 AM_CONDITIONAL([HAVE_OCAMLOPT], [test "x$OCAMLOPT" != "xno"])
72
73 dnl Camlp4 is required.
74 AC_PROG_CAMLP4
75 if test "x$CAMLP4" = "xno"; then
76     AC_MSG_ERROR([You must install camlp4 (the OCaml macro preprocessor)])
77 fi
78
79 dnl OCaml findlib ("ocamlfind") is required.
80 AC_PROG_FINDLIB
81 if test "x$OCAMLFIND" = "xno"; then
82     AC_MSG_ERROR([You must install OCaml findlib (the ocamlfind command)])
83 fi
84
85 dnl OCaml calendar library is required.
86 AC_CHECK_OCAML_PKG(calendar)
87 if test "x$OCAML_PKG_calendar" = "xno"; then
88     AC_MSG_ERROR([You must install OCaml calendar library version 2])
89 fi
90
91 dnl OCaml ocamlnet RPC library + dependencies (version 3) is required.
92 AC_CHECK_OCAML_PKG(rpc)
93 if test "x$OCAML_PKG_rpc" = "x"; then
94     AC_MSG_ERROR([You must install OCaml ocamlnet library version 3])
95 fi
96
97 AC_CHECK_PROG(OCAMLRPCGEN,ocamlrpcgen,ocamlrpcgen)
98 if test "x$OCAMLRPCGEN" = "x"; then
99     AC_MSG_ERROR([You must install the ocamlrpcgen program])
100 fi
101
102 dnl Check for POD (for manual pages).
103 AC_CHECK_PROG(PERLDOC,perldoc,perldoc)
104 if test "x$PERLDOC" = "x"; then
105     AC_MSG_ERROR([You must install the perldoc program])
106 fi
107
108 dnl Check for mailx (for sending email).
109 AC_CHECK_PROG(MAILX,mailx,mailx)
110 if test "x$MAILX" = "x"; then
111     AC_MSG_ERROR([You must install the mailx program])
112 fi
113
114 AC_CONFIG_HEADERS([config.h])
115 AC_CONFIG_FILES([Makefile
116                  daemon/Makefile
117                  lib/config.ml
118                  lib/Makefile
119                  tests/jobs/Makefile
120                  tests/parsing/Makefile
121                  tools/Makefile
122                  whenjobs.spec])
123 AC_OUTPUT