Обсуждение: AGAIN - problem with BCC55 and libpq 8.2

Поиск
Список
Период
Сортировка

AGAIN - problem with BCC55 and libpq 8.2

От
fabio guidi
Дата:
I trying to repost my problem ...

thanks in advance

Hello to all, i'm trying to build libpq for postgresql 8.2 with borland 
bcc5.5

After change the bcc32.mak path i try to execute
make -f bcc32.mak from postgresql_src/src
and i obtain this ...

bcc32.exe 
-ID:\Borland\BCC55\include;..\..\include;..\..\include\port\win32;..\..\include\port\win32_msvc;..\..\port 
-n".\Release" -WD -c -DFRONTEND;NDE
BUG;WIN32;_WINDOWS -tWM   -a8 -X -w-use -w-par -w-pia -w-csu -w-aus 
-w-ccc -O -Oi -OS -DNDEBUG win32.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
win32.c:
Error E2209 ..\..\include\c.h 64: Unable to open include file 'crtdefs.h'
Error E2209 ..\..\include\pg_config_os.h 20: Unable to open include file 
'sys/utime.h'
Warning W8017 ..\..\include\pg_config_os.h 152: Redefinition of 
'SIGUSR1' is not identical
Warning W8017 ..\..\include\pg_config_os.h 153: Redefinition of 
'SIGUSR2' is not identical
Error E2238 ..\..\include\pg_config_os.h 264: Multiple declaration for 
'mode_t'
Error E2344 D:\Borland\BCC55\include\sys/types.h 35: Earlier declaration 
of 'mode_t'
*** 4 errors in Compile ***

I don't find this file crtdefs.h i drop it
sys/utime wrong directory i correct
multiple declaration for mode_t i comment it

after i try to rebuild all and now i obtain these errors:

Warning: 'win32' not found in library
Warning: 'getaddrinfo' not found in library
Warning: 'pgstrcasecmp' not found in library
Warning: 'strlcpy' not found in library
Warning: 'thread' not found in library
Warning: 'inet_aton' not found in library
Warning: 'crypt' not found in library
Warning: 'noblock' not found in library
Warning: 'md5' not found in library
Warning: 'ip' not found in library
Warning: 'fe-auth' not found in library
Warning: 'fe-protocol2' not found in library
Warning: 'fe-protocol3' not found in library
Warning: 'fe-connect' not found in library
Warning: 'fe-exec' not found in library
Warning: 'fe-lobj' not found in library
Warning: 'fe-misc' not found in library
Warning: public '_pqFlush' in module 'fe-misc' clashes with prior module 
'fe-exec'
Warning: 'fe-print' not found in library
Warning: 'fe-secure' not found in library
Warning: 'pqexpbuffer' not found in library
Warning: 'pqsignal' not found in library
Warning: 'wchar' not found in library
Warning: 'encnames' not found in library
Warning: 'pthread-win32' not found in library
Warning: '' not found in library
Warning: '.OBJ' file not found       bcc32.exe 
-ID:\Borland\BCC55\include;..\..\include;..\..\include\port\win32;..\..\include\port\win32_msvc;..\..\port 
-n".\Release" -WD -c -DFRONTEND;NDE
BUG;WIN32;_WINDOWS -tWM   -a8 -X -w-use -w-par -w-pia -w-csu -w-aus 
-w-ccc -O -Oi -OS -DNDEBUG libpqdll.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
libpqdll.c:       brcc32.exe -l 0x409 -iD:\Borland\BCC55\include 
-fo".\Release\libpq.res"
libpq.rc
Borland Resource Compiler  Version 5.40
Copyright (c) 1990, 1999 Inprise Corporation.  All rights reserved.       ilink32.exe @MAKE0000.@@@
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_pg_snprintf' referenced from 
D:\POSTGRESQL-8.2.0\SRC\INTERFACES\LIBPQ\RELEASE\BLIBPQ.LIB|getaddrinfo
Error: Unresolved external '_pg_vsnprintf' referenced from 
D:\POSTGRESQL-8.2.0\SRC\INTERFACES\LIBPQ\RELEASE\BLIBPQ.LIB|pqexpbuffer
Error: Unresolved external '_pg_fprintf' referenced from 
D:\POSTGRESQL-8.2.0\SRC\INTERFACES\LIBPQ\RELEASE\BLIBPQ.LIB|fe-exec
Error: Unresolved external '_pg_sprintf' referenced from 
D:\POSTGRESQL-8.2.0\SRC\INTERFACES\LIBPQ\RELEASE\BLIBPQ.LIB|fe-protocol2

** error 2 ** deleting ".\Release\blibpq.dll"

** error 1 ** deleting ALL


what can i do now ?

Fabio


Re: AGAIN - problem with BCC55 and libpq 8.2

От
Mark Morgan Lloyd
Дата:
fabio guidi wrote:
> 
> I trying to repost my problem ...
> 
> thanks in advance
> 
> Hello to all, i'm trying to build libpq for postgresql 8.2 with borland
> bcc5.5

I'm hoping to look at this at some point but it is most unlikely to be this
year. Are you building from a set of freshly-unpacked sources or have they been
configured on say a Linux system? What I did with v8.1 was take the 8.1.3 source
tree after I'd built the server and work from that.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]


