[commit: ghc] master: Add BUILD_DPH variable to GHC build-system (88d85aa)

git at git.haskell.org git at git.haskell.org
Sun Jun 29 06:59:50 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/88d85aa65ea15d984bf207f82d99928eda0b6c26/ghc

>---------------------------------------------------------------

commit 88d85aa65ea15d984bf207f82d99928eda0b6c26
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sat Jun 28 20:23:48 2014 +0200

    Add BUILD_DPH variable to GHC build-system
    
    Now that the `libraries/dph` submodule is checked out always we need
    a different way to disable building DPH to save compile-time while
    developing GHC.
    
    This commit adds a new YES/NO Make variable `BUILD_DPH` that can be used
    inside mk/build.mk to control whether to build libraries/dph or not.
    The default setting is `BUILD_DPH=YES` (via `mk/config.mk.in`).
    
    This also changes `validate`'s flag `--no-dph` to explicitly disable DPH
    for the current validation run.
    
    Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org>
    
    Test Plan: successful validates with `--fast --no-dph`
    
    Differential Revision: https://phabricator.haskell.org/D31


>---------------------------------------------------------------

88d85aa65ea15d984bf207f82d99928eda0b6c26
 ghc.mk             | 16 +++++++++++++---
 mk/build.mk.sample |  3 +++
 mk/config.mk.in    |  3 +++
 validate           | 13 ++++++++++---
 4 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/ghc.mk b/ghc.mk
index 3beab67..e9d7e83 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -452,9 +452,17 @@ ifneq "$(CrossCompiling)" "YES"
 define addExtraPackage
 ifeq "$2" "-"
 # Do nothing; this package is already handled above
-else ifeq "$2 $$(GhcProfiled)" "dph YES"
-# Ignore the package: These packages need TH, which is incompatible
-# with a profiled GHC
+else ifeq "$2" "dph"
+## DPH-specific clause
+ifeq "$$(GhcProfiled)" "YES"
+# Ignore package: The DPH packages need TH, which is incompatible with
+# a profiled GHC
+else ifneq "$$(BUILD_DPH)" "YES"
+# Ignore package: DPH was disabled
+else
+PACKAGES_STAGE2 += $1
+endif
+## end of DPH-specific clause
 else
 PACKAGES_STAGE2 += $1
 endif
@@ -635,8 +643,10 @@ ifneq "$(CLEANING)" "YES"
 BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE2))
 BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE1))
 BUILD_DIRS += $(patsubst %, libraries/%, $(filter-out $(PACKAGES_STAGE1),$(PACKAGES_STAGE0)))
+ifeq "$(BUILD_DPH)" "YES"
 BUILD_DIRS += $(wildcard libraries/dph)
 endif
+endif
 
 
 ifeq "$(INTEGER_LIBRARY)" "integer-gmp"
diff --git a/mk/build.mk.sample b/mk/build.mk.sample
index 3d47bbe..a323884 100644
--- a/mk/build.mk.sample
+++ b/mk/build.mk.sample
@@ -66,6 +66,9 @@ V = 1
 # working on stage 2 and want to freeze stage 1 and the libraries for
 # a while.
 
+# Uncomment the following line to disable building DPH
+#BUILD_DPH=NO
+
 GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v)
 
 # ----------- A Performance/Distribution build --------------------------------
diff --git a/mk/config.mk.in b/mk/config.mk.in
index afe48ab..7a73d46 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -790,6 +790,9 @@ else
 HSCOLOUR_SRCS = YES
 endif
 
+# Build DPH?
+BUILD_DPH = YES
+
 ################################################################################
 #
 #    Library configure arguments
diff --git a/validate b/validate
index 889c0e8..cabb86c 100755
--- a/validate
+++ b/validate
@@ -22,9 +22,10 @@ Flags:
   --fast            Omit dyn way, omit binary distribution
   --slow            Build stage2 with -DDEBUG.
                     2008-07-01: 14% slower than the default.
-  --no-dph:         Skip requiring libraries/dph. In --slow mode, these tests
-                    can take a substantial amount of time, and on some platforms
-                    with broken linkers, we don't want to try compiling it.
+  --no-dph:         Skip building libraries/dph and running associated tests.
+                    In --slow mode, these tests can take a substantial amount
+                    of time, and on some platforms with broken linkers, we
+                    don't want to try compiling it.
   --help            shows this usage help.
 
   Set environment variable 'CPUS' to number of cores, to exploit
@@ -135,6 +136,12 @@ echo "Validating=YES"       >  mk/are-validating.mk
 echo "ValidateSpeed=$speed" >> mk/are-validating.mk
 echo "ValidateHpc=$hpc"     >> mk/are-validating.mk
 
+if [ $skip_dph -eq 1 ]; then
+    echo "BUILD_DPH=NO"     >> mk/are-validating.mk
+else
+    echo "BUILD_DPH=YES"    >> mk/are-validating.mk
+fi
+
 $make -j$threads
 # For a "debug make", add "--debug=b --debug=m"
 



More information about the ghc-commits mailing list