From 391a299af4deb7bd593696ee6d53ac8f5c4667e1 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Mon, 18 Aug 2008 20:28:45 +0000 Subject: [PATCH] Fix making it possible to build without the NCG If GhcWithNativeCodeGen = NO then we don't build the NCG modules, and we define OMIT_NATIVE_CODEGEN --- compiler/Makefile | 8 ++++++++ compiler/ghc.cabal | 49 ++++++++++++++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/compiler/Makefile b/compiler/Makefile index eabf9c6..01a6ba4 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 5a62841..88b04d1 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 -- 1.7.10.4