]> granicus.if.org Git - postgis/commitdiff
Properly fix #219 by creating a separate "mini install" of PostGIS into the PGXS...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Tue, 17 Nov 2009 14:00:09 +0000 (14:00 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Tue, 17 Nov 2009 14:00:09 +0000 (14:00 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4845 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/Makefile.in
regress/Makefile.in

index 4923eeb8aec9a9567a5758beeb3903fb665004f6..ec2438b848b85ef3a7c8079b450a5e09dc724640 100644 (file)
@@ -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
index a0bad8c25b9de11870799164bf57d1949c33001b..f549345590c2f784bb1151ae16b3c249d2a8bd52 100644 (file)
@@ -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