Distribution \
Distribution/Compat \
System \
+ System/Directory \
cbits
LIBRARY = libghccompat.a
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 \
# 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
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
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
# -----------------------------------------------------------------------------
# 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)
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