Re: AGAIN - problem with BCC55 and libpq 8.2

От
"f\.guidi\@libero\.it"
Дата:
... i hope that this problem will resolve first than 8.2.3 ... i need only to build a correct library for borland not
theentire engine ... 

merry christmas to all

> fabio guidi wrote:
> >
> > I trying to repost my problem ...
> >
> > thanks in advance
> >
> > Hello to all, i'm trying to build libpq for postgresql 8.2 with borland
> > bcc5.5
>
> I'm hoping to look at this at some point but it is most unlikely to be this
> year. Are you building from a set of freshly-unpacked sources or have they been
> configured on say a Linux system? What I did with v8.1 was take the 8.1.3 source
> tree after I'd built the server and work from that.
>
> --
> Mark Morgan Lloyd
> markMLl .AT. telemetry.co .DOT. uk
>
> [Opinions above are the author's, not those of his employers or colleagues]
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>


------------------------------------------------------
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada21dic06




Re: BCC55 and libpq 8.2

От
L Bayuk
Дата:
On Wed, Dec 20, 2006 at 07:51:00PM +0100, fabio guidi wrote:
>...
> Hello to all, i'm trying to build libpq for postgresql 8.2 with borland 
> bcc5.5
> ...

I finally found myself in front of Windows PC, with PostgreSQL-8.2.0
source, Borland BCC32 compiler, and a little time. I was trying to build my
Pgtclng DLL (http://pgfoundry.org/projects/pgtclng/) which requires the
libpq DLL.  The bad news is that (as you found) a bunch of stuff got broken
in 8.2.0 regarding BCC builds of libpq.  The good news is that I succeeded.
I built the libpq DLL, my Pgtclng DLL, and even the psql program. I tested
Pgtclng pretty hard with my test suite and it passed, so I am confident the
libpq build was good in so far as Pgtclng uses it.  But it got some scary
compiler warnings that I still want to look into.

I will try to post a patch soon for the bcc32.mak files, but I also had to
change some other files used by all other builds and I can't see them
patching those files for BCC. I don't have patch files yet, but if you want
to try it yourself here are the details.  Unless I missed something, after
these changes "make -N -f bcc32.mak" inside interfaces/libpq should build
it for you. There are also a few fixes for building psql I have to post
some other time. Sorry I don't have this as a patch yet but I figured you
have waited long enough and might want to try it.

In include/c.h :  Change: #if defined(__BORLANDC__) || (_MSC_VER >= 1400)     to: #if (_MSC_VER >= 1400)

In include/port.h :Delete the random() declaration, or change it so it looks like this:    #if !defined(__BORLANDC__)
#ifndef HAVE_RANDOM    extern long random(void);    #endif    #endif
 

In include/, copy pg_config.h.win32 to pg_config.h
In include/, copy port/win32.h to pg_config_os.h and make the following
changes. I made these conditional on __BORLANDC__, but if you are only
trying to build the thing just delete or change these lines:  Remove #include <sys/utime.h>  Remove #define SIGUSR1 and
SIGUSR2. Remove declarations of ssize_t and mode_t.  Remove #define's of _S_IRWXU through S_ISREG.  Replace the
definitionsso inline and __inline__ are defined to nothing.   (Might not be necessary, but it was in my notes from
priorreleases.)
 

In interfaces/libpq/bcc32.mak:  Add "snprintf.obj" to the LIB32_OBJS macro, and add the block which     builds it: Copy
theapplicable lines from win32.mak.  I always had to make these two changes to bcc32.mak for Pgtclng, but  this could
bespecific to linking with Tcl so you might not need it.     1) Add -c to LINK32_FLAGS (makes it case sensitive).
2)Change runtime library from cw32mti.lib to cw32mt.lib (static version)
 


Re: BCC55 and libpq 8.2

От
Mark Morgan Lloyd
Дата:
L Bayuk wrote:
> 
> On Wed, Dec 20, 2006 at 07:51:00PM +0100, fabio guidi wrote:
> >...
> > Hello to all, i'm trying to build libpq for postgresql 8.2 with borland
> > bcc5.5
> > ...
> 
> I finally found myself in front of Windows PC, with PostgreSQL-8.2.0
> source, Borland BCC32 compiler, and a little time. I was trying to build my
> Pgtclng DLL (http://pgfoundry.org/projects/pgtclng/) which requires the
> libpq DLL.  The bad news is that (as you found) a bunch of stuff got broken
> in 8.2.0 regarding BCC builds of libpq.  The good news is that I succeeded.
> I built the libpq DLL, my Pgtclng DLL, and even the psql program.

Thanks for that from me as well. Do you find the resulting psql reliable? I got
it built for 8.1 but found it very flaky and ended up doing that sort of work
using an ssh session to the (Linux) server.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]


Re: BCC55 and libpq 8.2

От
fabio guidi
Дата:
L Bayuk ha scritto:

