From 8e6126c2a612d83741987fc8e2b37b1500696643 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 6 Dec 2013 13:39:35 -0400 Subject: now it gets truely nightmarish --- Build/EvilLinker.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Build') 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" -- cgit v1.2.3