summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-09 21:49:06 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-09 21:49:06 +0000
commit2719e44e3c294b9717dbffb981c84b1e16b8f562 (patch)
tree00ec86403b85923d4bc7f5d2cff20d7bba6e6365 /lib
parent571b764929975cea697f7f11a3b6375f1dc81d7c (diff)
downloadperl-2719e44e3c294b9717dbffb981c84b1e16b8f562.tar.gz
Apply NetBSD patch-ag: shared/static linking,
but make the change less intrusive on non-NetBSD. p4raw-id: //depot/perl@13568
Diffstat (limited to 'lib')
-rw-r--r--lib/ExtUtils/MM_Unix.pm27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
index 7951fc11d3..f04be9ce0f 100644
--- a/lib/ExtUtils/MM_Unix.pm
+++ b/lib/ExtUtils/MM_Unix.pm
@@ -1088,6 +1088,12 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists
my $ldrun = qq{-rpath "$self->{LD_RUN_PATH}"}
if ($^O eq 'irix' && $self->{LD_RUN_PATH});
+ my $libs = $self->{LDLOADLIBS};
+
+ if ($^O eq 'netbsd') {
+ $libs = '$(LLIBPERL)';
+ }
+
# For example in AIX the shared objects/libraries from previous builds
# linger quite a while in the shared dynalinker cache even when nobody
# is using them. This is painful if one for instance tries to restart
@@ -1096,8 +1102,9 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists
push(@m,' $(RM_F) $@
');
- push(@m,' LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) '.$ldrun.' $(LDDLFLAGS) '.$ldfrom.
- ' $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST)');
+ push(@m,
+' LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) '.$ldrun.' $(LDDLFLAGS) '.$ldfrom.
+' $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) $(PERL_ARCHIVE) '.$libs.' $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST)');
push @m, '
$(CHMOD) $(PERM_RWX) $@
';
@@ -3207,6 +3214,22 @@ Defines the realclean target.
sub realclean {
my($self, %attribs) = @_;
my(@m);
+
+ # Set LLIBPERL to nothing on static perl platforms, and to the flags
+ # needed to link against the shared libperl library on shared perl
+ # platforms. We peek at lddlflags to see if we need -Wl,-R or -R
+ # to add paths to the run-time library search path.
+ #
+ my($llibperl) = '';
+ if ($Config{'useshrplib'}) {
+ if ($Config{'lddlflags'} =~ /-Wl,-R/) {
+ $llibperl = '-L$(PERL_INC) -Wl,-R$(INSTALLARCHLIB)/CORE -lperl';
+ } elsif ($Config{'lddlflags'} =~ /-R/) {
+ $llibperl = '-L$(PERL_INC) -R$(INSTALLARCHLIB)/CORE -lperl';
+ }
+ }
+ push(@m,'LLIBPERL = '.$llibperl."\n");
+
push(@m,'
# Delete temporary files (via clean) and also delete installed files
realclean purge :: clean