now it gets truely nightmarish

This commit is contained in:
Joey Hess 2013-12-06 13:39:35 -04:00
parent a5644eeeb9
commit 237f72990e

View file

@ -52,7 +52,7 @@ parseGccLink = do
path <- manyTill anyChar (try $ string collectcmd) path <- manyTill anyChar (try $ string collectcmd)
char ' ' char ' '
collect2params <- restOfLine collect2params <- restOfLine
return $ CmdParams (path ++ collectcmd) collect2params return $ CmdParams (path ++ collectcmd) (escapeDosPaths collect2params)
where where
collectcmd = "collect2.exe" collectcmd = "collect2.exe"
collectenv = "COLLECT_GCC_OPTIONS" collectenv = "COLLECT_GCC_OPTIONS"
@ -64,6 +64,18 @@ parseGccLink = do
notFollowedBy collectenvline notFollowedBy collectenvline
restOfLine 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. -} {- Find where collect2 calls ld. -}
parseCollect2 :: Parser CmdParams parseCollect2 :: Parser CmdParams
parseCollect2 = error "TODO" parseCollect2 = error "TODO"