Thread: ./configure fails for --host=i686-w64-mingw32 on Ubuntu

./configure fails for --host=i686-w64-mingw32 on Ubuntu

From
Pavel Golub
Date:
Hello, community.

Following instructions on Wiki
https://wiki.postgresql.org/wiki/Building_With_MinGW I was trying to
cross compile PostgreSQL 10.1 from a Linux box (Ubuntu 16.04). But it
always fails on configure step. I tried two different systems, results
are the same.   

Log attached. I examined it and found strange lines:

configure:4113: checking whether we are cross compiling
configure:4121: gcc -o conftest    conftest.c  >&5
configure:4125: $? = 0
configure:4132: ./conftest
configure:4136: $? = 0
configure:4151: result: no

But it seems to be YES, sin't it?

Full Output:

$ ./configure --host=i686-w64-mingw32
checking build system type... i686-pc-linux-gnu
checking host system type... i686-w64-mingw32
checking which template to use... win32
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for WAL segment size... 16MB
checking for i686-w64-mingw32-gcc... no
checking for i686-w64-mingw32-cc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc supports -Wdeclaration-after-statement... yes
checking whether gcc supports -Wendif-labels... yes
checking whether gcc supports -Wmissing-format-attribute... yes
checking whether gcc supports -Wformat-security... yes
checking whether gcc supports -fno-strict-aliasing... yes
checking whether gcc supports -fwrapv... yes
checking whether gcc supports -fexcess-precision=standard... yes
checking whether gcc supports -funroll-loops... yes
checking whether gcc supports -ftree-vectorize... yes
checking whether gcc supports -Wunused-command-line-argument... no
checking whether the C compiler still works... no
configure: error: cannot proceed




-- 
With best wishes,
 Pavel                          mailto:pavel@gf.microolap.com
Attachment

Re: ./configure fails for --host=i686-w64-mingw32 on Ubuntu

From
Tom Lane
Date:
Pavel Golub <pavel@microolap.com> writes:
> Following instructions on Wiki
> https://wiki.postgresql.org/wiki/Building_With_MinGW I was trying to
> cross compile PostgreSQL 10.1 from a Linux box (Ubuntu 16.04). But it
> always fails on configure step. I tried two different systems, results
> are the same.   

> $ ./configure --host=i686-w64-mingw32

Hm, are you sure you interpreted the wiki page's directions properly?
If you are running on a 64-bit Linux box, I think you need 
--host=x86_64-w64-mingw32

I'm trying this on a Fedora box right now, and although it's
really slow, it seems to be working ...
        regards, tom lane