[commit: ghc] master: Retire cabal_macros_boot.h hack (838a10f)

git at git.haskell.org git at git.haskell.org
Sat Sep 9 16:00:51 UTC 2017


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/838a10fcad9168895b49b4709056b549f2888860/ghc

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

commit 838a10fcad9168895b49b4709056b549f2888860
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sat Sep 9 17:37:03 2017 +0200

    Retire cabal_macros_boot.h hack
    
    I originally introduced this hack 3 years ago in
    b0379819e46796047c1574a6abccf186afd27afa, and finally we can
    retire it because starting with GHC 8.0 (which is the minimum
    required version to bootstrap GHC 8.4) these macros are generated
    natively by GHC.


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

838a10fcad9168895b49b4709056b549f2888860
 utils/ghc-cabal/cabal_macros_boot.h | 40 -------------------------------------
 utils/ghc-cabal/ghc.mk              |  9 ++-------
 2 files changed, 2 insertions(+), 47 deletions(-)

diff --git a/utils/ghc-cabal/cabal_macros_boot.h b/utils/ghc-cabal/cabal_macros_boot.h
deleted file mode 100644
index 3b130e8..0000000
--- a/utils/ghc-cabal/cabal_macros_boot.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* defines a few MIN_VERSION_...() macros used by some of the bootstrap packages */
-
-#if __GLASGOW_HASKELL__ >= 800
-/* macros are generated accurately by GHC on the fly */
-#elif __GLASGOW_HASKELL__ >= 711
-/* package base-4.9.0.0 */
-# define MIN_VERSION_base(major1,major2,minor) (\
-  (major1) <  4 || \
-  (major1) == 4 && (major2) <  9 || \
-  (major1) == 4 && (major2) == 9 && (minor) <= 0)
-/* package bytestring-0.10.8 */
-# define MIN_VERSION_bytestring(major1,major2,minor) (\
-  (major1) <  0 || \
-  (major1) == 0 && (major2) <  10 || \
-  (major1) == 0 && (major2) == 10 && (minor) <= 8)
-
-#elif __GLASGOW_HASKELL__ >= 709
-/* package base-4.8.0.0 */
-# define MIN_VERSION_base(major1,major2,minor) (\
-  (major1) <  4 || \
-  (major1) == 4 && (major2) <  8 || \
-  (major1) == 4 && (major2) == 8 && (minor) <= 0)
-/* package bytestring-0.10.6 */
-# define MIN_VERSION_bytestring(major1,major2,minor) (\
-  (major1) <  0 || \
-  (major1) == 0 && (major2) <  10 || \
-  (major1) == 0 && (major2) == 10 && (minor) <= 6)
-
-#elif __GLASGOW_HASKELL__ >= 707
-/* package base-4.7.0 */
-# define MIN_VERSION_base(major1,major2,minor) (\
-  (major1) <  4 || \
-  (major1) == 4 && (major2) <  7 || \
-  (major1) == 4 && (major2) == 7 && (minor) <= 0)
-/* package bytestring-0.10.4 */
-# define MIN_VERSION_bytestring(major1,major2,minor) (\
-  (major1) <  0 || \
-  (major1) == 0 && (major2) <  10 || \
-  (major1) == 0 && (major2) == 10 && (minor) <= 4)
-#endif
diff --git a/utils/ghc-cabal/ghc.mk b/utils/ghc-cabal/ghc.mk
index eeae8a7..e0d2afe 100644
--- a/utils/ghc-cabal/ghc.mk
+++ b/utils/ghc-cabal/ghc.mk
@@ -19,13 +19,9 @@ CABAL_VERSION := $(subst .,$(comma),$(CABAL_DOTTED_VERSION))
 CABAL_CONSTRAINT := --constraint="Cabal == $(CABAL_DOTTED_VERSION)"
 
 # Starting with GHC 8.0 we make use of GHC's native ability to
-# generate MIN_VERSION_<pkgname>() CPP macros (rather than relying on
-# the fragile `cabal_macros_boot.h` hack). The generation of those
+# generate MIN_VERSION_<pkgname>() CPP macros. The generation of those
 # macros is triggered by `-hide-all-packages`, so we have to explicitly
-# enumerate all packages we need in scope. In order to simplify the logic,
-# we pass `-hide-all-packages` also to GHCs < 8, and we include
-# `cabal_macros_boot.h` also for GHC >= 8 (in which case it becomes a
-# dummy include that doesn't contribute any macro definitions).
+# enumerate all packages we need in scope.
 ifeq "$(Windows_Host)" "YES"
 CABAL_BUILD_DEPS := ghc-prim base array transformers time containers bytestring deepseq process pretty directory Win32
 else
@@ -68,7 +64,6 @@ $(ghc-cabal_DIST_BINARY): $(CABAL_LEXER_DEP) utils/ghc-cabal/Main.hs $(TOUCH_DEP
 	       -DCABAL_VERSION=$(CABAL_VERSION) \
 	       -DCABAL_PARSEC \
 	       -DBOOTSTRAPPING \
-	       -optP-include -optPutils/ghc-cabal/cabal_macros_boot.h \
 	       -odir  bootstrapping \
 	       -hidir bootstrapping \
 	       $(CABAL_LEXER_DEP) \



More information about the ghc-commits mailing list