Attached is a patch that fixes this, by using AC_CHECK_TARGET_TOOL
instead of AC_CHECK_TOOL for all the compiler tools except ocamlc itself
(since bytecode should be portable doesn't matter which ocamlc is used).

--Edwin
--- ../ocaml.m4 2009-10-12 14:33:43.000000000 +0300
+++ m4/ocaml.m4 2010-05-26 21:54:54.458749283 +0300
@@ -28,7 +28,7 @@
      AC_SUBST([OCAMLLIB])
 
      # checking for ocamlopt
-     AC_CHECK_TOOL([OCAMLOPT],[ocamlopt],[no])
+     AC_CHECK_TARGET_TOOL([OCAMLOPT],[ocamlopt],[no])
      OCAMLBEST=byte
      if test "$OCAMLOPT" = "no"; then
        AC_MSG_WARN([Cannot find ocamlopt; bytecode compilation only.])
@@ -45,7 +45,7 @@
      AC_SUBST([OCAMLBEST])
 
      # checking for ocamlc.opt
-     AC_CHECK_TOOL([OCAMLCDOTOPT],[ocamlc.opt],[no])
+     AC_CHECK_TARGET_TOOL([OCAMLCDOTOPT],[ocamlc.opt],[no])
      if test "$OCAMLCDOTOPT" != "no"; then
        TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
        if test "$TMPVERSION" != "$OCAMLVERSION" ; then
@@ -57,7 +57,7 @@
 
      # checking for ocamlopt.opt
      if test "$OCAMLOPT" != "no" ; then
-       AC_CHECK_TOOL([OCAMLOPTDOTOPT],[ocamlopt.opt],[no])
+       AC_CHECK_TARGET_TOOL([OCAMLOPTDOTOPT],[ocamlopt.opt],[no])
        if test "$OCAMLOPTDOTOPT" != "no"; then
           TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* 
*\(.*\)$|\1|p' `
           if test "$TMPVERSION" != "$OCAMLVERSION" ; then

Reply via email to