[postgis-devel] Compilation using Visual C++ 8.0

Mateusz Loskot mateusz at loskot.net
Tue Apr 7 12:55:19 PDT 2009


Mark Cave-Ayland wrote:
> Mateusz Loskot wrote:
>> Mark, have you had a chance to test it? Anyone?
> 
> Just some notes:
> 
> - The patches seem out of date, in that I've already removed unistd.h
>  from several header files, but these are still included in your 
> patches.

Mark, yes, this is correct.
As I've indicated in my post, I build PostGIS r3938.

> - The patch introduces several different new directories like 
> platform/build without any real justification. Is this a standard 
> MSVC-type project layout?

AFAIK, there is nothing like a standard MSVC-type project layout.
I just put stuff specific to Windows  platform into platform directory.
This is my personal preference that I put solution/poject into
./build/msvcXY where XY is version of compiler, so source
directories are not polluted with platform specific stuff.

> - The patch includes a postgis/postgis.def file - should this not be 
> generated as part of the compilation process rather than included as 
> a static file in SVN?

It should not. postgis.def reflects state of postgis.sql.in.c
in terms of list of currently available functions.
Unfortunately, it has to be hacked manually. It's sort of part of
so called DLL hell.

> - The patch simply includes postgis.sql, rather than generating it 
> from the C pre-processor. IMHO this one of the most important parts 
> of the build system to get right for a given platform. How can this 
> be emulated using MSVC?

I'm not sure what's the list of steps taken to generate it.
Are there any Unix or autotools specific operations?
I suppose it's just C/C++ preprocessor involved, isn't it?

> - I don't see any evidence of building liblwgeom into a static 
> library. This is needed because not only does the library link with 
> postgis-1.4.dll, but also with the shapefile loaders. I think this is
>  also a critical part of the build to get right.

See liblwgeom.vcproj which produces liblwgeom.lib

> Also I'd like to see evidence of a clean regression run from an MSVC 
> build before committing some of this into the repository - just 
> because it builds doesn't necessarily mean that it works ;)

You are right. I've run some of tests I selected randomly,
i.e. regress.sql but I have not run full regress package.

Just to make things clear, I've prepared the build using Visual C++
as a proof of concept, to show that there is no rocket science
necessary to make it working, without using MinGW.
However, I'm not going to pursue to submit it to the official
PostGIS tree. I'm also not going to become maintainer of this
configuration. I'm only going to update it if I have a free
gap in my time or if I need it working myself.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org



More information about the postgis-devel mailing list