summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-12-30 15:24:14 +0000
committerRichard Jones <rjones@redhat.com>2009-12-30 15:24:14 +0000
commitd33e379556c6a8e8e8915f6cbc9f632a3fb1747b (patch)
tree60730aa7e207f321bb9a7fac1768a88eb457e706
parent727394f04343f2102a03c769de1cf6930656e409 (diff)
downloadvirt-top-d33e379556c6a8e8e8915f6cbc9f632a3fb1747b.tar.gz
virt-top-d33e379556c6a8e8e8915f6cbc9f632a3fb1747b.tar.xz
virt-top-d33e379556c6a8e8e8915f6cbc9f632a3fb1747b.zip
Update to ocaml-autoconf macros 1.1
-rw-r--r--m4/ocaml.m427
1 files 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 <<EOF
print_endline (string_of_int Sys.word_size)
EOF
- OCAML_WORD_SIZE=`ocaml conftest.ml`
+ OCAML_WORD_SIZE=`$OCAML conftest.ml`
AC_MSG_RESULT([$OCAML_WORD_SIZE])
AC_SUBST([OCAML_WORD_SIZE])
])
+
+AC_DEFUN([AC_CHECK_OCAML_OS_TYPE],
+[dnl
+ AC_REQUIRE([AC_PROG_OCAML])dnl
+ AC_MSG_CHECKING([OCaml Sys.os_type])
+
+ cat > conftest.ml <<EOF
+ print_string(Sys.os_type);;
+EOF
+
+ OCAML_OS_TYPE=`$OCAML conftest.ml`
+ AC_MSG_RESULT([$OCAML_OS_TYPE])
+ AC_SUBST([OCAML_OS_TYPE])
+])