@@ -62,6 +62,8 @@ import Distribution.Simple.BuildPaths
6262import Distribution.Simple.Compiler
6363import Distribution.Simple.Errors
6464import Distribution.Simple.Flag
65+ import Distribution.Simple.GHC.Build.Link (hasThreaded )
66+ import Distribution.Simple.GHC.Build.Utils (isCxx , isHaskell )
6567import Distribution.Simple.GHC.EnvironmentParser
6668import Distribution.Simple.GHC.ImplInfo
6769import qualified Distribution.Simple.GHC.Internal as Internal
@@ -1242,13 +1244,6 @@ gbuildSources verbosity mbWorkDir pkgId specVer tmpDir bm =
12421244 , inputSourceModules = foreignLibModules flib
12431245 }
12441246
1245- isCxx :: FilePath -> Bool
1246- isCxx fp = elem (takeExtension fp) [" .cpp" , " .cxx" , " .c++" ]
1247-
1248- -- | FilePath has a Haskell extension: .hs or .lhs
1249- isHaskell :: FilePath -> Bool
1250- isHaskell fp = elem (takeExtension fp) [" .hs" , " .lhs" ]
1251-
12521247-- | Generic build function. See comment for 'GBuildMode'.
12531248gbuild
12541249 :: Verbosity
@@ -1776,7 +1771,7 @@ getRPaths _ _ = return mempty
17761771popThreadedFlag :: BuildInfo -> (BuildInfo , Bool )
17771772popThreadedFlag bi =
17781773 ( bi{options = filterHcOptions (/= " -threaded" ) (options bi)}
1779- , hasThreaded (options bi)
1774+ , hasThreaded bi
17801775 )
17811776 where
17821777 filterHcOptions
@@ -1786,9 +1781,6 @@ popThreadedFlag bi =
17861781 filterHcOptions p (PerCompilerFlavor ghc ghcjs) =
17871782 PerCompilerFlavor (filter p ghc) ghcjs
17881783
1789- hasThreaded :: PerCompilerFlavor [String ] -> Bool
1790- hasThreaded (PerCompilerFlavor ghc _) = elem " -threaded" ghc
1791-
17921784-- | Extracts a String representing a hash of the ABI of a built
17931785-- library. It can fail if the library has not yet been built.
17941786libAbiHash
0 commit comments