Re: [HACKERS] Is there a way to build PostgreSQL client libraries with MinGW

From: Xiaobo Gu <guxiaobo1982(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, pgsql-bugs(at)postgresql(dot)org
Subject: Re: [HACKERS] Is there a way to build PostgreSQL client libraries with MinGW
Date: 2011-01-24 05:28:39
Message-ID: AANLkTind=UAiMT7eNwCDK8wp3uvyQVvb_EXo=PKxh6Hp@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

And there are two versions of gcc installed on my WinXP PRO SP3, 3.4.4
is the one used to the above test

D:\devproj\postgresql-9.0.2>gcc -v
Reading specs from /usr/lib/gcc/i686-pc-msys/3.4.4/specs
Configured with: /home/cstrauss/build/gcc3/gcc-3.4.4/configure --prefix=/usr --s
ysconfdir=/etc --localstatedir=/var --infodir=/share/info --mandir=/share/man --
libexecdir=/lib --enable-languages=c,c++ --disable-nls --enable-threads=posix --
enable-sjlj-exceptions --enable-hash-synchronization --enable-libstdcxx-debug --
with-newlib
Thread model: posix
gcc version 3.4.4 (msys special)

D:\devproj\postgresql-9.0.2>

D:\Amber\Program\Rtools211\MinGW\bin>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
Target: mingw32
Configured with: ../gcc-4.5.0/configure --enable-languages=c,c++,ada,fortran,obj
c,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgo
mp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-r
untime-libs --disable-werror --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.5.0 (GCC)

D:\Amber\Program\Rtools211\MinGW\bin>

On Mon, Jan 24, 2011 at 1:17 PM, Xiaobo Gu <guxiaobo1982(at)gmail(dot)com> wrote:
> Hi,
> I download the lastest 32bit MinGW from sourceforge, and found there
> are *NIX like tools such as chmod and ls in the MinGW\msys\1.0\bin
> directory.
>
>
> But the make process does not success,
>
> This test is done on my 32bit Windows XP SP3
>
> Here are the messages:
>
> D:\devproj\postgresql-9.0.2>sh configure --without-zlib
> ......
>
> D:\devproj\postgresql-9.0.2>ls
> 2011-01-24  13:14    <DIR>          .
> 2011-01-24  13:14    <DIR>          ..
> 2010-12-14  10:55               233 .gitignore
> 2010-12-14  10:55               445 aclocal.m4
> 2011-01-24  11:12    <DIR>          config
> 2011-01-24  13:14           478,602 config.log
> 2011-01-24  13:14            36,977 config.status
> 2010-12-14  10:55           844,733 configure
> 2010-12-14  10:55            60,877 configure.in
> 2011-01-24  12:06           840,095 configure.lineno
> 2011-01-24  11:12    <DIR>          contrib
> 2010-12-14  10:55             1,192 COPYRIGHT
> 2011-01-24  11:12    <DIR>          doc
> 2011-01-24  13:14             3,760 GNUmakefile
> 2010-12-14  10:55             3,760 GNUmakefile.in
> 2010-12-14  11:21           968,292 HISTORY
> 2010-12-14  11:21            79,024 INSTALL
> 2010-12-14  10:55             1,477 Makefile
> 2010-12-14  10:55             1,287 README
> 2011-01-24  13:14    <DIR>          src
>
> D:\devproj\postgresql-9.0.2>make
> make -C src all
> make[1]: Entering directory `/d/devproj/postgresql-9.0.2/src'
> make -C port all
> make[2]: Entering directory `/d/devproj/postgresql-9.0.2/src/port'
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
>  -Wendif-labels -fno-strict-aliasing -fwrapv -I../../src/port -DFRONTEND -I../..
> /src/include -I./src/include/port/win32 -DEXEC_BACKEND  "-I../../src/include/por
> t/win32"  -c -o fseeko.o fseeko.c
> gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
>  -Wendif-labels -fno-strict-aliasing -fwrapv -I../../src/port -DFRONTEND -I../..
> /src/include -I./src/include/port/win32 -DEXEC_BACKEND  "-I../../src/include/por
> t/win32"  -c -o crypt.o crypt.c
> In file included from ../../src/include/pg_config_os.h:22,
>                 from ../../src/include/c.h:90,
>                 from crypt.c:44:
> /usr/lib/gcc/i686-pc-msys/3.4.4/../../../../include/w32api/winsock2.h:103:2: war
> ning: #warning "fd_set and associated macros have been defined in sys/types.
>  This may cause runtime problems with W32 sockets"
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:28:20: direct.h: No such file or directory
> ../../src/include/pg_config_os.h:90:1: warning: "EIDRM" redefined
> In file included from /usr/include/errno.h:1,
>                 from ../../src/include/c.h:80,
>                 from crypt.c:44:
> /usr/include/sys/errno.h:64:1: warning: this is the location of the previous def
> inition
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:165:1: warning: "SIGABRT" redefined
> In file included from /usr/include/signal.h:8,
>                 from ../../src/include/pg_config_os.h:26,
>                 from ../../src/include/c.h:90,
>                 from crypt.c:44:
> /usr/include/sys/signal.h:225:1: warning: this is the location of the previous d
> efinition
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:222: error: conflicting types for 'uid_t'
> /usr/include/sys/types.h:133: error: previous declaration of 'uid_t' was here
> ../../src/include/pg_config_os.h:223: error: conflicting types for 'gid_t'
> /usr/include/sys/types.h:134: error: previous declaration of 'gid_t' was here
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:251:1: warning: "EMSGSIZE" redefined
> In file included from /usr/include/errno.h:1,
>                 from ../../src/include/c.h:80,
>                 from crypt.c:44:
> /usr/include/sys/errno.h:132:1: warning: this is the location of the previous de
> finition
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:252:1: warning: "EAFNOSUPPORT" redefined
> In file included from /usr/include/errno.h:1,
>                 from ../../src/include/c.h:80,
>                 from crypt.c:44:
> /usr/include/sys/errno.h:116:1: warning: this is the location of the previous de
> finition
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:253:1: warning: "EWOULDBLOCK" redefined
> In file included from /usr/include/errno.h:1,
>                 from ../../src/include/c.h:80,
>                 from crypt.c:44:
> /usr/include/sys/errno.h:150:1: warning: this is the location of the previous de
> finition
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:254:1: warning: "ECONNRESET" redefined
> In file included from /usr/include/errno.h:1,
>                 from ../../src/include/c.h:80,
>                 from crypt.c:44:
> /usr/include/sys/errno.h:114:1: warning: this is the location of the previous de
> finition
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:255:1: warning: "EINPROGRESS" redefined
> In file included from /usr/include/errno.h:1,
>                 from ../../src/include/c.h:80,
>                 from crypt.c:44:
> /usr/include/sys/errno.h:129:1: warning: this is the location of the previous de
> finition
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:256:1: warning: "ENOBUFS" redefined
> In file included from /usr/include/errno.h:1,
>                 from ../../src/include/c.h:80,
>                 from crypt.c:44:
> /usr/include/sys/errno.h:115:1: warning: this is the location of the previous de
> finition
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:257:1: warning: "EPROTONOSUPPORT" redefined
> In file included from /usr/include/errno.h:1,
>                 from ../../src/include/c.h:80,
>                 from crypt.c:44:
> /usr/include/sys/errno.h:133:1: warning: this is the location of the previous de
> finition
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:258:1: warning: "ECONNREFUSED" redefined
> In file included from /usr/include/errno.h:1,
>                 from ../../src/include/c.h:80,
>                 from crypt.c:44:
> /usr/include/sys/errno.h:121:1: warning: this is the location of the previous de
> finition
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:259:1: warning: "EBADFD" redefined
> In file included from /usr/include/errno.h:1,
>                 from ../../src/include/c.h:80,
>                 from crypt.c:44:
> /usr/include/sys/errno.h:100:1: warning: this is the location of the previous de
> finition
> In file included from ../../src/include/c.h:90,
>                 from crypt.c:44:
> ../../src/include/pg_config_os.h:260:1: warning: "EOPNOTSUPP" redefined
> In file included from /usr/include/errno.h:1,
>                 from ../../src/include/c.h:80,
>                 from crypt.c:44:
> /usr/include/sys/errno.h:112:1: warning: this is the location of the previous de
> finition
> In file included from ../../src/include/c.h:851,
>                 from crypt.c:44:
> ../../src/include/port.h:420: warning: "struct passwd" declared inside parameter
>  list
> ../../src/include/port.h:420: warning: its scope is only this definition or decl
> aration, which is probably not what you want
> make[2]: *** [crypt.o] Error 1
> make[2]: Leaving directory `/d/devproj/postgresql-9.0.2/src/port'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/d/devproj/postgresql-9.0.2/src'
> make: *** [all] Error 2
>
>
>
>
>
> On Mon, Jan 24, 2011 at 12:11 PM, Xiaobo Gu <guxiaobo1982(at)gmail(dot)com> wrote:
>> Yes, I want it working on 64 bit Windows Server 2003 R2 and 64 bit
>> Windows 7 home basic.
>> Which version of 32bit MinGW  do you use, I use the one shipped with
>> Rtools212.exe which is downloaded from
>> http://www.murdoch-sutherland.com/Rtools, and there is no chmod.
>>
>> xiaobo gu
>>
>>
>> 2011/1/24 Andrew Dunstan <andrew(at)dunslane(dot)net>:
>>>
>>>
>>> On 01/23/2011 10:09 PM, Xiaobo Gu wrote:
>>>> Here is my plan,
>>>> 1. To make the configurate script pass:
>>>>       Currently MinGW does not provide chmod, but on Windows I think this
>>>> can be ignored now, we all use Admin
>>>>       users to do the work.
>>>> 2. To make a pg-client Makefile target, can you help wich which c
>>>> files should be compiled and linked into dlls and lib file.
>>>>
>>>
>>>
>>> Why do you need to do this? Postgres can be built as is today on Mingw.
>>> Not just the client libraries, the whole server too. It does not need to
>>> be an Adminstrative user, and you should by no means assume that the
>>> user building Postgres will be an administrator, nor that the user
>>> running Postgres will be. My 32 bit Mingw certainly understands chmod.
>>>
>>> There are machines doing this every day, several times a day. See
>>> <http://www.pgbuildfarm.org/cgi-bin/show_status.pl> - frogmouth and
>>> narwhal are examples. We've had working Mingw builds for quite a few
>>> years now.
>>>
>>> The only issue is building 64bit binaries. So get the build working for
>>> 32bit, then try switching to the 64bit compiler and see what breaks. If
>>> all you need is the client library, build with no zlib or any other
>>> third party libraries.
>>>
>>> cheers
>>>
>>> andrew
>>>
>>
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Murray S. Kucherawy 2011-01-24 05:59:42 Re: BUG #5837: PQstatus() fails to report lost connection
Previous Message Xiaobo Gu 2011-01-24 05:17:21 Re: [HACKERS] Is there a way to build PostgreSQL client libraries with MinGW

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2011-01-24 05:38:06 Re: pg_basebackup for streaming base backups
Previous Message Xiaobo Gu 2011-01-24 05:17:21 Re: [HACKERS] Is there a way to build PostgreSQL client libraries with MinGW