Skip to content

Commit

Permalink
On windows, pick up ar.exe from the ghc install before looking on the…
Browse files Browse the repository at this point in the history
… $PATH

Some ar.exe versions floating around seem to have weird non-posix behaviour.
  • Loading branch information
dcoutts committed Mar 20, 2010
1 parent 3f1c9cc commit bb9f705
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Distribution/Simple/GHC.hs
Expand Up @@ -202,21 +202,29 @@ configureToolchain :: ConfiguredProgram -> ProgramConfiguration
configureToolchain ghcProg =
addKnownProgram gccProgram {
programFindLocation = findProg gccProgram
[ baseDir </> "gcc.exe",
mingwDir </> "bin" </> "gcc.exe" ],
[ if ghcVersion >= Version [6,12] []
then mingwBinDir </> "gcc.exe"
else baseDir </> "gcc.exe" ],
programPostConf = configureGcc
}
. addKnownProgram ldProgram {
programFindLocation = findProg ldProgram
[ libDir </> "ld.exe",
mingwDir </> "mingw32" </> "bin" </> "ld.exe" ],
[ if ghcVersion >= Version [6,12] []
then mingwBinDir </> "ld.exe"
else libDir </> "ld.exe" ],
programPostConf = configureLd
}
. addKnownProgram arProgram {
programFindLocation = findProg arProgram
[ if ghcVersion >= Version [6,12] []
then mingwBinDir </> "ar.exe"
else libDir </> "ar.exe" ]
}
where
Just ghcVersion = programVersion ghcProg
compilerDir = takeDirectory (programPath ghcProg)
baseDir = takeDirectory compilerDir
mingwDir = baseDir </> "mingw"
mingwBinDir = baseDir </> "mingw" </> "bin"
libDir = baseDir </> "gcc-lib"
includeDir = baseDir </> "include" </> "mingw"
isWindows = case buildOS of Windows -> True; _ -> False
Expand Down

0 comments on commit bb9f705

Please sign in to comment.