Re: Building Postgres using mingw - Mailing list pgsql-general

From Michael Paquier
Subject Re: Building Postgres using mingw
Date
Msg-id CAB7nPqS8wAFZFbXnf24UiCZjtaQsa0DdeBM4YR2yy-0cUQfpcQ@mail.gmail.com
Whole thread Raw
In response to Re: Building Postgres using mingw  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-general
On Wed, May 7, 2014 at 10:26 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
> On Wed, May 7, 2014 at 8:27 AM, Michael Paquier <michael.paquier@gmail.com>
> wrote:
>>
>> Hi all,
>>
>> Following some instructions on the wiki and the docs, I am trying to
>> compile the code using minwg:
>> https://wiki.postgresql.org/wiki/Building_With_MinGW
>>
>> http://www.postgresql.org/docs/devel/static/installation-platform-notes.html#INSTALLATION-NOTES-MINGW
>>
>> After installing mingw-w64 and adding its binaries to PATH, I am able
>> to complete configure correctly (including finding a compiler with
>> --host=x86_64-w64-mingw32). However mingw-w64 does not have a make
>> command included so compilation cannot continue.
>
>
> Did you select the 'developer toolkit' when running the mingw installer?
Think so... However I finally got it working, and here is a little bit
of feedback for the archive's sake as this is trickier than it seems
at first sight.

When trying to use a recent mingw package, sometimes ./configure is
not able to recognize a compiler even if there is one in PATH. This
worked correctly with the snapshot that Postgres wiki recommends
though, even if it is a couple of years old.

Then, after looking at some mingw builds available on sourceforge, the
make command is sometimes not available, but some of the latest builds
available name it mingw32-make.exe instead of make.exe to not conflict
with msys things. So a quick solution is to copy it as make.exe in
PATH if your environment does not include it yet. But be careful when
doing that.

I also had to enforce some environment variables to the following
values at configure (instead of the default values set to /bin/*
because this was failing):
SHELL=bash
PERL=perl
BISON=bison
FLEX=flex
MKDIR_P="mkdir -p"

I hope that this helps. Perhaps I missed something, so if someone has
better ideas or ways to do that... This has been done on a Win7 dev
box with msysgit installed.
Regards,
--
Michael


pgsql-general by date:

Previous
From: David G Johnston
Date:
Subject: Re: Enforce Symmetric Matrix
Next
From: Roxanne Reid-Bennett
Date:
Subject: Analyze against a table with geometry columns runs out of memory