Commit 82de8caa authored by Ian Lynagh's avatar Ian Lynagh

Also canonicalise the install prefix for the timeout program

parent a56435dc
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment