Patch to support building of osm2pgsql under mingw32 #926
Comments
Author: tom[at]compton.nu Does windows.h really provide termios?!? That seems very unlikely... One for Jon anyway - he knows more about this code than me. |
Author: grand.edgemaster[at]gmail.com The code seemed to already have WIN32 measures in place if termios was not available, I've just removed the hard-coded termios define, which appears to work. |
Author: grand.edgemaster[at]gmail.com My original compile was with pgsql 8.3 and postgis 1.3.3. Since steve8 had only pgsql 8.2 and an older postgis, I had to recompile. As requested by kleptog, attached is the patch file for that. Most of the changes to the Makefile are because I used the geos bundled with postgis this time around. There is one change to the headers for geos as well. |
Author: martinvoosterhout (In [7976]) Add some changes from Edgemaster for MinGW support, see #926 |
Author: osm[at]kleptog.org I committed the non-makefile changes already, what's not clear to me is how much of the Makefile changes are specific to windows and how much is specific to Edgemaster's installation. Does windows really not have geos-config, for example? |
Author: grand.edgemaster[at]gmail.com Replying to [comment:5 osm[at]kleptog.org]:
I was too lazy to recompile it all, so just downloaded the headers from the source package and linked against the geos-2 bundled with PostGIS. The compile I had of 1.3 did include geos-config, so this is one of those things you should ignore. I do reckon that quite a lot of the makefile stuff is just my local build, although I suspect the -lz requirement is a mingw thing? I'm also not sure about geos.h and geos_c.h, the latter doesn't exist in the 1.2 headers, not sure about the former in 1.3. |
Author: grand.edgemaster[at]gmail.com The -lpthreadGC2 is a Win32 implementation of pthreads (googled for it when the linker complained), not sure if it's required, since I just spotted the -DHAVE_PTHREAD flag. |
Author: tom[at]compton.nu geos.h is correct when you're writing C++ code and linking against libgeos - if you're linking against libgeos_c then you should use geos_c.h |
Author: osm[at]kleptog.org The pthread stuff is new for parallelizing the final index build. It would probably be easier to simply remove the HAVE_PTHREAD, the code will still work. The -lz should have been needed, no idea why the linker doesn't complain. |
Author: grand.edgemaster[at]gmail.com Can makefiles contain platform-specific instructions, if not I'll just write a howto up with what to patch in the makefile (and what dependancies are required) to build under mingw. Feel free to close this if nothing else can be done, the main codebase changes are in, which is probably the most important part. |
Author: osm[at]kleptog.org Replying to [comment:10 grand.edgemaster[at]gmail.com]:
There are a number of ways to handle this:
What I was hoping for was Artems patch for VC which AIUI required more work. But given that it now works under MinGW perhaps that isn't important anymore. Especially if the resulting binary can be uploaded somewhere so anyone can use it. |
Author: grand.edgemaster[at]gmail.com It would probably be sensible to revert the change made to applications/utils/export/osm2pgsql/build_geometry.cpp in r7976, it now breaks my build on Debian sid. |
Author: osm[at]kleptog.org Replying to [comment:12 grand.edgemaster[at]gmail.com]:
Please confirm your version of libgeos-dev. 2.2.3-3 is etch has both and 3.0.0 in sid has both. Or do you mean some other kind of error? |
Author: amm As anyone recently tried to compile osm2pgsql on Windows? Does it work? Can this bug be close for outdatedness? |
Author: amm Closing this bug as outdated. |
Reporter: grand.edgemaster[at]gmail.com
[Submitted to the original trac issue database at 2.55pm, Tuesday, 27th May 2008]
Attached is a patch to sprompt.c to fix a compile error under mingw32/msys.
I'll note that I have no clue about c development, a patch for the Makefile is also required, but is above my level to make it platform-sensitive. I did note that -lz is missing from the LDFLAGS, causing a linker error on mingw.
The text was updated successfully, but these errors were encountered: