Skip to content

Commit

Permalink
pass --host flag to configure when cross-compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa McHale committed Dec 4, 2018
1 parent d64ccf0 commit 5ef3478
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Cabal/Distribution/Simple.hs
Expand Up @@ -93,6 +93,7 @@ import Language.Haskell.Extension
import Distribution.Version
import Distribution.License
import Distribution.Pretty
import Distribution.System (buildPlatform)

-- Base
import System.Environment (getArgs, getProgName)
Expand Down Expand Up @@ -755,7 +756,9 @@ runConfigureScript verbosity backwardsCompatHack flags lbi = do
((intercalate spSep extraPath ++ spSep)++) $ lookup "PATH" env
overEnv = ("CFLAGS", Just cflagsEnv) :
[("PATH", Just pathEnv) | not (null extraPath)]
args' = configureFile':args ++ ["CC=" ++ ccProgShort]
hp = hostPlatform lbi
maybeHostFlag = if hp == buildPlatform then [] else ["--host=" ++ show (pretty hp)]
args' = configureFile':args ++ ["CC=" ++ ccProgShort] ++ maybeHostFlag
shProg = simpleProgram "sh"
progDb = modifyProgramSearchPath
(\p -> map ProgramSearchPathDir extraPath ++ p) emptyProgramDb
Expand Down

0 comments on commit 5ef3478

Please sign in to comment.