Use goals itself exclusively to build.
[goals.git] / configure.ac
1 # Goals
2 # Copyright (C) 2019 Richard W.M. Jones
3 # Copyright (C) 2019 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.1])
20 AC_CONFIG_MACRO_DIR([m4])
21
22 AC_PROG_INSTALL
23
24 dnl Check for basic C environment.
25 AC_PROG_CC_STDC
26 AC_PROG_INSTALL
27 AC_PROG_CPP
28
29 AC_C_PROTOTYPES
30 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
31
32 dnl Check for basic OCaml environment and findlib.
33 AC_PROG_OCAML
34 if test "x$OCAMLC" = "xno"; then
35     AC_MSG_ERROR([OCaml compiler is required])
36 fi
37
38 dnl Check for required programs.
39 AC_PROG_FINDLIB
40 if test "x$OCAMLFIND" = "xno"; then
41     AC_MSG_ERROR([OCaml findlib is required])
42 fi
43 AC_PROG_OCAMLLEX
44 if test "x$OCAMLLEX" = "xno"; then
45     AC_MSG_ERROR([OCaml ocamllex lexical generator tool is required])
46 fi
47
48 AC_CHECK_PROG(MENHIR, [menhir], [menhir], [
49     AC_MSG_ERROR([OCaml menhir parser generator is required])
50 ])
51
52 dnl Substitute OCaml flags and packages.
53 AC_SUBST([OCAMLFLAGS], ["-g -safe-string -warn-error CDEFLMPSUVYZX+52-3"])
54 AC_SUBST([OCAMLPACKAGES], ["-package str,unix"])
55
56 dnl Produce output files.
57 AC_CONFIG_HEADERS([config.h])
58 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
59 AC_CONFIG_FILES([run], [chmod +x,-w run])
60 AC_CONFIG_FILES([Goalfile Makefile
61                  src/config.ml])
62
63 AC_OUTPUT