summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/Makefile8
-rw-r--r--compiler/ghc.cabal49
2 files changed, 38 insertions, 19 deletions
diff --git a/compiler/Makefile b/compiler/Makefile
index eabf9c6e6d..01a6ba4270 100644
--- a/compiler/Makefile
+++ b/compiler/Makefile
@@ -80,6 +80,14 @@ CONFIGURE_FLAGS_STAGE2 += --flags=-stage1
CONFIGURE_FLAGS_STAGE1 += --flags=-ghci
+ifeq "$(GhcWithNativeCodeGen)" "YES"
+CONFIGURE_FLAGS_STAGE1 += --flags=ncg
+CONFIGURE_FLAGS_STAGE2 += --flags=ncg
+else
+CONFIGURE_FLAGS_STAGE1 += --flags=-ncg
+CONFIGURE_FLAGS_STAGE2 += --flags=-ncg
+endif
+
ifeq "$(GhcWithInterpreter)" "YES"
CONFIGURE_FLAGS_STAGE2 += --flags=ghci
diff --git a/compiler/ghc.cabal b/compiler/ghc.cabal
index 5a628415f5..88b04d1c30 100644
--- a/compiler/ghc.cabal
+++ b/compiler/ghc.cabal
@@ -26,6 +26,9 @@ Flag editline
Flag ghci
Description: Build GHCi support.
+Flag ncg
+ Description: Build the NCG.
+
Flag stage1
Description: Is this stage 1?
@@ -60,6 +63,9 @@ Library
CPP-Options: -DGHCI
Include-Dirs: ../libffi/build/include
+ if !flag(ncg)
+ CPP-Options: -DOMIT_NATIVE_CODEGEN
+
-- GHC 6.4.2 needs to be able to find WCsubst.c, which needs to be
-- able to find WCsubst.h
Include-Dirs: ../libraries/base/cbits, ../libraries/base/include
@@ -98,7 +104,6 @@ Library
hsSyn
iface
main
- nativeGen
parser
prelude
profiling
@@ -269,24 +274,6 @@ Library
StaticFlags
SysTools
TidyPgm
- AsmCodeGen
- MachCodeGen
- MachInstrs
- MachRegs
- NCGMonad
- PositionIndependentCode
- PprMach
- RegAllocColor
- RegAllocInfo
- RegAllocLinear
- RegAllocStats
- RegArchBase
- RegArchX86
- RegCoalesce
- RegLiveness
- RegSpill
- RegSpillClean
- RegSpillCost
Ctype
HaddockLex
HaddockParse
@@ -418,6 +405,30 @@ Library
VectUtils
Vectorise
+ if flag(ncg)
+ hs-source-dirs:
+ nativeGen
+
+ Exposed-Modules:
+ AsmCodeGen
+ MachCodeGen
+ MachInstrs
+ MachRegs
+ NCGMonad
+ PositionIndependentCode
+ PprMach
+ RegAllocColor
+ RegAllocInfo
+ RegAllocLinear
+ RegAllocStats
+ RegArchBase
+ RegArchX86
+ RegCoalesce
+ RegLiveness
+ RegSpill
+ RegSpillClean
+ RegSpillCost
+
if flag(ghci)
Exposed-Modules:
DsMeta