2011-10-20 18:06:23 +02:00
|
|
|
AC_INIT(heptagon,1.0)
|
|
|
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
2013-01-26 13:28:37 +01:00
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
|
2011-10-20 18:06:23 +02:00
|
|
|
AC_ARG_ENABLE(simulator,
|
2011-11-10 16:52:05 +01:00
|
|
|
[ --enable-simulator enable the graphical simulator],,
|
2013-02-04 22:16:10 +01:00
|
|
|
enable_simulator=yes)
|
2011-10-20 18:06:23 +02:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(local_stdlib,
|
2011-11-10 16:52:05 +01:00
|
|
|
[ --enable-local-stdlib use the in-sources standard library],,
|
2011-10-20 18:06:23 +02:00
|
|
|
enable_local_stdlib=no)
|
|
|
|
|
2014-10-22 17:42:57 +02:00
|
|
|
AC_ARG_ENABLE(ctrl2ept,
|
|
|
|
[ --enable-ctrl2ept enable the Controllable-Nbac entity translator],,
|
|
|
|
enable_ctrl2ept=yes)
|
|
|
|
|
2011-10-20 18:06:23 +02:00
|
|
|
AC_PROG_OCAML
|
|
|
|
if test "$OCAMLC" = "no"; then
|
|
|
|
AC_MSG_ERROR([Please install the OCaml compiler])
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$OCAMLVERSION" in
|
2015-02-27 15:50:21 +01:00
|
|
|
0.*|1.*|2.*|3.*)
|
|
|
|
AC_MSG_ERROR(You need Objective Caml 4.00 or higher);;
|
2011-10-20 18:06:23 +02:00
|
|
|
esac
|
|
|
|
|
2013-07-18 11:21:27 +02:00
|
|
|
AC_PROG_CAMLP4
|
|
|
|
if test "$CAMLP4OF" = "no"; then
|
|
|
|
AC_MSG_ERROR([Please install Camlp4 with extensions (camlp4of command)])
|
|
|
|
fi
|
|
|
|
|
2011-10-20 18:06:23 +02:00
|
|
|
AC_PROG_FINDLIB
|
|
|
|
if test "$OCAMLFIND" = "no"; then
|
|
|
|
AC_MSG_ERROR([Please install OCaml findlib (the ocamlfind command)])
|
|
|
|
fi
|
|
|
|
|
2011-11-14 10:52:06 +01:00
|
|
|
OCAMLC_STDLIB=`$OCAMLFIND ocamlc -where`
|
|
|
|
OCAMLFIND_STDLIB=`$OCAMLFIND printconf stdlib`
|
|
|
|
if test "$OCAMLC_STDLIB" != "$OCAMLFIND_STDLIB"; then
|
|
|
|
AC_MSG_ERROR([OCaml and OCamlfind make different assumptions about the standard library directory])
|
|
|
|
fi
|
|
|
|
|
2011-10-20 18:06:23 +02:00
|
|
|
AC_CHECK_PROG(MENHIR,menhir,menhir,no)
|
|
|
|
if test "$MENHIR" = no ; then
|
|
|
|
AC_MSG_ERROR(Please install menhir.)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CHECK_OCAML_PKG([menhirLib])
|
|
|
|
if test "$OCAML_PKG_menhirLib" = "no"; then
|
|
|
|
AC_MSG_ERROR([Please install menhirLib package.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CHECK_OCAML_PKG([ocamlgraph])
|
|
|
|
if test "$OCAML_PKG_ocamlgraph" = "no"; then
|
|
|
|
AC_MSG_ERROR([Please install ocamlgraph package.])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CHECK_OCAML_PKG([lablgtk2])
|
|
|
|
if test "$OCAML_PKG_lablgtk2" = "no"; then
|
2011-10-20 18:12:06 +02:00
|
|
|
enable_simulator=no
|
|
|
|
AC_MSG_WARN([Could not find 'lablgtk2'. The simulator will not be built])
|
2011-10-20 18:06:23 +02:00
|
|
|
fi
|
|
|
|
|
2014-10-31 14:14:15 +01:00
|
|
|
dnl version should be >= 0.9.6
|
2014-10-21 13:43:30 +02:00
|
|
|
AC_CHECK_OCAML_PKG([reatk.ctrlNbac])
|
|
|
|
if test "${OCAML_PKG_reatk_ctrlNbac}" = "no"; then
|
2014-10-21 15:24:48 +02:00
|
|
|
package_reatk_ctrlNbac="ocaml"; #dummy flag
|
|
|
|
ctrln_pp="-UENABLE_CTRLN"
|
2014-10-23 11:05:38 +02:00
|
|
|
enable_ctrl2ept=no
|
2014-10-21 15:24:48 +02:00
|
|
|
AC_MSG_WARN([Controllable-Nbac backend and translators disabled.])
|
|
|
|
else
|
|
|
|
package_reatk_ctrlNbac="package(reatk.ctrlNbac)"
|
|
|
|
ctrln_pp="-DENABLE_CTRLN"
|
2014-10-21 13:43:30 +02:00
|
|
|
fi
|
|
|
|
|
2011-10-20 18:06:23 +02:00
|
|
|
if test "$enable_local_stdlib" = "yes"; then
|
2011-11-16 16:07:59 +01:00
|
|
|
stdlib_dir=$PWD/lib
|
2011-10-20 18:06:23 +02:00
|
|
|
else
|
|
|
|
stdlib_dir=$libdir/heptagon
|
|
|
|
fi
|
|
|
|
|
2011-11-14 10:52:06 +01:00
|
|
|
|
2011-10-20 18:06:23 +02:00
|
|
|
AC_SUBST(INSTALL)
|
2015-02-27 15:50:21 +01:00
|
|
|
AC_SUBST(RM)
|
2011-10-20 18:06:23 +02:00
|
|
|
AC_SUBST(stdlib_dir)
|
|
|
|
|
|
|
|
AC_SUBST(enable_simulator)
|
2014-10-22 17:42:57 +02:00
|
|
|
AC_SUBST(enable_ctrl2ept)
|
2011-10-20 18:06:23 +02:00
|
|
|
|
2011-11-10 16:52:05 +01:00
|
|
|
AC_OUTPUT(config)
|
2014-10-21 15:24:48 +02:00
|
|
|
|
|
|
|
AC_SUBST(package_reatk_ctrlNbac)
|
|
|
|
AC_SUBST(ctrln_pp)
|
|
|
|
AC_OUTPUT(compiler/_tags)
|