Description
It seems currently cabal cannot know whether it cross-compiles or not, i.e. you can pass --with-ghc
, --with-gcc
, --with-ld
etc flags pointing to cross-compiler and other tools but there's no way to tell cabal to not try building setup executable with these tools.
When build-type
of a package is Simple
the cabal can avoid creating setup executable and is able to cross-compile a package. But when build-type
is Custom
, or when, for some other reason which I haven't figured out, cabal decides to build setup executable it uses cross-compiler and executable generally cannot be runned on the platform you're compiling. And so the cross-compilation process fails even when it could be successfully finished by using /usr/bin/runghc Setup.hs
(presuming that runghc is the native interpreter for the platform you`re building on).
Given the need to support Custom
build types I'd like to suggest to add an option to cabal to compile Setup.hs files with user-supplied ghc or to run them with user-supplied runghc rather than compiling them with compiler from --with-ghc
.
Or maybe I missed something obvious and someone can point it out.