Re: libpq and libecpg problems on MacOs-X (Panther/10.3.3)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Richard Frith-Macdonald <richard(at)brainstorm(dot)co(dot)uk>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: libpq and libecpg problems on MacOs-X (Panther/10.3.3)
Date: 2004-05-20 00:55:09
Message-ID: 200405200055.i4K0t9o02256@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports

Richard Frith-Macdonald wrote:
> When trying to use postgresql on my MacOS-X system (10.3.3) I
> encountered the problem that the libecpg and libpq dynamic libraries
> could not be linked into my applications.
>
> Upon investigation, it turns out that the postgresql libraries on
> MacOS-X/Darwin are being built as 'bundles' ... which means that you
> can dynamically load them into a running program using the dlopen()
> api, but you can't link them at application build time. This may be
> correct behavior for some of the modules in postgres (eg the perl
> module), but is certainly wrong for libecpg and libpq ... which are
> meant to be linked with C (and other language) applications.
>
> I attach a patch which fixes this for MacOS-X 10.3.3, by altering the
> makefiles to understand the two ways of building a library/bundle and
> having a variable setting 'BUNDLE=no' to day that the normal dynamic
> library should be built rather than a bundle. The patch alters the
> libecpg and libpq makefiles to set this variable, so these two are
> built as normal dynamic libraries, while the other code continues to be
> built as bundles.
>
> Probably there are other parts of the system which should not be
> bundles either ... but I don't use them so I don't know.
> Possibly behavior differs in older versions of MacOS-X ... again, I
> don't have the old systems so I don't know.

This sounds very strange. If you can't link libpq into your
application, why can psql link in libpq?

I am going to need another MacOSX person to comment on this before
applying this change because I thought things were fine on OS X.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-ports by date

  From Date Subject
Next Message Benjamin Reed 2004-05-20 13:25:20 Re: libpq and libecpg problems on MacOs-X (Panther/10.3.3)
Previous Message Bruce Momjian 2004-05-19 22:34:57 Re: [PORTS] Building PgSQL 7.4.2 on SGI Irix 6.19