]> granicus.if.org Git - postgis/commitdiff
Update topology/ directory to use the new PGXS build system.
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Thu, 22 May 2008 14:31:02 +0000 (14:31 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Thu, 22 May 2008 14:31:02 +0000 (14:31 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2779 b70326c6-7e19-0410-871a-916f4a2858ee

topology/Makefile
topology/topology.sql.in.c [moved from topology/topology.sql.in with 99% similarity]

index cae70b6da09af2039d126dddcd46a11b5edd7331..78f28a7eb7bc62f82c58062b65a21acf6341ebf0 100644 (file)
@@ -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 '^#' > $@
 
similarity index 99%
rename from topology/topology.sql.in
rename to topology/topology.sql.in.c
index c267618d1d8062ca2790f62d04b276362639c6e2..ef95c395b6ee2d9840dc7c2f544dd256a8c63e18 100644 (file)
@@ -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
 --  
 --  
 
-
-#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;
 
        --