[project @ 2003-08-20 15:16:43 by sof]
[ghc-hetmet.git] / ghc / rts / gmp / configure
index aeff38a..8b7be87 100644 (file)
@@ -3094,7 +3094,13 @@ if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ECHO_N "checking for ld used by GCC... $ECHO_C" 1>&6
 echo "configure:3090: checking for ld used by GCC" 1>&5
-  ac_prog=`($CC -print-prog-name=ld) 2>&5`
+  case $target in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
   case "$ac_prog" in
     # Accept absolute paths.
     [\\/]* | [A-Za-z]:[\\/]*)