summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonmar <unknown>2005-01-26 16:03:41 +0000
committersimonmar <unknown>2005-01-26 16:03:41 +0000
commit55aa70cdc5ebc3e1cb9d73907f3e9c72f82b6796 (patch)
treea7f6ad7af3d6ae699ebb8d52856784cdcb57b7dd
parented009da3ac2263249bba0673a13bd0718aa2dcce (diff)
downloadhaskell-55aa70cdc5ebc3e1cb9d73907f3e9c72f82b6796.tar.gz
[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.
-rw-r--r--ghc/lib/compat/Makefile5
-rw-r--r--ghc/mk/config.mk.in24
-rw-r--r--ghc/utils/genapply/Makefile2
-rw-r--r--ghc/utils/genprimopcode/Makefile4
-rw-r--r--ghc/utils/ghc-pkg/Makefile3
-rw-r--r--ghc/utils/hsc2hs/Makefile2
6 files changed, 27 insertions, 13 deletions
diff --git a/ghc/lib/compat/Makefile b/ghc/lib/compat/Makefile
index 6365954fbe..30c5d18889 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 2a787ca14b..27cfbd7596 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 394d88406f..1b54fe53f9 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 2b1ecd9ad6..0cc38b0e83 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 c80ec179af..809e0a9d09 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 dee408510f..3ec18d8e4f 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