summaryrefslogtreecommitdiff
path: root/rules/distdir-way-opts.mk
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2016-01-18 17:32:27 +0100
committerBen Gamari <ben@smart-cactus.org>2016-01-19 00:07:33 +0100
commit240ddd7c39536776e955e881d709bbb039b48513 (patch)
treeb9686cb0e771a268b514a57dc8bec7e31601351c /rules/distdir-way-opts.mk
parentb8abd852d3674cb485490d2b2e94906c06ee6e8f (diff)
downloadhaskell-240ddd7c39536776e955e881d709bbb039b48513.tar.gz
Switch from -this-package-key to -this-unit-id.
A small cosmetic change, but we have to do a bit of work to actually support it: - Cabal submodule update, so that Cabal passes us -this-unit-id when we ask for it. This includes a Cabal renaming to be consistent with Unit ID, which makes ghc-pkg a bit more scrutable. - Build system is updated to use -this-unit-id rather than -this-package-key, to avoid deprecation warnings. Needs a version test so I resurrected the old test we had (sorry rwbarton!) - I've *undeprecated* -package-name, so that we are in the same state as GHC 7.10, since the "correct" flag will have only entered circulation in GHC 8.0. - I removed -package-key. Since we didn't deprecate -package-id I think this should not cause any problems for users; they can just change their code to use -package-id. - The package database is indexed by UNIT IDs, not component IDs. I updated the naming here. - I dropped the signatures field from ExposedModule; nothing was using it, and instantiatedWith from the package database field. - ghc-pkg was updated to use unit ID nomenclature, I removed the -package-key flags but I decided not to add any new flags for now. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: 23Skidoo, thomie, erikd Differential Revision: https://phabricator.haskell.org/D1780
Diffstat (limited to 'rules/distdir-way-opts.mk')
-rw-r--r--rules/distdir-way-opts.mk14
1 files changed, 13 insertions, 1 deletions
diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
index f6b9a45b8f..66c00afc73 100644
--- a/rules/distdir-way-opts.mk
+++ b/rules/distdir-way-opts.mk
@@ -96,9 +96,21 @@ define distdir-way-opts # args: $1 = dir, $2 = distdir, $3 = way, $4 = stage
# $1_$2_$3_MOST_HC_OPTS is also passed to C compilations when we use
# GHC as the C compiler.
+ifeq "$(SUPPORTS_THIS_UNIT_ID)" "NO"
+ifeq "$4" "0"
+$4_USE_THIS_UNIT_ID=NO
+endif
+endif
+
$1_$2_$4_DEP_OPTS = \
$$(foreach pkg,$$($1_$2_DEP_IPIDS),-package-id $$(pkg))
+ifeq "$($4_USE_THIS_UNIT_ID)" "NO"
+$4_THIS_UNIT_ID = -this-package-key
+else
+$4_THIS_UNIT_ID = -this-unit-id
+endif
+
$1_$2_$3_MOST_HC_OPTS = \
$$(WAY_$3_HC_OPTS) \
$$(CONF_HC_OPTS) \
@@ -107,7 +119,7 @@ $1_$2_$3_MOST_HC_OPTS = \
$$($1_HC_OPTS) \
$$($1_$2_HC_PKGCONF) \
$$(if $$($1_$2_PROG),, \
- $$(if $$($1_PACKAGE),-this-package-key $$($1_$2_COMPONENT_ID))) \
+ $$(if $$($1_PACKAGE),$$($4_THIS_UNIT_ID) $$($1_$2_COMPONENT_ID))) \
$$(if $$($1_PACKAGE),-hide-all-packages) \
-i $$(if $$($1_$2_HS_SRC_DIRS),$$(foreach dir,$$($1_$2_HS_SRC_DIRS),-i$1/$$(dir)),-i$1) \
-i$1/$2/build -i$1/$2/build/autogen \