Skip to content

Commit

Permalink
Use --with-compiler and --with-hc-pkg.
Browse files Browse the repository at this point in the history
  • Loading branch information
bringert committed Oct 13, 2007
1 parent 451eb23 commit f0d73ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions Hackage/Config.hs
Expand Up @@ -128,11 +128,13 @@ pkgURL pkg = joinWith "/" [repoURL (pkgRepo pkg), pkgName p, showVersion (pkgVer
-- * Compiler and programs
--

-- FIXME: should use --with flags
findCompiler :: ConfigFlags -> IO (Compiler, ProgramConfiguration)
findCompiler cfg = Configure.configCompiler
(Just (configCompiler cfg))
Nothing Nothing defaultProgramConfiguration (configVerbose cfg)
(configCompilerPath cfg)
(configHcPkgPath cfg)
defaultProgramConfiguration
(configVerbose cfg)

--
-- * Default config
Expand All @@ -159,6 +161,8 @@ defaultConfigFlags =
cacheDir <- defaultCacheDir
return $ ConfigFlags
{ configCompiler = defaultCompiler
, configCompilerPath = Nothing
, configHcPkgPath = Nothing
, configInstallDirs = installDirs { prefixDirTemplate = toPathTemplate defaultPrefix }
, configCacheDir = cacheDir
, configRepos = [Repo "hackage.haskell.org" "http://hackage.haskell.org/packages/archive"]
Expand Down
4 changes: 2 additions & 2 deletions Hackage/Setup.hs
Expand Up @@ -81,8 +81,8 @@ configFromOptions :: ConfigFlags -> [Option] -> ConfigFlags
configFromOptions = foldr f
where f o cfg = case o of
OptCompilerFlavor c -> cfg { configCompiler = c}
OptCompiler _ -> cfg -- FIXME: where do we store this?
OptHcPkg _ -> cfg -- FIXME: where do we store this?
OptCompiler p -> cfg { configCompilerPath = Just p }
OptHcPkg p -> cfg { configHcPkgPath = Just p }
OptConfigFile _ -> cfg
OptCacheDir d -> cfg { configCacheDir = d }
OptPrefix d -> lib (\ds x -> ds { prefixDirTemplate = x }) d
Expand Down
2 changes: 2 additions & 0 deletions Hackage/Types.hs
Expand Up @@ -60,6 +60,8 @@ data Option = OptCompilerFlavor CompilerFlavor

data ConfigFlags = ConfigFlags {
configCompiler :: CompilerFlavor,
configCompilerPath :: Maybe FilePath,
configHcPkgPath :: Maybe FilePath,
configInstallDirs :: InstallDirTemplates,
configCacheDir :: FilePath,
configRepos :: [Repo], -- ^Available Hackage servers.
Expand Down

0 comments on commit f0d73ad

Please sign in to comment.