[commit: ghc] master: runghc: be explicit about ghc version (#9054) (6d17125)
git at git.haskell.org
git at git.haskell.org
Wed Feb 18 15:48:24 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/6d17125dccda76b7aafe33181df822045ff5b9bf/ghc
>---------------------------------------------------------------
commit 6d17125dccda76b7aafe33181df822045ff5b9bf
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date: Wed Feb 18 09:46:40 2015 -0600
runghc: be explicit about ghc version (#9054)
Summary: runghc-7.x should always call ghc-7.x
Reviewers: austin
Reviewed By: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D664
GHC Trac Issues: #9054
>---------------------------------------------------------------
6d17125dccda76b7aafe33181df822045ff5b9bf
rules/build-prog.mk | 6 +-----
rules/shell-wrapper.mk | 8 +++++---
utils/runghc/ghc.mk | 8 ++++++++
utils/runghc/runghc.wrapper | 2 +-
4 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/rules/build-prog.mk b/rules/build-prog.mk
index f93b99d..88f1b53 100644
--- a/rules/build-prog.mk
+++ b/rules/build-prog.mk
@@ -11,11 +11,7 @@
# -----------------------------------------------------------------------------
-# Build a program. Invoke like this:
-#
-# utils/genapply_MODULES = Main
-# utils/genapply_HC_OPTS = -package Cabal
-# utils/genapply_dist_PROGNAME = genapply
+# Build a program.
#
# $(eval $(call build-prog,utils/genapply,dist-install,1))
diff --git a/rules/shell-wrapper.mk b/rules/shell-wrapper.mk
index 05dd0ef..ae38e65 100644
--- a/rules/shell-wrapper.mk
+++ b/rules/shell-wrapper.mk
@@ -22,15 +22,17 @@ endif
ifeq "$$($1_$2_WANT_INPLACE_WRAPPER)" "YES"
+$1_$2_INPLACE_SHELL_WRAPPER_NAME = $$($1_$2_PROG)
+
ifeq "$$($1_$2_TOPDIR)" "YES"
-INPLACE_WRAPPER = $$(INPLACE_LIB)/$$($1_$2_PROG)
+INPLACE_WRAPPER = $$(INPLACE_LIB)/$$($1_$2_INPLACE_SHELL_WRAPPER_NAME)
else
-INPLACE_WRAPPER = $$(INPLACE_BIN)/$$($1_$2_PROG)
+INPLACE_WRAPPER = $$(INPLACE_BIN)/$$($1_$2_INPLACE_SHELL_WRAPPER_NAME)
endif
all_$1_$2 : $$(INPLACE_WRAPPER)
-$$(INPLACE_BIN)/$$($1_$2_PROG): WRAPPER=$$@
+$$(INPLACE_WRAPPER): WRAPPER=$$@
ifeq "$$($1_$2_SHELL_WRAPPER)" "YES"
$$(INPLACE_WRAPPER): $$($1_$2_SHELL_WRAPPER_NAME)
endif
diff --git a/utils/runghc/ghc.mk b/utils/runghc/ghc.mk
index 31bf089..6979d50 100644
--- a/utils/runghc/ghc.mk
+++ b/utils/runghc/ghc.mk
@@ -19,6 +19,14 @@ utils/runghc_dist-install_INSTALL_INPLACE = YES
utils/runghc_dist-install_INSTALL_SHELL_WRAPPER_NAME = runghc-$(ProjectVersion)
utils/runghc_dist-install_EXTRA_HC_OPTS = -cpp -DVERSION="\"$(ProjectVersion)\""
+# Be explicit about which version of ghc to call (#9054).
+define utils/runghc_dist-install_INPLACE_SHELL_WRAPPER_EXTRA
+echo 'ghcprog="$(ghc_stage2_INPLACE_SHELL_WRAPPER_NAME)"' >> "$(WRAPPER)"
+endef
+define utils/runghc_dist-install_INSTALL_SHELL_WRAPPER_EXTRA
+echo 'ghcprog="$(ghc_stage$(INSTALL_GHC_STAGE)_INSTALL_SHELL_WRAPPER_NAME)"' >> "$(WRAPPER)"
+endef
+
ifneq "$(BINDIST)" "YES"
# hack: the build system has trouble with Main modules not called Main.hs
utils/runghc/dist-install/build/Main.hs : utils/runghc/runghc.hs | $$(dir $$@)/.
diff --git a/utils/runghc/runghc.wrapper b/utils/runghc/runghc.wrapper
index 9110dcc..5caea0b 100644
--- a/utils/runghc/runghc.wrapper
+++ b/utils/runghc/runghc.wrapper
@@ -1,3 +1,3 @@
#!/bin/sh
-exec "$executablename" -f "$bindir/ghc" ${1+"$@"}
+exec "$executablename" -f "$bindir/$ghcprog" ${1+"$@"}
More information about the ghc-commits
mailing list