Front page | perl.vmsperl |
Postings from December 2001
[PATCH lib/ExtUtils/MM_Unix.pm] miniperl found before perl?
Thread Next
From:
Michael G Schwern
Date:
December 16, 2001 14:53
Subject:
[PATCH lib/ExtUtils/MM_Unix.pm] miniperl found before perl?
Message ID:
20011216225354.GE8900@blackrider
I just recently tried to install a module (Test::Harness 2.00) using
bleadperl on VMS and noticed it was using miniperl. bleadperl's
perl_setup.com doesn't define a miniperl symbol, but I had one left
over from 5.005_03 and it was pointing there. So the build choked
when it tried to use the 5.006 only ExtUtils::Installed with a
5.005_03 miniperl.
So, there's two things going on here.
1) Why is MakeMaker looking for miniperl?
2) Should perl_setup.com define it?
I think the answer to #1 is "because it needs it when building the
core". That can be made more elegant by only looking for miniperl if
PERL_CORE is set. I can fix it in ExtUtils::MM_Unix (patch below),
but somebody else is going to have to fix this in MM_VMS:
# Check miniperl before perl, and check names likely to contain
# version numbers before "generic" names, so we pick up an
# executable that's less likely to be from an old installation.
@snames = sort { my($ba) = $a =~ m!([^:>\]/]+)$!; # basename
my($bb) = $b =~ m!([^:>\]/]+)$!;
my($ahasdir) = (length($a) - length($ba) > 0);
my($bhasdir) = (length($b) - length($bb) > 0);
if ($ahasdir and not $bhasdir) { return 1; }
elsif ($bhasdir and not $ahasdir) { return -1; }
else { $bb =~ /\d/ <=> $ba =~ /\d/
or substr($ba,0,1) cmp substr($bb,0,1)
or length($bb) <=> length($ba) } } @$names;
#2 is for the VMS folks to decide.
--- lib/ExtUtils/MM_Unix.pm 2001/12/16 22:43:42 1.1
+++ lib/ExtUtils/MM_Unix.pm 2001/12/16 22:48:04
@@ -2035,16 +2035,27 @@
# --- Initialize Perl Binary Locations
# Find Perl 5. The only contract here is that both 'PERL' and 'FULLPERL'
- # will be working versions of perl 5. miniperl has priority over perl
- # for PERL to ensure that $(PERL) is usable while building ./ext/*
+ # will be working versions of perl 5.
my ($component,@defpath);
- foreach $component ($self->{PERL_SRC}, $self->path(), $Config::Config{binexp}) {
+ foreach $component ($self->{PERL_SRC}, $self->path(),
+ $Config::Config{binexp})
+ {
push @defpath, $component if defined $component;
}
+
+ my @perls = ($self->canonpath($^X), 'perl', 'perl5', "perl$Config{version}");
+
+ # miniperl has priority over all but the cannonical perl when in the
+ # core. Otherwise its a last resort.
+ if( $self->{PERL_CORE} ) {
+ splice @perls, 1, 0, 'miniperl';
+ }
+ else {
+ push @perls, 'miniperl';
+ }
+
$self->{PERL} ||=
- $self->find_perl(5.0, [ $self->canonpath($^X), 'miniperl',
- 'perl','perl5',"perl$Config{version}" ],
- \@defpath, $Verbose );
+ $self->find_perl(5.0, \@perls, \@defpath, $Verbose );
# don't check if perl is executable, maybe they have decided to
# supply switches with perl
--
Michael G. Schwern <schwern@pobox.com> http://www.pobox.com/~schwern/
Perl Quality Assurance <perl-qa@perl.org> Kwalitee Is Job One
huh huh huh huh huh
i will seduce you baby
or not, no offense
-- Fmh
Thread Next
-
[PATCH lib/ExtUtils/MM_Unix.pm] miniperl found before perl?
by Michael G Schwern