I'm sorry for having introduced this bug :(
These macros badly need to be rewritten, but that's for another
Autoconf that 2.50.
Here is what I'm applying:
Index: ChangeLog
from Akim Demaille <[EMAIL PROTECTED]>
* acgeneral.m4 (AC_PATH_TOOL, AC_CHECK_TOOL, AC_CHECK_TOOLS):
Because when not cross-compiling these macros use `ac_pt_$1' as
output variable, we lost the import of the user set value `$$1'
(rather we were reading `$ac_pt_$1'). Therefore, even if not
cross-compiling, we want to run the cross-compiling part of these
macros.
Reported by Morten Eriksen.
Index: TODO
===================================================================
RCS file: /cvs/autoconf/TODO,v
retrieving revision 1.96
diff -u -r1.96 TODO
--- TODO 2000/10/17 12:48:51 1.96
+++ TODO 2000/10/17 16:03:50
@@ -33,6 +33,9 @@
char intervals. Introducing ac_A_Z etc. might make it more
convenient.
+** AC_CHECK_TOOL...
+Write a test that checks that it honors the values set by the user.
+
* Autoconf 2.51 or so
** AC_FUNC_GETLOADAVG
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.578
diff -u -r1.578 acgeneral.m4
--- acgeneral.m4 2000/10/17 12:48:51 1.578
+++ acgeneral.m4 2000/10/17 16:03:51
@@ -3177,12 +3177,17 @@
# AC_PATH_TOOL(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH])
# -----------------------------------------------------------------------
-# (Use different variables $1 and ac_pt_$1 so that cache vars don't conflict.)
+# Use different variables $1 and ac_pt_$1 so that cache vars don't conflict.
+# Be extremely careful if you want to change this macro: there are several
+# factors to be honored:
+# - if VARIABLE is already set, don't look for another value
+# - in any case, including the previous one, display the `checking...'
+# message (hence, you cannot just condition the body of this macro
+# with `test -n "$$1"').
+# - if ac_tool_prefix is set, it must be honored first.
AC_DEFUN([AC_PATH_TOOL],
-[if test -n "$ac_tool_prefix"; then
- AC_PATH_PROG([$1], [${ac_tool_prefix}$2], , [$4])
-fi
-if test -z "$ac_cv_path_$1"; then
+[AC_PATH_PROG([$1], [${ac_tool_prefix}$2], , [$4])
+if test -z "$$1"; then
AC_PATH_PROG([ac_pt_$1], [$2], [$3], [$4])
$1="$ac_pt_$1"
fi
@@ -3191,12 +3196,10 @@
# AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR, [VALUE-IF-NOT-FOUND], [PATH])
# ------------------------------------------------------------------------
-# (Use different variables $1 and ac_ct_$1 so that cache vars don't conflict.)
+# Use different variables $1 and ac_ct_$1 so that cache vars don't conflict.
AC_DEFUN([AC_CHECK_TOOL],
-[if test -n "$ac_tool_prefix"; then
- AC_CHECK_PROG([$1], [${ac_tool_prefix}$2], [${ac_tool_prefix}$2], , [$4])
-fi
-if test -z "$ac_cv_prog_$1"; then
+[AC_CHECK_PROG([$1], [${ac_tool_prefix}$2], [${ac_tool_prefix}$2], , [$4])
+if test -z "$$1"; then
AC_CHECK_PROG([ac_ct_$1], [$2], [$2], [$3], [$4])
$1="$ac_ct_$1"
fi
@@ -3210,15 +3213,13 @@
# none can be found with a cross prefix, then use the first one that
# was found without the cross prefix.
AC_DEFUN([AC_CHECK_TOOLS],
-[if test -n "$ac_tool_prefix"; then
- for ac_prog in $2
- do
- AC_CHECK_PROG([$1],
- [$ac_tool_prefix$ac_prog], [$ac_tool_prefix$ac_prog],,
- [$4])
- test "$$1" != "" && break
- done
-fi
+[for ac_prog in $2
+do
+ AC_CHECK_PROG([$1],
+ [$ac_tool_prefix$ac_prog], [$ac_tool_prefix$ac_prog],,
+ [$4])
+ test -z "$$1" && break
+done
if test -z "$$1"; then
AC_CHECK_PROGS([$1], [$2], [$3], [$4])
fi