[patch] build issues on Win32

From: Dag-Erling Smørgrav <des(at)des(dot)no>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [patch] build issues on Win32
Date: 2010-03-10 14:22:14
Message-ID: 86sk8845pl.fsf@ds4.des.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I've run across a couple of stumbling blocks when building on Win32
(specifically, XP + MinGW):

1. PostgreSQL's private versions of inet_aton etc. can conflict with
similar functions in other libraries (in my case, PostgreSQL's
inet_aton conflicts with libavformat's).

2. On Win32, PostgreSQL uses the SSPI authentication interface. This
interface is implemented in secur32.dll, which needs to be added to
the linker command line. This is apparently only an issue when
building a static libpq.

3. src/template/win32 sets LDFLAGS unconditionally, overriding anything
the user may have specified in the environment or on the command
line (such as -L/path/to/my/lib/dir).

The attached patch addresses these issues by:

1. #defining the function names as appropriate

2. adding -lsecur32 to LIBS in src/Makefile.global.in when PORTNAME is
win32.

3. adding ${LDFLAGS} at the front of the LDFLAGS redefinition in
src/template/win32.

The patch was developed and tested on 8.3.9, because that's what my
customer uses. I have verified that it applies cleanly (albeit with
offsets) to 8.4.2.

BTW, IWBNI there were a quick and easy way to build and install only
libpq. I use this sequence of commands (after configure):

$ make -C src/port all
$ make -C src/backend utils/fmgroids.h
$ make -C src/backend ../../src/include/utils/fmgroids.h
$ make -C src/include all install
$ make -C src/interfaces/libpq all install
$ make -C src/bin/pg_config all install

DES
--
Dag-Erling Smørgrav - des(at)des(dot)no

Attachment Content-Type Size
postgresql839-win32.diff text/x-patch 2.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-03-10 15:51:23 Re: [patch] build issues on Win32
Previous Message Andrew Dunstan 2010-03-10 12:50:16 Re: Dyamic updates of NEW with pl/pgsql