Skip to content

Commit afa6ee7

Browse files
shawnlaffanmohawk2
authored andcommitted
Win32: Search for pl2bat.bat in the path
And specify its full path in the generated Makefile.
1 parent 0309317 commit afa6ee7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/ExtUtils/MM_Win32.pm

+3-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ sub init_tools {
148148
$self->{FIXIN} = "\$(PERLRUN) -I${psrc}\\cpan\\ExtUtils-PL2Bat\\lib ${psrc}\\win32\\bin\\pl2bat.pl";
149149
}
150150
else {
151-
my $p2bpath = "$Config{installscript}\\pl2bat.bat";
152-
$self->{FIXIN} = -e $p2bpath ? qq{"$p2bpath"} : 'pl2bat.bat';
151+
my @path = split $Config{path_sep}, $ENV{PATH};
152+
my @found = grep {-e qq{$_\\pl2bat.bat}} @path;
153+
$self->{FIXIN} = @found ? qq{"$found[0]\\pl2bat.bat"} : "pl2bat.bat";
153154
}
154155
}
155156

0 commit comments

Comments
 (0)