Skip to content

Commit a2149d7

Browse files
committed
Add override of xs_make_dynamic_lib for OS390
1 parent 08ae8d7 commit a2149d7

File tree

1 file changed

+50
-3
lines changed

1 file changed

+50
-3
lines changed

lib/ExtUtils/MM_OS390.pm

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,55 @@ OS390.
2424
2525
Unless otherwise stated it works just like ExtUtils::MM_Unix.
2626
27+
=head2 Overriden methods
28+
29+
=over
30+
31+
=item xs_make_dynamic_lib
32+
33+
Defines the recipes for the C<dynamic_lib> section.
34+
35+
=cut
36+
37+
sub xs_make_dynamic_lib {
38+
my ($self, $attribs, $object, $to, $todir, $ldfrom, $exportlist, $dlsyms) = @_;
39+
$exportlist = '' if $exportlist ne '$(EXPORT_LIST)';
40+
my $armaybe = $self->_xs_armaybe($attribs);
41+
my @m = sprintf '%s : %s $(MYEXTLIB) %s$(DFSEP).exists %s $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) %s'."\n", $to, $object, $todir, $exportlist, ($dlsyms || '');
42+
my $dlsyms_arg = $self->xs_dlsyms_arg($dlsyms);
43+
if ($armaybe ne ':'){
44+
$ldfrom = 'tmp$(LIB_EXT)';
45+
push(@m," \$(ARMAYBE) cr $ldfrom $object\n");
46+
push(@m," \$(RANLIB) $ldfrom\n");
47+
}
48+
49+
# For example in AIX the shared objects/libraries from previous builds
50+
# linger quite a while in the shared dynalinker cache even when nobody
51+
# is using them. This is painful if one for instance tries to restart
52+
# a failed build because the link command will fail unnecessarily 'cos
53+
# the shared object/library is 'busy'.
54+
push(@m," \$(RM_F) \$\@\n");
55+
56+
my $libs = '$(LDLOADLIBS)';
57+
58+
my $ld_run_path_shell = "";
59+
if ($self->{LD_RUN_PATH} ne "") {
60+
$ld_run_path_shell = 'LD_RUN_PATH="$(LD_RUN_PATH)" ';
61+
}
62+
63+
push @m, sprintf <<'MAKE', $ld_run_path_shell, $dlsyms_arg, $self->xs_obj_opt('$@'), $ldfrom, $libs, $exportlist;
64+
%s$(LD) $(LDDLFLAGS) %s $(OTHERLDFLAGS) %s $(MYEXTLIB) %s \
65+
$(PERL_ARCHIVE) %s $(PERL_ARCHIVE_AFTER) %s \
66+
$(INST_DYNAMIC_FIX)
67+
$(CHMOD) $(PERM_RWX) $@
68+
MAKE
69+
join '', @m;
70+
}
71+
72+
1;
73+
74+
=back
75+
2776
=head1 AUTHOR
2877
2978
Michael G Schwern <[email protected]> with code from ExtUtils::MM_Unix
@@ -33,6 +82,4 @@ Michael G Schwern <[email protected]> with code from ExtUtils::MM_Unix
3382
L<ExtUtils::MakeMaker>
3483
3584
=cut
36-
37-
38-
1;
85+
__END__

0 commit comments

Comments
 (0)