Skip to content
Snippets Groups Projects
Commit 5298ac6e authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Look for the 'haddock' exe in the GHC bin dir first.

Fixes #2475.
parent cb7c3f52
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ import Distribution.Simple.Program ...@@ -79,7 +79,7 @@ import Distribution.Simple.Program
, rawSystemProgramStdout, rawSystemProgramStdoutConf , rawSystemProgramStdout, rawSystemProgramStdoutConf
, getProgramInvocationOutput, requireProgramVersion, requireProgram , getProgramInvocationOutput, requireProgramVersion, requireProgram
, userMaybeSpecifyPath, programPath, lookupProgram, addKnownProgram , userMaybeSpecifyPath, programPath, lookupProgram, addKnownProgram
, ghcProgram, ghcPkgProgram, hsc2hsProgram, ldProgram ) , ghcProgram, ghcPkgProgram, haddockProgram, hsc2hsProgram, ldProgram )
import qualified Distribution.Simple.Program.HcPkg as HcPkg import qualified Distribution.Simple.Program.HcPkg as HcPkg
import qualified Distribution.Simple.Program.Ar as Ar import qualified Distribution.Simple.Program.Ar as Ar
import qualified Distribution.Simple.Program.Ld as Ld import qualified Distribution.Simple.Program.Ld as Ld
...@@ -147,11 +147,15 @@ configure verbosity hcPath hcPkgPath conf0 = do ...@@ -147,11 +147,15 @@ configure verbosity hcPath hcPkgPath conf0 = do
++ programPath ghcProg ++ " is version " ++ display ghcVersion ++ " " ++ programPath ghcProg ++ " is version " ++ display ghcVersion ++ " "
++ programPath ghcPkgProg ++ " is version " ++ display ghcPkgVersion ++ programPath ghcPkgProg ++ " is version " ++ display ghcPkgVersion
-- Likewise we try to find the matching hsc2hs program. -- Likewise we try to find the matching hsc2hs and haddock programs.
let hsc2hsProgram' = hsc2hsProgram { let hsc2hsProgram' = hsc2hsProgram {
programFindLocation = guessHsc2hsFromGhcPath ghcProg programFindLocation = guessHsc2hsFromGhcPath ghcProg
} }
conf3 = addKnownProgram hsc2hsProgram' conf2 haddockProgram' = haddockProgram {
programFindLocation = guessHaddockFromGhcPath ghcProg
}
conf3 = addKnownProgram haddockProgram' $
addKnownProgram hsc2hsProgram' conf2
languages <- Internal.getLanguages verbosity implInfo ghcProg languages <- Internal.getLanguages verbosity implInfo ghcProg
extensions <- Internal.getExtensions verbosity implInfo ghcProg extensions <- Internal.getExtensions verbosity implInfo ghcProg
...@@ -242,6 +246,18 @@ guessHsc2hsFromGhcPath :: ConfiguredProgram ...@@ -242,6 +246,18 @@ guessHsc2hsFromGhcPath :: ConfiguredProgram
-> Verbosity -> ProgramSearchPath -> IO (Maybe FilePath) -> Verbosity -> ProgramSearchPath -> IO (Maybe FilePath)
guessHsc2hsFromGhcPath = guessToolFromGhcPath hsc2hsProgram guessHsc2hsFromGhcPath = guessToolFromGhcPath hsc2hsProgram
-- | Given something like /usr/local/bin/ghc-6.6.1(.exe) we try and find a
-- corresponding haddock, we try looking for both a versioned and unversioned
-- haddock in the same dir, that is:
--
-- > /usr/local/bin/haddock-ghc-6.6.1(.exe)
-- > /usr/local/bin/haddock-6.6.1(.exe)
-- > /usr/local/bin/haddock(.exe)
--
guessHaddockFromGhcPath :: ConfiguredProgram
-> Verbosity -> ProgramSearchPath -> IO (Maybe FilePath)
guessHaddockFromGhcPath = guessToolFromGhcPath haddockProgram
getGhcInfo :: Verbosity -> ConfiguredProgram -> IO [(String, String)] getGhcInfo :: Verbosity -> ConfiguredProgram -> IO [(String, String)]
getGhcInfo verbosity ghcProg = Internal.getGhcInfo verbosity implInfo ghcProg getGhcInfo verbosity ghcProg = Internal.getGhcInfo verbosity implInfo ghcProg
where where
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment