diff --git a/ChangeLog b/ChangeLog
index 4865335c24d1dfd50f6ec6bfccc8a1611b952b13..2767631e9b3c9ad2e47a67d91d46c6461da65775 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-02  Alexandre Oliva  <aoliva@redhat.com>
+
+	* configure.in (CHILL_FOR_TARGET, CXX_FOR_TARGET): Convert blanks to
+	commas in $LANGUAGES.
+
 2000-08-02  Manfred Hollstein  <manfredh@redhat.com>
 
 	* configure.in: Re-enable all references to libg++ and librx.
diff --git a/configure.in b/configure.in
index 9250244a97419f79f5a598d96be6334f56a5f36f..485fbc488a36a863561010f1100386833ab446f2 100644
--- a/configure.in
+++ b/configure.in
@@ -1298,8 +1298,8 @@ esac
 if test "x${CHILL_FOR_TARGET+set}" = xset; then
   :
 elif test -d ${topsrcdir}/gcc &&
-   echo ",${enable_languages-${LANGUAGES-CHILL}}," |
-   grep ,CHILL, > /dev/null ; then
+   echo ",${enable_languages-`echo ${LANGUAGES-CHILL} | tr ' ' ','`}," |
+   grep ',CHILL,' > /dev/null ; then
   CHILL_FOR_TARGET='$$r/gcc/xgcc -L$$r/gcc/ch/runtime/'
 elif test "$host" = "$target"; then
   CHILL_FOR_TARGET='$(CC)'
@@ -1314,7 +1314,7 @@ esac
 if test "x${CXX_FOR_TARGET+set}" = xset; then
   :
 elif test -d ${topsrcdir}/gcc &&
-   echo ",${enable_languages-${LANGUAGES-c++}}," |
+   echo ",${enable_languages-`echo ${LANGUAGES-c++} | tr ' ' ','`}," |
    grep ',c[+][+],' > /dev/null ; then
   CXX_FOR_TARGET='$$r/gcc/g++ -nostdinc++ '$libstdcxx_flags
 elif test "$host" = "$target"; then