Commit cee1f271 authored by Mark Cave-Ayland's avatar Mark Cave-Ayland

Commit new build system based upon PGXS. Due to the large number of changes,...

Commit new build system based upon PGXS. Due to the large number of changes, please refer to http://postgis.refractions.net/pipermail/postgis-devel/2008-May/003010.html.

git-svn-id: http://svn.osgeo.org/postgis/trunk@2774 b70326c6-7e19-0410-871a-916f4a2858ee
parent db69c6e6
......@@ -5,16 +5,16 @@ How to release
Versioning Scheme
-----------------
Release version is composed by REL_MAJOR_VERSION, REL_MINOR_VERSION
and REL_MICRO_VERSION components.
Release version is composed by POSTGIS_MAJOR_VERSION, POSTGIS_MINOR_VERSION
and POSTGIS_MICRO_VERSION components.
By default only [REL_MICRO_VERSION] increments between releases.
By default only [POSTGIS_MICRO_VERSION] increments between releases.
[REL_MINOR_VERSION] is incremented (and MICRO set to 0) when minor
[POSTGIS_MINOR_VERSION] is incremented (and MICRO set to 0) when minor
additions have been introduced (one or two functions can be considered
*micro* additions)
[REL_MAJOR_VERSION] is incremented (and MICRO and MINOR set to 0) when
[POSTGIS_MAJOR_VERSION] is incremented (and MICRO and MINOR set to 0) when
a dump/reload of existing spatial databases is *REQUIRED* for things
to work or rather *HIGHLY RECOMMENDED* to get new functionalities.
......
#---------------------------------------------------------------
# Configuration Directives
#---------------------------------------------------------------
#
# We recommend that you install the Proj4 and GEOS libraries
# referenced below to get the most use out of your PostGIS
# database.
#
# Set USE_PROJ to 1 for Proj4 reprojection support (recommended)
#
# Reprojection allows you to transform coordinate systems
# in the database with the Transform() function.
#
# Download from: http://www.remotesensing.org/proj
#
USE_PROJ=@USE_PROJ@
PROJ_DIR=@PROJ_DIR@
PROJ_LIBDIR=@PROJ_LIBDIR@
#
# Set USE_GEOS to 1 for GEOS spatial predicate and operator
# support (recommended).
# GEOS installation directory defaults to /usr/local,
# set GEOS_DIR environment variable to change it.
#
# GEOS allows you to do exact topological tests, such as
# Intersects() and Touches(), as well as geometry operations,
# such as Buffer(), GeomUnion() and Difference().
#
# Download from: http://geos.refractions.net
#
# PostGIS >= 1.2.0 requires a CAPI GEOS (GEOS >= 2.2.0)
#
USE_GEOS=@USE_GEOS@
GEOS_DIR=@GEOS_DIR@
GEOS_LDFLAGS=@GEOS_LDFLAGS@
GEOS_VERNUM=@GEOS_VERNUM@
#
# Set USE_JTS to 1 if you have libjts installed.
#
USE_JTS=@USE_JTS@
JTS_INCLUDES=@JTS_INCLUDES@
JTS_LIBDIR=@JTS_LIBDIR@
#
# Set USE_STATS to 1 for new GiST statistics collection support
# Note that this support requires additional columns in
# GEOMETRY_COLUMNS, so see the list archives for info or
# install a fresh database using postgis.sql.
# This option is useless for builds against PGSQL>=80 (stats
# are always gathered in that case, and you don't need additional
# columns in geometry_columns).
#
USE_STATS=1
#
# Set AUTOCACHE_BBOX to 0 if you want finer control over
# bounding box computation and caching for your geometries.
# If you do, bbox computattion strategies are listed in
# the file lwgeom/BBOXCACHE_BEHAVIOURS, but don't expect
# them to be easy nor consistent.
#
AUTOCACHE_BBOX=1
#
# Set USE_ICONV to 1 if you want the loader (shp2pgsql)
# to support UTF-8 output.
#
USE_ICONV=@USE_ICONV@
ICONV_LDFLAGS=@ICONV_LDFLAGS@
#
# PGSQL
#
PGCONFIG=@PGCONFIG@
PGFEINCLUDES=@PGFEINCLUDES@
PGBEINCLUDES=@PGBEINCLUDES@
PGFELIBS=@PGFELIBS@
PGBELIBS=@PGBELIBS@
PORTNAME=@PORTNAME@
#
# Docbook
#
XSLBASE=@XSLBASE@
XSLTPROC=@XSLTPROC@
PDFXMLTEX=@PDFXMLTEX@
DB2PDF=@DB2PDF@
JW=@JW@
DOC_RULE=@DOC_RULE@
#
# Compilers
#
CC=@CC@
CXX=@CXX@
ELF_SYSTEM=@ELF_SYS@
#
# Other programs
#
PERL=@PERL@
FLEX=@FLEX@
YACC=@YACC@
LN_S=@LN_S@
INSTALL=@INSTALL@ -c
PWDREGRESS=@PWDREGRESS@
INSTALL_DATA=$(INSTALL) -m 644
INSTALL_BIN=$(INSTALL) -m 755
INSTALL_LIB=$(INSTALL) -m 755
INSTALL_SHLIB=$(INSTALL_LIB)
#
# PATHS
#
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
datadir=@datadir@
mandir=@mandir@
docdir=@docdir@
libexecdir=@libexecdir@
libdir=@libdir@
LPATH=@LPATH@
#
# DLL
#
DLSUFFIX=@DLSUFFIX@
DLFLAGS=@DLFLAGS@
# these are for win32 and cygwin platforms
DLLTOOL=@DLLTOOL@
DLLWRAP=@DLLWRAP@
#
# EXE
#
EXE=@EXE@
#
# HOST OS
#
HOST_OS=@HOST_OS@
#---------------------------------------------------------------
# END OF CONFIGURATION
#---------------------------------------------------------------
# Use JTS instead of GEOS if available
ifeq ($(USE_JTS),1)
USE_GEOS=0
endif
#---------------------------------------------------------------
# Test the version string and set the USE_VERSION macro
# appropriately. eg:
#
# pg_config --version => PostgreSQL 8.3.1
#
PG_VERSION_MAJOR=$(shell $(PGCONFIG) --version | cut -f2 -d' ' | cut -f1 -d.)
PG_VERSION_MINOR=$(shell $(PGCONFIG) --version | cut -f2 -d' ' | cut -f2 -d.)
USE_VERSION=$(PG_VERSION_MAJOR)$(PG_VERSION_MINOR)
......@@ -3,7 +3,7 @@
# See HOWTO_RELEASE file in SVN for definitions of those three.
REL_MAJOR_VERSION=1
REL_MINOR_VERSION=3
REL_MICRO_VERSION=4SVN
POSTGIS_MAJOR_VERSION=1
POSTGIS_MINOR_VERSION=4
POSTGIS_MICRO_VERSION=0
#!/bin/sh
aclocal -I macros
autoconf
#undef HAVE_ICONV_H
#undef USE_GEOS
#undef USE_JTS
This diff is collapsed.
include ../Makefile.config
# Version handling:
include ../Version.config
POSTGIS_VERSION = $(REL_MAJOR_VERSION).$(REL_MINOR_VERSION).$(REL_MICRO_VERSION)
#
# PostGIS Loader Makefile
# PostGIS PGXS build system
#
OBJS = shpopen.o dbfopen.o getopt.o
#---------------------------------------------------------------
ifeq ($(USE_ICONV),1)
override CFLAGS += -DUSE_ICONV
override LDFLAGS += $(ICONV_LDFLAGS)
endif
override CFLAGS := -g -Wall -I.. $(CFLAGS) -DUSE_VERSION=$(USE_VERSION) -DPOSTGIS_VERSION='"$(POSTGIS_VERSION)"'
all: shp2pgsql$(EXE) pgsql2shp$(EXE)
pgsql2shp.o: pgsql2shp.c
$(CC) $(CFLAGS) $(PGFEINCLUDES) -c $<
pgsql2shp$(EXE): $(OBJS) pgsql2shp.o PQunescapeBytea.o
$(CC) $(CFLAGS) $(OBJS) PQunescapeBytea.o pgsql2shp.o $(LDFLAGS) $(PGFELIBS) -o $@
shp2pgsql$(EXE): $(OBJS) shp2pgsql.o
$(CC) $(CFLAGS) $(OBJS) shp2pgsql.o $(LDFLAGS) -o $@
install: all
@mkdir -p $(DESTDIR)$(bindir)
$(INSTALL_BIN) pgsql2shp$(EXE) $(DESTDIR)$(bindir)/pgsql2shp$(EXE)
$(INSTALL_BIN) shp2pgsql$(EXE) $(DESTDIR)$(bindir)/shp2pgsql$(EXE)
uninstall:
rm -f $(DESTDIR)$(bindir)/pgsql2shp$(EXE)
rm -f $(DESTDIR)$(bindir)/shp2pgsql$(EXE)
clean:
rm -f $(OBJS) shp2pgsql.o pgsql2shp.o PQunescapeBytea.o shp2pgsql$(EXE) pgsql2shp$(EXE)
all:
%:
make -f Makefile.shp2pgsql $@
make -f Makefile.pgsql2shp $@
#
# PostGIS PGXS build system
#
PROGRAM=pgsql2shp
# List of objects to build
OBJS= shpopen.o \
dbfopen.o \
getopt.o \
pgsql2shp.o \
PQunescapeBytea.o
# Link against libpq
PG_CPPFLAGS=@PGSQL_FE_CPPFLAGS@
PG_LIBS=@PGSQL_FE_LDFLAGS@ -lpq
# PGXS information
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
#
# PostGIS PGXS build system
#
PROGRAM=shp2pgsql
# List of objects to build
OBJS= shpopen.o \
dbfopen.o \
getopt.o \
shp2pgsql.o
# PGXS information
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
......@@ -21,6 +21,8 @@
static char rcsid[] =
"$Id$";
#include "../postgis_config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -22,7 +22,7 @@
*
**********************************************************************/
#include "../config.h"
#include "../postgis_config.h"
#include "shapefil.h"
#include <stdio.h>
#include <string.h>
......
# Configuration Directives
include ../Makefile.config
include ../Version.config
#---------------------------------------------------------------
# Default missing CXX variable to c++
#
ifndef $(CXX)
CXX = c++
endif
#---------------------------------------------------------------
# Shared library parameters.
#
NAME=lwgeom
SHLIB_LINK = $(DLFLAGS)
#---------------------------------------------------------------
# Postgis version and build date
#---------------------------------------------------------------
POSTGIS_VERSION = $(REL_MAJOR_VERSION).$(REL_MINOR_VERSION) USE_GEOS=$(USE_GEOS) USE_PROJ=$(USE_PROJ) USE_STATS=$(USE_STATS)
POSTGIS_LIB_VERSION = $(REL_MAJOR_VERSION).$(REL_MINOR_VERSION).$(REL_MICRO_VERSION)
POSTGIS_BUILD_DATE := $(shell date -u "+%Y-%m-%d %H:%M:%S")
SCRIPTS_VERSION=$(POSTGIS_LIB_VERSION)
SQL_FLAGS = -DUSE_VERSION=$(USE_VERSION)
#---------------------------------------------------------------
CSTAR_FLAGS = -Wall -g -O2 -fPIC -fexceptions
override CFLAGS += -DUSE_VERSION=$(USE_VERSION)
override CFLAGS += -DPOSTGIS_LIB_VERSION='"$(POSTGIS_LIB_VERSION)"'
override CFLAGS += -DPOSTGIS_VERSION='"$(POSTGIS_VERSION)"'
override CFLAGS += -DPOSTGIS_SCRIPTS_VERSION='"$(SCRIPTS_VERSION)"'
override CFLAGS += -DPOSTGIS_BUILD_DATE='"$(POSTGIS_BUILD_DATE)"'
JTS_OBJ=lwgeom_nojts.o
ifeq ($(USE_GEOS),1)
CSTAR_FLAGS += -DUSE_GEOS
CSTAR_FLAGS += -DGEOS_VERNUM=$(GEOS_VERNUM)
SQL_FLAGS += -DUSE_GEOS -DGEOS_VERNUM=$(GEOS_VERNUM)
GEOS_RULES=
CSTAR_FLAGS += -I$(GEOS_DIR)/include
GEOS_WRAPPER=
JTS_OBJ=lwgeom_geos_c.o
SHLIB_LINK += $(GEOS_LDFLAGS) -lgeos_c
endif
ifeq ($(USE_JTS),1)
CXXFLAGS += -I$(JTS_INCLUDES)
CSTAR_FLAGS += -DUSE_JTS
SQL_FLAGS += -DUSE_JTS
JTS_WRAPPER=lwgeom_jts_wrapper.o
JTS_OBJ=lwgeom_jts.o
SHLIB_LINK += -lgcj -ljts -lstdc++ -L$(JTS_LIBDIR)
endif
ifeq ($(USE_PROJ),1)
override CFLAGS += -I$(PROJ_DIR)/include -DUSE_PROJ
SHLIB_LINK += -L$(PROJ_LIBDIR) -lproj
SQL_FLAGS += -DUSE_PROJ
endif
override CFLAGS += $(PGBEINCLUDES) -DAUTOCACHE_BBOX=$(AUTOCACHE_BBOX)
# memory debug for gcc 2.91, 2.95, 3.0 and 3.1
# for gcc >= 3.2.2 set GLIBCPP_FORCE_NEW at runtime instead
#override CXXFLAGS += -D__USE_MALLOC
#---------------------------------------------------------------
# Add index selectivity to C flags
# PostGIS PGXS build system
#
ifeq ($(USE_STATS),1)
override CFLAGS += -DUSE_STATS
endif
override CFLAGS += $(CSTAR_FLAGS)
override CXXFLAGS += $(CSTAR_FLAGS)
SA_OBJS=measures.o box2d.o ptarray.o lwgeom_api.o lwgeom.o lwpoint.o lwline.o lwpoly.o lwmpoint.o lwmline.o lwmpoly.o lwcollection.o $(GEOS_WRAPPER) $(JTS_WRAPPER) wktunparse.o lwgparse.o wktparse.tab.o lex.yy.o vsprintf.o
OBJS=$(SA_OBJS) liblwgeom.o lwgeom_pg.o lwgeom_debug.o lwgeom_spheroid.o lwgeom_ogc.o lwgeom_functions_analytic.o $(JTS_OBJ) lwgeom_inout.o lwgeom_estimate.o lwgeom_functions_basic.o lwgeom_gist.o lwgeom_btree.o lwgeom_transform.o stringBuffer.o lwgeom_box.o lwgeom_box3d.o lwgeom_box2dfloat4.o lwgeom_chip.o lwgeom_svg.o lwgeom_gml.o lwgeom_kml.o lwgeom_geojson.o lwgeom_triggers.o lwgeom_dump.o lwgeom_functions_lrs.o long_xact.o lwcurve.o lwcompound.o lwcurvepoly.o lwmcurve.o lwmsurface.o lwgeom_sqlmm.o lwgeom_rtree.o
#OTHERS=y.output lex.yy.c wktparse.tab.c wktparse.tab.h lwpostgis.sql
OTHERS=y.output postgis_geos_version.h
all: $(GEOS_RULES) ../lwpostgis.sql ../regress/lwpostgis.sql ../lwpostgis_upgrade.sql all-shared-lib
enable_shared=yes
include Makefile.shlib
MODULE_FILENAME = $(LPATH)/lib$(NAME)
REGRESS_MODULE_FILENAME = $(shell $(PWDREGRESS))/$(shlib)
#---------------------------------------------------------------
# Makefile targets
wktparse.tab.c: wktparse.y
$(YACC) -vd -p lwg_parse_yy wktparse.y
mv -f y.tab.c wktparse.tab.c
mv -f y.tab.h wktparse.tab.h
lex.yy.c: wktparse.lex wktparse.tab.c
$(FLEX) -Plwg_parse_yy -i -f -o'lex.yy.c' wktparse.lex
lwgeom_jts_wrapper.o: lwgeom_jts_wrapper.cpp
lwgeom_geos_c.o: lwgeom_geos_c.c profile.h
lwgeom_jts.o: lwgeom_jts.c profile.h
lwgeom_nojts.o: lwgeom_nojts.c
lwgeom_functions_basic.o: lwgeom_functions_basic.c profile.h
# Shared library stuff
../lwpostgis_upgrade.sql: ../lwpostgis.sql ../utils/postgis_proc_upgrade.pl
$(PERL) ../utils/postgis_proc_upgrade.pl ../lwpostgis.sql > ../lwpostgis_upgrade.sql
../lwpostgis.sql: lwpostgis.sql.in long_xact.sql.in sqlmm.sql.in sqldefines.h
cpp -P -traditional-cpp $(SQL_FLAGS) $< | sed -e 's:@MODULE_FILENAME@:$(MODULE_FILENAME):g;s:@POSTGIS_VERSION@:$(POSTGIS_VERSION):g;s:@POSTGIS_SCRIPTS_VERSION@:$(SCRIPTS_VERSION):g;s/@POSTGIS_BUILD_DATE@/$(POSTGIS_BUILD_DATE)/g' | grep -v '^#' > $@
../regress/lwpostgis.sql: lwpostgis.sql.in long_xact.sql.in sqlmm.sql.in sqldefines.h
cpp -P -traditional-cpp $(SQL_FLAGS) $< | sed -e 's#@MODULE_FILENAME@#$(MODULE_FILENAME)#g;s#@POSTGIS_VERSION@#$(POSTGIS_VERSION)#g;s#@POSTGIS_SCRIPTS_VERSION@#$(SCRIPTS_VERSION)#g;s/@POSTGIS_BUILD_DATE@/$(POSTGIS_BUILD_DATE)/g' | grep -v '^#' > $@
install: all install-lib-shared install-lwgeom-scripts
install-lwgeom-scripts:
@mkdir -p $(DESTDIR)$(datadir)
$(INSTALL_DATA) ../lwpostgis.sql $(DESTDIR)$(datadir)/lwpostgis.sql
$(INSTALL_DATA) ../lwpostgis_upgrade.sql $(DESTDIR)$(datadir)/lwpostgis_upgrade.sql
$(INSTALL_DATA) ../spatial_ref_sys.sql $(DESTDIR)$(datadir)/spatial_ref_sys.sql
#----------------------------------------------------------
detect_geos_version:
sh ../geos_version.sh $(GEOS_DIR) > postgis_geos_version.h
uninstall-lwgeom-scripts:
rm -f $(DESTDIR)$(datadir)/lwpostgis.sql
rm -f $(DESTDIR)$(datadir)/lwpostgis_upgrade.sql
rm -f $(DESTDIR)$(datadir)/spatial_ref_sys.sql
uninstall: uninstall-lib uninstall-lwgeom-scripts
clean-lwgeom-lib: clean-lib
clean distclean: clean-lwgeom-lib
rm -f *.o *.so *.a ../lwpostgis.sql ../lwpostgis_upgrade.sql test $(OTHERS)
maintainer-clean: clean
rm -f lex.yy.c wktparse.tab.c wktparse.tab.h
liblwgeom_sa.o: liblwgeom.c
$(CC) -DSTANDALONE -o $@ -c $<
liblwgeom_sa.so: $(SA_OBJS) liblwgeom_sa.o
$(CC) -shared -o $@ $^
liblwgeom_sa.a: $(SA_OBJS) liblwgeom_sa.o
$(AR) -rc $@ $^
test: liblwgeom_sa.so liblwgeom_sa.a test.c
$(CC) -Wall -lm -g -o test test.c liblwgeom_sa.a
MODULE_big=lwpostgis
# Files to be copied to the contrib/ directory
DATA_built=lwpostgis.sql
DATA=../spatial_ref_sys.sql
# SQL objects (files requiring C pre-processing)
SQL_OBJS=lwpostgis.sql.in
# Standalone LWGEOM objects
SA_OBJS=measures.o \
box2d.o \
ptarray.o \
lwgeom_api.o \
lwgeom.o \
lwpoint.o \
lwline.o \
lwpoly.o \
lwmpoint.o \
lwmline.o \
lwmpoly.o \
lwcollection.o \
lwgeom_geos_c.o \
wktunparse.o \
lwgparse.o \
wktparse.tab.o \
lex.yy.o \
vsprintf.o
# PostgreSQL objects
PG_OBJS=liblwgeom.o \
lwgeom_pg.o \
lwgeom_debug.o \
lwgeom_spheroid.o \
lwgeom_ogc.o \
lwgeom_functions_analytic.o \
$(JTS_OBJ) \
lwgeom_inout.o \
lwgeom_estimate.o \
lwgeom_functions_basic.o \
lwgeom_gist.o \
lwgeom_btree.o \
lwgeom_transform.o \
stringBuffer.o \
lwgeom_box.o \
lwgeom_box3d.o \
lwgeom_box2dfloat4.o \
lwgeom_chip.o \
lwgeom_svg.o \
lwgeom_gml.o \
lwgeom_kml.o \
lwgeom_geojson.o \
lwgeom_triggers.o \
lwgeom_dump.o \
lwgeom_functions_lrs.o \
long_xact.o \
lwcurve.o \
lwcompound.o \
lwcurvepoly.o \
lwmcurve.o \
lwmsurface.o \
lwgeom_sqlmm.o \
lwgeom_rtree.o
# Objects to build using PGXS
OBJS=$(SA_OBJS) $(PG_OBJS)
# Libraries to link into the module (proj, geos)
SHLIB_LINK= -L/usr/lib -lgeos_c -lproj
# Extra files to remove during 'make clean'
EXTRA_CLEAN=$(SQL_OBJS)
# PGXS information
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
# 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 '^#' > $@
tsort:
lorder $(SA_OBJS) | tsort
#
# PostGIS PGXS build system
#
MODULE_big=lwpostgis
# Files to be copied to the contrib/ directory
DATA_built=lwpostgis.sql
DATA=../spatial_ref_sys.sql
# SQL objects (files requiring C pre-processing)
SQL_OBJS=lwpostgis.sql.in
# Standalone LWGEOM objects
SA_OBJS=measures.o \
box2d.o \
ptarray.o \
lwgeom_api.o \
lwgeom.o \
lwpoint.o \
lwline.o \
lwpoly.o \
lwmpoint.o \
lwmline.o \
lwmpoly.o \
lwcollection.o \
lwgeom_geos_c.o \
wktunparse.o \
lwgparse.o \
wktparse.tab.o \
lex.yy.o \
vsprintf.o
# PostgreSQL objects
PG_OBJS=liblwgeom.o \
lwgeom_pg.o \
lwgeom_debug.o \
lwgeom_spheroid.o \
lwgeom_ogc.o \
lwgeom_functions_analytic.o \
$(JTS_OBJ) \
lwgeom_inout.o \
lwgeom_estimate.o \
lwgeom_functions_basic.o \
lwgeom_gist.o \
lwgeom_btree.o \
lwgeom_transform.o \
stringBuffer.o \
lwgeom_box.o \
lwgeom_box3d.o \
lwgeom_box2dfloat4.o \
lwgeom_chip.o \
lwgeom_svg.o \
lwgeom_gml.o \
lwgeom_kml.o \
lwgeom_geojson.o \
lwgeom_triggers.o \
lwgeom_dump.o \
lwgeom_functions_lrs.o \
long_xact.o \
lwcurve.o \
lwcompound.o \
lwcurvepoly.o \
lwmcurve.o \
lwmsurface.o \
lwgeom_sqlmm.o \
lwgeom_rtree.o
# Objects to build using PGXS
OBJS=$(SA_OBJS) $(PG_OBJS)
# Libraries to link into the module (proj, geos)
SHLIB_LINK=@SHLIB_LINK@
# Extra files to remove during 'make clean'
EXTRA_CLEAN=$(SQL_OBJS)
# PGXS information
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
# 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 '^#' > $@
This diff is collapsed.
......@@ -15,6 +15,8 @@
#endif
/* Global variables */
#include "../postgis_config.h"
#if DEFAULT_CONTEXT == CONTEXT_SA
#include "liblwgeom.h"
lwallocator lwalloc_var = default_allocator;
......
......@@ -34,8 +34,10 @@ typedef void (*lwfreeor)(void* mem);
typedef void (*lwreporter)(const char* fmt, ...);
#ifndef C_H
typedef unsigned int uint32;
typedef int int32;
#endif
/*
......
......@@ -211,12 +211,12 @@ CREATEFUNCTION CheckAuth(text, text)
CREATEFUNCTION CheckAuthTrigger()
RETURNS trigger AS
'@MODULE_FILENAME@', 'check_authorization'
'MODULE_PATHNAME', 'check_authorization'
LANGUAGE C;
CREATEFUNCTION GetTransactionID()
RETURNS xid AS
'@MODULE_FILENAME@', 'getTransactionID'
'MODULE_PATHNAME', 'getTransactionID'
LANGUAGE C;
......
......@@ -29,10 +29,10 @@ Datum lwgeom_cmp(PG_FUNCTION_ARGS);
/* #define PGIS_DEBUG */
#if USE_VERSION == 72
#if POSTGIS_PGSQL_VERSION == 72
#define BTREE_SRID_MISMATCH_SEVERITY NOTICE
#else
#if USE_VERSION < 80
#if POSTGIS_PGSQL_VERSION < 80
#define BTREE_SRID_MISMATCH_SEVERITY WARNING
#else
#define BTREE_SRID_MISMATCH_SEVERITY ERROR
......
#include "../postgis_config.h"
/*
* This only works for PGSQL > 72
*/
#if USE_VERSION > 72
#if POSTGIS_PGSQL_VERSION > 72
#include <math.h>
#include <float.h>
......@@ -307,4 +309,4 @@ Datum LWGEOM_dump_rings(PG_FUNCTION_ARGS)
}
#endif /* USE_VERSION > 72 */
#endif /* POSTGIS_PGSQL_VERSION > 72 */
......@@ -29,7 +29,7 @@
/*#define DEBUG_GEOMETRY_STATS 1*/
#if USE_VERSION >= 80
#if POSTGIS_PGSQL_VERSION >= 80
#include "commands/vacuum.h"
#include "utils/lsyscache.h"
......@@ -82,7 +82,7 @@ typedef struct GEOM_STATS_T
static float8 estimate_selectivity(BOX2DFLOAT4 *box, GEOM_STATS *geomstats);
#endif /* USE_VERSION >= 80 */
#endif /* POSTGIS_PGSQL_VERSION >= 80 */
#define SHOW_DIGS_DOUBLE 15
#define MAX_DIGS_DOUBLE (SHOW_DIGS_DOUBLE + 6 + 1 + 3 +1)
......@@ -136,7 +136,7 @@ Datum estimate_lwhistogram2d(PG_FUNCTION_ARGS);
Datum LWGEOM_gist_sel(PG_FUNCTION_ARGS);
Datum LWGEOM_gist_joinsel(PG_FUNCTION_ARGS);
Datum LWGEOM_estimated_extent(PG_FUNCTION_ARGS);
#if USE_VERSION >= 80
#if POSTGIS_PGSQL_VERSION >= 80