From: Mark Cave-Ayland Date: Thu, 21 Aug 2008 08:45:07 +0000 (+0000) Subject: Alter the lwgeom Makefile so that liblwgeom.a is linked directly, rather than using... X-Git-Tag: 1.4.0b1~785 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=244c93572961c154f3097678038b0d2665c0a1b3;p=postgis 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. git-svn-id: http://svn.osgeo.org/postgis/trunk@2918 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/loader/Makefile.pgsql2shp.in b/loader/Makefile.pgsql2shp.in index e3931ae60..196c06406 100644 --- a/loader/Makefile.pgsql2shp.in +++ b/loader/Makefile.pgsql2shp.in @@ -19,8 +19,8 @@ OBJS= shpopen.o \ 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 diff --git a/loader/Makefile.shp2pgsql.in b/loader/Makefile.shp2pgsql.in index 5313d09b3..7a9e5d8c6 100644 --- a/loader/Makefile.shp2pgsql.in +++ b/loader/Makefile.shp2pgsql.in @@ -19,7 +19,7 @@ OBJS= shpopen.o \ shp2pgsql.o # Link against libiconv where available -PG_LIBS=@ICONV_LDFLAGS@ +PG_LIBS+=@ICONV_LDFLAGS@ # PGXS information PG_CONFIG = @PGCONFIG@ diff --git a/lwgeom/Makefile.in b/lwgeom/Makefile.in index 78f432004..c13a7478f 100644 --- a/lwgeom/Makefile.in +++ b/lwgeom/Makefile.in @@ -53,8 +53,14 @@ PG_OBJS=lwgeom_pg.o \ 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)