From: simonmar Date: Wed, 26 Jan 2005 16:03:41 +0000 (+0000) Subject: [project @ 2005-01-26 16:03:40 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~1192 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=55aa70cdc5ebc3e1cb9d73907f3e9c72f82b6796;p=ghc-hetmet.git [project @ 2005-01-26 16:03:40 by simonmar] Common up the ghc_ge_XXX variables into config.mk, and add the ability to build ghc/lib and ghc/utils using the stage1 compiler, by saying 'make UseStage1=YES'. This is going to be useful for bootstrapping. --- diff --git a/ghc/lib/compat/Makefile b/ghc/lib/compat/Makefile index 6365954..30c5d18 100644 --- a/ghc/lib/compat/Makefile +++ b/ghc/lib/compat/Makefile @@ -7,6 +7,7 @@ ALL_DIRS = \ Distribution \ Distribution/Compat \ System \ + System/Directory \ cbits LIBRARY = libghccompat.a @@ -16,9 +17,7 @@ MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR) UseGhcForCc = YES -ghc_603_plus = $(shell if (test $(GhcCanonVersion) -ge 603); then echo YES; else echo NO; fi) - -ifeq "$(ghc_603_plus)" "YES" +ifeq "$(ghc_ge_603)" "YES" # These modules are all provided in GHC 6.3+ EXCLUDED_SRCS += \ System/Directory/Internals.hs \ diff --git a/ghc/mk/config.mk.in b/ghc/mk/config.mk.in index 2a787ca..27cfbd7 100644 --- a/ghc/mk/config.mk.in +++ b/ghc/mk/config.mk.in @@ -31,3 +31,27 @@ GhcHasReadline = @GhcHasReadline@ # GTK+ GTK_CONFIG = @GTK_CONFIG@ + +# ----------------------------------------------------------------------------- + +# We can build using the stage1 compiler by setting UseStage1=YES. +# This is useful when building up a set of .hc files for +# bootstrapping, because we need the ghc/lib/compat library and the +# contents of ghc/utils compiled with the stage1 compiler. + +ifeq "$(UseStage1)" "YES" +HC=$(GHC_STAGE1) +MKDEPENDHS=$(GHC_STAGE1) +endif + +# Some useful GHC version predicates: + +ifeq "$(UseStage1)" "YES" +ghc_ge_504 = YES +ghc_ge_601 = YES +ghc_ge_603 = YES +else +ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi) +ghc_ge_601 = $(shell if (test $(GhcCanonVersion) -ge 601); then echo YES; else echo NO; fi) +ghc_ge_603 = $(shell if (test $(GhcCanonVersion) -ge 603); then echo YES; else echo NO; fi) +endif diff --git a/ghc/utils/genapply/Makefile b/ghc/utils/genapply/Makefile index 394d884..1b54fe5 100644 --- a/ghc/utils/genapply/Makefile +++ b/ghc/utils/genapply/Makefile @@ -8,8 +8,6 @@ ifneq "$(BootingFromHc)" "YES" boot :: all endif -ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi) - ifeq "$(ghc_ge_504)" "NO" SRC_HC_OPTS += -package lang -package util -package text endif diff --git a/ghc/utils/genprimopcode/Makefile b/ghc/utils/genprimopcode/Makefile index 2b1ecd9..0cc38b0 100644 --- a/ghc/utils/genprimopcode/Makefile +++ b/ghc/utils/genprimopcode/Makefile @@ -3,12 +3,10 @@ include $(TOP)/mk/boilerplate.mk HS_PROG = genprimopcode -ghc_lt_504 = $(shell if (test $(GhcCanonVersion) -lt 504); then echo YES; else echo NO; fi) -ifeq "$(ghc_lt_504)" "YES" +ifeq "$(ghc_ge_504)" "NO" SRC_HC_OPTS += -package text endif -ghc_ge_601 = $(shell if (test $(GhcCanonVersion) -ge 601); then echo YES; else echo NO; fi) ifeq "$(ghc_ge_601)" "YES" SRC_HC_OPTS += -package parsec endif diff --git a/ghc/utils/ghc-pkg/Makefile b/ghc/utils/ghc-pkg/Makefile index c80ec17..809e0a9 100644 --- a/ghc/utils/ghc-pkg/Makefile +++ b/ghc/utils/ghc-pkg/Makefile @@ -9,9 +9,6 @@ INSTALLING=1 # ----------------------------------------------------------------------------- # ghc-pkg.bin -ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi) -ghc_ge_603 = $(shell if (test $(GhcCanonVersion) -ge 603); then echo YES; else echo NO; fi) - SRC_HC_OPTS += -cpp -Wall -fno-warn-name-shadowing -fno-warn-unused-matches SRC_HC_OPTS += -i$(GHC_LIB_COMPAT_DIR) diff --git a/ghc/utils/hsc2hs/Makefile b/ghc/utils/hsc2hs/Makefile index dee4085..3ec18d8 100644 --- a/ghc/utils/hsc2hs/Makefile +++ b/ghc/utils/hsc2hs/Makefile @@ -21,8 +21,6 @@ ifeq "$(HOSTPLATFORM)" "i386-unknown-cygwinw32" HS_PROG = hsc2hs$(exeext) endif -ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi) - ifeq "$(ghc_ge_504)" "NO" SRC_HC_OPTS += -package util endif