require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-our $VERSION = '7.48';
+our $VERSION = '7.52';
$VERSION =~ tr/_//d;
$ENV{EMXSHELL} = 'sh'; # to run `commands`
}
sub can_dep_space {
- my $self = shift;
- 1; # with Win32::GetShortPathName
+ my ($self) = @_;
+ return 0 unless $self->can_load_xs;
+ require Win32;
+ require File::Spec;
+ my ($vol, $dir) = File::Spec->splitpath($INC{'ExtUtils/MakeMaker.pm'});
+ # can_dep_space via GetShortPathName, if short paths are supported
+ my $canary = Win32::GetShortPathName(File::Spec->catpath($vol, $dir, 'MakeMaker.pm'));
+ (undef, undef, my $file) = File::Spec->splitpath($canary);
+ return (length $file > 11) ? 0 : 1;
}
=item quote_dep
our %macro_fsentity; # whether a macro is a filesystem name
our %macro_dep; # whether a macro is a dependency
-our $VERSION = '7.48';
+our $VERSION = '7.52';
$VERSION =~ tr/_//d;
# Emulate something resembling CVS $Revision$
check_hints($self);
- if ( defined $self->{MIN_PERL_VERSION}
- && $self->{MIN_PERL_VERSION} !~ /^v?[\d_\.]+$/ ) {
- require version;
- my $normal = eval {
- local $SIG{__WARN__} = sub {
- # simulate "use warnings FATAL => 'all'" for vintage perls
- die @_;
- };
- version->new( $self->{MIN_PERL_VERSION} )
- };
- $self->{MIN_PERL_VERSION} = $normal if defined $normal && !$@;
- }
-
- # Translate X.Y.Z to X.00Y00Z
- if( defined $self->{MIN_PERL_VERSION} ) {
- $self->{MIN_PERL_VERSION} =~ s{ ^v? (\d+) \. (\d+) \. (\d+) $ }
- {sprintf "%d.%03d%03d", $1, $2, $3}ex;
- }
+ if ( $self->{MIN_PERL_VERSION}) {
+ my $perl_version = $self->{MIN_PERL_VERSION};
+ if (ref $perl_version) {
+ # assume a version object
+ }
+ else {
+ $perl_version = eval {
+ local $SIG{__WARN__} = sub {
+ # simulate "use warnings FATAL => 'all'" for vintage perls
+ die @_;
+ };
+ version->new( $perl_version )->numify;
+ };
+ $perl_version =~ tr/_//d
+ if defined $perl_version;
+ }
- my $perl_version_ok = eval {
- local $SIG{__WARN__} = sub {
- # simulate "use warnings FATAL => 'all'" for vintage perls
- die @_;
- };
- !$self->{MIN_PERL_VERSION} or $self->{MIN_PERL_VERSION} <= "$]"
- };
- if (!$perl_version_ok) {
- if (!defined $perl_version_ok) {
- die <<'END';
-Warning: MIN_PERL_VERSION is not in a recognized format.
+ if (!defined $perl_version) {
+ # should this be a warning?
+ die sprintf <<'END', $self->{MIN_PERL_VERSION};
+MakeMaker FATAL: MIN_PERL_VERSION (%s) is not in a recognized format.
Recommended is a quoted numerical value like '5.005' or '5.008001'.
END
}
- elsif ($self->{PREREQ_FATAL}) {
- die sprintf <<"END", $self->{MIN_PERL_VERSION}, $];
-MakeMaker FATAL: perl version too low for this distribution.
-Required is %s. We run %s.
+ elsif ($perl_version > "$]") {
+ my $message = sprintf <<'END', $perl_version, $];
+Perl version %s or higher required. We run %s.
END
+ if ($self->{PREREQ_FATAL}) {
+ die "MakeMaker FATAL: $message";
+ }
+ else {
+ warn "Warning: $message";
+ }
}
- else {
- warn sprintf
- "Warning: Perl version %s or higher required. We run %s.\n",
- $self->{MIN_PERL_VERSION}, $];
- }
+
+ $self->{MIN_PERL_VERSION} = $perl_version;
}
my %configure_att; # record &{$self->{CONFIGURE}} attributes
local($@, $!);
print "Processing hints file $hint_file\n" if $Verbose;
- # Just in case the ./ isn't on the hint file, which File::Spec can
- # often strip off, we bung the curdir into @INC
if(open(my $fh, '<', $hint_file)) {
- eval join('', <$fh>);
+ my $hints_content = do { local $/; <$fh> };
+ no strict;
+ eval $hints_content;
warn "Failed to run hint file $hint_file: $@" if $@;
}
else {
=item XSPROTOARG
-May be set to C<-protoypes>, C<-noprototypes> or the empty string. The
+May be set to C<-prototypes>, C<-noprototypes> or the empty string. The
empty string is equivalent to the xsubpp default, or C<-noprototypes>.
See the xsubpp documentation for details. MakeMaker
defaults to the empty string.
perl_lib();
+rmtree($DIRNAME);
hash2files($DIRNAME, \%FILES);
END {
ok( chdir(File::Spec->updir), 'leaving dir' );
};
ok( '' ne $warnings, 'MIN_PERL_VERSION=999999 triggers a warning' );
is( $warnings,
- "Warning: Perl version 999999 or higher required. We run $].\n",
+ "Warning: Perl version 999999.000 or higher required. We run $].\n",
' with expected message text' );
is( $@, '', ' and without a hard failure' );
};
is( $warnings, '', 'MIN_PERL_VERSION=999999 and PREREQ_FATAL: no warning' );
is( $@, <<"END", ' correct exception' );
-MakeMaker FATAL: perl version too low for this distribution.
-Required is 999999. We run $].
+MakeMaker FATAL: Perl version 999999.000 or higher required. We run $].
END
$warnings = '';
);
};
is( $@, <<'END', 'Invalid MIN_PERL_VERSION is fatal' );
-Warning: MIN_PERL_VERSION is not in a recognized format.
+MakeMaker FATAL: MIN_PERL_VERSION (foobar) is not in a recognized format.
Recommended is a quoted numerical value like '5.005' or '5.008001'.
END