I made the following patch, and it works for MY platform.

Peter,
    Can we do something similar for the distribution to set the
RUNPATH for Pg.so? 


Index: Makefile.PL
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/perl5/Makefile.PL,v
retrieving revision 1.17
diff -c -r1.17 Makefile.PL
*** Makefile.PL	2001/03/06 22:07:09	1.17
--- Makefile.PL	2001/08/13 04:12:28
***************
*** 64,66 ****
--- 64,77 ----
  ];
  
  }
+ sub MY::dynamic_lib {
+       package MY;
+       my $inherited= shift->SUPER::dynamic_lib(@_);
+       if (! -d $ENV{POSTGRES_LIB} ) {
+        my $cwd = `pwd`;
+       chop $cwd;
+       $ENV{POSTGRES_LIB} = "$cwd/../libpq";
+       }
+       $inherited=~ s@OTHERLDFLAGS =@OTHERLDFLAGS =-R$ENV{POSTGRES_LIB}@;
+       $inherited;
+ }

-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

Sun, 12 Aug 2001 23:14:00 -0500
Larry Rosenman <ler@lerctr.org>
Makefile.PL for Pg.so
Larry Rosenman writes:

> I made the following patch, and it works for MY platform.
>
> Peter,
>     Can we do something similar for the distribution to set the
> RUNPATH for Pg.so?

This is an interesting idea.  I'd rather rip out MakeMaker completely, but
this might be a good start.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Wed, 15 Aug 2001 00:02:24 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: [PATCHES] Makefile.PL for Pg.so
* Peter Eisentraut <peter_e@gmx.net> [010814 16:58]:
> Larry Rosenman writes:
> 
> > I made the following patch, and it works for MY platform.
> >
> > Peter,
> >     Can we do something similar for the distribution to set the
> > RUNPATH for Pg.so?
> 
> This is an interesting idea.  I'd rather rip out MakeMaker completely, but
> this might be a good start.
I'm not familiar enough with the config / autoconf stuff to do a
portable patch.  Can you help in this area?

LER
> 
> -- 
> Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter

-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

Tue, 14 Aug 2001 17:38:36 -0500
Larry Rosenman <ler@lerctr.org>
Re: [PATCHES] Makefile.PL for Pg.so
* Peter Eisentraut <peter_e@gmx.net> [010825 18:14]:
> Larry Rosenman writes:
> 
> >     Can we do something similar for the distribution to set the
> > RUNPATH for Pg.so?
> 
> AFAICT, Pg.so does get the runpath set correctly.  Are you saying it
> doesn't work on your system or do you want to get rid of the
> recompilation during installation?
It doesn't work on this systsm . 

(you still have a login here). 

LER

> 
> -- 
> Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter

-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

Sat, 25 Aug 2001 18:15:33 -0500
Larry Rosenman <ler@lerctr.org>
Re: [PATCHES] Makefile.PL for Pg.so
Larry Rosenman writes:

>     Can we do something similar for the distribution to set the
> RUNPATH for Pg.so?

AFAICT, Pg.so does get the runpath set correctly.  Are you saying it
doesn't work on your system or do you want to get rid of the
recompilation during installation?

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Sun, 26 Aug 2001 01:18:17 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: [PATCHES] Makefile.PL for Pg.so
* Peter Eisentraut <peter_e@gmx.net> [010825 18:14]:
> Larry Rosenman writes:
> 
> >     Can we do something similar for the distribution to set the
> > RUNPATH for Pg.so?
> 
> AFAICT, Pg.so does get the runpath set correctly.  Are you saying it
> doesn't work on your system or do you want to get rid of the
> recompilation during installation?
> 
Oh, BTW, LD_RUN_PATH is *NOT* used to set the runpath on SVR5.  That's
why I needed to pass -R to the build. 

LER

> -- 
> Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter

-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

Sat, 25 Aug 2001 19:18:55 -0500
Larry Rosenman <ler@lerctr.org>
Re: [PATCHES] Makefile.PL for Pg.so
On Saturday 25 August 2001 19:18, Peter Eisentraut wrote:
> AFAICT, Pg.so does get the runpath set correctly.  Are you saying it
> doesn't work on your system or do you want to get rid of the
> recompilation during installation?

Pg.so does not get the proper RPATH in a DESTDIR build environment.

Trying to fix this for the RPMS -- the RPATH contains the buildroot instead 
of where the libs really are.  Could cause security problems.  Working on it, 
but it's slow going for me at this busy time.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Sun, 26 Aug 2001 01:05:09 -0400
Lamar Owen <lamar.owen@wgcr.org>
Re: Re: [PATCHES] Makefile.PL for Pg.so
Lamar Owen writes:

