2 # Copyright (C) 2019 Richard W.M. Jones
3 # Copyright (C) 2019 Red Hat Inc.
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.
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.
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.
19 AC_INIT([goals], [0.1])
20 AC_CONFIG_MACRO_DIR([m4])
24 dnl Check for basic C environment.
30 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
32 dnl C headers and functions.
33 AC_CHECK_HEADERS([sys/sysinfo.h])
34 AC_CHECK_FUNCS([get_nprocs])
36 dnl Check for basic OCaml environment and findlib.
38 if test "x$OCAMLC" = "xno"; then
39 AC_MSG_ERROR([OCaml compiler is required])
42 dnl Check for required programs.
44 if test "x$OCAMLFIND" = "xno"; then
45 AC_MSG_ERROR([OCaml findlib is required])
48 if test "x$OCAMLLEX" = "xno"; then
49 AC_MSG_ERROR([OCaml ocamllex lexical generator tool is required])
52 AC_CHECK_PROG(MENHIR, [menhir], [menhir], [
53 AC_MSG_ERROR([OCaml menhir parser generator is required])
56 AC_CHECK_PROG([POD2MAN], [pod2man], [pod2man], [
57 AC_MSG_ERROR([pod2man tool from Perl is required])
60 AC_CHECK_PROG([POD2TEXT], [pod2text], [pod2text], [
61 AC_MSG_ERROR([pod2text tool from Perl is required])
64 dnl Substitute OCaml flags and packages.
65 AC_SUBST([OCAMLFLAGS], ["-g -safe-string -warn-error CDEFLMPSUVYZX+52-3"])
66 AC_SUBST([OCAMLPACKAGES], ["-package str,unix,threads -thread"])
68 dnl Produce output files.
69 AC_CONFIG_HEADERS([config.h])
70 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
71 AC_CONFIG_FILES([run], [chmod +x,-w run])
72 AC_CONFIG_FILES([Goalfile Makefile