diff --git a/configure b/configure
index 741d741fbcc7dfbbb911d8130754275f08aad56f..88ee93668301a2f69e7e71628fc2669b5a0f3abc 100755
--- a/configure
+++ b/configure
@@ -477,7 +477,7 @@ sh_quote(){
 }
 
 cleanws(){
-    echo "$@" | sed 's/^ *//;s/  */ /g;s/ *$//;s/\\r//g'
+    echo "$@" | sed 's/^ *//;s/[[:space:]][[:space:]]*/ /g;s/ *$//'
 }
 
 filter(){