> Pg.so does not get the proper RPATH in a DESTDIR build environment.
>
> Trying to fix this for the RPMS -- the RPATH contains the buildroot instead
> of where the libs really are.  Could cause security problems.  Working on it,
> but it's slow going for me at this busy time.

Another fun feature of the DESTDIR build environment is that the
writability test of the target directory will most likely fail because it
doesn't exist at all.

I've been thinking how I'd like to fix this:  We add an option to
configure that says to *not* install the Perl module into the standard
Perl tree, but instead somewhere under our own $prefix.  That way people
that don't have root access can use this option and still install the
whole tree in one run.  But then we'd remove that writability check and
people that have root access or failed to use that option will get a hard
failure.  This would create a much more reliable and predictable build
environment.

Comments?  And a good name for such an option?

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Sun, 26 Aug 2001 14:37:25 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: Re: [PATCHES] Makefile.PL for Pg.so
Peter Eisentraut <peter_e@gmx.net> writes:
> Another fun feature of the DESTDIR build environment is that the
> writability test of the target directory will most likely fail because it
> doesn't exist at all.

> I've been thinking how I'd like to fix this:  We add an option to
> configure that says to *not* install the Perl module into the standard
> Perl tree, but instead somewhere under our own $prefix.  That way people
> that don't have root access can use this option and still install the
> whole tree in one run.  But then we'd remove that writability check and
> people that have root access or failed to use that option will get a hard
> failure.  This would create a much more reliable and predictable build
> environment.

Why would we remove the writability check?  Perhaps it needs to be
extended to recognize the case of target-dir-doesn't-exist-but-can-be-
created, but I don't see why a hard failure is better.

			regards, tom lane

