ef0c7a1cd3f3189f2480c7113b425f5951b58bac
[goals.git] / configure.ac
1 # Goals
2 # Copyright (C) 2019-2020 Richard W.M. Jones
3 # Copyright (C) 2019-2020 Red Hat Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19 AC_INIT([goals], [0.3])
20 AC_CONFIG_MACRO_DIR([m4])
21
22 AM_INIT_AUTOMAKE(foreign) dnl Do not quote this parameter.
23
24 AC_PROG_INSTALL
25
26 dnl Check for basic C environment.
27 AC_PROG_CC_STDC
28 AC_PROG_INSTALL
29 AC_PROG_CPP
30
31 AC_C_PROTOTYPES
32 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
33
34 dnl C headers and functions.
35 AC_CHECK_HEADERS([sys/sysinfo.h])
36 AC_CHECK_FUNCS([get_nprocs])
37
38 dnl Check for basic OCaml environment and findlib.
39 AC_PROG_OCAML
40 if test "x$OCAMLC" = "xno"; then
41     AC_MSG_ERROR([OCaml compiler is required])
42 fi
43
44 dnl Check for required programs.
45 AC_PROG_FINDLIB
46 if test "x$OCAMLFIND" = "xno"; then
47     AC_MSG_ERROR([OCaml findlib is required])
48 fi
49 AC_PROG_OCAMLLEX
50 if test "x$OCAMLLEX" = "xno"; then
51     AC_MSG_ERROR([OCaml ocamllex lexical generator tool is required])
52 fi
53
54 AC_CHECK_PROG(MENHIR, [menhir], [menhir], [
55     AC_MSG_ERROR([OCaml menhir parser generator is required])
56 ])
57
58 AC_CHECK_PROG([POD2MAN], [pod2man], [pod2man], [
59     AC_MSG_ERROR([pod2man tool from Perl is required])
60 ])
61
62 AC_CHECK_PROG([POD2TEXT], [pod2text], [pod2text], [
63     AC_MSG_ERROR([pod2text tool from Perl is required])
64 ])
65
66 dnl Substitute OCaml flags and packages.
67 AC_SUBST([OCAMLFLAGS], ["-g -safe-string -warn-error +C+D+E+F+L+M+P+S+U+V+Y+Z+X+52-3"])
68 AC_SUBST([OCAMLPACKAGES], ["-package str,unix,threads -thread"])
69
70 dnl Produce output files.
71 AC_CONFIG_HEADERS([config.h])
72 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
73 AC_CONFIG_FILES([run], [chmod +x,-w run])
74 AC_CONFIG_FILES([Goalfile Makefile
75                  goals.spec
76                  src/config.ml])
77
78 AC_OUTPUT