Skip to content

Commit b51707c

Browse files
committed
Introduce an INST_SHARE pseudo-target
This is not a real installation directory yet, because the backend (ExtUtils::Install and %Config) don't support that yet.
1 parent 84d63ab commit b51707c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/ExtUtils/MM_Any.pm

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,6 +1938,8 @@ sub init_INST {
19381938
$self->{INST_ARCHAUTODIR} = $self->catdir('$(INST_ARCHLIB)', 'auto',
19391939
'$(FULLEXT)');
19401940

1941+
$self->{INST_SHARE} ||= $self->catdir('$(INST_LIB)', 'auto', 'share');
1942+
19411943
$self->{INST_SCRIPT} ||= $self->catdir($Curdir,'blib','script');
19421944

19431945
$self->{INST_MAN1DIR} ||= $self->catdir($Curdir,'blib','man1');
@@ -2957,25 +2959,25 @@ sub sharedir {
29572959
return '' unless %share;
29582960

29592961
my %files;
2960-
_sharedir_find_files(\%files, $share{dist}, File::Spec->catdir('$(INST_LIB)', qw(auto share dist), '$(DISTNAME)'), \%share) if $share{dist};
2962+
$self->_sharedir_find_files(\%files, $share{dist}, [qw/ $(INST_SHARE) dist $(DISTNAME) /], \%share) if $share{dist};
29612963
for my $module (keys %{ $share{module} || {} }) {
2962-
my $destination = File::Spec->catdir('$(INST_LIB)', qw(auto share module), $module);
2963-
_sharedir_find_files(\%files, $share{module}{$module}, $destination, \%share);
2964+
my $destination = [ qw/$(INST_SHARE) module/, $module ];
2965+
$self->_sharedir_find_files(\%files, $share{module}{$module}, $destination, \%share);
29642966
}
29652967
my $pm_to_blib = $self->oneliner(q{pm_to_blib({@ARGV}, '$(INST_LIB)')}, ['-MExtUtils::Install']);
29662968
return "\npure_all :: sharedir\n\nsharedir : \n" . join '', map { "\t\$(NOECHO) $_\n" } $self->split_command($pm_to_blib, %files);
29672969
}
29682970

29692971
sub _sharedir_find_files {
2970-
my ($files, $source, $sink, $options) = @_;
2972+
my ($self, $files, $source, $sink, $options) = @_;
29712973
File::Find::find({
29722974
wanted => sub {
29732975
if (-d) {
29742976
$File::Find::prune = 1 if $options->{skip_dotdir} && /^\./;
29752977
return;
29762978
}
29772979
return if $options->{skip_dotfile} && /^\./;
2978-
$files->{$_} = File::Spec->catfile($sink, $_);
2980+
$files->{$_} = $self->catfile(@{$sink}, $_);
29792981
},
29802982
no_chdir => 1,
29812983
}, $source);

lib/ExtUtils/MM_Unix.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ INST_ARCHLIBDIR = $self->{INST_ARCHLIBDIR}
476476
477477
INST_AUTODIR = $self->{INST_AUTODIR}
478478
INST_ARCHAUTODIR = $self->{INST_ARCHAUTODIR}
479+
INST_SHARE = $self->{INST_SHARE}
479480
480481
INST_STATIC = $self->{INST_STATIC}
481482
INST_DYNAMIC = $self->{INST_DYNAMIC}

0 commit comments

Comments
 (0)