Update of /cvsroot/module-build/Module-Build/lib/Module/Build/Platform
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24597/lib/Module/Build/Platform
Modified Files:
Windows.pm
Log Message:
Find pl2bat differently when building in the core
Index: Windows.pm
===================================================================
RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Platform/Windows.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- Windows.pm 3 Dec 2005 03:08:14 -0000 1.25
+++ Windows.pm 21 Jan 2006 18:05:01 -0000 1.26
@@ -13,14 +13,32 @@
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
+
+ $self->_find_pl2bat();
+ return $self;
+}
+
+
+sub _find_pl2bat {
+ my $self = shift;
my $cf = $self->{config};
# Find 'pl2bat.bat' utility used for installing perl scripts.
# This search is probably overkill, as I've never met a MSWin32 perl
# where these locations differed from each other.
- my @potential_dirs = map { File::Spec->canonpath($_) }
- @${cf}{qw(installscript installbin installsitebin installvendorbin)},
- File::Basename::dirname($self->{properties}{perl});
+
+ my @potential_dirs;
+
+ if ( $ENV{PERL_CORE} ) {
+
+ require ExtUtils::CBuilder;
+ @potential_dirs = File::Spec->catdir( ExtUtils::CBuilder->new()->perl_src(),
+ qw/win32 bin/ );
+ } else {
+ @potential_dirs = map { File::Spec->canonpath($_) }
+ @${cf}{qw(installscript installbin installsitebin installvendorbin)},
+ File::Basename::dirname($self->{properties}{perl});
+ }
foreach my $dir (@potential_dirs) {
my $potential_file = File::Spec->catfile($dir, 'pl2bat.bat');
@@ -29,8 +47,6 @@
last;
}
}
-
- return $self;
}
sub make_executable {
@@ -49,7 +65,7 @@
(my $script_bat = $script) =~ s/\.plx?//i;
$script_bat .= '.bat' unless $script_bat =~ /\.bat$/i;
- my $status = $self->do_system($pl2bat, '<', $script, '>', $script_bat);
+ my $status = $self->do_system("$self->{properties}{perl} $pl2bat < $script > $script_bat");
if ( $status && -f $script_bat ) {
$self->SUPER::make_executable($script_bat);
} else {
|