[commit: ghc] master: Add PACKAGES_STAGE0 to build-dirs too; fixes #7700 (056997a)
Ian Lynagh
igloo at earth.li
Sun Mar 3 15:25:40 CET 2013
Repository : http://darcs.haskell.org/ghc.git/
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/056997a285a368f5f78905b4b325a3258484f71d
>---------------------------------------------------------------
commit 056997a285a368f5f78905b4b325a3258484f71d
Author: Ian Lynagh <ian at well-typed.com>
Date: Sun Mar 3 13:35:41 2013 +0000
Add PACKAGES_STAGE0 to build-dirs too; fixes #7700
This is sometimes needed when cross-compiling, as some packages may be
built in stage 0 but not stage 1.
In order to make everything work out, this also removes the requirement
that the build-dirs are in dependency order
>---------------------------------------------------------------
ghc.mk | 16 ++++++++--------
rules/haddock.mk | 5 ++++-
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/ghc.mk b/ghc.mk
index 191987c..f9f9785 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -583,9 +583,6 @@ endif
# -----------------------------------------------------------------------------
# Include build instructions from all subdirs
-# These need to be in dependency order, as some of the rules refer to
-# variables defined by their dependencies
-
ifneq "$(BINDIST)" "YES"
BUILD_DIRS += utils/mkdirhier
endif
@@ -621,7 +618,15 @@ BUILD_DIRS += utils/genapply
endif
ifneq "$(CLEANING)" "YES"
+# These are deliberately in reverse order, so as to ensure that
+# there is no need to have them in dependency order. That's important
+# because it's tricky to ensure that they are in dependency order when
+# cross-compiling, as some packages may only be in PACKAGES_STAGE0
+# or PACKAGES_STAGE1.
+BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE2))
BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE1))
+BUILD_DIRS += $(patsubst %, libraries/%, $(filter-out $(PACKAGES_STAGE1),$(PACKAGES_STAGE0))
+BUILD_DIRS += libraries/dph
endif
@@ -655,11 +660,6 @@ BUILD_DIRS += $(MAYBE_HPC)
BUILD_DIRS += $(MAYBE_RUNGHC)
BUILD_DIRS += ghc
-ifneq "$(CLEANING)" "YES"
-BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE2))
-BUILD_DIRS += libraries/dph
-endif
-
ifneq "$(BINDIST)" "YES"
ifneq "$(CrossCompiling)-$(phase)" "YES-final"
BUILD_DIRS += utils/mkUserGuidePart
diff --git a/rules/haddock.mk b/rules/haddock.mk
index 99a93f1..4ef0fb1 100644
--- a/rules/haddock.mk
+++ b/rules/haddock.mk
@@ -40,7 +40,10 @@ $1_$2_HADDOCK_FLAGS += --source-module=src/%{MODULE/./-}.html --source-entity=sr
endif
ifneq "$$(BINDIST)" "YES"
-$$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_FILE) : $$(INPLACE_BIN)/haddock$$(exeext) $$(GHC_CABAL_INPLACE) $$($1_$2_HS_SRCS) $$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_DEPS) | $$$$(dir $$$$@)/.
+# We need the quadruple dollars for the dependencies, as it isn't
+# guaranteed that we are processing the packages in dependency order,
+# so we don't want to expand it yet.
+$$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_FILE) : $$(INPLACE_BIN)/haddock$$(exeext) $$(GHC_CABAL_INPLACE) $$($1_$2_HS_SRCS) $$$$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_DEPS) | $$$$(dir $$$$@)/.
ifeq "$$(HSCOLOUR_SRCS)" "YES"
"$$(GHC_CABAL_INPLACE)" hscolour $2 $1
endif
More information about the ghc-commits
mailing list