Commit 61bc3618 authored by duncan.coutts@worc.ox.ac.uk's avatar duncan.coutts@worc.ox.ac.uk
Browse files

Change flags passed to hsc2hs

The extra-libraries must be passed as -L-l${lib} or linking the C prog
that hsc2hs generates may fail if any symbols are referenced.
Also can't use cppOptions function since hsc2hs doesn't support -U.
Need to do -U flags in ccOptions seperately.
parent d1b640ff
......@@ -232,7 +232,12 @@ ppCpp' inputArgs bi lbi =
ppHsc2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppHsc2hs bi lbi
= maybe (ppNone "hsc2hs") pp (withHsc2hs lbi)
where pp n = standardPP n (cppOptions bi lbi)
where pp n = standardPP n (hcDefines (compiler lbi)
++ ["-I" ++ dir | dir <- includeDirs bi]
++ [opt | opt@('-':c:_) <- ccOptions bi, c == 'D' || c == 'I']
++ ["--cflag=" ++ opt | opt@('-':'U':_) <- ccOptions bi]
++ ["--lflag=-L" ++ dir | dir <- extraLibDirs bi]
++ ["--lflag=-l" ++ lib | lib <- extraLibs bi])
ppC2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppC2hs bi lbi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment