Skip to content

use ghc-paths to support cross-compiling #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion c2hs.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ Executable c2hs
bytestring,
language-c >= 0.7.1 && < 0.10,
filepath,
dlist
dlist,
ghc-paths

if flag(base3)
Build-Depends: base >= 3, process, directory, array, containers, pretty
Expand Down
3 changes: 2 additions & 1 deletion src/C2HS/Gen/Bind.hs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ import qualified Foreign.Storable as Storable (Storable(alignment),
Storable(sizeOf))
import Foreign (Ptr, FunPtr)
import Foreign.C
import GHC.Paths (ghc)

-- Language.C / compiler toolkit
import Language.C.Data.Position
Expand Down Expand Up @@ -3136,7 +3137,7 @@ cCompiler = unsafePerformIO $ do
case mcc of
Just cc -> return cc
Nothing -> do
(code, stdout, _) <- readProcessWithExitCode "ghc" ["--info"] ""
(code, stdout, _) <- readProcessWithExitCode ghc ["--info"] ""
when (code /= ExitSuccess) $
error "Failed to determine C compiler from 'ghc --info'!"
let vals = read stdout :: [(String, String)]
Expand Down