Skip to content

Commit 97e4609

Browse files
committed
Revert "RT #129386 remove Cygwin override of maybe_command()"
This reverts commit fa269b9. Tests fail on all Cygwin installations I have with my own compiled perls and with Cygwin packaged perl. Needs more investigation.
1 parent 5230f9b commit 97e4609

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/ExtUtils/MM_Cygwin.pm

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,26 @@ sub init_linker {
100100
$self->{EXPORT_LIST} ||= '';
101101
}
102102

103+
=item maybe_command
104+
105+
Determine whether a file is native to Cygwin by checking whether it
106+
resides inside the Cygwin installation (using Windows paths). If so,
107+
use C<ExtUtils::MM_Unix> to determine if it may be a command.
108+
Otherwise use the tests from C<ExtUtils::MM_Win32>.
109+
110+
=cut
111+
112+
sub maybe_command {
113+
my ($self, $file) = @_;
114+
115+
my $cygpath = Cygwin::posix_to_win_path('/', 1);
116+
my $filepath = Cygwin::posix_to_win_path($file, 1);
117+
118+
return (substr($filepath,0,length($cygpath)) eq $cygpath)
119+
? $self->SUPER::maybe_command($file) # Unix
120+
: ExtUtils::MM_Win32->maybe_command($file); # Win32
121+
}
122+
103123
=item dynamic_lib
104124
105125
Use the default to produce the *.dll's.

0 commit comments

Comments
 (0)