Skip to content

Commit

Permalink
Remove compilerBinaryName, use compilerId instead
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoutts committed Aug 4, 2007
1 parent 63f6c50 commit 1666bd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 3 additions & 12 deletions Distribution/Compiler.hs
Expand Up @@ -44,7 +44,6 @@ module Distribution.Compiler (
-- * Haskell implementations
CompilerFlavor(..), Compiler(..),
showCompilerId, compilerVersion,
compilerBinaryName,
compilerPath, compilerPkgToolPath,
-- * Support for language extensions
Opt,
Expand All @@ -56,8 +55,8 @@ module Distribution.Compiler (
#endif
) where

import Distribution.Version (Version(..), showVersion)
import Distribution.Package (PackageIdentifier(..))
import Distribution.Version (Version(..))
import Distribution.Package (PackageIdentifier(..), showPackageId)
import Language.Haskell.Extension (Extension(..))
import Distribution.Program

Expand All @@ -84,19 +83,11 @@ data Compiler = Compiler {
deriving (Show, Read)

showCompilerId :: Compiler -> String
showCompilerId (Compiler f (PackageIdentifier _ (Version [] _)) _ _) = compilerBinaryName f
showCompilerId (Compiler f (PackageIdentifier _ v) _ _) = compilerBinaryName f ++ '-': showVersion v
showCompilerId = showPackageId . compilerId

compilerVersion :: Compiler -> Version
compilerVersion = pkgVersion . compilerId

compilerBinaryName :: CompilerFlavor -> String
compilerBinaryName GHC = "ghc"
compilerBinaryName NHC = "hmake" -- FIX: uses hmake for now
compilerBinaryName Hugs = "ffihugs"
compilerBinaryName JHC = "jhc"
compilerBinaryName cmp = error $ "Unsupported compiler: " ++ (show cmp)

compilerPath :: Compiler -> FilePath
compilerPath = programPath . compilerProg

Expand Down
2 changes: 1 addition & 1 deletion Distribution/Simple/Configure.hs
Expand Up @@ -69,7 +69,7 @@ import Distribution.Simple.Register (removeInstalledConfig)
import Distribution.Setup(ConfigFlags(..), CopyDest(..))
import Distribution.Compiler(CompilerFlavor(..), Compiler(..),
compilerVersion, compilerPath, compilerPkgToolPath,
compilerBinaryName, extensionsToFlags)
extensionsToFlags)
import Distribution.Package (PackageIdentifier(..), showPackageId,
parsePackageId)
import Distribution.PackageDescription(
Expand Down

0 comments on commit 1666bd2

Please sign in to comment.