2011-10-20 18:06:23 +02:00
|
|
|
AC_INIT(heptagon,1.0)
|
|
|
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(simulator,
|
2011-11-10 16:52:05 +01:00
|
|
|
[ --enable-simulator enable the graphical simulator],,
|
2011-10-20 18:06:23 +02:00
|
|
|
enable_simulator=no)
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
AC_PROG_OCAML
|
|
|
|
if test "$OCAMLC" = "no"; then
|
|
|
|
AC_MSG_ERROR([Please install the OCaml compiler])
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$OCAMLVERSION" in
|
|
|
|
0.*|1.*|2.*|3.0*)
|
|
|
|
AC_MSG_ERROR(You need Objective Caml 3.10 or higher);;
|
|
|
|
esac
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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)
|
|
|
|
AC_SUBST(stdlib_dir)
|
|
|
|
|
|
|
|
AC_SUBST(enable_simulator)
|
|
|
|
|
2011-11-10 16:52:05 +01:00
|
|
|
AC_OUTPUT(config)
|