Commit e174dca4 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Drop nonCabalContext, since all GHC packages now come with Cabal files

parent 8dc4f73f
......@@ -12,7 +12,7 @@ module GHC (
testsuitePackages,
-- * Package information
programName, nonCabalContext, nonHsMainPackage, autogenPath, installStage,
programName, nonHsMainPackage, autogenPath, installStage,
-- * Miscellaneous
programPath, buildDll0, rtsContext, rtsBuildPath, libffiContext,
......@@ -157,12 +157,6 @@ programPath context@Context {..} = do
pgm <- programName context
return $ path -/- pgm <.> exe
-- TODO: This is no longer true -- both @hp2ps@ and @touchy@ appear to have been
-- Cabal-ised, so we need to drop these special cases.
-- | Some contexts are special: their packages do not have @.cabal@ metadata.
nonCabalContext :: Context -> Bool
nonCabalContext Context {..} = (package `elem` [hp2ps, touchy])
-- | Some program packages should not be linked with Haskell main function.
nonHsMainPackage :: Package -> Bool
nonHsMainPackage = (`elem` [ghc, hp2ps, iserv, touchy, unlit])
......
......@@ -72,11 +72,11 @@ packageTargets includeGhciLib stage pkg = do
else if isLibrary pkg
then do -- Collect all targets of a library package.
let pkgWays = if pkg == rts then getRtsWays else getLibraryWays
ways <- interpretInContext context pkgWays
libs <- mapM (pkgLibraryFile . Context stage pkg) ways
more <- libraryTargets includeGhciLib context
setup <- pkgSetupConfigFile context
return $ [ setup | not (nonCabalContext context) ] ++ libs ++ more
ways <- interpretInContext context pkgWays
libs <- mapM (pkgLibraryFile . Context stage pkg) ways
more <- libraryTargets includeGhciLib context
setup <- pkgSetupConfigFile context
return $ [setup] ++ libs ++ more
else do -- The only target of a program package is the executable.
prgContext <- programContext stage pkg
prgPath <- programPath prgContext
......
......@@ -133,5 +133,4 @@ includeGhcArgs = do
, cIncludeArgs
, arg $ "-I" ++ root -/- generatedDir
, arg $ "-optc-I" ++ root -/- generatedDir
, (not $ nonCabalContext context) ?
pure [ "-optP-include", "-optP" ++ autogen -/- "cabal_macros.h" ] ]
, pure [ "-optP-include", "-optP" ++ autogen -/- "cabal_macros.h" ] ]
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