Ok, here is a patch like the last one except that it does
not change anything related to --build and --host. It does
improve the warning that gets printed (IMHO) and it fixes
a couple of bugs in AC_CHECK_TOOLS and AC_LANG_COMPILER_WORKS.
I don't think we want to actually encourage the use of
--build=TRIPLE --host=X-TRIPLE when folks can just use
--host=X-TRIPLE by itself.

Mo DeJong
Red Hat Inc

(I also attached the patch file, in case that helps)

Index: ChangeLog
===================================================================
RCS file: /cvs/autoconf/ChangeLog,v
retrieving revision 1.713
diff -u -r1.713 ChangeLog
--- ChangeLog   2000/07/04 10:34:21     1.713
+++ ChangeLog   2000/07/04 12:28:48
@@ -1,3 +1,11 @@
+2000-07-04  Mo DeJong  <[EMAIL PROTECTED]>
+
+       * acgeneral.m4 (_AC_INIT_PARSE_ARGS, AC_CHECK_TOOLS): Change
+       warning message printed when only --host is given. Fix printing
+       of multiple compiler cache values, use PATH argument.
+       * aclang.m4 (AC_LANG_COMPILER_WORKS): Print the cross compile
+       status, fix problem where two results were printed at once.
+
 2000-07-04  Akim Demaille  <[EMAIL PROTECTED]>
 
        * acgeneral.m4 (AC_CACHE_LOAD): Be ready to read the cache even
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.501
diff -u -r1.501 acgeneral.m4
--- acgeneral.m4        2000/07/04 10:34:21     1.501
+++ acgeneral.m4        2000/07/04 12:28:52
@@ -1567,8 +1567,8 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    AC_MSG_WARN([Did you mean --build instead of --host?  Assuming you did.])
-    AC_MSG_WARN([If not, please specify both --build and --host.])
+    AC_MSG_WARN([If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used.])
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -2926,11 +2926,11 @@
 AC_DEFUN([AC_CHECK_TOOLS],
 [for ac_prog in $2
 do
-  AC_CHECK_PROG([$1], $ac_tool_prefix$ac_prog, $ac_tool_prefix$ac_prog, [$3])
-  test "$$1" != "$3" && break
+  AC_CHECK_PROG([$1], $ac_tool_prefix$ac_prog, $ac_tool_prefix$ac_prog,, [$4])
+  test "$$1" != "" && break
 done
-if test "$$1" = "$3"; then
-  AC_CHECK_PROGS([$1], [$2], [$3])
+if test "$$1" = ""; then
+  AC_CHECK_PROGS([$1], [$2], [$3], [$4])
 fi
 ])# AC_CHECK_TOOLS
 
Index: aclang.m4
===================================================================
RCS file: /cvs/autoconf/aclang.m4,v
retrieving revision 1.35
diff -u -r1.35 aclang.m4
--- aclang.m4   2000/06/30 13:34:38     1.35
+++ aclang.m4   2000/07/04 12:28:53
@@ -471,12 +471,12 @@
 define([_AC_LANG_COMPILER_WORKS],
 [AC_MSG_CHECKING([whether the _AC_LANG compiler works])
 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
-[# If not cross compiling, check that we can run a simple program.
+[# FIXME : these cross compiler hacks should be removed for autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if AC_TRY_COMMAND(./conftest); then
     cross_compiling=no
   else
-    AC_MSG_RESULT(no)
     if test "$cross_compiling" = maybe; then
       cross_compiling=yes
     else
@@ -488,6 +488,8 @@
 AC_MSG_RESULT(yes)],
 [AC_MSG_RESULT(no)
 AC_MSG_ERROR([_AC_LANG compiler cannot create executables], 77)])[]dnl
+AC_MSG_CHECKING([whether we are cross compiling])
+AC_MSG_RESULT($cross_compiling)
 ])# AC_LANG_COMPILER_WORKS
  
Index: ChangeLog
===================================================================
RCS file: /cvs/autoconf/ChangeLog,v
retrieving revision 1.713
diff -u -r1.713 ChangeLog
--- ChangeLog   2000/07/04 10:34:21     1.713
+++ ChangeLog   2000/07/04 12:28:48
@@ -1,3 +1,11 @@
+2000-07-04  Mo DeJong  <[EMAIL PROTECTED]>
+
+       * acgeneral.m4 (_AC_INIT_PARSE_ARGS, AC_CHECK_TOOLS): Change
+       warning message printed when only --host is given. Fix printing
+       of multiple compiler cache values, use PATH argument.
+       * aclang.m4 (AC_LANG_COMPILER_WORKS): Print the cross compile
+       status, fix problem where two results were printed at once.
+
 2000-07-04  Akim Demaille  <[EMAIL PROTECTED]>
 
        * acgeneral.m4 (AC_CACHE_LOAD): Be ready to read the cache even
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.501
diff -u -r1.501 acgeneral.m4
--- acgeneral.m4        2000/07/04 10:34:21     1.501
+++ acgeneral.m4        2000/07/04 12:28:52
@@ -1567,8 +1567,8 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    AC_MSG_WARN([Did you mean --build instead of --host?  Assuming you did.])
-    AC_MSG_WARN([If not, please specify both --build and --host.])
+    AC_MSG_WARN([If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used.])
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -2926,11 +2926,11 @@
 AC_DEFUN([AC_CHECK_TOOLS],
 [for ac_prog in $2
 do
-  AC_CHECK_PROG([$1], $ac_tool_prefix$ac_prog, $ac_tool_prefix$ac_prog, [$3])
-  test "$$1" != "$3" && break
+  AC_CHECK_PROG([$1], $ac_tool_prefix$ac_prog, $ac_tool_prefix$ac_prog,, [$4])
+  test "$$1" != "" && break
 done
-if test "$$1" = "$3"; then
-  AC_CHECK_PROGS([$1], [$2], [$3])
+if test "$$1" = ""; then
+  AC_CHECK_PROGS([$1], [$2], [$3], [$4])
 fi
 ])# AC_CHECK_TOOLS
 
Index: aclang.m4
===================================================================
RCS file: /cvs/autoconf/aclang.m4,v
retrieving revision 1.35
diff -u -r1.35 aclang.m4
--- aclang.m4   2000/06/30 13:34:38     1.35
+++ aclang.m4   2000/07/04 12:28:53
@@ -471,12 +471,12 @@
 define([_AC_LANG_COMPILER_WORKS],
 [AC_MSG_CHECKING([whether the _AC_LANG compiler works])
 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
-[# If not cross compiling, check that we can run a simple program.
+[# FIXME : these cross compiler hacks should be removed for autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if AC_TRY_COMMAND(./conftest); then
     cross_compiling=no
   else
-    AC_MSG_RESULT(no)
     if test "$cross_compiling" = maybe; then
       cross_compiling=yes
     else
@@ -488,6 +488,8 @@
 AC_MSG_RESULT(yes)],
 [AC_MSG_RESULT(no)
 AC_MSG_ERROR([_AC_LANG compiler cannot create executables], 77)])[]dnl
+AC_MSG_CHECKING([whether we are cross compiling])
+AC_MSG_RESULT($cross_compiling)
 ])# AC_LANG_COMPILER_WORKS
 
 

Reply via email to