Avoid the use of unversioned package dependencies
[ghc-hetmet.git] / compiler / Makefile
index 568812a..fa6d4a5 100644 (file)
@@ -843,7 +843,9 @@ PACKAGE = ghc
 HIERARCHICAL_LIB = NO
 VERSION = $(ProjectVersion)
 PKG_DEPENDS += base haskell98
-PACKAGE_CPP_OPTS += -DPKG_DEPENDS='$(PKG_DEPENDS)'
+# We have to expand each package dependency with its version, which we
+# can do by calling "ghc-pkg list $pkg --simple-output".
+PACKAGE_CPP_OPTS += -DPKG_DEPENDS='$(foreach pkg,$(PKG_DEPENDS),$(shell $(GHC_PKG_INPLACE) list $(pkg) --simple-output))'
 PACKAGE_CPP_OPTS += -DSTAGE='"$(stage)"'
 
 # Omit Main from the library, the client will want to plug their own Main in