Re: compile postgres with visual studio 2010

From: Brar Piening <brar(at)gmx(dot)de>
To: "Sofer, Yuval" <Yuval_Sofer(at)bmc(dot)com>
Cc: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: compile postgres with visual studio 2010
Date: 2011-07-21 11:56:28
Message-ID: 4E2813EC.2050505@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-------- Original Message --------
Subject: Re: [GENERAL] compile postgres with visual studio 2010
From: Sofer, Yuval <Yuval_Sofer(at)bmc(dot)com>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Date: 21.07.2011 08:56
> Hi
>
> Ok - but how do I install the patch in the link?
>
> I pressed the latest "patch" link Tom Lane gave me (Patch by brar on 2011-07-07 12:37:47 AM: Added documentation, removed pgflex.pl and pgbison.pl. No changes to the existing code. ), where I saw some correspondence and very long text file (perl).
>
> Is there a utility for applying the patch, or a README document for step by step implementation?
>
In short (for the records): download and install msysgit from
http://code.google.com/p/msysgit/downloads/list
Open git bash and cd into an empty directory like:
cd c:
mkdir pgdev
cd pgdev

Clone the postgresql repository:
git clone git://git.postgresql.org/git/postgresql.git
cd postgresql

Copy the patch (the part with the strange perl-like text of the
message) from
http://archives.postgresql.org/message-id/4E14FD1A.8080703@gmx.de and
save it to a file (like VS2010v9.patch) which you put into the directory
which contains your newly created repository (c:\pgdev).

Apply the Patch:
patch -Ec -p 1 -i ../VS2010v9.patch
(which doesn't seem to apply cleanly anymore which will break things for
you - but I currently have no time to fix it)

Put bison and flex into your path like:
echo "\$ENV{PATH}=\$ENV{PATH} . ';C:\Program Files (x86)\Git\bin';" >
src/tools/msvc/buildenv.pl
(you might have to adopt the path)

Open a Visual Studio 2010 command prompt and cd into the src/tools/msvc
directory of your repository like:
cd C:\pgdev\postgresql\src\tools\msvc

Start the build:
build.bat
(which will break because of the fact that the patch didn't apply cleanly)

I'll take care of the patch as soon as I can (which will not be before
this weekend).
I'm sorry for the bad state of the patch but I've been keepnig it up to
date for months now which isn't always easy.

Regards,
Brar

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2011-07-21 12:11:47 Re: compile postgres with visual studio 2010
Previous Message Pavel Stehule 2011-07-21 10:16:39 Re: Maximum number of client connection supported by Postgres 8.4.6