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
|
|
|
#
|
2002-12-06 20:31:56 +00:00
|
|
|
USE_PROJ=0
|
2002-12-05 19:48:20 +00:00
|
|
|
PROJ_DIR=/usr/local
|
2002-05-04 22:46:50 +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
|
|
|
#
|
2002-10-16 17:27:11 +00:00
|
|
|
USE_STATS=0
|
|
|
|
|
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
|
2002-12-05 20:48:06 +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
|
2002-12-05 20:48:06 +00:00
|
|
|
LPATH := ${PWD}
|
2001-06-26 23:57:10 +00:00
|
|
|
endif
|
2001-06-22 17:39:29 +00:00
|
|
|
|
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
|
|
|
|
USE_VERSION=73
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
#---------------------------------------------------------------
|
|
|
|
# Regression test temporary database.
|
2002-12-05 20:54:57 +00:00
|
|
|
#
|
2002-12-05 19:48:20 +00:00
|
|
|
TEST_DB=geom_regress
|
|
|
|
|
|
|
|
#---------------------------------------------------------------
|
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
|
|
|
|
SO_MINOR_VERSION=7
|
|
|
|
|
2002-10-16 17:06:19 +00:00
|
|
|
#---------------------------------------------------------------
|
2002-12-05 20:54:57 +00:00
|
|
|
# override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
|
2001-06-22 17:39:29 +00:00
|
|
|
# Altered for Cynwin
|
2002-05-04 22:46:50 +00:00
|
|
|
ifeq ($(USE_PROJ),1)
|
2002-12-05 20:54:57 +00:00
|
|
|
override CPPFLAGS := -g -I$(PROJ_DIR)/include -I$(srcdir) $(CPPFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"' -DUSE_PROJ -DUSE_VERSION=$(USE_VERSION)
|
2002-05-04 22:46:50 +00:00
|
|
|
else
|
2002-12-05 20:54:57 +00:00
|
|
|
override CPPFLAGS := -g -I$(srcdir) $(CPPFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"' -DUSE_VERSION=$(USE_VERSION)
|
2002-05-04 22:46:50 +00:00
|
|
|
endif
|
2001-06-22 17:39:29 +00:00
|
|
|
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
|
|
|
|
|
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
|
2002-04-26 22:50:06 +00:00
|
|
|
else
|
2002-12-05 19:48:20 +00:00
|
|
|
GIST_SUPPORT=72
|
2002-04-26 22:50:06 +00:00
|
|
|
endif
|
2001-06-22 17:39:29 +00:00
|
|
|
|
2002-12-05 20:30: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 postgis_estimate.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.)
|
2002-05-04 22:46:50 +00:00
|
|
|
SHLIB_LINK=$(filter -L%, $(LDFLAGS))
|
|
|
|
ifeq ($(USE_PROJ),1)
|
2002-12-05 19:48:20 +00:00
|
|
|
SHLIB_LINK=$(filter -L%, $(LDFLAGS)) -L$(PROJ_DIR)/lib -lproj
|
2002-05-04 22:46:50 +00:00
|
|
|
else
|
|
|
|
SHLIB_LINK=$(filter -L%, $(LDFLAGS))
|
|
|
|
endif
|
2001-06-22 17:39:29 +00:00
|
|
|
|
2002-12-05 20:54:57 +00:00
|
|
|
#---------------------------------------------------------------
|
|
|
|
# Makefile targets
|
|
|
|
|
2002-04-26 22:50:06 +00:00
|
|
|
all: all-lib $(NAME).sql $(NAME).sql $(NAME)_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
|
|
|
|
include $(top_srcdir)/src/Makefile.shlib
|
|
|
|
|
2002-12-05 19:48:20 +00:00
|
|
|
$(NAME).sql: $(NAME).sql.in $(NAME)_gist_$(USE_VERSION).sql.in
|
2002-12-05 20:48:06 +00:00
|
|
|
sed -e 's:@MODULE_FILENAME@:$(LPATH)/$(shlib):g;s:@POSTGIS_VERSION@:$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION):g' < $(NAME).sql.in > $@
|
|
|
|
sed -e 's:@MODULE_FILENAME@:$(LPATH)/$(shlib):g;s:@POSTGIS_VERSION@:$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION):g' < $(NAME)_gist_$(USE_VERSION).sql.in >> $(NAME).sql
|
2001-06-22 17:39:29 +00:00
|
|
|
|
2001-10-18 17:51:55 +00:00
|
|
|
$(NAME)_undef.sql: $(NAME).sql
|
|
|
|
perl create_undef.pl $< > $@
|
|
|
|
|
2001-06-22 17:39:29 +00:00
|
|
|
install: all installdirs install-lib
|
|
|
|
$(INSTALL_DATA) $(srcdir)/README.$(NAME) $(docdir)/contrib
|
|
|
|
$(INSTALL_DATA) $(NAME).sql $(datadir)/contrib
|
2001-10-18 17:51:55 +00:00
|
|
|
$(INSTALL_DATA) $(NAME)_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
|
|
|
|
|
|
|
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
|
|
|
|
@rm -f $(docdir)/contrib/README.$(NAME) $(datadir)/contrib/$(NAME).sql
|
|
|
|
|
|
|
|
clean distclean maintainer-clean: clean-lib
|
2002-05-04 22:47:38 +00:00
|
|
|
@rm -f $(OBJS) $(NAME).sql $(NAME)_undef.sql
|
2002-11-26 03:59:16 +00:00
|
|
|
$(MAKE) -C loader clean
|
2001-06-22 17:39:29 +00:00
|
|
|
|
|
|
|
test: all
|
2002-05-04 22:46:50 +00:00
|
|
|
csh regress/regress.csh $(TEST_DB)
|