Commit 838a10fc authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Retire cabal_macros_boot.h hack

I originally introduced this hack 3 years ago in
b0379819, 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.
parent 346e562a
/* 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
......@@ -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) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment