[postgis-devel]WKTRaster:WhyhavingtocompilePostgreSQL&PostGISfirst?

Mateusz Loskot mateusz at loskot.net
Wed Mar 4 15:42:15 PST 2009


Mark Cave-Ayland wrote:
> Mateusz Loskot wrote:
> 
>>> Unfortunately there is with PostGIS if you use newer versions of
>>> PostgreSQL. Since PostgreSQL 8.3 is now compiled with MSVC, there is no
>>> way to generate the required PGXS Makefiles, and so you must use MingW
>>> to generate them.
>>
>>
>> So, how it's possible developers build extensions using Visual C++?
>> One of example at the bottom of this page:
>>
>> http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html
> 
> As long as you stick with standard C rather than C++ then you can
> mix/match libraries between MingW/MSVC as you wish.

Yes.

> The issue with
> respect to MSVC is that PGXS (the PostgreSQL extension building
> infrastructure) works using GNU Makefiles, which of course won't work
> with MSVC.

Understood.

> I've CC'd Magnus onto this email, but as far as I know the MSVC
> PostgreSQL builds don't generate the PGXS Makefiles anymore - at least,
> I don't see them installed as part of the development packages.

Great, thanks.

Simply, my point is that if something can be generated using autotools,
then it can be written by hand and if it can be written by hand, then it
can be generated in any other way, not only with autotools.
The procedure just needs to be written down in form of a script or
scripts. Unless I still don't understand something.

>> It may seem harsh, but in *my* opinion MinGW makes more troubles than
>> helps.
>> Considering that
>> a) C/C++ code is portable
> 
> The basic C standard is portable but the libraries aren't; for example
> the original Microsoft POSIX implementation was fairly broken which is
> why people write their own implementations as wrappers on native Win32
> calls.

You are right. I'd had to write one (a POSIX layer) myself too.

>> b) it can be compiled using Visual C++ and
>> c) there is building configuration for Visual Studio toolset,
>> then I can't see any reason why some makefiles couldn't be generated
>> under Windows without MinGW or cygwin.
> 
> Well as part of the rebuilding of the PostGIS build system, I made a
> conscious effort to write it in a way that would make compilation under
> MSVC possible. As a result, all of the logic has been moved from the
> Makefiles into autotools which generates postgis_config.h. So if you can
> come up with a suitable file for MSVC, you should just be left with
> standard MSVC compatibility issues.

Is your work available anywhere? In SVN?

> Several people have expressed interest in helping add MSVC support, but
> no-one has yet stepped up to both i) do the work and ii) continue
> maintenance of the MSVC port. Until this happens then I doubt that we
> will switch.

I'd like to take a look at the stuff you've developed for this.

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



More information about the postgis-devel mailing list