Commit 6f5155cf authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Cope with gcc.exe and ld.exe not being where ex expect on Windows

parent 1a496ed1
......@@ -225,12 +225,21 @@ configureToolchain ghcProg =
compilerDir = takeDirectory (programPath ghcProg)
baseDir = takeDirectory compilerDir
libDir = baseDir </> "gcc-lib"
programFindLocationOnWindows prog windowsProgPath verbosity =
do -- On Windows windowsProgPath should exist. However, in case
-- it doesn't (and currently it doesn't for the inplace GHC)
-- we check that it does.
exists <- doesFileExist windowsProgPath
if exists then return (Just windowsProgPath)
else programFindLocation prog verbosity
isWindows = case buildOS of Windows -> True; _ -> False
-- on Windows finding and configuring ghc's gcc and ld is a bit special
findGcc | isWindows = \_ -> return (Just (baseDir </> "gcc.exe"))
findGcc | isWindows = programFindLocationOnWindows
gccProgram (baseDir </> "gcc.exe")
| otherwise = programFindLocation gccProgram
findLd | isWindows = \_ -> return (Just (libDir </> "ld.exe"))
findLd | isWindows = programFindLocationOnWindows
ldProgram (libDir </> "ld.exe")
| otherwise = programFindLocation ldProgram
configureGcc
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment