Commit 55aa70cd authored by simonmar's avatar simonmar
Browse files

[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.
parent ed009da3
......@@ -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 \
......
......@@ -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
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
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