Avoid the use of unversioned package dependencies
authorSimon Marlow <simonmar@microsoft.com>
Thu, 15 Nov 2007 10:32:49 +0000 (10:32 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Thu, 15 Nov 2007 10:32:49 +0000 (10:32 +0000)
Fortunately "ghc-pkg list $pkg --simple-output" is a good way to add
the version number.

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