Sun, 26 Aug 2001 12:11:25 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Re: [PATCHES] Makefile.PL for Pg.so 
* Tom Lane <tgl@sss.pgh.pa.us> [010826 11:11]:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Another fun feature of the DESTDIR build environment is that the
> > writability test of the target directory will most likely fail because it
> > doesn't exist at all.
> 
> > I've been thinking how I'd like to fix this:  We add an option to
> > configure that says to *not* install the Perl module into the standard
> > Perl tree, but instead somewhere under our own $prefix.  That way people
> > that don't have root access can use this option and still install the
> > whole tree in one run.  But then we'd remove that writability check and
> > people that have root access or failed to use that option will get a hard
> > failure.  This would create a much more reliable and predictable build
> > environment.
> 
> Why would we remove the writability check?  Perhaps it needs to be
> extended to recognize the case of target-dir-doesn't-exist-but-can-be-
> created, but I don't see why a hard failure is better.
I tend to agree with Tom here.  The original problem I was seeing is
*NOT* related to DESTDIR (I don't believe). 

CC=cc CXX=CC ./configure  --prefix=/usr/local/pgsql --enable-syslog \
	--with-CXX --with-perl --enable-multibyte --enable-cassert \
	--with-includes=/usr/local/include --with-libs=/usr/local/lib \
	--enable-debug \
	--with-tcl --with-tclconfig=/usr/local/lib \
	--with-tkconfig=/usr/local/lib  --enable-locale --with-python

The above is my configure input. 
> 
> 			regards, tom lane

-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

Sun, 26 Aug 2001 12:48:11 -0500
Larry Rosenman <ler@lerctr.org>
Re: Re: [PATCHES] Makefile.PL for Pg.so
Lamar Owen <lamar.owen@wgcr.org> writes:

> On Saturday 25 August 2001 19:18, Peter Eisentraut wrote:
> > AFAICT, Pg.so does get the runpath set correctly.  Are you saying it
> > doesn't work on your system or do you want to get rid of the
> > recompilation during installation?
> 
> Pg.so does not get the proper RPATH in a DESTDIR build environment.

Rather: Perl decides it wants to specify a LD_RUN_PATH in its makefile. 
This will automatically make use of -R. It's fixed in the RPMs
available at http://people.redhat.com/teg/pg/

-- 
Trond Eivind Glomsrï¿½d
Red Hat, Inc.

26 Aug 2001 14:46:54 -0400
teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
Re: Re: [PATCHES] Makefile.PL for Pg.so
Trond Eivind Glomsrï¿½d writes:

> > Pg.so does not get the proper RPATH in a DESTDIR build environment.
>
> Rather: Perl decides it wants to specify a LD_RUN_PATH in its makefile.
> This will automatically make use of -R. It's fixed in the RPMs
> available at http://people.redhat.com/teg/pg/

AFAICT, these RPMs still contain the same problem that the runpath will
point the the temporary installation directory, not the final location.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Sun, 26 Aug 2001 22:05:44 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: Re: [PATCHES] Makefile.PL for Pg.so
Peter Eisentraut <peter_e@gmx.net> writes:

> Trond Eivind Glomsrï¿½d writes:
> 
> > > Pg.so does not get the proper RPATH in a DESTDIR build environment.
> >
> > Rather: Perl decides it wants to specify a LD_RUN_PATH in its makefile.
> > This will automatically make use of -R. It's fixed in the RPMs
> > available at http://people.redhat.com/teg/pg/
> 
> AFAICT, these RPMs still contain the same problem that the runpath will
> point the the temporary installation directory, not the final location.

Doh... these were just temporary rpms, I've put the final -2 rpms
there now (built later the same day).

Basically, I fixed it by removing references to LD_RUN_PATH after perl
had generated it.
-- 
Trond Eivind Glomsrï¿½d
Red Hat, Inc.

26 Aug 2001 16:09:45 -0400
teg@redhat.com (Trond Eivind =?iso-8859-1?q?Glomsr=F8d?=)
Re: Re: [PATCHES] Makefile.PL for Pg.so
* Peter Eisentraut <peter_e@gmx.net> [010826 17:42]:
> I've checked in a fix for the runpath, DESTDIR, and VPATH problems.  The
> first needs to be tested on a variety of platforms because I had to guess
> the osname configuration values and the linker/compiler that Perl uses.
I ass/u/me that you tested it on lerami? 

LER

-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

Sun, 26 Aug 2001 17:43:38 -0500
Larry Rosenman <ler@lerctr.org>
Re: Re: [PATCHES] Makefile.PL for Pg.so
I've checked in a fix for the runpath, DESTDIR, and VPATH problems.  The
first needs to be tested on a variety of platforms because I had to guess
the osname configuration values and the linker/compiler that Perl uses.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Mon, 27 Aug 2001 00:46:47 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: Re: [PATCHES] Makefile.PL for Pg.so

Can someone comment on this?


> I made the following patch, and it works for MY platform.
> 
> Peter,
>     Can we do something similar for the distribution to set the
> RUNPATH for Pg.so? 
> 
> 
> Index: Makefile.PL
> ===================================================================
> RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/perl5/Makefile.PL,v
> retrieving revision 1.17
> diff -c -r1.17 Makefile.PL
> *** Makefile.PL	2001/03/06 22:07:09	1.17
> --- Makefile.PL	2001/08/13 04:12:28
> ***************
> *** 64,66 ****
> --- 64,77 ----
>   ];
>   
>   }
> + sub MY::dynamic_lib {
> +       package MY;
> +       my $inherited= shift->SUPER::dynamic_lib(@_);
> +       if (! -d $ENV{POSTGRES_LIB} ) {
> +        my $cwd = `pwd`;
> +       chop $cwd;
> +       $ENV{POSTGRES_LIB} = "$cwd/../libpq";
> +       }
> +       $inherited=~ s@OTHERLDFLAGS =@OTHERLDFLAGS =-R$ENV{POSTGRES_LIB}@;
> +       $inherited;
> + }
> 
> -- 
> Larry Rosenman                     http://www.lerctr.org/~ler
> Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
> US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Fri, 7 Sep 2001 14:25:47 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Makefile.PL for Pg.so
I think peter_e dealt with this....

LER

* Bruce Momjian <pgman@candle.pha.pa.us> [010907 13:25]:
> 
> Can someone comment on this?
> 
> 
> > I made the following patch, and it works for MY platform.
> > 
> > Peter,
> >     Can we do something similar for the distribution to set the
> > RUNPATH for Pg.so? 
> > 
> > 
> > Index: Makefile.PL
> > ===================================================================
> > RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/perl5/Makefile.PL,v
> > retrieving revision 1.17
> > diff -c -r1.17 Makefile.PL
> > *** Makefile.PL	2001/03/06 22:07:09	1.17
> > --- Makefile.PL	2001/08/13 04:12:28
> > ***************
> > *** 64,66 ****
> > --- 64,77 ----
> >   ];
> >   
> >   }
> > + sub MY::dynamic_lib {
> > +       package MY;
> > +       my $inherited= shift->SUPER::dynamic_lib(@_);
> > +       if (! -d $ENV{POSTGRES_LIB} ) {
> > +        my $cwd = `pwd`;
> > +       chop $cwd;
> > +       $ENV{POSTGRES_LIB} = "$cwd/../libpq";
> > +       }
> > +       $inherited=~ s@OTHERLDFLAGS =@OTHERLDFLAGS =-R$ENV{POSTGRES_LIB}@;
> > +       $inherited;
> > + }
> > 
> > -- 
> > Larry Rosenman                     http://www.lerctr.org/~ler
> > Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
> > US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
> > 
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> > 
> 
> -- 
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

