[commit: ghc] wip/angerman/backport/8.6/reinstallable-lib-ghc: Migrate flag logic from ghc to ghc-prim; add HsVersion.h to rts (9a03279)

git at git.haskell.org git at git.haskell.org
Fri Mar 8 01:45:10 UTC 2019


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

On branch  : wip/angerman/backport/8.6/reinstallable-lib-ghc
Link       : http://ghc.haskell.org/trac/ghc/changeset/9a03279d3d5e684c7777ef04eab990420e4365f9/ghc

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

commit 9a03279d3d5e684c7777ef04eab990420e4365f9
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Wed Mar 6 16:35:08 2019 +0800

    Migrate flag logic from ghc to ghc-prim; add HsVersion.h to rts


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

9a03279d3d5e684c7777ef04eab990420e4365f9
 ghc/ghc.mk                        |  4 ----
 libraries/ghc-prim/ghc-prim.cabal | 16 ++++++++++++++++
 libraries/ghc-prim/ghc.mk         |  5 +++++
 rts/rts.cabal.in                  |  1 +
 4 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/ghc/ghc.mk b/ghc/ghc.mk
index 05354fb..b062443 100644
--- a/ghc/ghc.mk
+++ b/ghc/ghc.mk
@@ -14,10 +14,6 @@ ghc_USES_CABAL = YES
 ghc_PACKAGE = ghc-bin
 ghc_EXECUTABLE = ghc
 
-ghc_stage1_CONFIGURE_OPTS += --flags=stage1
-ghc_stage2_CONFIGURE_OPTS += --flags=stage2
-ghc_stage3_CONFIGURE_OPTS += --flags=stage3
-
 ifeq "$(GhcWithInterpreter)" "YES"
 ghc_stage2_CONFIGURE_OPTS += --flags=ghci
 ghc_stage3_CONFIGURE_OPTS += --flags=ghci
diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cabal
index 3bc849b..1432360 100644
--- a/libraries/ghc-prim/ghc-prim.cabal
+++ b/libraries/ghc-prim/ghc-prim.cabal
@@ -12,6 +12,16 @@ build-type:     Custom
 description:
     This package contains the primitive types and operations supplied by GHC.
 
+Flag boot
+    Description: Is this stage 1?
+    Default: False
+    Manual: True
+
+Flag install
+    Description: Is this stage 2?
+    Default: True
+    Manual: True
+
 extra-source-files: changelog.md
 
 source-repository head
@@ -82,6 +92,12 @@ Library
     -- as it's magic.
     ghc-options: -this-unit-id ghc-prim
 
+    if flag(boot)
+      include-dirs: dist-boot
+    else
+      if flag(install)
+        include-dirs: dist-install
+
     install-includes:
         primop-data-decl.hs-incl
         primop-tag.hs-incl
diff --git a/libraries/ghc-prim/ghc.mk b/libraries/ghc-prim/ghc.mk
index 87f676f..5b09478 100644
--- a/libraries/ghc-prim/ghc.mk
+++ b/libraries/ghc-prim/ghc.mk
@@ -1,6 +1,11 @@
 libraries/ghc-prim_PACKAGE = ghc-prim
 libraries/ghc-prim_dist-install_GROUP = libraries
 
+libraries/ghc-prim_stage1_CONFIGURE_OPTS += --flags=boot
+libraries/ghc-prim_stage2_CONFIGURE_OPTS += --flags=install
+libraries/ghc-prim_stage3_CONFIGURE_OPTS += --flags=install
+
+
 # ----------------------------------------
 # Special magic for the ghc-prim package
 
diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in
index 508f5ec..4ab75bc 100644
--- a/rts/rts.cabal.in
+++ b/rts/rts.cabal.in
@@ -106,6 +106,7 @@ library
                       CodeGen.Platform.hs
                       platformConstants
                       config.hs-incl
+                      HsVersions.h
                       -- ^ generated
                       rts/Adjustor.h
                       rts/BlockSignals.h



More information about the ghc-commits mailing list