summaryrefslogtreecommitdiff
path: root/testsuite/mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-05-03 12:27:37 +0100
committerIan Lynagh <igloo@earth.li>2012-05-03 12:27:37 +0100
commita511dcd3d2657ef7d3b76cdd055a0a1789b4b596 (patch)
treeb147c2c0a52dcbd3628d79ec2ed009eb3dc04741 /testsuite/mk
parentb806bd2da7d13dedc73ff8c1016c1de0aa2bc26b (diff)
downloadhaskell-a511dcd3d2657ef7d3b76cdd055a0a1789b4b596.tar.gz
Fix the way we find the path to 'ar'
Fixes ghcilink001 on Windows
Diffstat (limited to 'testsuite/mk')
-rw-r--r--testsuite/mk/boilerplate.mk4
-rw-r--r--testsuite/mk/ghc-config.hs18
2 files changed, 12 insertions, 10 deletions
diff --git a/testsuite/mk/boilerplate.mk b/testsuite/mk/boilerplate.mk
index 707c037a87..56b0284583 100644
--- a/testsuite/mk/boilerplate.mk
+++ b/testsuite/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/testsuite/mk/ghc-config.hs b/testsuite/mk/ghc-config.hs
index 7bdc6d6d79..a14949ee70 100644
--- a/testsuite/mk/ghc-config.hs
+++ b/testsuite/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
+