2 # Copyright (C) 2013 Red Hat Inc.
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.
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.
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.
18 AC_INIT([goaljobs],[0.3])
19 AM_INIT_AUTOMAKE([foreign])
21 dnl Only used temporarily while goaljobs.spec is contained in the
22 dnl tarball. We will remove this later.
23 AC_SUBST([RPM_RELEASE],[1])
25 AC_CONFIG_MACRO_DIR([m4])
27 dnl Allow all GNU/Linux functions.
28 dnl autoconf complains unless this is very early in the file.
29 AC_USE_SYSTEM_EXTENSIONS
33 dnl Check for basic C environment.
39 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
43 AC_ARG_ENABLE([gcc-warnings],
44 [AS_HELP_STRING([--enable-gcc-warnings],
45 [turn on lots of GCC warnings (for developers)])],
48 *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
50 gcc_warnings=$enableval],
54 if test "$gcc_warnings" = yes; then
55 # XXX With gnulib we can improve this in future.
57 AC_SUBST([WARN_CFLAGS])
58 WERROR_CFLAGS="-Werror"
59 AC_SUBST([WERROR_CFLAGS])
62 dnl Check support for 64 bit file offsets.
67 if test "$OCAMLC" = "no"; then
68 AC_MSG_ERROR([You must install the OCaml compiler])
71 AM_CONDITIONAL([HAVE_OCAMLOPT], [test "x$OCAMLOPT" != "xno"])
73 dnl Camlp4 is required.
75 if test "x$CAMLP4" = "xno"; then
76 AC_MSG_ERROR([You must install camlp4 (the OCaml macro preprocessor)])
79 dnl OCaml findlib ("ocamlfind") is required.
81 if test "x$OCAMLFIND" = "xno"; then
82 AC_MSG_ERROR([You must install OCaml findlib (the ocamlfind command)])
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])
91 dnl Check for curl (for URL testing, downloads).
92 AC_CHECK_PROG(CURL,curl,curl)
93 if test "x$CURL" = "x"; then
94 AC_MSG_ERROR([You must install the 'curl' program])
97 dnl ocamldoc (optional)
98 AM_CONDITIONAL([HAVE_OCAMLDOC],
99 [test "x$OCAMLDOC" != "xno"])
101 dnl Check for POD (for manual pages).
102 AC_CHECK_PROG(POD2MAN,pod2man,pod2man,no)
103 if test "x$POD2MAN" = "x"; then
104 AC_MSG_ERROR([You must install the 'pod2man' program])
106 AM_CONDITIONAL([HAVE_POD2MAN],
107 [test "x$POD2MAN" != "xno"])
109 dnl Check for mailx (for sending email).
110 AC_CHECK_PROG(MAILX,mailx,mailx)
111 if test "x$MAILX" = "x"; then
112 AC_MSG_ERROR([You must install the mailx program])
115 AC_CONFIG_HEADERS([config.h])
116 AC_CONFIG_FILES([goaljobs_config.ml
121 examples/compile-c/Makefile