summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-06 13:39:35 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-06 13:39:35 -0400
commit8e6126c2a612d83741987fc8e2b37b1500696643 (patch)
tree10a71a3e6199668967bbff3e1c6c5ae6205bbeba /Build
parent74b94c7512bd2a23597e78e42c82a859bdcbe1a1 (diff)
now it gets truely nightmarish
Diffstat (limited to 'Build')
-rw-r--r--Build/EvilLinker.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/Build/EvilLinker.hs b/Build/EvilLinker.hs
index 09a75bd60..652f97e85 100644
--- a/Build/EvilLinker.hs
+++ b/Build/EvilLinker.hs
@@ -52,7 +52,7 @@ parseGccLink = do
path <- manyTill anyChar (try $ string collectcmd)
char ' '
collect2params <- restOfLine
- return $ CmdParams (path ++ collectcmd) collect2params
+ return $ CmdParams (path ++ collectcmd) (escapeDosPaths collect2params)
where
collectcmd = "collect2.exe"
collectenv = "COLLECT_GCC_OPTIONS"
@@ -64,6 +64,18 @@ parseGccLink = do
notFollowedBy collectenvline
restOfLine
+{- Input contains something like
+ - c:/program files/haskell platform/foo -LC:/Program Files/Haskell Platform/ -L...
+ - and the *right* spaces must be escaped with \
+ -
+ - Argh.
+ -}
+escapeDosPaths :: String -> String
+escapeDosPaths = replace "Program Files" "Program\\ Files"
+ . replace "program files" "program\\ files"
+ . replace "Haskell Platform" "Haskell\\ Platform"
+ . replace "haskell platform" "haskell\\ platform"
+
{- Find where collect2 calls ld. -}
parseCollect2 :: Parser CmdParams
parseCollect2 = error "TODO"