diff options
author | Ian Lynagh <igloo@earth.li> | 2010-01-08 21:04:00 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2010-01-08 21:04:00 +0000 |
commit | 0a71f99b12863c2cfa5d46c4656e819df982ae4a (patch) | |
tree | f03ae9039f813efd624ee2d96fa71afbb50264d3 /testsuite/mk | |
parent | 092875293c22f8cee219196efcae6cd78ca244f4 (diff) | |
download | haskell-0a71f99b12863c2cfa5d46c4656e819df982ae4a.tar.gz |
Improve the handling of TEST_HC
We now accept TEST_HC=ghc as well as TEST_HC=/usr/bin/ghc
The code is also a little more correct, as it will now actually
canonicalise the value of TEST_HC if it is given on the commandline.
Diffstat (limited to 'testsuite/mk')
-rw-r--r-- | testsuite/mk/boilerplate.mk | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/testsuite/mk/boilerplate.mk b/testsuite/mk/boilerplate.mk index ac2376ca2d..9cbed5ef93 100644 --- a/testsuite/mk/boilerplate.mk +++ b/testsuite/mk/boilerplate.mk @@ -19,14 +19,18 @@ define canonicalise # $1 = path variable $1_CYGPATH := $$(shell $(SHELL) -c "cygpath -m '$$($1)'" 2> /dev/null) ifneq "$$($1_CYGPATH)" "" -$1 := $$($1_CYGPATH) +# We use 'override' in case we are trying to update a value given on +# the commandline (e.g. TEST_HC) +override $1 := $$($1_CYGPATH) endif endef define canonicaliseExecutable # $1 = program path variable ifneq "$$(shell test -x '$$($1).exe' && echo exists)" "" -$1 := $$($1).exe +# We use 'override' in case we are trying to update a value given on +# the commandline (e.g. TEST_HC) +override $1 := $$($1).exe endif $(call canonicalise,$1) endef @@ -78,6 +82,13 @@ endif else IN_TREE_COMPILER = NO +# We want to support both "ghc" and "/usr/bin/ghc" as values of TEST_HC +# 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. +override TEST_HC := $(shell which '$(TEST_HC)') endif # We can't use $(dir ...) here as TEST_HC might be in a path |