- f pd' lbi muhs x
-
-add_configure_options :: [String] -> PostConfHook -> PostConfHook
-add_configure_options args f as cfs pd lbi
- = f (as ++ args) cfs pd lbi
-
-filter_modules_hook :: Hook a -> Hook a
-filter_modules_hook f pd lbi muhs x
- = let build_filter = case compilerFlavor $ compiler lbi of
- GHC -> forGHCBuild
- _ -> isPortableBuild
- lib' = case library pd of
- Just lib ->
- let ems = filter build_filter (exposedModules lib)
- in lib { exposedModules = ems }
- Nothing -> error "Expected a library"
- pd' = pd { library = Just lib' }
- in f pd' lbi muhs x
-
-isPortableBuild :: String -> Bool
-isPortableBuild s
- | "GHC" `isPrefixOf` s = False
- | "Data.Generics" `isPrefixOf` s = False
- | otherwise = s `notElem` ["Foreign.Concurrent", "System.Process"]
-
-forGHCBuild :: String -> Bool
-forGHCBuild = ("GHC.Prim" /=)
-
-add_extra_deps :: ConfHook -> ConfHook
-add_extra_deps f pd cf
- = do lbi <- f pd cf
- case compilerFlavor (compiler lbi) of
- GHC ->
- do -- Euch. We should just add the right thing to the lbi
- -- ourselves rather than rerunning configure.
- let pd' = pd { buildDepends = Dependency "rts" AnyVersion
- : buildDepends pd }
- f pd' cf
- _ ->
- return lbi