2002-05-04 22:46:50 +00:00
|
|
|
# Configuration Directives
|
2002-10-16 17:06:19 +00:00
|
|
|
|
2002-05-04 22:46:50 +00:00
|
|
|
#---------------------------------------------------------------
|
|
|
|
# Set USE_PROJ to 1 for Proj4 reprojection support
|
2002-12-05 20:54:57 +00:00
|
|
|
#
|
2003-05-27 22:35:14 +00:00
|
|
|
USE_PROJ=1
|
2003-10-21 07:44:39 +00:00
|
|
|
ifeq (${PROJ_DIR},)
|
|
|
|
PROJ_DIR=/usr/local
|
|
|
|
endif
|
2002-05-04 22:46:50 +00:00
|
|
|
|
2003-04-09 18:34:43 +00:00
|
|
|
#---------------------------------------------------------------
|
|
|
|
# Set USE_GEOS to 1 for GEOS spatial predicate and operator
|
|
|
|
# support
|
|
|
|
#
|
2003-05-27 22:35:14 +00:00
|
|
|
USE_GEOS=1
|
2003-10-21 07:44:39 +00:00
|
|
|
ifeq (${GEOS_DIR},)
|
|
|
|
GEOS_DIR=/usr/local
|
|
|
|
endif
|
2003-04-09 18:34:43 +00:00
|
|
|
|
2002-10-16 17:27:11 +00:00
|
|
|
#---------------------------------------------------------------
|
|
|
|
# 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
|
2002-12-05 20:54:57 +00:00
|
|
|
#
|
2003-08-08 18:19:20 +00:00
|
|
|
USE_STATS=1
|
2002-10-16 17:27:11 +00:00
|
|
|
|
2002-05-04 22:46:50 +00:00
|
|
|
#---------------------------------------------------------------
|
|
|
|
subdir=contrib/postgis
|
|
|
|
|
|
|
|
#---------------------------------------------------------------
|
|
|
|
# Default the root of the PostgreSQL source tree
|
|
|
|
# To use a non-standard location set the PGSQL_SRC environment
|
|
|
|
# variable to the appropriate location.
|
2002-12-05 20:54:57 +00:00
|
|
|
#
|
2001-07-20 15:25:09 +00:00
|
|
|
ifeq (${PGSQL_SRC},)
|
2001-06-26 23:57:10 +00:00
|
|
|
top_builddir = ../..
|
2001-07-26 17:41:03 +00:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
2003-11-20 15:54:02 +00:00
|
|
|
#LPATH := $$libdir
|
2001-07-20 15:25:09 +00:00
|
|
|
else
|
|
|
|
top_builddir = ${PGSQL_SRC}
|
2001-07-26 17:41:03 +00:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
2003-11-20 15:54:02 +00:00
|
|
|
#LPATH := ${PWD}
|
2001-06-26 23:57:10 +00:00
|
|
|
endif
|
2001-06-22 17:39:29 +00:00
|
|
|
|
2003-04-10 16:22:05 +00:00
|
|
|
#---------------------------------------------------------------
|
|
|
|
# Default missing CXX variable to c++
|
|
|
|
#
|
|
|
|
ifeq ($(CXX),)
|
|
|
|
CXX = c++
|
|
|
|
endif
|
|
|
|
|
2002-10-16 17:06:19 +00:00
|
|
|
#---------------------------------------------------------------
|
2002-12-05 21:49:59 +00:00
|
|
|
# Test the version string and set the USE_VERSION macro
|
|
|
|
# appropriately.
|
2002-12-05 20:54:57 +00:00
|
|
|
#
|
2002-10-16 17:06:19 +00:00
|
|
|
ifneq ($(findstring 7.1,$(VERSION)),)
|
2002-12-05 19:48:20 +00:00
|
|
|
USE_VERSION=71
|
2002-10-16 17:06:19 +00:00
|
|
|
else
|
2002-12-05 19:48:20 +00:00
|
|
|
ifneq ($(findstring 7.2,$(VERSION)),)
|
|
|
|
USE_VERSION=72
|
|
|
|
else
|
2003-10-17 16:32:36 +00:00
|
|
|
ifneq ($(findstring 7.3,$(VERSION)),)
|
|
|
|
USE_VERSION=73
|
|
|
|
else
|
|
|
|
USE_VERSION=74
|
|
|
|
endif
|
2002-12-05 19:48:20 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
#---------------------------------------------------------------
|
2002-12-05 21:49:59 +00:00
|
|
|
# Shared library parameters.
|
2002-12-05 20:54:57 +00:00
|
|
|
#
|
2002-12-05 19:48:20 +00:00
|
|
|
NAME=postgis
|
|
|
|
SO_MAJOR_VERSION=0
|
2003-04-09 21:35:56 +00:00
|
|
|
SO_MINOR_VERSION=8
|
2003-11-20 17:51:43 +00:00
|
|
|
ifeq (${USE_VERSION}, 71)
|
|
|
|
MODULE_FILENAME = $(libdir)/$(shlib)
|
|
|
|
MODULE_INSTALLDIR = $(libdir)
|
|
|
|
else
|
|
|
|
MODULE_FILENAME = $$libdir/$(shlib)
|
|
|
|
MODULE_INSTALLDIR = $(pkglibdir)
|
|
|
|
endif
|
2002-10-16 17:06:19 +00:00
|
|
|
#---------------------------------------------------------------
|
2003-04-09 21:35:56 +00:00
|
|
|
|
2003-05-27 22:35:14 +00:00
|
|
|
override CFLAGS += -g -fexceptions
|
2003-04-09 21:35:56 +00:00
|
|
|
override CFLAGS += -I$(srcdir) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"'
|
|
|
|
override CFLAGS += -DUSE_VERSION=$(USE_VERSION)
|
|
|
|
|
2003-04-09 18:34:43 +00:00
|
|
|
ifeq ($(USE_GEOS),1)
|
2003-04-09 21:35:56 +00:00
|
|
|
override CFLAGS += -I$(GEOS_DIR)/include/geos -DUSE_GEOS
|
2003-04-09 18:34:43 +00:00
|
|
|
endif
|
2003-04-09 21:53:41 +00:00
|
|
|
ifeq ($(USE_PROJ),1)
|
|
|
|
override CFLAGS += -I$(PROJ_DIR)/include -DUSE_PROJ
|
|
|
|
endif
|
2001-06-22 17:39:29 +00:00
|
|
|
|
2003-04-09 21:35:56 +00:00
|
|
|
override DLLLIBS += $(BE_DLLLIBS)
|
|
|
|
|
|
|
|
override CXXFLAGS := $(CFLAGS)
|
2003-10-23 09:14:04 +00:00
|
|
|
# memory debug for gcc 2.91, 2.95, 3.0 and 3.1
|
2003-10-23 19:52:04 +00:00
|
|
|
# for gcc >= 3.2.2 set GLIBCPP_FORCE_NEW at runtime instead
|
2003-10-23 09:14:04 +00:00
|
|
|
#override CXXFLAGS += -D__USE_MALLOC
|
2003-04-09 18:34:43 +00:00
|
|
|
|
2002-12-05 20:54:57 +00:00
|
|
|
#---------------------------------------------------------------
|
2003-01-06 18:07:09 +00:00
|
|
|
# Add index selectivity to C flags
|
|
|
|
#
|
|
|
|
ifeq ($(USE_STATS),1)
|
2003-04-09 21:35:56 +00:00
|
|
|
override CFLAGS += -DUSE_STATS
|
2003-01-06 18:07:09 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
#---------------------------------------------------------------
|
2002-12-05 20:54:57 +00:00
|
|
|
# Select proper GiST support C file
|
|
|
|
#
|
2002-12-05 19:48:20 +00:00
|
|
|
ifeq ($(USE_VERSION),71)
|
|
|
|
GIST_SUPPORT=71
|
2003-02-12 21:03:49 +00:00
|
|
|
GIST_ESTIMATE=
|
2002-04-26 22:50:06 +00:00
|
|
|
else
|
2002-12-05 19:48:20 +00:00
|
|
|
GIST_SUPPORT=72
|
2003-02-12 21:03:49 +00:00
|
|
|
GIST_ESTIMATE=postgis_estimate.o
|
2002-04-26 22:50:06 +00:00
|
|
|
endif
|
2001-06-22 17:39:29 +00:00
|
|
|
|
2003-04-09 21:35:56 +00:00
|
|
|
ifeq ($(USE_GEOS),1)
|
|
|
|
GEOS_WRAPPER=postgis_geos_wrapper.o
|
|
|
|
endif
|
|
|
|
|
2003-10-28 11:16:22 +00:00
|
|
|
OBJS=postgis_debug.o postgis_ops.o postgis_fn.o postgis_inout.o postgis_proj.o postgis_chip.o postgis_transform.o postgis_gist_$(GIST_SUPPORT).o $(GIST_ESTIMATE) postgis_geos.o $(GEOS_WRAPPER) postgis_algo.o
|
2002-12-05 19:48:20 +00:00
|
|
|
|
2002-12-05 20:54:57 +00:00
|
|
|
#---------------------------------------------------------------
|
2001-06-22 17:39:29 +00:00
|
|
|
# Add libraries that libpq depends (or might depend) on into the
|
|
|
|
# shared library link. (The order in which you list them here doesn't
|
|
|
|
# matter.)
|
2003-04-09 18:34:43 +00:00
|
|
|
|
2003-04-09 21:35:56 +00:00
|
|
|
SHLIB_LINK = $(filter -L%, $(LDFLAGS))
|
2003-04-09 21:53:41 +00:00
|
|
|
ifeq ($(USE_GEOS),1)
|
|
|
|
SHLIB_LINK += -lstdc++ -L$(GEOS_DIR)/lib -lgeos
|
|
|
|
endif
|
2003-04-09 21:35:56 +00:00
|
|
|
ifeq ($(USE_PROJ),1)
|
|
|
|
SHLIB_LINK += -L$(PROJ_DIR)/lib -lproj
|
|
|
|
endif
|
|
|
|
SHLIB_LINK += $(BE_DLLLIBS)
|
2001-06-22 17:39:29 +00:00
|
|
|
|
2002-12-05 20:54:57 +00:00
|
|
|
#---------------------------------------------------------------
|
|
|
|
# Makefile targets
|
|
|
|
|
2003-04-09 18:34:43 +00:00
|
|
|
include $(top_srcdir)/src/Makefile.shlib
|
|
|
|
|
|
|
|
postgis_geos_wrapper.o: postgis_geos_wrapper.cpp
|
|
|
|
|
2003-04-10 16:20:22 +00:00
|
|
|
all: all-lib postgis.sql postgis.sql postgis_undef.sql loaderdumper
|
2001-07-30 16:27:11 +00:00
|
|
|
|
2001-09-19 19:01:38 +00:00
|
|
|
loaderdumper:
|
2002-11-26 03:59:16 +00:00
|
|
|
$(MAKE) -C loader
|
2001-06-22 17:39:29 +00:00
|
|
|
|
|
|
|
# Shared library stuff
|
|
|
|
|
2003-04-10 16:20:22 +00:00
|
|
|
postgis.sql: postgis_sql_common.sql.in postgis_sql_$(USE_VERSION)_end.sql.in postgis_sql_$(USE_VERSION)_start.sql.in
|
2003-11-20 15:29:43 +00:00
|
|
|
cat postgis_sql_$(USE_VERSION)_start.sql.in postgis_sql_common.sql.in postgis_sql_$(USE_VERSION)_end.sql.in | sed -e 's:@MODULE_FILENAME@:$(MODULE_FILENAME):g;s:@POSTGIS_VERSION@:$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) USE_GEOS=$(USE_GEOS) USE_PROJ=$(USE_PROJ) USE_STATS=$(USE_STATS):g' > $@
|
2001-06-22 17:39:29 +00:00
|
|
|
|
2003-04-10 16:20:22 +00:00
|
|
|
postgis_undef.sql: postgis.sql create_undef.pl
|
2002-12-10 04:36:37 +00:00
|
|
|
perl create_undef.pl $< $(USE_VERSION) > $@
|
2001-10-18 17:51:55 +00:00
|
|
|
|
2003-11-20 17:51:43 +00:00
|
|
|
install: all installdirs install-postgis-lib
|
2003-04-10 16:20:22 +00:00
|
|
|
$(INSTALL_DATA) $(srcdir)/README.postgis $(docdir)/contrib
|
|
|
|
$(INSTALL_DATA) postgis.sql $(datadir)/contrib
|
|
|
|
$(INSTALL_DATA) postgis_undef.sql $(datadir)/contrib
|
2001-10-31 22:18:32 +00:00
|
|
|
$(INSTALL_DATA) spatial_ref_sys.sql $(datadir)/contrib
|
2001-11-02 00:28:18 +00:00
|
|
|
$(INSTALL_DATA) README.postgis $(datadir)/contrib
|
2002-11-26 03:59:16 +00:00
|
|
|
$(MAKE) -C loader install
|
2001-06-22 17:39:29 +00:00
|
|
|
|
2003-11-20 17:51:43 +00:00
|
|
|
#- This has been copied from postgresql and adapted
|
|
|
|
install-postgis-lib: $(shlib)
|
|
|
|
$(INSTALL_SHLIB) $< $(DESTDIR)$(MODULE_INSTALLDIR)/$(shlib)
|
|
|
|
ifneq ($(PORTNAME), win)
|
|
|
|
ifneq ($(shlib), lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION))
|
|
|
|
cd $(DESTDIR)$(MODULE_INSTALLDIR) && \
|
|
|
|
rm -f lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) && \
|
|
|
|
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
|
|
|
|
endif
|
|
|
|
ifneq ($(shlib), lib$(NAME)$(DLSUFFIX))
|
|
|
|
cd $(DESTDIR)$(MODULE_INSTALLDIR) && \
|
|
|
|
rm -f lib$(NAME)$(DLSUFFIX) && \
|
|
|
|
$(LN_S) $(shlib) lib$(NAME)$(DLSUFFIX)
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif # not win
|
|
|
|
#----------------------------------------------------------
|
|
|
|
|
2001-06-22 17:39:29 +00:00
|
|
|
installdirs:
|
2001-07-26 17:37:56 +00:00
|
|
|
$(mkinstalldirs) $(docdir)/contrib $(datadir)/contrib $(libdir)
|
2001-06-22 17:39:29 +00:00
|
|
|
|
|
|
|
uninstall: uninstall-lib
|
2003-04-10 16:20:22 +00:00
|
|
|
@rm -f $(docdir)/contrib/README.postgis $(datadir)/contrib/postgis.sql
|
2001-06-22 17:39:29 +00:00
|
|
|
|
|
|
|
clean distclean maintainer-clean: clean-lib
|
2003-04-10 16:20:22 +00:00
|
|
|
@rm -f $(OBJS) postgis.sql postgis_undef.sql
|
2002-11-26 03:59:16 +00:00
|
|
|
$(MAKE) -C loader clean
|
2003-11-04 19:07:13 +00:00
|
|
|
$(MAKE) -C doc clean
|
2001-06-22 17:39:29 +00:00
|
|
|
|