Thread: Building libpq/psql with Borland BCC5

Building libpq/psql with Borland BCC5

From
L Bayuk
Date:
The attached patch against PostgreSQL-8.2.1 was discussed on [INTERFACES].
It fixes bcc32.mak makefiles for the Borland BCC compiler to build libpq
and psql*. There are also changes to some header files to hide some things
BCC doesn't like.

*Note: psql compiles with bcc after the patch, but it does not run very well.

Attachment

Re: Building libpq/psql with Borland BCC5

From
Gavin Sherry
Date:
On Tue, 9 Jan 2007, L Bayuk wrote:

> The attached patch against PostgreSQL-8.2.1 was discussed on [INTERFACES].
> It fixes bcc32.mak makefiles for the Borland BCC compiler to build libpq
> and psql*. There are also changes to some header files to hide some things
> BCC doesn't like.
>
> *Note: psql compiles with bcc after the patch, but it does not run very well.
>

Define "does not run very well" :-)

Gavin

Re: Building libpq/psql with Borland BCC5

From
Bruce Momjian
Date:
Gavin Sherry wrote:
> On Tue, 9 Jan 2007, L Bayuk wrote:
>
> > The attached patch against PostgreSQL-8.2.1 was discussed on [INTERFACES].
> > It fixes bcc32.mak makefiles for the Borland BCC compiler to build libpq
> > and psql*. There are also changes to some header files to hide some things
> > BCC doesn't like.
> >
> > *Note: psql compiles with bcc after the patch, but it does not run very well.
> >
>
> Define "does not run very well" :-)

See:

    http://archives.postgresql.org/pgsql-interfaces/2007-01/msg00003.php

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

  + If your life is a hard drive, Christ can be your backup. +

Re: Building libpq/psql with Borland BCC5

From
Gavin Sherry
Date:
On Tue, 9 Jan 2007, Bruce Momjian wrote:

> Gavin Sherry wrote:
> > On Tue, 9 Jan 2007, L Bayuk wrote:
> >
> > > The attached patch against PostgreSQL-8.2.1 was discussed on [INTERFACES].
> > > It fixes bcc32.mak makefiles for the Borland BCC compiler to build libpq
> > > and psql*. There are also changes to some header files to hide some things
> > > BCC doesn't like.
> > >
> > > *Note: psql compiles with bcc after the patch, but it does not run very well.
> > >
> >
> > Define "does not run very well" :-)
>
> See:
>
>     http://archives.postgresql.org/pgsql-interfaces/2007-01/msg00003.php
>

*blinks*

Can we be sure that a BCC build libpq is even safe to use given the
problems seen when using psql?

Gavin

Re: Building libpq/psql with Borland BCC5

From
Bruce Momjian
Date:
Gavin Sherry wrote:
> On Tue, 9 Jan 2007, Bruce Momjian wrote:
>
> > Gavin Sherry wrote:
> > > On Tue, 9 Jan 2007, L Bayuk wrote:
> > >
> > > > The attached patch against PostgreSQL-8.2.1 was discussed on [INTERFACES].
> > > > It fixes bcc32.mak makefiles for the Borland BCC compiler to build libpq
> > > > and psql*. There are also changes to some header files to hide some things
> > > > BCC doesn't like.
> > > >
> > > > *Note: psql compiles with bcc after the patch, but it does not run very well.
> > > >
> > >
> > > Define "does not run very well" :-)
> >
> > See:
> >
> >     http://archives.postgresql.org/pgsql-interfaces/2007-01/msg00003.php
> >
>
> *blinks*
>
> Can we be sure that a BCC build libpq is even safe to use given the
> problems seen when using psql?

The bcc users say it is.

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

  + If your life is a hard drive, Christ can be your backup. +

Re: Building libpq/psql with Borland BCC5

From
Tom Lane
Date:
Gavin Sherry <swm@linuxworld.com.au> writes:
> Can we be sure that a BCC build libpq is even safe to use given the
> problems seen when using psql?

Well, I'd not trust it a lot, but surely we have to get it to build
before anyone can debug it ...

            regards, tom lane

Re: [PATCHES] Building libpq/psql with Borland BCC5

From
Bruce Momjian
Date:
Tom Lane wrote:
> Gavin Sherry <swm@linuxworld.com.au> writes:
> > Can we be sure that a BCC build libpq is even safe to use given the
> > problems seen when using psql?
>
> Well, I'd not trust it a lot, but surely we have to get it to build
> before anyone can debug it ...

It does build, but the report is that psql crashes after a few commands.

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

  + If your life is a hard drive, Christ can be your backup. +

Re: [HACKERS] [PATCHES] Building libpq/psql with Borland BCC5

