[commit: ghc] master: Explicitly version test for package key support. (2272c50)

git at git.haskell.org git at git.haskell.org
Wed Aug 13 14:33:32 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2272c50a61c3dc43edf35b3eeb7997cc0f47eaf3/ghc

>---------------------------------------------------------------

commit 2272c50a61c3dc43edf35b3eeb7997cc0f47eaf3
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Wed Aug 13 11:30:26 2014 +0100

    Explicitly version test for package key support.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>


>---------------------------------------------------------------

2272c50a61c3dc43edf35b3eeb7997cc0f47eaf3
 configure.ac              | 5 +++++
 mk/config.mk.in           | 2 ++
 rules/distdir-way-opts.mk | 8 +++++++-
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 533ea29..378578a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -162,6 +162,11 @@ FP_COMPARE_VERSIONS([$GhcVersion],[-gt],[7.7],
                     CMM_SINK_BOOTSTRAP_IS_NEEDED=NO)
 AC_SUBST(CMM_SINK_BOOTSTRAP_IS_NEEDED)
 
+FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[7.9],
+                    SUPPORTS_PACKAGE_KEY=NO,
+                    SUPPORTS_PACKAGE_KEY=YES)
+AC_SUBST(SUPPORTS_PACKAGE_KEY)
+
 # GHC is passed to Cabal, so we need a native path
 if test "${WithGhc}" != ""
 then
diff --git a/mk/config.mk.in b/mk/config.mk.in
index d26684e..c210cd3 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -484,6 +484,8 @@ GHC_PACKAGE_DB_FLAG = @GHC_PACKAGE_DB_FLAG@
 
 CMM_SINK_BOOTSTRAP_IS_NEEDED = @CMM_SINK_BOOTSTRAP_IS_NEEDED@
 
+SUPPORTS_PACKAGE_KEY = @SUPPORTS_PACKAGE_KEY@
+
 #-----------------------------------------------------------------------------
 # C compiler
 #
diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
index 898485c..0a6d84e 100644
--- a/rules/distdir-way-opts.mk
+++ b/rules/distdir-way-opts.mk
@@ -81,9 +81,15 @@ 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_PACKAGE_KEY)" "NO"
+ifeq "$4" "0"
+$4_USE_PACKAGE_KEY=NO
+endif
+endif
+
 # ToDo: It would be more accurate to version test this against what version of
 # GHC we're using to see if it understands package-key
-ifeq "$4" "0"
+ifeq "$($4_USE_PACKAGE_KEY)" "NO"
 $1_$2_$4_DEP_OPTS = \
  $$(foreach pkg,$$($1_$2_DEPS),-package $$(pkg))
 $4_THIS_PACKAGE_KEY = -package-name



More information about the ghc-commits mailing list