diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-05-29 19:53:17 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-01 06:40:41 -0400 |
commit | 95da76c2b9ffe2a4fb4230de0061918de3fc89a9 (patch) | |
tree | efea749b11fb1d5882c19641be72328f4e9dcb2b | |
parent | 68b71c4a99ef7c009e0095823950cd12408ad7fe (diff) | |
download | haskell-95da76c2b9ffe2a4fb4230de0061918de3fc89a9.tar.gz |
Hadrian: fix binary-dist target for cross-compilation
-rw-r--r-- | hadrian/src/Rules/BinaryDist.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs index 6b1bad005c..589c0e95fb 100644 --- a/hadrian/src/Rules/BinaryDist.hs +++ b/hadrian/src/Rules/BinaryDist.hs @@ -6,6 +6,7 @@ import CommandLine import Context import Expression import Oracles.Setting +import Oracles.Flag import Packages import Settings import Settings.Program (programContext) @@ -114,8 +115,9 @@ bindistRules = do phony "binary-dist-dir" $ do -- We 'need' all binaries and libraries targets <- mapM pkgTarget =<< stagePackages Stage1 + cross <- flag CrossCompiling need targets - needIservBins + unless cross $ needIservBins version <- setting ProjectVersion targetPlatform <- setting TargetPlatformFull @@ -134,7 +136,7 @@ bindistRules = do copyDirectory (ghcBuildDir -/- "bin") bindistFilesDir copyDirectory (ghcBuildDir -/- "lib") bindistFilesDir copyDirectory (rtsIncludeDir) bindistFilesDir - need ["docs"] + unless cross $ need ["docs"] -- TODO: we should only embed the docs that have been generated -- depending on the current settings (flavours' "ghcDocs" field and -- "--docs=.." command-line flag) @@ -151,9 +153,10 @@ bindistRules = do -- We copy the binary (<build root>/stage1/bin/haddock[.exe]) to -- the bindist's bindir (<build root>/bindist/ghc-.../bin/). - haddockPath <- programPath (vanillaContext Stage1 haddock) - copyFile haddockPath - (bindistFilesDir -/- "bin" -/- takeFileName haddockPath) + unless cross $ do + haddockPath <- programPath (vanillaContext Stage1 haddock) + copyFile haddockPath + (bindistFilesDir -/- "bin" -/- takeFileName haddockPath) -- We then 'need' all the files necessary to configure and install -- (as in, './configure [...] && make install') this build on some |