# This causes problems for bindisttest/checkBinaries.sh which then
# thinks that e.g. the userguide HTML files are binaries.
#
-# We therefore use a /cygdrive path if we are on cygwin
-ifeq '$(shell cygpath "c:/" 2> /dev/null)' ''
-MK_INSTALL_DEST = $1
+# We therefore use a /cygdrive path if we are on cygwin (only)
+# (This will make a Cygwin build run slowly
+# because of all those shell invocations.)
+ifeq "$(OSTYPE)" "cygwin"
+MK_INSTALL_DEST = $$(cygpath $1)
else
-MK_INSTALL_DEST = "$(shell cygpath $1)"
+MK_INSTALL_DEST = $1
endif
#
# NB. we use negative tests here because for binary-distributions we cannot
# test build-time variables at install-time, so they must default to on.
+ifneq "$(DESTDIR)" ""
+override DESTDIR := $(abspath $(DESTDIR))
+endif
+