Libpq visual c++ build errors, addrinfo and sockaddr_storage redefinition error

From: "Pierre Joye" <pierre(dot)php(at)gmail(dot)com>
To: pgsql-ports(at)postgresql(dot)org
Subject: Libpq visual c++ build errors, addrinfo and sockaddr_storage redefinition error
Date: 2008-05-06 08:29:02
Message-ID: fe05d1540805060129i35cd33c4rb2d62fea090907d5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports

hi,

While trying to update the PHP postgresql extension to 8.3.1, I met a
couple of issues.

The first was about not using kerberos, the makefile is incorrect as
an error will be raised when kerberos is used and no kerberos is used.
I added the following lines to avoid libpath error:

!IFDEF USE_SSL
CPP_PROJ=$(CPP_PROJ) /D USE_SSL
SSL_LIBS=ssleay32.lib libeay32.lib gdi32.lib
SSL_LIBPATH_ARG= /libpath:"$(SSL_LIB_PATH)"
!ENDIF

!IFDEF USE_KFW
CPP_PROJ=$(CPP_PROJ) /D KRB5
KFW_LIBS=krb5_32.lib comerr32.lib gssapi32.lib
KFW_LIBPATH_ARG= /libpath:"$(KFW_LIB_PATH)"
!ENDIF

and use XXX_LIBPATH_ARG in the LINK32_FLAG

The 2nd problem is about Shell32.lib, it is missing in the lib list.
It is required for SHGetFolderPath.

The last two problems are more tricky. It is about addrinfo and
sockaddr. addrinfo is actually defined on windows and seems to have
the correct order of the structure elements (see the comment in
src/include/getaddrinfo.h). Removing this declaration seems to work
(not tested yet).

I'm now trying to figure out the sockaddr_storage redclaration. The
windows struct is different
(http://msdn.microsoft.com/en-us/library/aa917505.aspx) and I'm not
sure it is a good idea to force the related HAVE_* definitions. Does
anyone have an idea about how to fix these two problems? If not, I can
try to fix them and run some tests using PHP, any help welcome as I'm
not a pgsql user (only building php releases and snapshots,
www.php.net/download and snaps.php.net)

The last version of my win32.mak file is available here:

http://pecl2.php.net/downloads/php-windows-builds/source/libpq/win32.mak

Cheers,
--
Pierre

http://blog.thepimp.net | http://www.libgd.org

Responses

Browse pgsql-ports by date

  From Date Subject
Next Message Magnus Hagander 2008-05-06 11:36:47 Re: Libpq visual c++ build errors, addrinfo and sockaddr_storage redefinition error
Previous Message Nathan Garlington 2008-05-02 19:23:50 Compile error: command not found