From
Alvaro Herrera
Date:
Bruce Momjian wrote:
> Tom Lane wrote:
> > Gavin Sherry <swm@linuxworld.com.au> writes:
> > > Can we be sure that a BCC build libpq is even safe to use given the
> > > problems seen when using psql?
> >
> > Well, I'd not trust it a lot, but surely we have to get it to build
> > before anyone can debug it ...
>
> It does build, but the report is that psql crashes after a few commands.

What about a Mingw or VC++ psql with a BCC libpq?  Is it possible to
link something like that?

It would be nice to have the libpq at least able to pass the regression
tests.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: [HACKERS] [PATCHES] Building libpq/psql with Borland BCC5

From
Bruce Momjian
Date:
Alvaro Herrera wrote:
> Bruce Momjian wrote:
> > Tom Lane wrote:
> > > Gavin Sherry <swm@linuxworld.com.au> writes:
> > > > Can we be sure that a BCC build libpq is even safe to use given the
> > > > problems seen when using psql?
> > >
> > > Well, I'd not trust it a lot, but surely we have to get it to build
> > > before anyone can debug it ...
> >
> > It does build, but the report is that psql crashes after a few commands.
>
> What about a Mingw or VC++ psql with a BCC libpq?  Is it possible to
> link something like that?

No idea.

> It would be nice to have the libpq at least able to pass the regression
> tests.

True.

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

  + If your life is a hard drive, Christ can be your backup. +

Re: [HACKERS] [PATCHES] Building libpq/psql with Borland BCC5

From
"Merlin Moncure"
Date:
On 1/10/07, Alvaro Herrera <alvherre@commandprompt.com> wrote:

> What about a Mingw or VC++ psql with a BCC libpq?  Is it possible to
> link something like that?
>
> It would be nice to have the libpq at least able to pass the regression
> tests.

you can use microsoft/mingw compiled DLL files but not library files.
however, borland provides a command line tool (implib i thnk) to
create an import library for it which works ok. (i think you have to
pass a switch to fix underscore issue).

libpq.lib is not directly usable (coff vs. omf) but digital mars makes
a tool which can do this and I have confirmed it works.

note: I've used borland compiled libpq (not psql) with borland C++
builder 3 & 5 with no problems. I had to hack pg_config.h however.

merlin

Re: [PATCHES] Building libpq/psql with Borland BCC5

From
Bruce Momjian
Date:
Patch applied.  Thanks.

Backpatch to 8.2.X.z

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


L Bayuk wrote:
> The attached patch against PostgreSQL-8.2.1 was discussed on [INTERFACES].
> It fixes bcc32.mak makefiles for the Borland BCC compiler to build libpq
> and psql*. There are also changes to some header files to hide some things
> BCC doesn't like.
>
> *Note: psql compiles with bcc after the patch, but it does not run very well.

[ Attachment, skipping... ]

>
> ---------------------------(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. +

Re: [PATCHES] Building libpq/psql with Borland BCC5

From
L Bayuk
Date:
On Wed, Jan 10, 2007 at 02:53:01PM +1100, Gavin Sherry wrote:
>...
> Can we be sure that a BCC build libpq is even safe to use given the
> problems seen when using psql?

I have high confidence in my BCC-built libpq, in so far as its functions
are exposed through the Tcl interface pgtcl-ng. My test suite for pgtcl
is rather thorough (more below), and it passes using BCC-built libpq.

Compare that to the fact that my BCC-built psql crashes consistently after
six "\h set" commands - which don't even use libpq! - and you can see why I
think the problem is entirely in psql.

BCC was free to use and easy to set up, and I was able to make Tcl-loadable
modules with it, so that's what I'm using for pgtcl-ng.  I'm not suggesting
people use it for anything else based on what I've done.  If there is a
regression test for libpq which does not use psql, show me and I'll run it.
Otherwise, people will have to do their own testing. But in my opinion if
you have Mingw or VC++, use it (not that I've used either).

.....
My test suite exercises libpq/pgtcl. I use it for pgtclng and pgintcl (see
pgfoundry).  It runs about 160 test cases on Windows (more on Linux, where
it tests for memory leaks, but I don't know how to do that on Windows).  It
includes: synchronous and asynchronous queries, extended 8-bit characters,
COPY From/To, cursors with text and binary data, error detection, prepared
and parameterized queries (text and binary data), large objects, long TEXT
fields, 300-column table queries, transactions, and more. I have some
performance tests in there as a sanity check, including my favorite: a
single query against a 1-column 10-row table which takes 3-10 minutes of
backend time.

Three tests claim to fail on Windows, same as always. Changes to
environment variables like PGUSER within the script are not seen by
pg_connect; this is apparently a DLL thing.  The other 2 failures are
false, and have to do with a limitation of tcltest not seeing output
notification messages written by libpq. These are not real errors.