[commit: testsuite] ghc-7.6: Handles TEST_HC=c:/... on Windows (cc20d14)
Ian Lynagh
igloo at earth.li
Sat Jan 26 00:36:46 CET 2013
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : ghc-7.6
http://hackage.haskell.org/trac/ghc/changeset/cc20d143286c2fb5371d40d62aeb2f16a1370709
>---------------------------------------------------------------
commit cc20d143286c2fb5371d40d62aeb2f16a1370709
Author: Ian Lynagh <igloo at earth.li>
Date: Fri Jan 25 19:11:00 2013 +0000
Handles TEST_HC=c:/... on Windows
>---------------------------------------------------------------
mk/boilerplate.mk | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/mk/boilerplate.mk b/mk/boilerplate.mk
index 56b0284..28610d7 100644
--- a/mk/boilerplate.mk
+++ b/mk/boilerplate.mk
@@ -66,9 +66,21 @@ IN_TREE_COMPILER = NO
# passed in by the user, but
# which ghc == /usr/bin/ghc
# which /usr/bin/ghc == /usr/bin/ghc
-# so we can just always 'which' it. We need to use 'override' in order
-# to override a value given on the commandline.
+# so on unix-like platforms we can just always 'which' it.
+# However, on cygwin, we can't just use which:
+# $ which c:/ghc/ghc-7.4.1/bin/ghc.exe
+# which: no ghc.exe in (./c:/ghc/ghc-7.4.1/bin)
+# so we start off by using realpath, and if that succeeds then we use
+# that value. Otherwise we fall back on 'which'.
+#
+# Note also that we need to use 'override' in order to override a
+# value given on the commandline.
+TEST_HC_REALPATH := $(realpath $(TEST_HC))
+ifeq "$(TEST_HC_REALPATH)" ""
override TEST_HC := $(shell which '$(TEST_HC)')
+else
+override TEST_HC := $(TEST_HC_REALPATH)
+endif
endif
# We can't use $(dir ...) here as TEST_HC might be in a path
More information about the ghc-commits
mailing list