>On Wed, Dec 20, 2006 at 07:51:00PM +0100, fabio guidi wrote:
>  
>
>>...
>>Hello to all, i'm trying to build libpq for postgresql 8.2 with borland 
>>bcc5.5
>>...
>>    
>>
>
>I finally found myself in front of Windows PC, with PostgreSQL-8.2.0
>source, Borland BCC32 compiler, and a little time. I was trying to build my
>Pgtclng DLL (http://pgfoundry.org/projects/pgtclng/) which requires the
>libpq DLL.  The bad news is that (as you found) a bunch of stuff got broken
>in 8.2.0 regarding BCC builds of libpq.  The good news is that I succeeded.
>I built the libpq DLL, my Pgtclng DLL, and even the psql program. I tested
>Pgtclng pretty hard with my test suite and it passed, so I am confident the
>libpq build was good in so far as Pgtclng uses it.  But it got some scary
>compiler warnings that I still want to look into.
>
>I will try to post a patch soon for the bcc32.mak files, but I also had to
>change some other files used by all other builds and I can't see them
>patching those files for BCC. I don't have patch files yet, but if you want
>to try it yourself here are the details.  Unless I missed something, after
>these changes "make -N -f bcc32.mak" inside interfaces/libpq should build
>it for you. There are also a few fixes for building psql I have to post
>some other time. Sorry I don't have this as a patch yet but I figured you
>have waited long enough and might want to try it.
>
>In include/c.h : 
>  Change: #if defined(__BORLANDC__) || (_MSC_VER >= 1400)
>      to: #if (_MSC_VER >= 1400)
>
>In include/port.h :
> Delete the random() declaration, or change it so it looks like this:
>     #if !defined(__BORLANDC__)
>     #ifndef HAVE_RANDOM
>     extern long random(void);
>     #endif
>     #endif
>
>In include/, copy pg_config.h.win32 to pg_config.h
>In include/, copy port/win32.h to pg_config_os.h and make the following
>changes. I made these conditional on __BORLANDC__, but if you are only
>trying to build the thing just delete or change these lines:
>   Remove #include <sys/utime.h>
>   Remove #define SIGUSR1 and SIGUSR2.
>   Remove declarations of ssize_t and mode_t.
>   Remove #define's of _S_IRWXU through S_ISREG.
>   Replace the definitions so inline and __inline__ are defined to nothing.
>    (Might not be necessary, but it was in my notes from prior releases.)
>
>In interfaces/libpq/bcc32.mak:
>   Add "snprintf.obj" to the LIB32_OBJS macro, and add the block which
>      builds it: Copy the applicable lines from win32.mak.
>   I always had to make these two changes to bcc32.mak for Pgtclng, but
>   this could be specific to linking with Tcl so you might not need it.
>      1) Add -c to LINK32_FLAGS (makes it case sensitive).
>      2) Change runtime library from cw32mti.lib to cw32mt.lib (static version)
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faq
>
>  
>
Thanks a lot, i'm reading only now your problem solution ...

fabio


Re: BCC55 and libpq 8.2

От
L Bayuk
Дата:
On Mon, Jan 01, 2007 at 09:50:18PM +0000, Mark Morgan Lloyd wrote:
> >...
> > I built the libpq DLL, my Pgtclng DLL, and even the psql program.
> 
> Thanks for that from me as well. Do you find the resulting psql reliable? I got
> it built for 8.1 but found it very flaky and ended up doing that sort of work
> using an ssh session to the (Linux) server.

I can hardly say if my bcc-built psql 8.2.0 is reliable. After I got libpq
and pgtcl-ng built, I went ahead and tried psql. Got it to compile,
connected, and did a few simple selects.  That's all. I don't normally
build or use psql on Windows, and I don't have any kind of test setup for it.

If you have a suggestion how I might get psql to misbehave, I'll try it
out, but I have a feeling whatever you saw isn't easy to reproduce on
demand.

I should have a cleaned-up patch soon. Turns out most of the work is just
copying updates from the win32.mak files into the bcc32.mak files.


Re: BCC55 and libpq 8.2

От
Bruce Momjian
Дата:
I have created the following patch based on your description of how to
get BCC compiled.  Please let me know how it works against a stock
PostgreSQL 8.2.X and I can include the patch in 8.2.2.  Sorry it didn't
make it in time for 8.2.1.

---------------------------------------------------------------------------

