diff --git a/ChangeLog b/ChangeLog
index 9e3d3889c654c40d9934bcec10f96ba87afc071e..39ad00f9602bdc05e3fb5a46eae04387d79a1493 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-05-07  Paolo Bonzini  <bonzini@gnu.org>
+
+	* config.guess: Sync with src.
+
 2009-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
 
 	* configure.ac ($with_ppl):  Default to no if not supplied.
diff --git a/config.guess b/config.guess
index e5716eea733e225984bd4634a1d655127dfa470c..b8cdd22573d584bb79d1c0d9f2c04e40da80f9c5 100755
--- a/config.guess
+++ b/config.guess
@@ -1116,7 +1116,10 @@ EOF
 	# Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
-	echo i386-pc-msdosdjgpp
+	# Note: whatever this is, it MUST be the same as what config.sub
+	# prints for the "djgpp" host, or else GDB configury will decide that
+	# this is a cross-build.
+	echo i586-pc-msdosdjgpp
         exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
diff --git a/config/ChangeLog b/config/ChangeLog
index d0342028fb21eb97a27c99efa17cb148b474347e..d670de4e37184996c20f691b38892e0cd890c793 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,14 @@
+2009-05-07  Paolo Bonzini
+
+	Sync from src:
+	2009-02-02  Doug Evans  <dje@google.com>
+
+	* tcl.m4 (SC_PATH_TCLCONFIG): Don't exit 0 if tclconfig fails.
+	(SC_PATH_TKCONFIG): Don't exit 0 if tkconfig fails.
+	(SC_LOAD_TCLCONFIG): Quote all uses of TCL_BIN_DIR, it may contain
+	"# no Tcl configs found".
+	(SC_LOAD_TKCONFIG): Similarily for TK_BIN_DIR.
+
 2009-04-09  Jakub Jelinek  <jakub@redhat.com>
 
 	* lead-dot.m4: Change copyright header to refer to version
diff --git a/config/tcl.m4 b/config/tcl.m4
index be0129b1bdfc23e135f83ce99a02fa585bf5090d..900a2ceb81ecaea15d1d6dacfab8c7566b35f468 100644
--- a/config/tcl.m4
+++ b/config/tcl.m4
@@ -114,7 +114,6 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
 	if test x"${ac_cv_c_tclconfig}" = x ; then
 	    TCL_BIN_DIR="# no Tcl configs found"
 	    AC_MSG_WARN([Can't find Tcl configuration definitions])
-	    exit 0
 	else
 	    no_tcl=
 	    TCL_BIN_DIR=${ac_cv_c_tclconfig}
@@ -237,7 +236,6 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
 	if test x"${ac_cv_c_tkconfig}" = x ; then
 	    TK_BIN_DIR="# no Tk configs found"
 	    AC_MSG_WARN([Can't find Tk configuration definitions])
-	    exit 0
 	else
 	    no_tk=
 	    TK_BIN_DIR=${ac_cv_c_tkconfig}
@@ -285,7 +283,7 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
     # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
     # instead of TCL_BUILD_LIB_SPEC since it will work with both an
     # installed and uninstalled version of Tcl.
-    if test -f ${TCL_BIN_DIR}/Makefile ; then
+    if test -f "${TCL_BIN_DIR}/Makefile" ; then
         TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
         TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
         TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
@@ -295,7 +293,7 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
 	# against Tcl.framework installed in an arbitary location.
 	case ${TCL_DEFS} in
 	    *TCL_FRAMEWORK*)
-		if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then
+		if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
 		    for i in "`cd ${TCL_BIN_DIR}; pwd`" \
 			     "`cd ${TCL_BIN_DIR}/../..; pwd`"; do
 			if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
@@ -304,7 +302,7 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
 			fi
 		    done
 		fi
-		if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then
+		if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
 		    TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
 		    TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
 		fi
@@ -368,7 +366,7 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
     # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
     # instead of TK_BUILD_LIB_SPEC since it will work with both an
     # installed and uninstalled version of Tcl.
-    if test -f ${TK_BIN_DIR}/Makefile ; then
+    if test -f "${TK_BIN_DIR}/Makefile" ; then
         TK_LIB_SPEC=${TK_BUILD_LIB_SPEC}
         TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC}
         TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH}
@@ -378,7 +376,7 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
 	# against Tk.framework installed in an arbitary location.
 	case ${TK_DEFS} in
 	    *TK_FRAMEWORK*)
-		if test -f ${TK_BIN_DIR}/${TK_LIB_FILE}; then
+		if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
 		    for i in "`cd ${TK_BIN_DIR}; pwd`" \
 			     "`cd ${TK_BIN_DIR}/../..; pwd`"; do
 			if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
@@ -387,7 +385,7 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
 			fi
 		    done
 		fi
-		if test -f ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}; then
+		if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then
 		    TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}"
 		    TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
 		fi