From: Graham Knop Date: Fri, 20 Sep 2013 11:48:04 +0000 (-0400) Subject: fix PUREPERL_ONLY support X-Git-Tag: Devel-GlobalDestruction-0.12~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e00dea6cd9072706aa8b8e705b9ecb8b7f7b913c;p=p5sagit%2FDevel-GlobalDestruction.git fix PUREPERL_ONLY support --- diff --git a/Makefile.PL b/Makefile.PL index ceb9563..b2ddd69 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -19,13 +19,16 @@ BEGIN { if ( $^O eq 'cygwin' ) { } }} -my $pureperl; -for my $i (0..$#ARGV) { - if ($ARGV[$i] =~ /^PUREPERL_ONLY=(.*)/) { - $pureperl = $1; - splice @ARGV, $i, 1; - last; - } +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 }; @@ -35,7 +38,7 @@ my %META_BITS = ( ); my %RUN_DEPS = ( 'Sub::Exporter::Progressive' => '0.001006', - ( (defined ${^GLOBAL_PHASE} or $pureperl or !can_xs() ) + ( (defined ${^GLOBAL_PHASE} or parse_args()->{PUREPERL_ONLY} or !can_xs() ) ? () : ('Devel::GlobalDestruction::XS' => 0) ),