L Bayuk wrote:
> On Wed, Dec 20, 2006 at 07:51:00PM +0100, fabio guidi wrote:
> >...
> > Hello to all, i'm trying to build libpq for postgresql 8.2 with borland
> > bcc5.5
> > ...
>
> I finally found myself in front of Windows PC, with PostgreSQL-8.2.0
> source, Borland BCC32 compiler, and a little time. I was trying to build my
> Pgtclng DLL (http://pgfoundry.org/projects/pgtclng/) which requires the
> libpq DLL.  The bad news is that (as you found) a bunch of stuff got broken
> in 8.2.0 regarding BCC builds of libpq.  The good news is that I succeeded.
> I built the libpq DLL, my Pgtclng DLL, and even the psql program. I tested
> Pgtclng pretty hard with my test suite and it passed, so I am confident the
> libpq build was good in so far as Pgtclng uses it.  But it got some scary
> compiler warnings that I still want to look into.
>
> I will try to post a patch soon for the bcc32.mak files, but I also had to
> change some other files used by all other builds and I can't see them
> patching those files for BCC. I don't have patch files yet, but if you want
> to try it yourself here are the details.  Unless I missed something, after
> these changes "make -N -f bcc32.mak" inside interfaces/libpq should build
> it for you. There are also a few fixes for building psql I have to post
> some other time. Sorry I don't have this as a patch yet but I figured you
> have waited long enough and might want to try it.
>
> In include/c.h :
>   Change: #if defined(__BORLANDC__) || (_MSC_VER >= 1400)
>       to: #if (_MSC_VER >= 1400)
>
> In include/port.h :
>  Delete the random() declaration, or change it so it looks like this:
>      #if !defined(__BORLANDC__)
>      #ifndef HAVE_RANDOM
>      extern long random(void);
>      #endif
>      #endif
>
> In include/, copy pg_config.h.win32 to pg_config.h
> In include/, copy port/win32.h to pg_config_os.h and make the following
> changes. I made these conditional on __BORLANDC__, but if you are only
> trying to build the thing just delete or change these lines:
>    Remove #include <sys/utime.h>
>    Remove #define SIGUSR1 and SIGUSR2.
>    Remove declarations of ssize_t and mode_t.
>    Remove #define's of _S_IRWXU through S_ISREG.
>    Replace the definitions so inline and __inline__ are defined to nothing.
>     (Might not be necessary, but it was in my notes from prior releases.)
>
> In interfaces/libpq/bcc32.mak:
>    Add "snprintf.obj" to the LIB32_OBJS macro, and add the block which
>       builds it: Copy the applicable lines from win32.mak.
>    I always had to make these two changes to bcc32.mak for Pgtclng, but
>    this could be specific to linking with Tcl so you might not need it.
>       1) Add -c to LINK32_FLAGS (makes it case sensitive).
>       2) Change runtime library from cw32mti.lib to cw32mt.lib (static version)
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq

--
  Bruce Momjian   bruce@momjian.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: src/include/c.h
===================================================================
RCS file: /cvsroot/pgsql/src/include/c.h,v
retrieving revision 1.215
diff -c -c -r1.215 c.h
*** src/include/c.h    5 Jan 2007 22:19:50 -0000    1.215
--- src/include/c.h    6 Jan 2007 01:40:05 -0000
***************
*** 59,65 ****
  #include "postgres_ext.h"
  #include "pg_trace.h"

! #if defined(__BORLANDC__) || (_MSC_VER >= 1400)
  #define errcode __msvc_errcode
  #include <crtdefs.h>
  #undef errcode
--- 59,65 ----
  #include "postgres_ext.h"
  #include "pg_trace.h"

! #if _MSC_VER >= 1400
  #define errcode __msvc_errcode
  #include <crtdefs.h>
  #undef errcode
Index: src/include/port.h
===================================================================
RCS file: /cvsroot/pgsql/src/include/port.h,v
retrieving revision 1.107
diff -c -c -r1.107 port.h
*** src/include/port.h    5 Jan 2007 22:19:50 -0000    1.107
--- src/include/port.h    6 Jan 2007 01:40:05 -0000
***************
*** 343,349 ****
  extern size_t strlcpy(char *dst, const char *src, size_t siz);
  #endif

! #ifndef HAVE_RANDOM
  extern long random(void);
  #endif

--- 343,349 ----
  extern size_t strlcpy(char *dst, const char *src, size_t siz);
  #endif

! #if !defined(HAVE_RANDOM) && !defined(__BORLANDC__)
  extern long random(void);
  #endif

Index: src/include/port/win32.h
===================================================================
RCS file: /cvsroot/pgsql/src/include/port/win32.h,v
retrieving revision 1.64
diff -c -c -r1.64 win32.h
*** src/include/port/win32.h    2 Jan 2007 21:25:50 -0000    1.64
--- src/include/port/win32.h    6 Jan 2007 01:40:05 -0000
***************
*** 17,23 ****
--- 17,25 ----
  #include <signal.h>
  #include <errno.h>
  #include <direct.h>
+ #ifndef __BORLANDC__
  #include <sys/utime.h>            /* for non-unicode version */
+ #endif
  #undef near

  /* Must be here to avoid conflicting with prototype in windows.h */
***************
*** 149,156 ****
--- 151,160 ----
  #define SIGTTIN                21
  #define SIGTTOU                22    /* Same as SIGABRT -- no problem, I hope */
  #define SIGWINCH            28
+ #ifndef __BORLANDC__
  #define SIGUSR1                30
  #define SIGUSR2                31
