$host are definitely set before we compare them.
dnl Internal subroutine.
AC_DEFUN(AC_CHECK_TOOL_PREFIX,
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+[AC_REQUIRE([AC_CANONICAL_HOST])AC_REQUIRE([AC_CANONICAL_BUILD])dnl
if test $host != $build; then
ac_tool_prefix=${host_alias}-
else
dnl Internal subroutine.
AC_DEFUN(AC_CHECK_TOOL_PREFIX,
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+[AC_REQUIRE([AC_CANONICAL_HOST])AC_REQUIRE([AC_CANONICAL_BUILD])dnl
if test $host != $build; then
ac_tool_prefix=${host_alias}-
else