Also canonicalise the install prefix for the timeout program
authorIan Lynagh <igloo@earth.li>
Fri, 16 Jan 2009 16:37:49 +0000 (16:37 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 16 Jan 2009 16:37:49 +0000 (16:37 +0000)
testsuite/mk/boilerplate.mk
testsuite/timeout/Makefile

index 75fcb1a..e8bd73a 100644 (file)
@@ -12,16 +12,21 @@ show:
        @echo '$(VALUE)="$($(VALUE))"'
 
 define canonicalise
-# $1 = program path variable
-ifneq "$$(wildcard $$($1).exe)" ""
-$1 := $$($1).exe
-endif
+# $1 = path variable
 $1_CYGPATH := $$(shell cygpath -m $$($1) 2> /dev/null)
 ifneq "$$($1_CYGPATH)" ""
 $1 := $$($1_CYGPATH)
 endif
 endef
 
+define canonicaliseExecutable
+# $1 = program path variable
+ifneq "$$(wildcard $$($1).exe)" ""
+$1 := $$($1).exe
+endif
+$(call canonicalise,$1)
+endef
+
 define get-ghc-rts-field # $1 = rseult variable, $2 = field name
 $1 := $$(shell $$(TEST_HC) +RTS --info | grep '^ .("$2",' | sed -e 's/.*", *"//' -e 's/")$$$$//')
 endef
@@ -96,17 +101,17 @@ ifeq "$(HP2PS_ABS)" ""
 HP2PS_ABS := $(dir $(TEST_HC))/hp2ps
 endif
 
-$(eval $(call canonicalise,TEST_HC))
+$(eval $(call canonicaliseExecutable,TEST_HC))
 ifeq "$(wildcard $(TEST_HC))" ""
 $(error Cannot find ghc: $(TEST_HC))
 endif
 
-$(eval $(call canonicalise,GHC_PKG))
+$(eval $(call canonicaliseExecutable,GHC_PKG))
 ifeq "$(wildcard $(GHC_PKG))" ""
 $(error Cannot find ghc-pkg: $(GHC_PKG))
 endif
 
-$(eval $(call canonicalise,HP2PS_ABS))
+$(eval $(call canonicaliseExecutable,HP2PS_ABS))
 ifeq "$(wildcard $(HP2PS_ABS))" ""
 $(error Cannot find hp2ps: $(HP2PS_ABS))
 endif
index 8acc229..bdea066 100644 (file)
@@ -12,6 +12,9 @@ include $(TOP)/mk/boilerplate.mk
 
 TIMEOUT_PROGRAM = install-inplace/bin/timeout$(exeext)
 
+PREFIX := $(abspath install-inplace)
+$(eval $(call canonicalise,PREFIX))
+
 ifeq "$(filter thr, $(GhcRTSWays))" ""
 $(TIMEOUT_PROGRAM): timeout.py
        rm -rf install-inplace
@@ -24,7 +27,7 @@ $(TIMEOUT_PROGRAM): timeout.hs
        rm -rf install-inplace
        $(TEST_HC) --make Setup
        ./Setup configure --with-compiler=$(TEST_HC) --with-hc-pkg=$(GHC_PKG) \
-                         --ghc-option=-threaded --prefix=$(abspath install-inplace)
+                         --ghc-option=-threaded --prefix=$(PREFIX)
        ./Setup build
        ./Setup install
 endif