+ #endif

  struct timezone
  {
***************
*** 258,266 ****


  /* Things that exist in MingW headers, but need to be added to MSVC */
! #ifdef WIN32_ONLY_COMPILER
  typedef long ssize_t;
  typedef unsigned short mode_t;

  /*
   *    Certain "standard edition" versions of MSVC throw a warning
--- 262,271 ----


  /* Things that exist in MingW headers, but need to be added to MSVC */
! #if defined(WIN32_ONLY_COMPILER) && !defined(__BORLANDC__)
  typedef long ssize_t;
  typedef unsigned short mode_t;
+ #endif

  /*
   *    Certain "standard edition" versions of MSVC throw a warning
***************
*** 271,276 ****
--- 276,282 ----
  #define inline __inline
  #define __inline__ __inline

+ #ifndef __BORLANDC__
  #define _S_IRWXU    (_S_IREAD | _S_IWRITE | _S_IEXEC)
  #define _S_IXUSR    _S_IEXEC
  #define _S_IWUSR    _S_IWRITE
***************
*** 280,285 ****
--- 286,292 ----
  #define S_IXUSR        _S_IXUSR
  #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
  #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+ #endif

  #define F_OK 0
  #define W_OK 2
Index: src/interfaces/libpq/bcc32.mak
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpq/bcc32.mak,v
retrieving revision 1.25
diff -c -c -r1.25 bcc32.mak
*** src/interfaces/libpq/bcc32.mak    21 Nov 2006 23:26:47 -0000    1.25
--- src/interfaces/libpq/bcc32.mak    6 Jan 2007 01:40:05 -0000
***************
*** 76,82 ****
  CLEAN :
      -@erase "$(INTDIR)\getaddrinfo.obj"
      -@erase "$(INTDIR)\pgstrcasecmp.obj"
-     -@erase "$(INTDIR)\strlcpy.obj"
      -@erase "$(INTDIR)\thread.obj"
      -@erase "$(INTDIR)\inet_aton.obj"
      -@erase "$(INTDIR)\crypt.obj"
--- 76,81 ----
***************
*** 99,104 ****
--- 98,105 ----
      -@erase "$(INTDIR)\wchar.obj"
      -@erase "$(INTDIR)\encnames.obj"
      -@erase "$(INTDIR)\pthread-win32.obj"
+     -@erase "$(INTDIR)\snprintf.obj"
+     -@erase "$(INTDIR)\strlcpy.obj"
      -@erase "$(OUTDIR)\$(OUTFILENAME).lib"
      -@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
      -@erase "$(OUTDIR)\libpq.res"
***************
*** 113,119 ****
      "$(INTDIR)\win32.obj" \
      "$(INTDIR)\getaddrinfo.obj" \
      "$(INTDIR)\pgstrcasecmp.obj" \
-     "$(INTDIR)\strlcpy.obj" \
      "$(INTDIR)\thread.obj" \
      "$(INTDIR)\inet_aton.obj" \
      "$(INTDIR)\crypt.obj" \
--- 114,119 ----
***************
*** 133,138 ****
--- 133,140 ----
      "$(INTDIR)\pqsignal.obj" \
      "$(INTDIR)\wchar.obj" \
      "$(INTDIR)\encnames.obj" \
+     "$(INTDIR)\snprintf.obj" \
+     "$(INTDIR)\strlcpy.obj" \
      "$(INTDIR)\pthread-win32.obj"


***************
*** 187,197 ****
      $(CPP_PROJ) ..\..\port\pgstrcasecmp.c
  <<

- "$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c
-     $(CPP) @<<
-     $(CPP_PROJ) ..\..\port\strlcpy.c
- <<
-
  "$(INTDIR)\thread.obj" : ..\..\port\thread.c
      $(CPP) @<<
      $(CPP_PROJ) ..\..\port\thread.c
--- 189,194 ----
***************
*** 233,237 ****
--- 230,244 ----
      $(CPP_PROJ) /I"." ..\..\backend\utils\mb\encnames.c
  <<

+ "$(INTDIR)\snprintf.obj" : ..\..\port\snprintf.c
+     $(CPP) @<<
+     $(CPP_PROJ) ..\..\port\snprintf.c
+ <<
+
+ "$(INTDIR)\strlcpy.obj" : ..\..\port\strlcpy.c
+     $(CPP) @<<
+     $(CPP_PROJ) ..\..\port\strlcpy.c
+ <<
+
  .c.obj:
      $(CPP) $(CPP_PROJ) $<
Index: src/interfaces/libpq/win32.mak
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpq/win32.mak,v
retrieving revision 1.42
diff -c -c -r1.42 win32.mak
*** src/interfaces/libpq/win32.mak    21 Nov 2006 23:26:47 -0000    1.42
--- src/interfaces/libpq/win32.mak    6 Jan 2007 01:40:05 -0000
***************
*** 74,81 ****
      -@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
      -@erase "$(OUTDIR)\libpq.res"
      -@erase "$(OUTDIR)\$(OUTFILENAME).dll"
- #    -@erase "*.pch"
- #    -@erase "$(OUTDIR)\libpq.pch"
      -@erase "$(OUTDIR)\$(OUTFILENAME)dll.exp"
      -@erase "$(INTDIR)\pg_config_paths.h"

--- 74,79 ----

Re: BCC55 and libpq 8.2

От
L Bayuk
Дата:
On Fri, Jan 05, 2007 at 08:57:00PM -0500, Bruce Momjian wrote:
> 
> I have created the following patch based on your description of how to
> get BCC compiled.  Please let me know how it works against a stock
> PostgreSQL 8.2.X and I can include the patch in 8.2.2.  Sorry it didn't
> make it in time for 8.2.1.

I understand about 8.2.1, and sorry for not getting to this sooner. I did
have a patch file ready. I've compared it with the one you attached, and I
have some questions.

1. In the past, I've had to define "inline" to nothing to get libpq to compile
with BCC, but I don't know if it is still necessary. I had that in my patch
but you left it out. Do you know that this is no longer necessary, or
should I test it?

2. I also have a patch for bin/psql/bcc32.mak which basically synchronizes
it to changes in win32.mak. With this patch, psql compiles with BCC -
but it does not run well. (See my previous post on INTERFACES.) Can we
include the patch anyway? Maybe someone will try to fix what's wrong
someday and this patch will help.

3. To build libpq with BCC for use with pgtcl-ng, I had to add "-c" to the
LINK32_FLAGS (makes symbols case sensitive, due to PQflush() vs pqFlush()
if I recall), and change the runtime library from cw32mti.lib to cw32mt.lib
(static version). I don't know if these are specific to linking with Tcl
libraries, but I can't see it would hurt anyone else. Can I include these
in the patch?

I will try your patch, and look into the inline thing as soon as I can,
perhaps Monday.


Re: BCC55 and libpq 8.2

От
Bruce Momjian
Дата:
L Bayuk wrote:
> On Fri, Jan 05, 2007 at 08:57:00PM -0500, Bruce Momjian wrote:
> > 
> > I have created the following patch based on your description of how to
> > get BCC compiled.  Please let me know how it works against a stock
> > PostgreSQL 8.2.X and I can include the patch in 8.2.2.  Sorry it didn't
> > make it in time for 8.2.1.
> 
> I understand about 8.2.1, and sorry for not getting to this sooner. I did
> have a patch file ready. I've compared it with the one you attached, and I
> have some questions.
> 
> 1. In the past, I've had to define "inline" to nothing to get libpq to compile
> with BCC, but I don't know if it is still necessary. I had that in my patch
> but you left it out. Do you know that this is no longer necessary, or
> should I test it?

We adjusted inline for 8.2 so I figured you will need to retest this
before we add it.

> 2. I also have a patch for bin/psql/bcc32.mak which basically synchronizes
> it to changes in win32.mak. With this patch, psql compiles with BCC -
> but it does not run well. (See my previous post on INTERFACES.) Can we
> include the patch anyway? Maybe someone will try to fix what's wrong
> someday and this patch will help.

Yes, let's do that.

> 3. To build libpq with BCC for use with pgtcl-ng, I had to add "-c" to the
> LINK32_FLAGS (makes symbols case sensitive, due to PQflush() vs pqFlush()
> if I recall), and change the runtime library from cw32mti.lib to cw32mt.lib
> (static version). I don't know if these are specific to linking with Tcl
> libraries, but I can't see it would hurt anyone else. Can I include these
> in the patch?

I did some research and it seems the MS linker is case-sensitive by
default, while BCC is case-insensitive by default, so that -c option is
something we definately should add to the bcc makefile.

> I will try your patch, and look into the inline thing as soon as I can,
> perhaps Monday.

Great.  Just send me a patch that works on your setup and I will apply
it.  Thanks.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


Re: BCC55 and libpq 8.2

От
L Bayuk
Дата:
On Mon, Jan 08, 2007 at 10:54:23AM -0500, Bruce Momjian wrote:
> L Bayuk wrote:
> >...
> > 1. In the past, I've had to define "inline" to nothing...
> We adjusted inline for 8.2 so I figured you will need to retest this
> before we add it.

Tested and works as is in 8.2.0. No need to #define inline (as nothing).

>...
> > 3. To build libpq with BCC for use with pgtcl-ng, I had to add "-c" to the
> > LINK32_FLAGS (makes symbols case sensitive, due to PQflush() vs pqFlush()
> > if I recall), and change the runtime library from cw32mti.lib to cw32mt.lib
> > (static version). I don't know if these are specific to linking with Tcl
> > libraries, but I can't see it would hurt anyone else. Can I include these
> > in the patch?
> 
> I did some research and it seems the MS linker is case-sensitive by
> default, while BCC is case-insensitive by default, so that -c option is
> something we definately should add to the bcc makefile.

I think I was wrong. According to the Borland Linker documentation, -c
defaults on (case sensitive). But when I link without -c, it warns about
pqFlush vs PQflush.  Confusing. I'm going to try it again, both ways.

Why are there two functions anyway? I suppose historical reasons.
Since PQflush(c) is { return pqFlush(c); } I guess if the linker gets
the case thing wrong we loop until overrunning the stack.

I would also prefer to use cm32mt.lib; it makes blibpq.dll bigger but
otherwise it requires another DLL at runtime, I think (cw3250mt.dll).

> > I will try your patch, and look into the inline thing as soon as I can,
> > perhaps Monday.
> 
> Great.  Just send me a patch that works on your setup and I will apply
> it.  Thanks.

Don't apply your patch. There is an extra #endif in port/win32.h after the
patch which breaks it. I will fix, add the psql/bcc32.mak stuff, test it,
and post it on [PATCHES].


Re: BCC55 and libpq 8.2

От
Bruce Momjian
Дата:
L Bayuk wrote:
> On Mon, Jan 08, 2007 at 10:54:23AM -0500, Bruce Momjian wrote:
> > L Bayuk wrote:
> > >...
> > > 1. In the past, I've had to define "inline" to nothing...
> > We adjusted inline for 8.2 so I figured you will need to retest this
> > before we add it.
> 
> Tested and works as is in 8.2.0. No need to #define inline (as nothing).
> 
> >...
> > > 3. To build libpq with BCC for use with pgtcl-ng, I had to add "-c" to the
> > > LINK32_FLAGS (makes symbols case sensitive, due to PQflush() vs pqFlush()
> > > if I recall), and change the runtime library from cw32mti.lib to cw32mt.lib
> > > (static version). I don't know if these are specific to linking with Tcl
> > > libraries, but I can't see it would hurt anyone else. Can I include these
> > > in the patch?
> > 
> > I did some research and it seems the MS linker is case-sensitive by
> > default, while BCC is case-insensitive by default, so that -c option is
> > something we definately should add to the bcc makefile.
> 
> I think I was wrong. According to the Borland Linker documentation, -c
> defaults on (case sensitive). But when I link without -c, it warns about
> pqFlush vs PQflush.  Confusing. I'm going to try it again, both ways.

Ah, interesting.

> Why are there two functions anyway? I suppose historical reasons.
> Since PQflush(c) is { return pqFlush(c); } I guess if the linker gets
> the case thing wrong we loop until overrunning the stack.

Yes, I assume historical, so feel free to add -c, but add a
documentation comment about it so we remember.

> I would also prefer to use cm32mt.lib; it makes blibpq.dll bigger but
> otherwise it requires another DLL at runtime, I think (cw3250mt.dll).

Sure.

> > > I will try your patch, and look into the inline thing as soon as I can,
> > > perhaps Monday.
> > 
> > Great.  Just send me a patch that works on your setup and I will apply
> > it.  Thanks.
> 
> Don't apply your patch. There is an extra #endif in port/win32.h after the
> patch which breaks it. I will fix, add the psql/bcc32.mak stuff, test it,
> and post it on [PATCHES].

OK, great.  Thanks.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


Re: BCC55 and libpq 8.2

От
L Bayuk
Дата:
On Mon, Jan 08, 2007 at 10:48:02PM -0500, Bruce Momjian wrote:
> > 
> > I think I was wrong. According to the Borland Linker documentation, -c
> > defaults on (case sensitive). But when I link without -c, it warns about
> > pqFlush vs PQflush.  Confusing. I'm going to try it again, both ways.
> 
> Ah, interesting.
> 
> > Why are there two functions anyway? I suppose historical reasons.
> > Since PQflush(c) is { return pqFlush(c); } I guess if the linker gets
> > the case thing wrong we loop until overrunning the stack.
> 
> Yes, I assume historical, so feel free to add -c, but add a
> documentation comment about it so we remember.

On closer look I saw that the warning about pqFlush vs PQflush was from the
library tool (TLIB), not the linker. The linker is apparently
case-sensitive by default, so there is no need for -c there. As to the
library tool, the help file says it is not case sensitive, -c makes it so,
but there is a warning against its use.  Since it seems to work as is (no
-c) I think it is best to leave it alone.


Re: BCC55 and libpq 8.2

От
CN
Дата:
On Fri, 5 Jan 2007 20:57:00 -0500 (EST), Bruce Momjian <bruce@momjian.us>  
wrote:

> I have created the following patch based on your description of how to
> get BCC compiled.  Please let me know how it works against a stock
> PostgreSQL 8.2.X and I can include the patch in 8.2.2.

I tried the CVS version just now and noticed that

(1) I have to do "ln -s libpq.rc.in libpq.rc".
(2) File blibpqdll.def is missing. I then got one from
http://src.opensolaris.org/source/xref/sfw/usr/src/cmd/postgres/postgresql-8.1.4/src/interfaces/libpq/blibpqdll.def

Then it compiles fine and appears to work with _old_ libwine.

By the way, I have not received any response to BUG #2827. Hopefully  
someone will help.

Regards,

CN


Re: BCC55 and libpq 8.2

От
Bruce Momjian
Дата:
CN wrote:
> On Fri, 5 Jan 2007 20:57:00 -0500 (EST), Bruce Momjian <bruce@momjian.us>  
> wrote:
> 
> > I have created the following patch based on your description of how to
> > get BCC compiled.  Please let me know how it works against a stock
> > PostgreSQL 8.2.X and I can include the patch in 8.2.2.
> 
> I tried the CVS version just now and noticed that
> 
> (1) I have to do "ln -s libpq.rc.in libpq.rc".

Interesting question.  I looked at the install instructions and there is
no mention of this for MSVC or BCC:
http://www.postgresql.org/docs/8.2/static/install-win32.html

I looked at the win32.mak file, and see no refererence to libpq.rc.in,
so how is the MSVC working?  Should we add rules for both?

> (2) File blibpqdll.def is missing. I then got one from
> http://src.opensolaris.org/source/xref/sfw/usr/src/cmd/postgres/postgresql-8.1.4/src/interfaces/libpq/blibpqdll.def
> 
> Then it compiles fine and appears to work with _old_ libwine.

Uh, it is supposed to be build by this rule:
$(srcdir)/blibpqdll.def: exports.txt        echo '; DEF file for Borland C++ Builder' > $@        echo 'LIBRARY BLIBPQ'
>>$@        echo 'EXPORTS' >> $@        sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/    _\1@ \2/' < $< >> $@
echo'' >> $@        echo '; Aliases for MS compatible names' >> $@        sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/
  \1= _\1/' < $< | sed 's/ *$$//' >> $@
 

Is there a reason this failed?

> By the way, I have not received any response to BUG #2827. Hopefully  
> someone will help.

Yes, I saw that.  It is not clear whether this is a libpq problem or a
Wine problem.  We are unsure how to debug this.  I wonder whether it is
a problem with getaddrinfo.  We did fix an addrinfo issue in 8.2.1:
    * Improve handling of getaddrinfo() on AIX (Tom)

I wonder if that fixes it.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


Re: BCC55 and libpq 8.2

От
L Bayuk
Дата:
On Mon, Jan 15, 2007 at 05:18:20PM -0500, Bruce Momjian wrote:
> CN wrote:
> > I tried the CVS version just now and noticed that
> > 
> > (1) I have to do "ln -s libpq.rc.in libpq.rc".
> 
> Interesting question.  I looked at the install instructions and there is
> no mention of this for MSVC or BCC:
> 
>     http://www.postgresql.org/docs/8.2/static/install-win32.html
> 
> I looked at the win32.mak file, and see no refererence to libpq.rc.in,
> so how is the MSVC working?  Should we add rules for both?

libpq.rc is included in the source distribution of PostgreSQL.
I think it gets created from libpq.rc.in during release generation
(via "make distprep"?). So it does not need to go in any *.mak files.
But it wasn't there because he built from CVS.


Re: BCC55 and libpq 8.2

От
CN
Дата:
On Tue, 16 Jan 2007 06:18:20 +0800, Bruce Momjian <bruce@momjian.us> wrote:

>> (2) File blibpqdll.def is missing. I then got one from
>> http://src.opensolaris.org/source/xref/sfw/usr/src/cmd/postgres/postgresql-8.1.4/src/interfaces/libpq/blibpqdll.def
>>
>> Then it compiles fine and appears to work with _old_ libwine.
>
> Uh, it is supposed to be build by this rule:
>
>     $(srcdir)/blibpqdll.def: exports.txt
>             echo '; DEF file for Borland C++ Builder' > $@
>             echo 'LIBRARY BLIBPQ' >> $@
>             echo 'EXPORTS' >> $@
>             sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/    _\1@ \2/' < $<
> >> $@
>             echo '' >> $@
>             echo '; Aliases for MS compatible names' >> $@
>             sed -e '/^#/d' -e 's/^\(.* \)\([0-9][0-9]*\)/    \1= _\1/' < $<
> | sed 's/ *$$//' >> $@
>
> Is there a reason this failed?

Oops! Probably it is because I didn't run "configure" in advance. Maybe
MinGW or Cygwin is mandatory as I guess BCB doesn't come with "sed"
although pgsql document says they are optional if only client library is
to be built in Windowz.

>
>> By the way, I have not received any response to BUG #2827. Hopefully
>> someone will help.
>
> Yes, I saw that.  It is not clear whether this is a libpq problem or a
> Wine problem.  We are unsure how to debug this.  I wonder whether it is
> a problem with getaddrinfo.  We did fix an addrinfo issue in 8.2.1:
>
>      * Improve handling of getaddrinfo() on AIX (Tom)
>
> I wonder if that fixes it.
>

That problem remains in the CVS version I checked out about 20 hours ago.

Regards,
CN


Re: BCC55 and libpq 8.2

От
Bruce Momjian
Дата:
L Bayuk wrote:
> On Mon, Jan 15, 2007 at 05:18:20PM -0500, Bruce Momjian wrote:
> > CN wrote:
> > > I tried the CVS version just now and noticed that
> > > 
> > > (1) I have to do "ln -s libpq.rc.in libpq.rc".
> > 
> > Interesting question.  I looked at the install instructions and there is
> > no mention of this for MSVC or BCC:
> > 
> >     http://www.postgresql.org/docs/8.2/static/install-win32.html
> > 
> > I looked at the win32.mak file, and see no refererence to libpq.rc.in,
> > so how is the MSVC working?  Should we add rules for both?
> 
> libpq.rc is included in the source distribution of PostgreSQL.
> I think it gets created from libpq.rc.in during release generation
> (via "make distprep"?). So it does not need to go in any *.mak files.
> But it wasn't there because he built from CVS.

Ah, yes, I see it in libpq/Makefile now.  I didn't realize that.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


Re: BCC55 and libpq 8.2

От
Bruce Momjian
Дата:
> >      * Improve handling of getaddrinfo() on AIX (Tom)
> >
> > I wonder if that fixes it.
> >
> 
> That problem remains in the CVS version I checked out about 20 hours
> ago.

Hmm.  Thanks for testing.  No one else on Win32 has reported that
problem, so my guess is that there is some wine problem there.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +