Re: Problems with Perl - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Problems with Perl
Date
Msg-id Pine.LNX.4.21.0011102324150.775-100000@peter.localdomain
Whole thread Raw
In response to Re: Problems with Perl  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane writes:

> A bigger problem is that if interfaces/perl5 builds itself to refer to
> an installed libpq to begin with, there'll be no way to run its selftest
> without installing libpq first.

Actually, there are only a few platforms where this does work at all,
namely on AIX, FreeBSD <2.2, HPUX, SunOS 4, and Unixware 2.  (information
decoded from Libtool sources)  These platforms record the path where the
library was originally found.  On all other platforms, shared libraries
are only searched in explicitly specified locations ("rpath") or some
default places (/usr/lib), *not* in the place it was found at link-time.  

Furthermore, in order to run the self-test you need a running postmaster,
and you probably have libpq installed by the time you have a postmaster
up.

> The real issue here is that make install builds new files in the source
> tree.  Perhaps "make install" should do a "make clean" after rebuilding
> and installing.

Building new files during install is certainly unclean, but the real
problem is that you need to be root to install the Perl module, but not
for the rest (necessarily), so the rebuilt files are root-owned.  Running
clean after install ought to work, but we could probably do better.

In fact, it would generally be better to get the rpath in there for any
platform, because otherwise we're back to ground zero where people need to
set up LD_LIBRARY_PATH in order for the Perl module to work.

> Bear in mind that if we ever start using libtool, we will have this
> problem all over the tree, not just in interfaces/perl5.  At least on
> HPUX, libtool's standard behavior is to relink just before install.
> I would imagine that the other platforms with rpath capability would
> do the same thing.  So a perl-only solution may be pointless.

On my system (Linux) and on FreeBSD 4.1.1 (hub.org) libtool does exactly
what our code does:  it installs the library file and creates two
symlinks.  Relinking will only happen on the platforms listed above.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Coping with 'C' vs 'newC' function language names
Next
From: Larry Rosenman
Date:
Subject: NEW Inet/Cidr