On Sun, Nov 02, 2003 at 09:50:48PM +0100, Jochen Eisinger wrote:
> I have a Makefile.PL here to which I pass
> LIB=/usr/pkg/perl-extension/perl5/i386-netbsd (because I want it to be
> installed there), my perl is installed in /usr/pkg/perl5/5.6.1/i386-netbsd
> 
> Now the MakeMaker puts this as LLIBPERL in the dynamic_lib section:
> 
> LLIBPERL=-L$(PERL_INC) -Wl,-R$(INSTALLARCHLIB)/CORE -lperl
> 
> mhm, but I wanted to install my extension to INSTALLARCHLIB, I didn't
> say I have my perl installed there. All in all this results in a .so
> file for my extension that cannot be loaded because it contains a fubar
> rpath.
> 
> >From the comments in MM_Unix.pm I guess LLIBPERL should be the flags
> needed to link against libperl.so.
> 
> I think it should expand to
> 
> LLIBPERL=-L$(PERL_INC) -Wl,-R$(INSTALLARCHLIB)/CORE \
>   -Wl,-R$(PERL_ARCHLIB)/CORE -lperl
> 
> If you have a local copy of libperl.so, it works (that's what it does at
> the moment). If not, it uses your default libperl.so (doesn't work now,
> a bug IMHO)

This sounds logical, but I'd like someone more familiar with static
builds to put their stamp on it.


> This is perl5.6.1 on NetBSD 1.6.1_STABLE btw

The code below doesn't quite correspond to any version of MakeMaker I know.
Its close enough that I can adapt it, but the changes are much less than
trivial.  I don't suppose you could point me at a list of NetBSD patches
to MakeMaker so I might find out what they're up to and possibly
incorporate them?


> --- MM_Unix.pm.orig   Sun Nov  2 20:39:53 2003
> +++ MM_Unix.pm        Sun Nov  2 20:40:46 2003
> @@ -1068,9 +1068,9 @@
>      my($llibperl) = '';
>      if (($^O eq 'netbsd') and ($Config{'useshrplib'} eq 'true')) {
>       if ($Config{'lddlflags'} =~ /-Wl,-R/) {
> -         $llibperl = '-L$(PERL_INC) -Wl,-R$(INSTALLARCHLIB)/CORE -lperl';
> +         $llibperl = '-L$(PERL_INC) -Wl,-R$(INSTALLARCHLIB)/CORE 
> -Wl,-R$(PERL_ARCHLIB)/CORE -lperl';
>       } elsif ($Config{'lddlflags'} =~ /-R/) {
> -         $llibperl = '-L$(PERL_INC) -R$(INSTALLARCHLIB)/CORE -lperl';
> +         $llibperl = '-L$(PERL_INC) -R$(INSTALLARCHLIB)/CORE -R$(PERL_ARCHLIB)/CORE 
> -lperl';
>       }
>      }
>      push(@m,'LLIBPERL = '.$llibperl."\n");


-- 
Michael G Schwern        [EMAIL PROTECTED]  http://www.pobox.com/~schwern/
How can you get very far,
If you don't know Who You Are?
How can you do what you ought,
If you don't know What You've Got?

Reply via email to