From 69999aff270f84967e3507b919094c276c04bce2 Mon Sep 17 00:00:00 2001
From: Ben Elliston <bje@gnu.org>
Date: Fri, 10 Nov 2000 12:05:37 +0000
Subject: [PATCH] 2000-11-10  Ben Elliston  <bje@redhat.com>

	* config.guess: Search for a working C compiler if CC_FOR_BUILD is
	not specified. From Kevin Ryde <user42@zip.com.au>.
---
 ChangeLog    |  5 +++++
 config.guess | 21 ++++++++++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 54a08c6..ce56470 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-10  Ben Elliston  <bje@redhat.com>
+
+	* config.guess: Search for a working C compiler if CC_FOR_BUILD is
+	not specified. From Kevin Ryde <user42@zip.com.au>.
+
 2000-11-08  Ben Elliston  <bje@redhat.com>
 
 	* config.guess: Detect sparc-unknown-linux-gnu. Reported by Peter
diff --git a/config.guess b/config.guess
index 42cd3fe..7bb1f32 100755
--- a/config.guess
+++ b/config.guess
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
 #   Free Software Foundation, Inc.
 
-version='2000-11-08'
+version='2000-11-10'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -78,6 +78,10 @@ if test $# != 0; then
   exit 1
 fi
 
+
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
+
 # Use $HOST_CC if defined. $CC may point to a cross-compiler
 if test x"$CC_FOR_BUILD" = x; then
   if test x"$HOST_CC" != x; then
@@ -86,7 +90,17 @@ if test x"$CC_FOR_BUILD" = x; then
     if test x"$CC" != x; then
       CC_FOR_BUILD="$CC"
     else
-      CC_FOR_BUILD=cc
+      echo 'int dummy(){}' >$dummy.c
+      for c in cc c89 gcc; do 
+	($c $dummy.c -c) >/dev/null 2>&1
+	if test $? = 0; then
+	  CC_FOR_BUILD="$c"; break
+	fi
+      done
+      rm -f $dummy.c $dummy.o
+      if test x"$CC_FOR_BUILD" = x; then
+	CC_FOR_BUILD=no_compiler_found
+      fi
     fi
   fi
 fi
@@ -103,9 +117,6 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
-
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in