#-----------------------------------------------------
# todo: add all subdirs
-SUBDIRS = liblwgeom regress postgis loader utils raster @TOPOLOGY@
+SUBDIRS = liblwgeom regress postgis loader utils @RASTER@ @TOPOLOGY@
# todo: add more rules here, like uninstall, clean...
all install uninstall noop clean distclean check:
AC_ARG_WITH([raster],
[AS_HELP_STRING([--with-raster],
[compile the raster extension (requires GDAL >= 1.6.0) @<:@default=no@:>@])],
- [RASTER="yes"], [RASTER="no"])
+ [RASTER="raster"], [RASTER=""])
-if test "x$RASTER" = "xyes"; then
+if test "x$RASTER" = "xraster"; then
AC_MSG_RESULT([RASTER: Raster support requested])
AC_CONFIG_HEADERS([raster/raster_config.h])
dnl Activates raster stuff construction.
BUILD_RASTER=yes
+ dnl just in case...
+ AC_SUBST([RASTER])
+
AC_SUBST([RT_CORE_LIB])
AC_SUBST([RT_PG_LIB])
AC_SUBST([RT_POSTGIS_SQL])
#
#############################################################################
-BUILD_RASTER=@BUILD_RASTER@
all: @RT_CORE_LIB@ @RT_PG_LIB@ @RT_POSTGIS_SQL@
corelib:
-ifeq ($(BUILD_RASTER), yes)
$(MAKE) -C rt_core
-endif
pglib:
-ifeq ($(BUILD_RASTER), yes)
$(MAKE) -C rt_pg
-endif
rtpostgis.sql:
-ifeq ($(BUILD_RASTER), yes)
$(MAKE) -C rt_pg rtpostgis.sql
-endif
install: all
-ifeq ($(BUILD_RASTER), yes)
$(MAKE) -C rt_pg install
$(MAKE) -C scripts/python install
-endif
uninstall:
-ifeq ($(BUILD_RASTER), yes)
$(MAKE) -C rt_pg uninstall
$(MAKE) -C scripts/python uninstall
-endif
clean:
-ifeq ($(BUILD_RASTER), yes)
$(MAKE) -C rt_core $@
$(MAKE) -C rt_pg $@
$(MAKE) -C test $@
$(MAKE) -C scripts/python $@
-endif
distclean: clean
-ifeq ($(BUILD_RASTER), yes)
$(RM) -R autom4te.cache
$(RM) config.status
-endif
-check:
-ifeq ($(BUILD_RASTER), yes)
+core-check:
$(MAKE) -C test $@
- @echo
- @echo "Consider also running make post-install-check after installation"
- @echo
-endif
-post-install-check:
-ifeq ($(BUILD_RASTER), yes)
+check: core-check
$(MAKE) -C test $@
-endif
include Makefile.pgxs
endif
+# If REGRESS=1 passed as a parameter, change the default install paths
+# so that no prefix is included. This allows us to relocate to a temporary
+# directory for regression testing.
+ifeq ($(REGRESS),1)
+ bindir=/bin
+ pkglibdir=/lib
+ datadir=/share
+endif
+
# Borrow the $libdir substitution from PGXS but customise by adding the version number
%.sql: %.sql.in
sed 's,MODULE_PATHNAME,$$libdir/rtpostgis-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@,g' $< >$@
all: check
-check: $(RT_CORE)/librtcore.a
+core-check: $(RT_CORE)/librtcore.a
$(MAKE) -C core check
-post-install-check: $(RT_CORE)/librtcore.a
+check: core-check
$(MAKE) -C regress check
$(RT_CORE)/librtcore.a:
/* First test: NODATA value = -1 */
rt_raster rt = fillRasterToPolygonize(ctx, 1, -1.0);
-
- printf("*** POLYGONIZE WITH NODATA = -1.0\n");
/* We can check rt_raster_has_no_band here too */
CHECK(!rt_raster_has_no_band(ctx, rt, 1));
# $Id$
#
# Copyright (c) 2009 Sandro Santilli <strk@keybit.net>, Pierre Racine <pierre.racine@sbf.ulaval.ca>
+# Copyright (c) 2011 Jorge Arevalo <jorge.arevalo@deimos-space.com>
#
# This is free software; you can redistribute and/or modify it under
# the terms of the GNU General Public Licence. See the COPYING file.
POSTGIS_SRC=@POSTGIS_SRCDIR@
+# 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 cd "@PGSQL_BINDIR@" && pwd)
+
+# Where we put our regression installation
+REGRESS_INSTALLDIR=$(POSTGIS_SRC)/regress/00-regress-install
+
+#
+# Put path from pg_config into front of search path
+#
+PATH := $(PGSQL_BINDIR):$(PATH)
+export PATH
+
TEST_METADATA = \
check_raster_columns.sql \
check_raster_overviews.sql \
TEST_UTILITY = \
create_rt_utility_test.sql \
rt_utility.sql \
- create_rt_mapalgebra_test.sql \
- rt_mapalgebra.sql \
+ create_rt_mapalgebra_test.sql \
+ rt_mapalgebra.sql \
$(NULL)
TEST_GIST = \
$(TEST_UTILITY) $(TEST_GIST) $(TEST_SREL) \
$(TEST_BUGS)
-all: run_test
+all:
+ @echo "Use 'make check' to run all tests"
+
+clean distclean:
+ $(RM) -f rtpostgis.sql
+
+rtpostgis.sql: ../../rt_pg/rtpostgis.sql
+ sed 's,$$libdir,$(REGRESS_INSTALLDIR)/lib,g' ../../rt_pg/rtpostgis.sql > rtpostgis.sql
+
+
+check: rtpostgis.sql
+ $(MAKE) -C ../../../regress postgis.sql staged-install
+ $(MAKE) -C ../../rt_pg REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install
+ @USE_VERSION=$(POSTGIS_PGSQL_VERSION) ../../../regress/run_test --raster $(TESTS)
+
+#all: run_test
-run_test: run_test.in Makefile
- sed -e "s#@POSTGIS_SRC@#$(POSTGIS_SRC)#" $< > $@
- chmod +x $@
+#run_test: run_test.in Makefile
+# sed -e "s#@POSTGIS_SRC@#$(POSTGIS_SRC)#" $< > $@
+# chmod +x $@
-post-install-check check: run_test
- ./run_test $(TESTS)
+#post-install-check check: run_test
+# ./run_test $(TESTS)
-clean:
- $(RM) run_test
+#clean:
+# $(RM) run_test
fi
if test x"$OPT_WITH_RASTER" = "xyes"; then
if test -e ${REGDIR}/../raster/rt_pg/rtpostgis.sql; then
- echo "Adding topology support"
+ echo "Adding raster support"
${PSQL} ${_psql_opts} -Xf ${REGDIR}/../raster/rt_pg/rtpostgis.sql "${DB}" >> ${TMPDIR}/regress_log 2>&1
else
echo "Raster support skipped (rtpostgis.sql not found)"