Skip to content

Commit 170beb6

Browse files
committed
Back-compat linkext -> subdirs_(perl-linktype) if LINKTYPE= and DIR
1 parent b8a7110 commit 170beb6

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

lib/ExtUtils/MM_Unix.pm

+11-4
Original file line numberDiff line numberDiff line change
@@ -2389,13 +2389,20 @@ Defines the linkext target which in turn defines the LINKTYPE.
23892389
23902390
=cut
23912391

2392+
# LINKTYPE => static or dynamic or ''
23922393
sub linkext {
23932394
my($self, %attribs) = @_;
2394-
# LINKTYPE => static or dynamic or ''
2395-
my($linktype) = defined $attribs{LINKTYPE} ?
2396-
$attribs{LINKTYPE} : '$(LINKTYPE)';
2395+
my $extra = ''; # so if LINKTYPE eq '' and there are DIR
2396+
# we can bring in subdirs_(perl-linktype) for back-compat
2397+
my $linktype = $attribs{LINKTYPE};
2398+
$linktype = $self->{LINKTYPE} unless defined $linktype;
2399+
if (defined $linktype and $linktype eq '' and @{ $self->{DIR} || [] }) {
2400+
warn "Warning: LINKTYPE set to '', no longer necessary\n";
2401+
$extra = 'subdirs_' . $Config{usedl} ? 'dynamic' : 'static';
2402+
}
2403+
$linktype = '$(LINKTYPE)' unless defined $linktype;
23972404
"
2398-
linkext :: $linktype
2405+
linkext :: $linktype $extra
23992406
\$(NOECHO) \$(NOOP)
24002407
";
24012408
}

0 commit comments

Comments
 (0)