[postgis-commits] svn - r2918 - in trunk: loader lwgeom
postgis-commits at postgis.refractions.net
postgis-commits at postgis.refractions.net
Thu Aug 21 01:45:08 PDT 2008
Author: mcayland
Date: 2008-08-21 01:45:07 -0700 (Thu, 21 Aug 2008)
New Revision: 2918
Modified:
trunk/loader/Makefile.pgsql2shp.in
trunk/loader/Makefile.shp2pgsql.in
trunk/lwgeom/Makefile.in
Log:
Alter the lwgeom Makefile so that liblwgeom.a is linked directly, rather than using the -L...-l options on the command line. This is to prevent problems on OSX where PGXSadds the PostgreSQL $libdir to the PostGIS link line, causing it to link to liblwgeom.so produced by older versions of PostGIS rather than the static liblwgeom.a.
Also change the PGXS CPP/LIB equivalent variables to use += so that extra compile/link options can be supplied. Per report from Robert Rainthorpe, with thanks to William Kyngesburye.
Modified: trunk/loader/Makefile.pgsql2shp.in
===================================================================
--- trunk/loader/Makefile.pgsql2shp.in 2008-08-12 16:46:35 UTC (rev 2917)
+++ trunk/loader/Makefile.pgsql2shp.in 2008-08-21 08:45:07 UTC (rev 2918)
@@ -19,8 +19,8 @@
pgsql2shp.o
# Link against libpq
-PG_CPPFLAGS=@PGSQL_FE_CPPFLAGS@
-PG_LIBS=@PGSQL_FE_LDFLAGS@ -lpq
+PG_CPPFLAGS+=@PGSQL_FE_CPPFLAGS@
+PG_LIBS+=@PGSQL_FE_LDFLAGS@ -lpq
# PGXS information
Modified: trunk/loader/Makefile.shp2pgsql.in
===================================================================
--- trunk/loader/Makefile.shp2pgsql.in 2008-08-12 16:46:35 UTC (rev 2917)
+++ trunk/loader/Makefile.shp2pgsql.in 2008-08-21 08:45:07 UTC (rev 2918)
@@ -19,7 +19,7 @@
shp2pgsql.o
# Link against libiconv where available
-PG_LIBS=@ICONV_LDFLAGS@
+PG_LIBS+=@ICONV_LDFLAGS@
# PGXS information
PG_CONFIG = @PGCONFIG@
Modified: trunk/lwgeom/Makefile.in
===================================================================
--- trunk/lwgeom/Makefile.in 2008-08-12 16:46:35 UTC (rev 2917)
+++ trunk/lwgeom/Makefile.in 2008-08-21 08:45:07 UTC (rev 2918)
@@ -53,8 +53,14 @@
OBJS=$(PG_OBJS)
# Libraries to link into the module (proj, geos)
-PG_CPPFLAGS=@CPPFLAGS@ -I../liblwgeom
-SHLIB_LINK=@SHLIB_LINK@ -L../liblwgeom -llwgeom
+#
+# Note: we specify liblwgeom.a directly in SHLIB_LINK rather than using
+# -L... -l options to prevent issues with some platforms trying to link
+# to an existing liblwgeom.so in the PostgreSQL $libdir supplied by an
+# older version of PostGIS, rather than with the static liblwgeom.a
+# supplied with newer versions of PostGIS
+PG_CPPFLAGS+=@CPPFLAGS@ -I../liblwgeom
+SHLIB_LINK+=@SHLIB_LINK@ ../liblwgeom/liblwgeom.a
# Extra files to remove during 'make clean'
EXTRA_CLEAN=$(SQL_OBJS)
More information about the postgis-commits
mailing list