From d33e379556c6a8e8e8915f6cbc9f632a3fb1747b Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Wed, 30 Dec 2009 15:24:14 +0000 Subject: [PATCH] Update to ocaml-autoconf macros 1.1 --- m4/ocaml.m4 | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/m4/ocaml.m4 b/m4/ocaml.m4 index fa8c4ce..479f3a8 100644 --- a/m4/ocaml.m4 +++ b/m4/ocaml.m4 @@ -16,7 +16,12 @@ AC_DEFUN([AC_PROG_OCAML], if test "$OCAMLC" != "no"; then OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'` AC_MSG_RESULT([OCaml version is $OCAMLVERSION]) - OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4` + # If OCAMLLIB is set, use it + if test "$OCAMLLIB" = ""; then + OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4` + else + AC_MSG_RESULT([OCAMLLIB previously set; preserving it.]) + fi AC_MSG_RESULT([OCaml library path is $OCAMLLIB]) AC_SUBST([OCAMLVERSION]) @@ -68,6 +73,9 @@ AC_DEFUN([AC_PROG_OCAML], AC_SUBST([OCAMLC]) + # checking for ocaml toplevel + AC_CHECK_TOOL([OCAML],[ocaml],[no]) + # checking for ocamldep AC_CHECK_TOOL([OCAMLDEP],[ocamldep],[no]) @@ -207,11 +215,26 @@ EOF dnl XXX Cross-compiling AC_DEFUN([AC_CHECK_OCAML_WORD_SIZE], [dnl + AC_REQUIRE([AC_PROG_OCAML])dnl AC_MSG_CHECKING([for OCaml compiler word size]) cat > conftest.ml < conftest.ml <