Re: How to build contrib module separately in PostgreSQL on windows

From: Craig Ringer <craig(at)2ndQuadrant(dot)com>
To: 朱冯贶天 <zhfkt(at)hotmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How to build contrib module separately in PostgreSQL on windows
Date: 2013-01-21 02:18:04
Message-ID: 50FCA55C.1080109@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/19/2013 11:09 PM, 朱冯贶天 wrote:

> After downloading the source code, I enter the
> "postgresql-9.2.2\contrib\cube" to type 'nmake' with VS2010 command
> environment. However, the Makefile is not compatible with vs2010.

Correct - PostgreSQL's makefiles are written for GNU make and a
unix-like shell (sh/bash/ash/dash etc). They will not work with NMake.

The Windows build infrastructure uses src/tools/msvc/build.pl as pointed
out by the link Andrew posted,
http://www.postgresql.org/docs/current/static/install-windows.html .
build.pl reads the GNU makefiles and produces MSBuild (Microsoft's nmake
replacement) files that it then runs to compile the sources with the
Visual Studio compilers.

I've never worked out how to build contrib modules externally with it,
though I haven't looked particularly hard. I find it effective to just
drop the contrib module I want to build into the contrib/ directory of
the source tree then use build.pl to compile the tree.

I'd really like to improve this situation - finding and documenting the
external module build method if one exists, and failing that
implementing it. As always, it's down to time and priorities.

> I know that there is a way to build the whole PostgreSQL from source
> code. But it is not convenient.

As far as I know it's your best option right now.

I've tried to make it a bit more convenient with this code and
documentation:

https://github.com/2ndQuadrant/pg_build_win

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2013-01-21 02:23:33 Re: Contrib PROGRAM problem
Previous Message Robert Haas 2013-01-21 02:05:53 Re: Removing PD_ALL_VISIBLE