Commit 098c9ece authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Pass __GLASGOW_HASKELL__ to gcc when compiling directory.c

parent b0424dc9
module Settings.Builders.Gcc (gccArgs, gccMArgs) where
import Expression
import GHC
import Oracles
import Predicates (stagedBuilder)
import Predicates (package, stagedBuilder)
import Settings
-- TODO: I had to define symbol __GLASGOW_HASKELL__ as otherwise directory.c is
-- effectively empty. I presume it was expected that GHC will be used for
-- compiling all C files, but I don't know why. It seems that directory.c is the
-- only file which requires special treatment when using GCC.
gccArgs :: Args
gccArgs = stagedBuilder Gcc ? mconcat [ commonGccArgs
, arg "-c", arg =<< getInput
, arg "-o", arg =<< getOutput ]
gccArgs = stagedBuilder Gcc ?
mconcat [ commonGccArgs
, package directory ? arg "-D__GLASGOW_HASKELL__"
, arg "-c", arg =<< getInput
, arg "-o", arg =<< getOutput ]
-- TODO: handle custom $1_$2_MKDEPENDC_OPTS and
gccMArgs :: Args
......
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