[postgis-devel] building 1.4.1 on NetBSD

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Fri Jan 29 02:56:34 PST 2010


Greg Troxel wrote:

> Thanks to some of the people who work on pkgsrc-wip.sourceforge.net,
> there is now a postgis package in pkgsrc.  To get this to work a few
> patches were needed, and for some of these changes, I don't understand
> how it builds on other systems.
> 
> I am testing with 8.4, with pgxs files from 8.4.  With the below
> patches, postgis passes make check.
> 
> The big issue was that liblwgeom is built into a .a and then included to
> form the postgis.so module.  libtool complains that this is improper and
> doesn't include liblwgeom, and thus nothing works.
> 
> A minor issue is that where postgis.sql looks for the module is
> different than where the build puts it.
> 
> So, the changes are
> 
> 1) Use libtool to compile files, rather than making a static library
> that is later expected to be linked into a shlib.
> 
> 2) Change the path to look for the postgis module as
> 
> /usr/pkg/lib/libpostgis-1.4.so:
> 
> rather than as postgis-1.4.so.
> 
> I didn't make these changes, so I am not 100% clear on them.  But I did
> run into both problems.

Hi Greg,

Thanks for the feedback on the build system and the proposed patch. 
Strangely enough, the two points above mean that I am not happy to apply 
the patch in its current state.

liblwgeom is currently linked as a static library because it is 
currently not suitable for use outside of PostGIS, and for the moment I 
feel it is best to keep it that way. I'm not sure why NetBSD doesn't 
like linking a static library into a dynamic library (it's effectively 
the same as adding multiple .o files), so I would be interested to know 
if there is a workaround here. Note there will be some more work done in 
the 2.0 timeframe on this, so perhaps this may change in the future.

In terms of the library name, this change should not be needed. If you 
look in the contrib/ directory in the vanilla PostgreSQL tree then you 
can see that the lib prefix is omitted. PostgreSQL normally adds the lib 
prefix automatically on platforms where it is needed, so I don't 
understand why it is required on NetBSD or just for PostGIS...


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs



More information about the postgis-devel mailing list