X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=b2ddd69b7f791efbba8e4967c965e51d44c92161;hb=350bef653f634d1c7cb7357b45e1835b1489f9b7;hp=b251d5aa4a5e3fce23d50d4b14d796554b985967;hpb=d4be4bd8bf54216cf2a58041f82f5fdaead5850a;p=p5sagit%2FDevel-GlobalDestruction.git diff --git a/Makefile.PL b/Makefile.PL index b251d5a..b2ddd69 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -19,14 +19,26 @@ BEGIN { if ( $^O eq 'cygwin' ) { } }} +use Text::ParseWords; + +sub parse_args { + # copied from EUMM + ExtUtils::MakeMaker::parse_args( + my $tmp = {}, + Text::ParseWords::shellwords($ENV{PERL_MM_OPT} || ''), + @ARGV, + ); + return $tmp->{ARGS} || {}; +} + my $mymeta_works = eval { ExtUtils::MakeMaker->VERSION('6.5707'); 1 }; my $mymeta = $mymeta_works || eval { ExtUtils::MakeMaker->VERSION('6.5702'); 1 }; my %META_BITS = ( ); my %RUN_DEPS = ( - 'Sub::Exporter::Progressive' => '0.001002', - ( (defined ${^GLOBAL_PHASE} or !can_xs() ) + 'Sub::Exporter::Progressive' => '0.001006', + ( (defined ${^GLOBAL_PHASE} or parse_args()->{PUREPERL_ONLY} or !can_xs() ) ? () : ('Devel::GlobalDestruction::XS' => 0) ), @@ -65,6 +77,21 @@ unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) { } } +if (eval { require Devel::GlobalDestruction } + && Devel::GlobalDestruction->VERSION < 0.10) { + package MY; + no warnings 'once'; + + *install = sub { + my $self = shift; + return ' +pure_site_install :: + $(NOECHO) $(RM_F) ' . $self->quote_literal( + $self->catfile('$(DESTINSTALLSITEARCH)', 'Devel', 'GlobalDestruction.pm') + ) . "\n" . $self->SUPER::install; + }; +} + delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION('6.52') };