From: Sandro Santilli Date: Wed, 26 Apr 2006 12:19:48 +0000 (+0000) Subject: Added --with-geos-libdir and --with-proj-libdir configure switches X-Git-Tag: pgis_1_1_3~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=800cd001d66f970c361f824f42c9588f22194d5b;p=postgis Added --with-geos-libdir and --with-proj-libdir configure switches git-svn-id: http://svn.osgeo.org/postgis/trunk@2337 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/CHANGES b/CHANGES index b5544ad17..71fcf63e9 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,8 @@ PostGIS 1.1.3CVS - WKT parser: forbidden construction of multigeometries with EMPTY elements (still supported for GEOMETRYCOLLECTION). + - Added --with-proj-libdir and --with-geos-libdir configure + switches PostGIS 1.1.2 2006/03/30 diff --git a/Makefile.config.in b/Makefile.config.in index c6efa8c28..44f9eb08e 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -17,6 +17,7 @@ # USE_PROJ=@USE_PROJ@ PROJ_DIR=@PROJ_DIR@ +PROJ_LIBDIR=@PROJ_LIBDIR@ # # Set USE_GEOS to 1 for GEOS spatial predicate and operator @@ -32,6 +33,7 @@ PROJ_DIR=@PROJ_DIR@ # USE_GEOS=@USE_GEOS@ GEOS_DIR=@GEOS_DIR@ +GEOS_LDFLAGS=@GEOS_LDFLAGS@ # EXPERIMENTAL! use geos C-API (only available with GEOS-2.2.x and up) USE_GEOS_CAPI=@USE_GEOS_CAPI@ diff --git a/configure.in b/configure.in index 98cadd70a..c7e179e30 100644 --- a/configure.in +++ b/configure.in @@ -113,10 +113,12 @@ dnl AC_SUBST(USE_GEOS) AC_SUBST(GEOS_DIR) +AC_SUBST(GEOS_LDFLAGS) AC_SUBST(USE_GEOS_CAPI) USE_GEOS=0 USE_GEOS_CAPI=0 GEOS_DIR= +GEOS_LDFLAGS= AC_PATH_PROG([GEOSCONFIG], [geos-config]) if test -n "$GEOSCONFIG"; then @@ -142,6 +144,7 @@ AC_ARG_WITH(geos, if test $USE_GEOS -gt 0; then GEOS_DIR=`$GEOSCONFIG --prefix` + GEOS_LDFLAGS=`$GEOSCONFIG --ldflags` GEOS_MAJOR=`$GEOSCONFIG --version | cut -d. -f1` if test "$GEOS_MAJOR" = "@GEOS_VERSION@"; then GEOS_MAJOR=1 @@ -156,6 +159,20 @@ if test $USE_GEOS -gt 0; then fi fi +AC_ARG_WITH(geos-libdir, +[ --with-geos-libdir=PATH path to GEOS libdir + [[taken from geos-config by default]]], +[ +case "$with_geos_libdir" in + no|yes) + AC_MSG_ERROR([Invalid argument to --with-geos-libdir]) + ;; + *) + GEOS_LDFLAGS=-L${with_geos_libdir} + ;; +esac +], with_geos_libdir=no) + dnl AC_ARG_WITH(geos-capi, dnl [ --with-geos-capi enable use of GEOS C API ], dnl if test "$with_geos_capi" != "no"; then @@ -165,8 +182,10 @@ dnl ) AC_SUBST(USE_PROJ) AC_SUBST(PROJ_DIR) +AC_SUBST(PROJ_LIBDIR) USE_PROJ=0 PROJ_DIR= +PROJ_LIBDIR= AC_PATH_PROG([PROJ], [proj]) if test -n "$PROJ"; then USE_PROJ=1 @@ -188,8 +207,22 @@ if test $USE_PROJ -gt 0; then if test ! -f $PROJ_DIR/include/projects.h; then AC_MSG_ERROR([Can't find proj dir.]); fi + PROJ_LIBDIR=${PROJ_DIR}/lib fi +AC_ARG_WITH(proj-libdir, +[ --with-proj-libdir=PATH path to PROJ4 libdir], +[ +case "$with_proj_libdir" in + no|yes) + AC_MSG_ERROR([Invalid argument to --with-proj-libdir]) + ;; + *) + PROJ_LIBDIR=${with_proj_libdir} + ;; +esac +], with_proj_libdir=no) + AC_SUBST(USE_JTS) AC_SUBST(JTS_INCLUDES) AC_SUBST(JTS_LIBDIR) @@ -555,9 +588,10 @@ if test $USE_GEOS -gt 0; then else AC_MSG_RESULT([ GEOS: $GEOSCONFIG]) fi + AC_MSG_RESULT([ (ldflags: $GEOS_LDFLAGS)]) fi if test $USE_PROJ -gt 0; then - AC_MSG_RESULT([ PROJ: dir=$PROJ_DIR]) + AC_MSG_RESULT([ PROJ: prefix=$PROJ_DIR libdir=$PROJ_LIBDIR]) fi AC_MSG_RESULT([ ICONV: $USE_ICONV $ICONV_LDFLAGS]) dnl AC_MSG_RESULT([ FLEX: path=$FLEX]) diff --git a/lwgeom/Makefile b/lwgeom/Makefile index dd4ca4d2b..d0a7a97dc 100644 --- a/lwgeom/Makefile +++ b/lwgeom/Makefile @@ -43,12 +43,12 @@ ifeq ($(USE_GEOS),1) CSTAR_FLAGS += -I$(GEOS_DIR)/include GEOS_WRAPPER= JTS_OBJ=lwgeom_geos_c.o - SHLIB_LINK += -L$(GEOS_DIR)/lib -lgeos_c + SHLIB_LINK += $(GEOS_LDFLAGS) -lgeos_c else CXXFLAGS += -I$(GEOS_DIR)/include GEOS_WRAPPER=lwgeom_geos_wrapper.o JTS_OBJ=lwgeom_geos.o - SHLIB_LINK += -lstdc++ -L$(GEOS_DIR)/lib -lgeos + SHLIB_LINK += -lstdc++ $(GEOS_LDFLAGS) -lgeos GEOS_RULES=detect_geos_version endif endif @@ -63,7 +63,7 @@ endif ifeq ($(USE_PROJ),1) override CFLAGS += -I$(PROJ_DIR)/include -DUSE_PROJ - SHLIB_LINK += -L$(PROJ_DIR)/lib -lproj + SHLIB_LINK += -L$(PROJ_LIBDIR) -lproj endif override CFLAGS += $(PGBEINCLUDES) -DAUTOCACHE_BBOX=$(AUTOCACHE_BBOX)