POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@
POSTGIS_GEOS_VERSION=@POSTGIS_GEOS_VERSION@
POSTGIS_PROJ_VERSION=@POSTGIS_PROJ_VERSION@
-PGSQL_BINDIR=@PGSQL_BINDIR@
+
+# MingW hack: rather than use PGSQL_BINDIR directly, we change
+# to the directory and then use "pwd" to return the path. This
+# ensures that the returned path is in MSYS format, otherwise
+# colons in drive letters will break PATH.
+PGSQL_BINDIR=$(shell pushd "@PGSQL_BINDIR@" && pwd && popd)
#
# Put path from pg_config into front of search path
#
-PATH := $(PGSQL_BINDIR):$(PATH)
+PATH := "$(PGSQL_BINDIR):$(PATH)"
export PATH
show_progress
- if [ `${PSQL} -t -A -c "SELECT count(*) FROM pg_tables WHERE tablename = '${_tblname}'" "${DB}"` -gt 0 ]; then
+ # MingW hack: use tr to strip off any trailing CR/LFs introduce by MingW which confuse expr
+ if [ `${PSQL} -t -A -c "SELECT count(*) FROM pg_tables WHERE tablename = '${_tblname}'" "${DB}" | tr -d '\r\n'` -gt 0 ]; then
${PSQL} -c "DROP TABLE ${_tblname}" "${DB}" >> ${TMPDIR}/regress_log 2>&1
fi