X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=0c1d029a2b572370d257c97e5823140c3137e8e2;hb=e029c65666417046fefe06ad3caf04f489fe31d1;hp=bf935f05f36fd62bcd14221a71ac767ffafe02b2;hpb=0e762adeb08fb1fc9534c0e629e269d18951791a;p=p5sagit%2FDevel-GlobalDestruction.git diff --git a/Makefile.PL b/Makefile.PL index bf935f0..0c1d029 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,7 +1,7 @@ use strict; use warnings; -require 5.006000; +require 5.006; use ExtUtils::MakeMaker; BEGIN { if ( $^O eq 'cygwin' ) { @@ -19,13 +19,29 @@ 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' => 0, + 'Sub::Exporter::Progressive' => '0.001011', + ( (defined ${^GLOBAL_PHASE} or parse_args()->{PUREPERL_ONLY} or !can_xs() ) + ? () + : ('Devel::GlobalDestruction::XS' => 0) + ), ); my %WriteMakefileArgs = ( @@ -34,7 +50,7 @@ my %WriteMakefileArgs = ( LICENSE => 'perl', INSTALLDIRS => 'site', PL_FILES => { }, - MIN_PERL_VERSION => '5.006000', + MIN_PERL_VERSION => '5.006', PREREQ_PM => \%RUN_DEPS, CONFIGURE_REQUIRES => { 'ExtUtils::CBuilder' => 0.27 }, META_ADD => { @@ -46,10 +62,6 @@ my %WriteMakefileArgs = ( requires => \%RUN_DEPS, }, ($mymeta and !$mymeta_works) ? ( 'NO_MYMETA' => 1 ) : (), - ( (defined ${^GLOBAL_PHASE} or !can_xs() ) - ? (XS => {}, C => []) - : () - ), ); unless ( eval { ExtUtils::MakeMaker->VERSION('6.56') } ) { @@ -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') };