From 61bc3618c0c9df71e1cc16f4c7e74f77ff9e16bc Mon Sep 17 00:00:00 2001 From: Duncan Coutts <duncan.coutts@worc.ox.ac.uk> Date: Tue, 4 Jul 2006 00:19:26 +0000 Subject: [PATCH] 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. --- Distribution/PreProcess.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Distribution/PreProcess.hs b/Distribution/PreProcess.hs index bab8ed9803..75464aef57 100644 --- a/Distribution/PreProcess.hs +++ b/Distribution/PreProcess.hs @@ -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 -- GitLab