[commit: testsuite] master: Handles TEST_HC=c:/... on Windows (0a1e0e6)

Ian Lynagh igloo at earth.li
Sat Jan 26 02:45:19 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/0a1e0e63b1294ee3498b15a3e5de752b3caa2c15

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

commit 0a1e0e63b1294ee3498b15a3e5de752b3caa2c15
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 f1cd6c8..f9ed52e 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