From: Mark Cave-Ayland Date: Thu, 22 May 2008 14:31:02 +0000 (+0000) Subject: Update topology/ directory to use the new PGXS build system. X-Git-Tag: 1.4.0b1~906 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70609da272add43ca5f37135edc490d4866bd330;p=postgis Update topology/ directory to use the new PGXS build system. git-svn-id: http://svn.osgeo.org/postgis/trunk@2779 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/topology/Makefile b/topology/Makefile index cae70b6da..78f28a7eb 100644 --- a/topology/Makefile +++ b/topology/Makefile @@ -1,27 +1,28 @@ -# Configuration Directives -include ../Makefile.config -include ../Version.config +# +# PostGIS PGXS build system +# -#--------------------------------------------------------------- -# Postgis version and build date -#--------------------------------------------------------------- +# Files to be copied to the contrib/ directory +DATA_built=topology.sql -all: topology.sql +# SQL objects (files requiring C pre-processing) +SQL_OBJS=topology.sql.in -topology.sql: topology.sql.in - cpp -P -traditional-cpp -DUSE_VERSION=$(USE_VERSION) $< | grep -v '^#' > $@ +# Extra files to remove during 'make clean' +EXTRA_CLEAN=$(SQL_OBJS) -install: all install-topology-scripts +# PGXS information +PG_CONFIG = pg_config +PGXS := $(shell $(PG_CONFIG) --pgxs) +include $(PGXS) -uninstall: uninstall-topology-scripts -install-topology-scripts: - @mkdir -p $(DESTDIR)$(datadir) - $(INSTALL_DATA) topology.sql $(DESTDIR)$(datadir)/topology.sql +# Unfortunately we have to copy this from the PGXS Makefile as it only gets picked up +# if MODULE_big is defined +%.sql: %.sql.in + sed 's,MODULE_PATHNAME,$$libdir/$*,g' $< >$@ -uninstall-topology-scripts: - rm -f $(DESTDIR)$(datadir)/postgis/topology.sql - -clean distclean: - rm -f topology.sql +# Generate any .sql.in files from .sql.in.c files by running them through the C pre-processor +$(SQL_OBJS): %.in: %.in.c + $(CPP) -traditional-cpp $< | grep -v '^#' > $@ diff --git a/topology/topology.sql.in b/topology/topology.sql.in.c similarity index 99% rename from topology/topology.sql.in rename to topology/topology.sql.in.c index c267618d1..ef95c395b 100644 --- a/topology/topology.sql.in +++ b/topology/topology.sql.in.c @@ -1,6 +1,6 @@ -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- --- $Id$ +-- $Id: topology.sql.in 2469 2006-09-06 11:16:59Z strk $ -- -- PostGIS - Spatial Types for PostgreSQL -- http://postgis.refractions.net @@ -160,26 +160,7 @@ -- -- - -#define CREATEFUNCTION CREATE OR REPLACE FUNCTION - -#if USE_VERSION > 72 -# define _IMMUTABLE_STRICT IMMUTABLE STRICT -# define _IMMUTABLE IMMUTABLE -# define _STABLE_STRICT STABLE STRICT -# define _STABLE STABLE -# define _VOLATILE_STRICT VOLATILE STRICT -# define _VOLATILE VOLATILE -# define _STRICT STRICT -#else -# define _IMMUTABLE_STRICT with(iscachable,isstrict) -# define _IMMUTABLE with(iscachable) -# define _STABLE_STRICT with(isstrict) -# define _STABLE -# define _VOLATILE_STRICT with(isstrict) -# define _VOLATILE -# define _STRICT with(isstrict) -#endif +#include "../lwgeom/sqldefines.h" DROP SCHEMA topology CASCADE; @@ -2428,7 +2409,7 @@ BEGIN || '')'' LOOP RAISE EXCEPTION - ''SQL/MM Spatial exception ­ edge crosses node.''; + ''SQL/MM Spatial exception - edge crosses node.''; END LOOP; @@ -2556,7 +2537,7 @@ BEGIN || '')'' LOOP RAISE EXCEPTION - ''SQL/MM Spatial exception ­ edge crosses node.''; + ''SQL/MM Spatial exception - edge crosses node.''; END LOOP; -- @@ -3275,7 +3256,7 @@ BEGIN -- IF ! within(acurve, face) THEN RAISE EXCEPTION - ''SQL/MM Spatial exception ­ geometry not within face.''; + ''SQL/MM Spatial exception - geometry not within face.''; END IF; END IF; @@ -3287,7 +3268,7 @@ BEGIN IF x(snodegeom) != x(StartPoint(acurve)) OR y(snodegeom) != y(StartPoint(acurve)) THEN RAISE EXCEPTION - ''SQL/MM Spatial exception ­ start node not geometry start point.''; + ''SQL/MM Spatial exception - start node not geometry start point.''; END IF; -- @@ -3297,7 +3278,7 @@ BEGIN IF x(enodegeom) != x(EndPoint(acurve)) OR y(enodegeom) != y(EndPoint(acurve)) THEN RAISE EXCEPTION - ''SQL/MM Spatial exception ­ end node not geometry end point.''; + ''SQL/MM Spatial exception - end node not geometry end point.''; END IF; --