summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2014-07-19 16:24:59 +0100
committerEdward Z. Yang <ezyang@cs.stanford.edu>2014-07-21 02:27:58 -0700
commitbb06e2a8ae38f0fcfbd2cdfa1f42dfa1e252c939 (patch)
treed2ea0d83e65aa278e1ab336d39a2c8a4e3ca6d70
parent4dd7ae620d7b2edc5b03d6f5bd0985006e9448e3 (diff)
downloadhaskell-bb06e2a8ae38f0fcfbd2cdfa1f42dfa1e252c939.tar.gz
Make 'ghc' a wired in package.
Summary: Previously, the GHC API was "semi" wired-in: it was installed with a version number, but that version number was hard-coded into the compiler and it wasn't really possible to install other copies of the GHC API. This patch makes the GHC API more similar to existing wired-in packages such as ghc-prim, and will be helpful when we start extending the amount of information passed to -package-name. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonmar, simonpj, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D78
-rw-r--r--compiler/basicTypes/Module.lhs2
-rw-r--r--compiler/ghc.cabal.in7
-rw-r--r--compiler/main/Packages.lhs1
3 files changed, 9 insertions, 1 deletions
diff --git a/compiler/basicTypes/Module.lhs b/compiler/basicTypes/Module.lhs
index 080ae47ac9..bd2d119655 100644
--- a/compiler/basicTypes/Module.lhs
+++ b/compiler/basicTypes/Module.lhs
@@ -367,7 +367,7 @@ rtsPackageId = fsToPackageId (fsLit "rts")
thPackageId = fsToPackageId (fsLit "template-haskell")
dphSeqPackageId = fsToPackageId (fsLit "dph-seq")
dphParPackageId = fsToPackageId (fsLit "dph-par")
-thisGhcPackageId = fsToPackageId (fsLit ("ghc-" ++ cProjectVersion))
+thisGhcPackageId = fsToPackageId (fsLit "ghc")
interactivePackageId = fsToPackageId (fsLit "interactive")
-- | This is the package Id for the current program. It is the default
diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in
index e6f86c97d9..838a908364 100644
--- a/compiler/ghc.cabal.in
+++ b/compiler/ghc.cabal.in
@@ -104,6 +104,13 @@ Library
Include-Dirs: . parser utils
+ if impl( ghc >= 7.9 )
+ -- We need to set the package name to ghc (without a version number)
+ -- as it's magic. But we can't set it for old versions of GHC (e.g.
+ -- when bootstrapping) because those versions of GHC don't understand
+ -- that GHC is wired-in.
+ GHC-Options: -package-name ghc
+
if flag(stage1)
Include-Dirs: stage1
else
diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs
index bb2e048cc3..360519e071 100644
--- a/compiler/main/Packages.lhs
+++ b/compiler/main/Packages.lhs
@@ -481,6 +481,7 @@ findWiredInPackages dflags pkgs = do
basePackageId,
rtsPackageId,
thPackageId,
+ thisGhcPackageId,
dphSeqPackageId,
dphParPackageId ]