From: Mark Cave-Ayland Date: Tue, 17 Nov 2009 14:00:09 +0000 (+0000) Subject: Properly fix #219 by creating a separate "mini install" of PostGIS into the PGXS... X-Git-Tag: 1.5.0b1~217 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1bb2f3a2e6014b38fdf42f4c6fe593fd94c4087c;p=postgis Properly fix #219 by creating a separate "mini install" of PostGIS into the PGXS regression directory that can be used for regression. This is because different architectures have different naming conventions, and so Paul's original hack isn't guaranteed to work. By using PGXS to perform the install, we eliminate the problem of having to know the final architecture library name. git-svn-id: http://svn.osgeo.org/postgis/trunk@4845 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/Makefile.in b/postgis/Makefile.in index 4923eeb8a..ec2438b84 100644 --- a/postgis/Makefile.in +++ b/postgis/Makefile.in @@ -78,6 +78,15 @@ PG_CONFIG = @PGCONFIG@ PGXS := @PGXS@ include $(PGXS) +# 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 diff --git a/regress/Makefile.in b/regress/Makefile.in index a0bad8c25..f54934559 100644 --- a/regress/Makefile.in +++ b/regress/Makefile.in @@ -11,15 +11,9 @@ HAVE_LIBXML2=@HAVE_LIBXML2@ # colons in drive letters will break PATH. PGSQL_BINDIR=$(shell pushd "@PGSQL_BINDIR@" > /dev/null && pwd && popd > /dev/null) - -# Hack to support the change in .so name from PgSQL 8.3 to 8.4 -# and allow in-place regression testing still. (#219) -LIBNAME = postgis -ifeq ($(shell expr $(POSTGIS_PGSQL_VERSION) "<" 84),1) - LIBNAME = libpostgis -endif - +# Where we put our regression installation srcdir=$(shell pwd) +REGRESS_INSTALLDIR=$(srcdir)/00-regress-install # # Put path from pg_config into front of search path @@ -103,20 +97,16 @@ endif all: test -test check: ../postgis/postgis.sql ../loader/pgsql2shp ../loader/shp2pgsql - sed 's,$$libdir/postgis,$(srcdir)/../postgis/$(LIBNAME),g' ../postgis/postgis.sql > postgis.sql +test check: + $(MAKE) -C ../postgis REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install + $(MAKE) -C ../loader REGRESS=1 DESTDIR=$(REGRESS_INSTALLDIR) install + sed 's,$$libdir,$(REGRESS_INSTALLDIR)/lib,g' ../postgis/postgis.sql > postgis.sql @USE_VERSION=$(POSTGIS_PGSQL_VERSION) ./run_test $(TESTS) - -../postgis/postgis.sql: - $(MAKE) -C ../postgis - -../loader/pgsql2shp ../loader/shp2pgsql: - $(MAKE) -C ../loader - cleanup: @sleep 1 @dropdb postgis_reg > /dev/null clean: + rm -rf $(REGRESS_INSTALLDIR) rm -f postgis.sql