From: Sandro Santilli Date: Mon, 20 Sep 2004 09:58:26 +0000 (+0000) Subject: Configuration and common Makefile work moved to Makefile.config X-Git-Tag: pgis_1_0_0RC1~427 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cbbbfa301c904b8288378e8956b3b66d7c5b83e0;p=postgis Configuration and common Makefile work moved to Makefile.config Build is possible from each directory and from the root directory. git-svn-id: http://svn.osgeo.org/postgis/trunk@844 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/Makefile b/Makefile index 0c278bcf7..60a84c88e 100644 --- a/Makefile +++ b/Makefile @@ -1,73 +1,8 @@ -#--------------------------------------------------------------- -# 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) +# Configuration directives are in Makefile.config # -# Reprojection allows you to transform coordinate systems -# in the database with the Transform() function. -# -# Download from: http://www.remotesensing.org/proj -# -USE_PROJ=1 -ifeq (${PROJ_DIR},) - PROJ_DIR=/usr/local -endif - -# -# 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 -# -USE_GEOS=1 -ifeq (${GEOS_DIR},) - GEOS_DIR=/usr/local -endif - -# -# 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 -# -USE_STATS=1 - -# -# Root of the PostgreSQL source tree -# If you are not building from within postgresql 'contrib' directory -# set the PGSQL_SRC either below or in the environment (an absolute path). -# -# PGSQL_SRC=/usr/src/postgresql - -# -# Path to library (to be specified in CREATE FUNCTION queries) -# Defaults to $libdir. -# Set LPATH below or in the environment to change it. -# -# LPATH=/usr/src/postgis - -#--------------------------------------------------------------- -# END OF CONFIGURATION -#--------------------------------------------------------------- - -export USE_GEOS -export GEOS_DIR -export USE_STATS -export USE_PROJ -export PGSQL_SRC +#----------------------------------------------------- all: liblwgeom loaderdumper diff --git a/Makefile.config b/Makefile.config new file mode 100644 index 000000000..200fcd654 --- /dev/null +++ b/Makefile.config @@ -0,0 +1,95 @@ +#--------------------------------------------------------------- +# 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=1 +ifeq (${PROJ_DIR},) + PROJ_DIR=/usr/local +endif + +# +# 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 +# +USE_GEOS=1 +ifeq (${GEOS_DIR},) + GEOS_DIR=/usr/local +endif + +# +# 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 +# +USE_STATS=1 + +# +# Root of the PostgreSQL source tree +# If you are not building from within postgresql 'contrib' directory +# set the PGSQL_SRC either below or in the environment (an absolute path). +# +# PGSQL_SRC=/usr/src/postgresql + +# +# Path to library (to be specified in CREATE FUNCTION queries) +# Defaults to $libdir. +# Set LPATH below or in the environment to change it. +# +# LPATH=/usr/src/postgis + +#--------------------------------------------------------------- +# END OF CONFIGURATION +#--------------------------------------------------------------- + +ifeq (${PGSQL_SRC},) + PGSQL_SRC = ${PWD}/../.. +endif + +subdir=contrib/postgis +top_builddir = ${PGSQL_SRC} +include $(top_builddir)/src/Makefile.global + +#--------------------------------------------------------------- +# Test the version string and set the USE_VERSION macro +# appropriately. +# +ifneq ($(findstring 7.1,$(VERSION)),) + USE_VERSION=71 +else + ifneq ($(findstring 7.2,$(VERSION)),) + USE_VERSION=72 + else + ifneq ($(findstring 7.3,$(VERSION)),) + USE_VERSION=73 + else + ifneq ($(findstring 7.4,$(VERSION)),) + USE_VERSION=74 + else + USE_VERSION=80 + endif + endif + endif +endif + diff --git a/hwgeom/Makefile b/hwgeom/Makefile index 339287715..d7ad5a359 100644 --- a/hwgeom/Makefile +++ b/hwgeom/Makefile @@ -1,3 +1,5 @@ +include ../Makefile.config + #--------------------------------------------------------------- # Configuration Directives # @@ -23,8 +25,8 @@ ifeq (${LPATH},) endif #--------------------------------------------------------------- -top_builddir = ${PGSQL_SRC} -include $(top_builddir)/src/Makefile.global +#top_builddir = ${PGSQL_SRC} +#include $(top_builddir)/src/Makefile.global #--------------------------------------------------------------- # Default missing CXX variable to c++ @@ -150,10 +152,7 @@ include $(top_srcdir)/src/Makefile.shlib postgis_geos_wrapper.o: postgis_geos_wrapper.cpp -all: $(GEOS_RULES) all-lib postgis.sql postgis_undef.sql loaderdumper - -loaderdumper: - $(MAKE) -C loader +all: $(GEOS_RULES) all-lib postgis.sql postgis_undef.sql # Shared library stuff @@ -163,15 +162,14 @@ postgis_old.sql: postgis_sql_common.sql.in postgis_sql_$(USE_VERSION)_end.sql.in postgis.sql: postgis.sql.in cpp -P -traditional-cpp -DUSE_VERSION=$(USE_VERSION) $< | sed -e 's:@MODULE_FILENAME@:$(MODULE_FILENAME):g;s:@POSTGIS_VERSION@:$(POSTGIS_VERSION):g;s:@POSTGIS_SCRIPTS_VERSION@:$(SCRIPTS_VERSION):g' > $@ -postgis_undef.sql: postgis.sql create_undef.pl - perl create_undef.pl $< $(USE_VERSION) > $@ +postgis_undef.sql: postgis.sql ../create_undef.pl + perl ../create_undef.pl $< $(USE_VERSION) > $@ install: all installdirs install-postgis-lib $(INSTALL_DATA) postgis.sql $(DESTDIR)$(datadir) $(INSTALL_DATA) postgis_undef.sql $(DESTDIR)$(datadir) $(INSTALL_DATA) spatial_ref_sys.sql $(DESTDIR)$(datadir) $(INSTALL_DATA) README.postgis $(DESTDIR)$(datadir) - $(MAKE) DESTDIR=$(DESTDIR) -C loader install #- This has been copied from postgresql and adapted install-postgis-lib: $(shlib) @@ -195,13 +193,11 @@ detect_geos_version: ../geos_version.sh $(GEOS_DIR) > postgis_geos_version.h installdirs: - $(mkinstalldirs) $(docdir)/contrib $(datadir)/contrib $(libdir) + $(mkinstalldirs) $(datadir)/contrib $(libdir) uninstall: uninstall-lib @rm -f $(docdir)/contrib/README.postgis $(datadir)/contrib/postgis.sql clean distclean maintainer-clean: clean-lib @rm -f $(OBJS) postgis.sql postgis_undef.sql postgis_geos_version.h - $(MAKE) -C loader clean - $(MAKE) -C doc clean diff --git a/loader/Makefile b/loader/Makefile index 4ce039874..570ad3ad6 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -1,3 +1,5 @@ +include ../Makefile.config + # # PostGIS Loader Makefile # @@ -10,33 +12,8 @@ ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) EXE = .exe endif -# Root of the pgsql source tree -ifeq (${PGSQL_SRC},) - top_builddir = ../../.. - include $(top_builddir)/src/Makefile.global - libdir := $(libdir)/contrib -else - top_builddir = ${PGSQL_SRC} - include $(top_builddir)/src/Makefile.global - libdir := ${PWD} -endif - OBJS = shpopen.o dbfopen.o getopt.o -#--------------------------------------------------------------- -# Test the version string and set the USE_VERSION macro -# appropriately. -# -ifneq ($(findstring 7.1,$(VERSION)),) - USE_VERSION=71 -else - ifneq ($(findstring 7.2,$(VERSION)),) - USE_VERSION=72 - else - USE_VERSION=73 - endif -endif - #--------------------------------------------------------------- override CFLAGS := -g -I.. -I$(srcdir) -I$(top_builddir)/src/interfaces/libpq $(CFLAGS) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"' -DUSE_VERSION=$(USE_VERSION) @@ -54,5 +31,5 @@ install: all $(INSTALL_PROGRAM) shp2pgsql$(EXE) $(DESTDIR)$(bindir)/shp2pgsql$(EXE) clean: - @rm -f $(OBJS) shp2pgsql.o pgsql2shp.o shp2pgsql$(EXE) pgsql2shp$(EXE) + rm -f $(OBJS) shp2pgsql.o pgsql2shp.o shp2pgsql$(EXE) pgsql2shp$(EXE) diff --git a/lwgeom/Makefile b/lwgeom/Makefile index f5638d2ff..0e665f930 100644 --- a/lwgeom/Makefile +++ b/lwgeom/Makefile @@ -1,16 +1,9 @@ # Configuration Directives +include ../Makefile.config + #--------------------------------------------------------------- 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. -# -ifeq (${PGSQL_SRC},) - PGSQL_SRC = ../../.. -endif - #--------------------------------------------------------------- # Path to library (to be specified in CREATE FUNCTION queries) # Defaults to $libdir. @@ -20,9 +13,6 @@ ifeq (${LPATH},) LPATH := \$$libdir endif -#--------------------------------------------------------------- -top_builddir = ${PGSQL_SRC} -include $(top_builddir)/src/Makefile.global #--------------------------------------------------------------- # Default missing CXX variable to c++ # @@ -30,28 +20,6 @@ ifeq ($(CXX),) CXX = c++ endif -#--------------------------------------------------------------- -# Test the version string and set the USE_VERSION macro -# appropriately. -# -ifneq ($(findstring 7.1,$(VERSION)),) - USE_VERSION=71 -else - ifneq ($(findstring 7.2,$(VERSION)),) - USE_VERSION=72 - else - ifneq ($(findstring 7.3,$(VERSION)),) - USE_VERSION=73 - else - ifneq ($(findstring 7.4,$(VERSION)),) - USE_VERSION=74 - else - USE_VERSION=80 - endif - endif - endif -endif - #--------------------------------------------------------------- # Shared library parameters. #