Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/fbbb955418168fcab8ca42b74f9be5e78c88967a

>---------------------------------------------------------------

commit fbbb955418168fcab8ca42b74f9be5e78c88967a
Author: Ian Lynagh <ig...@earth.li>
Date:   Thu May 3 12:27:37 2012 +0100

    Fix the way we find the path to 'ar'
    
    Fixes ghcilink001 on Windows

>---------------------------------------------------------------

 mk/boilerplate.mk |    4 ----
 mk/ghc-config.hs  |   18 ++++++++++++------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/mk/boilerplate.mk b/mk/boilerplate.mk
index 707c037..56b0284 100644
--- a/mk/boilerplate.mk
+++ b/mk/boilerplate.mk
@@ -116,10 +116,6 @@ ifeq "$(shell test -x '$(HPC)' && echo exists)" ""
 $(error Cannot find hpc: $(HPC))
 endif
 
-ifeq "$(AR)" ""
-AR = ar
-endif
-
 # Be careful when using this. On Windows it ends up looking like
 # c:/foo/bar which confuses make, as make thinks that the : is Makefile
 # syntax
diff --git a/mk/ghc-config.hs b/mk/ghc-config.hs
index 7bdc6d6..a14949e 100644
--- a/mk/ghc-config.hs
+++ b/mk/ghc-config.hs
@@ -22,7 +22,7 @@ main = do
   getGhcField fields "GhcUnregisterised" "Unregisterised"
   getGhcField fields "GhcWithSMP" "Support SMP"
   getGhcField fields "GhcRTSWays" "RTS ways"
-  getGhcFieldWithDefault fields "AR" "ar command" "ar"
+  getGhcFieldProgWithDefault fields "AR" "ar command" "ar"
 
 getGhcField :: [(String,String)] -> String -> String -> IO ()
 getGhcField fields mkvar key =
@@ -30,12 +30,12 @@ getGhcField fields mkvar key =
       Nothing  -> fail ("No field: " ++ key)
       Just val -> putStrLn (mkvar ++ '=':val)
 
-getGhcFieldWithDefault :: [(String,String)]
-                       -> String -> String -> String -> IO ()
-getGhcFieldWithDefault fields mkvar key deflt = do
+getGhcFieldProgWithDefault :: [(String,String)]
+                           -> String -> String -> String -> IO ()
+getGhcFieldProgWithDefault fields mkvar key deflt = do
    case lookup key fields of
-      Nothing  -> putStrLn (mkvar ++ '=':deflt)
-      Just val -> putStrLn (mkvar ++ '=': fixTopdir topdir val)
+      Nothing  -> putStrLn (mkvar ++ '=' : deflt)
+      Just val -> putStrLn (mkvar ++ '=' : fixSlashes (fixTopdir topdir val))
  where
   topdir = fromMaybe "" (lookup "LibDir" fields)
 
@@ -43,3 +43,9 @@ fixTopdir :: String -> String -> String
 fixTopdir t "" = ""
 fixTopdir t ('$':'t':'o':'p':'d':'i':'r':s) = t ++ s
 fixTopdir t (c:s) = c : fixTopdir t s
+
+fixSlashes :: FilePath -> FilePath
+fixSlashes = map f
+    where f '\\' = '/'
+          f c    = c
+



_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to