[geos-devel] C API / DLL only?

Howard Butler hobu.inc at gmail.com
Mon Jul 2 12:20:04 PDT 2012


On Jul 2, 2012, at 1:44 PM, Chris Krycho @ GEOS wrote:

> Sorry if this has been asked before, but I have not been able to find it after a couple of days of Googling, including the list archives.
> 
> I've just started work on an existing piece of in-house software that uses GEOS, which is built against the C API. So far so good, and it builds just fine that way. However, I was looking to see if there's a way to use the C API with a statically compiled library rather than the DLL, as that would substantially simply use of the in-house software. (It would be nice to be able to just distribute the executable, and not worry about passing around library files as well; there's no installer as it's just an internal tool.)
> 
> However, from what I can see in the code, that doesn't appear to be supported. Is that correct? Is it conceivably doable to modify the makefiles to support building a static library rather than a dynamic one?
> 
> I should note, too, that I'm doing all this with MinGW/msys, and the latest builds just fine under that configuration.
> 
> If there's a way to do this, I'm willing to put in some legwork to make it happen and contribute that back to the project, but it's not worth more than a day or two of work for my employer and I'm not particularly familiar with makefiles.
> 
> If I'm just missing something obvious in the available configure and make options, call me dumb and tell me what I'm missing. ;)

If you're willing to get your hands dirty with CMake, you should be able to modify the add_library C API invocation from SHARED to STATIC to get the desired effect.  Attached is a patch that should get you what you want.



Hope this helps,

Howard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20120702/f87ae829/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: static-geos.patch
Type: application/octet-stream
Size: 974 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20120702/f87ae829/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20120702/f87ae829/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20120702/f87ae829/attachment.pgp>


More information about the geos-devel mailing list