Re: Is there a way to build PostgreSQL client libraries with MinGW - Mailing list pgsql-hackers

From Xiaobo Gu
Subject Re: Is there a way to build PostgreSQL client libraries with MinGW
Date
Msg-id AANLkTikgpau5iTATKdnOfjN0B7R7QuCqog0dqD9e9Y0t@mail.gmail.com
Whole thread Raw
In response to Re: Is there a way to build PostgreSQL client libraries with MinGW  (Xiaobo Gu <guxiaobo1982@gmail.com>)
Responses Re: Is there a way to build PostgreSQL client libraries with MinGW  (Xiaobo Gu <guxiaobo1982@gmail.com>)
List pgsql-hackers
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,
fromcrypt.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 parameterlist
../../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@gmail.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@dunslane.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
>>
>


pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: ALTER TYPE 2: skip already-provable no-work rewrites
Next
From: Xiaobo Gu
Date:
Subject: Re: Is there a way to build PostgreSQL client libraries with MinGW