Fix some bugs to do with tools in paths containing spaces
authorSimon Marlow <marlowsd@gmail.com>
Wed, 4 Nov 2009 16:43:43 +0000 (16:43 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 4 Nov 2009 16:43:43 +0000 (16:43 +0000)
Not everything is fixed yet; see #3642

aclocal.m4
configure.ac

index d4a58f9..64425b1 100644 (file)
@@ -415,7 +415,7 @@ else
   touch conftest.dummy
   for fp_var in clqsZ clqs cqs clq cq ; do
      rm -f conftest.a
-     if $fp_prog_ar_raw $fp_var conftest.a conftest.dummy > /dev/null 2> /dev/null; then
+     if "$fp_prog_ar_raw" $fp_var conftest.a conftest.dummy > /dev/null 2> /dev/null; then
         fp_cv_prog_ar_args=$fp_var
         break
      fi
@@ -1207,7 +1207,7 @@ if test ! -f utils/ghc-pwd/ghc-pwd && test ! -f utils/ghc-pwd/ghc-pwd.exe; then
   rm -f *.hi
   rm -f ghc-pwd
   rm -f ghc-pwd.exe
-  $WithGhc -v0 --make ghc-pwd -o ghc-pwd
+  "$WithGhc" -v0 --make ghc-pwd -o ghc-pwd
   cd ../..
 fi
 
index f5d4fc8..c11d663 100644 (file)
@@ -156,7 +156,7 @@ fi;
 # GHC is passed to Cabal, so we need a native path
 if test "${WithGhc}" != ""
 then
-    ghc_host=`${WithGhc} +RTS --info | grep 'Host platform' | sed -e 's/.*, "//' -e 's/")//'`
+    ghc_host=`"${WithGhc}" +RTS --info | grep 'Host platform' | sed -e 's/.*, "//' -e 's/")//'`
 
     if test "$ghc_host" = "i386-unknown-mingw32"
     then
@@ -165,7 +165,7 @@ then
             WithGhc=`echo "${WithGhc}" | sed "s#^/\([a-zA-Z]\)/#\1:/#"`
         else
             # Canonicalise to <drive>:/path/to/ghc
-            WithGhc=`cygpath -m ${WithGhc}`
+            WithGhc=`cygpath -m "${WithGhc}"`
         fi
         echo "GHC path canonicalised to: ${WithGhc}"
     fi
@@ -212,7 +212,7 @@ if test "$build" = ""
 then
     if test "${WithGhc}" != ""
     then
-        build=`${WithGhc} +RTS --info | grep '^ ,("Target platform"' | sed -e 's/.*, "//' -e 's/")//' | tr -d '\r'`
+        build=`"${WithGhc}" +RTS --info | grep '^ ,("Target platform"' | sed -e 's/.*, "//' -e 's/")//' | tr -d '\r'`
         echo "Build platform inferred as: $build"
     else
         echo "Can't work out build platform"
@@ -224,7 +224,7 @@ if test "$host" = ""
 then
     if test "${WithGhc}" != ""
     then
-        host=`${WithGhc} +RTS --info | grep '^ ,("Target platform"' | sed -e 's/.*, "//' -e 's/")//' | tr -d '\r'`
+        host=`"${WithGhc}" +RTS --info | grep '^ ,("Target platform"' | sed -e 's/.*, "//' -e 's/")//' | tr -d '\r'`
         echo "Host platform inferred as: $host"
     else
         echo "Can't work out host platform"
@@ -236,7 +236,7 @@ if test "$target" = ""
 then
     if test "${WithGhc}" != ""
     then
-        target=`${WithGhc} +RTS --info | grep '^ ,("Target platform"' | sed -e 's/.*, "//' -e 's/")//' | tr -d '\r'`
+        target=`"${WithGhc}" +RTS --info | grep '^ ,("Target platform"' | sed -e 's/.*, "//' -e 's/")//' | tr -d '\r'`
         echo "Target platform inferred as: $target"
     else
         echo "Can't work out target platform"