Install the goaljobs.a file, used for native code linking.
[goaljobs.git] / configure.ac
1 # goaljobs
2 # Copyright (C) 2013 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([goaljobs],[0.3])
19 AM_INIT_AUTOMAKE([foreign])
20
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])
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 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])
95 fi
96
97 dnl ocamldoc (optional)
98 AM_CONDITIONAL([HAVE_OCAMLDOC],
99                [test "x$OCAMLDOC" != "xno"])
100
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])
105 fi
106 AM_CONDITIONAL([HAVE_POD2MAN],
107                [test "x$POD2MAN" != "xno"])
108
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])
113 fi
114
115 AC_CONFIG_HEADERS([config.h])
116 AC_CONFIG_FILES([goaljobs_config.ml
117                  goaljobs.spec
118                  Makefile
119                  META
120                  examples/Makefile
121                  examples/compile-c/Makefile
122                  tests/Makefile])
123 AC_OUTPUT