diff options
author | Ben Gamari <ben@smart-cactus.org> | 2017-12-08 12:42:35 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-12-08 13:22:41 -0500 |
commit | 7733e44dd4ba7e7a0a9f3456e6ddc32decbcf5a3 (patch) | |
tree | 79c5e7151d760e6c7617d8450fb9ec2a10560989 /hadrian/src/Settings.hs | |
parent | 5695f462f604fc63cbb45a7f3073bc114f9b475f (diff) | |
download | haskell-7733e44dd4ba7e7a0a9f3456e6ddc32decbcf5a3.tar.gz |
Rip out hadrian subtree
Sadly subtrees haven't worked quite as well as we would have liked for
developers. See Hadrian #440.
Diffstat (limited to 'hadrian/src/Settings.hs')
-rw-r--r-- | hadrian/src/Settings.hs | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/hadrian/src/Settings.hs b/hadrian/src/Settings.hs deleted file mode 100644 index 091efc10ca..0000000000 --- a/hadrian/src/Settings.hs +++ /dev/null @@ -1,68 +0,0 @@ -module Settings ( - getArgs, getLibraryWays, getRtsWays, flavour, knownPackages, - findPackageByName, getPkgData, getPkgDataList, isLibrary, stagePackages, - programContext, getIntegerPackage, getDestDir - ) where - -import CommandLine -import Expression -import Flavour -import {-# SOURCE #-} Settings.Default -import Settings.Flavours.Development -import Settings.Flavours.Performance -import Settings.Flavours.Profiled -import Settings.Flavours.Quick -import Settings.Flavours.Quickest -import Settings.Flavours.QuickCross -import UserSettings - -getArgs :: Args -getArgs = expr flavour >>= args - -getLibraryWays :: Ways -getLibraryWays = expr flavour >>= libraryWays - -getRtsWays :: Ways -getRtsWays = expr flavour >>= rtsWays - -stagePackages :: Stage -> Action [Package] -stagePackages stage = do - f <- flavour - packages f stage - -hadrianFlavours :: [Flavour] -hadrianFlavours = - [ defaultFlavour, developmentFlavour Stage1, developmentFlavour Stage2 - , performanceFlavour, profiledFlavour, quickFlavour, quickestFlavour - , quickCrossFlavour ] - -flavour :: Action Flavour -flavour = do - flavourName <- fromMaybe "default" <$> cmdFlavour - let unknownFlavour = error $ "Unknown build flavour: " ++ flavourName - flavours = hadrianFlavours ++ userFlavours - return $ fromMaybe unknownFlavour $ find ((== flavourName) . name) flavours - -getIntegerPackage :: Expr Package -getIntegerPackage = expr (integerLibrary =<< flavour) - -programContext :: Stage -> Package -> Action Context -programContext stage pkg = do - profiled <- ghcProfiled <$> flavour - return $ if pkg == ghc && profiled && stage > Stage0 - then Context stage pkg profiling - else vanillaContext stage pkg - --- TODO: switch to Set Package as the order of packages should not matter? --- Otherwise we have to keep remembering to sort packages from time to time. -knownPackages :: [Package] -knownPackages = sort $ ghcPackages ++ userPackages - --- TODO: Speed up? Switch to Set? --- Note: this is slow but we keep it simple as there are just ~50 packages -findPackageByName :: PackageName -> Maybe Package -findPackageByName name = find (\pkg -> pkgName pkg == name) knownPackages - --- | Install's DESTDIR setting. -getDestDir :: Action FilePath -getDestDir = fromMaybe "" <$> cmdInstallDestDir |