summaryrefslogtreecommitdiff
path: root/compiler/ghc.cabal.in
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-05-24 10:59:57 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-05-30 13:44:50 -0400
commitcac8c7bb098002ddce0ef7c1e4429940d22d8cc2 (patch)
tree547f1dba2414774d0c2fd6d2c5e5e838d22e00ad /compiler/ghc.cabal.in
parent6656f0165a30fc2a22208532ba384fc8e2f11b46 (diff)
downloadhaskell-cac8c7bb098002ddce0ef7c1e4429940d22d8cc2.tar.gz
hadrian: Fix building from source-dist without alex/happy
This fixes two bugs which were adding dependencies on alex/happy when building from a source dist. * When we try to pass `--with-alex` and `--with-happy` to cabal when configuring but the builders are not set. This is fixed by making them optional. * When we configure, cabal requires alex/happy because of the build-tool-depends fields. These are now made optional with a cabal flag (build-tool-depends) for compiler/hpc-bin/genprimopcode. Fixes #21627
Diffstat (limited to 'compiler/ghc.cabal.in')
-rw-r--r--compiler/ghc.cabal.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index 9e61e0e2a2..74d95cdc65 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -56,6 +56,12 @@ Flag dynamic-system-linker
Default: True
Manual: True
+-- hadrian disables this flag because the user may be building from a source
+-- distribution where the parser has already been generated.
+Flag build-tool-depends
+ Description: Use build-tool-depends
+ Default: True
+
Library
Default-Language: Haskell2010
Exposed: False
@@ -67,7 +73,8 @@ Library
FunTypes.h
ghc-llvm-version.h
- build-tool-depends: alex:alex >= 3.2.6, happy:happy >= 1.20.0, genprimopcode:genprimopcode, deriveConstants:deriveConstants
+ if flag(build-tool-depends)
+ build-tool-depends: alex:alex >= 3.2.6, happy:happy >= 1.20.0, genprimopcode:genprimopcode, deriveConstants:deriveConstants
Build-Depends: base >= 4.11 && < 4.17,
deepseq >= 1.4 && < 1.5,