summaryrefslogtreecommitdiff
path: root/testsuite/mk/boilerplate.mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2013-01-25 19:11:00 +0000
committerIan Lynagh <ian@well-typed.com>2013-01-26 01:32:00 +0000
commite66a81c6a15e620875834e3d3862f838d88338ca (patch)
tree89f6f22b0c6cace319716d146014c275a9b5a479 /testsuite/mk/boilerplate.mk
parenta673689462cee9900314825a02f307f95889de16 (diff)
downloadhaskell-e66a81c6a15e620875834e3d3862f838d88338ca.tar.gz
Handles TEST_HC=c:/... on Windows
Diffstat (limited to 'testsuite/mk/boilerplate.mk')
-rw-r--r--testsuite/mk/boilerplate.mk16
1 files changed, 14 insertions, 2 deletions
diff --git a/testsuite/mk/boilerplate.mk b/testsuite/mk/boilerplate.mk
index f1cd6c8131..f9ed52ee0f 100644
--- a/testsuite/mk/boilerplate.mk
+++ b/testsuite/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