Fri, 7 Sep 2001 13:35:39 -0500
Larry Rosenman <ler@lerctr.org>
Re: Makefile.PL for Pg.so

Yes, thanks.  Cleaning out my mailbox, as usualy before a beta.



> I think peter_e dealt with this....
> 
> LER
> 
> * Bruce Momjian <pgman@candle.pha.pa.us> [010907 13:25]:
> > 
> > Can someone comment on this?
> > 
> > 
> > > I made the following patch, and it works for MY platform.
> > > 
> > > Peter,
> > >     Can we do something similar for the distribution to set the
> > > RUNPATH for Pg.so? 
> > > 
> > > 
> > > Index: Makefile.PL
> > > ===================================================================
> > > RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/perl5/Makefile.PL,v
> > > retrieving revision 1.17
> > > diff -c -r1.17 Makefile.PL
> > > *** Makefile.PL	2001/03/06 22:07:09	1.17
> > > --- Makefile.PL	2001/08/13 04:12:28
> > > ***************
> > > *** 64,66 ****
> > > --- 64,77 ----
> > >   ];
> > >   
> > >   }
> > > + sub MY::dynamic_lib {
> > > +       package MY;
> > > +       my $inherited= shift->SUPER::dynamic_lib(@_);
> > > +       if (! -d $ENV{POSTGRES_LIB} ) {
> > > +        my $cwd = `pwd`;
> > > +       chop $cwd;
> > > +       $ENV{POSTGRES_LIB} = "$cwd/../libpq";
> > > +       }
> > > +       $inherited=~ s@OTHERLDFLAGS =@OTHERLDFLAGS =-R$ENV{POSTGRES_LIB}@;
> > > +       $inherited;
> > > + }
> > > 
> > > -- 
> > > Larry Rosenman                     http://www.lerctr.org/~ler
> > > Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
> > > US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
> > > 
> > > ---------------------------(end of broadcast)---------------------------
> > > TIP 2: you can get off all lists at once with the unregister command
> > >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> > > 
> > 
> > -- 
> >   Bruce Momjian                        |  http://candle.pha.pa.us
> >   pgman@candle.pha.pa.us               |  (610) 853-3000
> >   +  If your life is a hard drive,     |  830 Blythe Avenue
> >   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
> 
> -- 
> Larry Rosenman                     http://www.lerctr.org/~ler
> Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
> US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Fri, 7 Sep 2001 14:48:42 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: Makefile.PL for Pg.so
Bruce Momjian writes:

> Can someone comment on this?

It's done.

>
>
> > I made the following patch, and it works for MY platform.
> >
> > Peter,
> >     Can we do something similar for the distribution to set the
> > RUNPATH for Pg.so?
> >
> >
> > Index: Makefile.PL
> > ===================================================================
> > RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/perl5/Makefile.PL,v
> > retrieving revision 1.17
> > diff -c -r1.17 Makefile.PL
> > *** Makefile.PL	2001/03/06 22:07:09	1.17
> > --- Makefile.PL	2001/08/13 04:12:28
> > ***************
> > *** 64,66 ****
> > --- 64,77 ----
> >   ];
> >
> >   }
> > + sub MY::dynamic_lib {
> > +       package MY;
> > +       my $inherited= shift->SUPER::dynamic_lib(@_);
> > +       if (! -d $ENV{POSTGRES_LIB} ) {
> > +        my $cwd = `pwd`;
> > +       chop $cwd;
> > +       $ENV{POSTGRES_LIB} = "$cwd/../libpq";
> > +       }
> > +       $inherited=~ s@OTHERLDFLAGS =@OTHERLDFLAGS =-R$ENV{POSTGRES_LIB}@;
> > +       $inherited;
> > + }
> >
> > --
> > Larry Rosenman                     http://www.lerctr.org/~ler
> > Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
> > US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> >
>
>

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Fri, 7 Sep 2001 20:51:48 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: [PATCHES] Makefile.PL for Pg.so