Hi,
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)
attached is a patch that fixes it for Unix-style OSs
This is perl5.6.1 on NetBSD 1.6.1_STABLE btw
best regards
-- jochen
--- 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");