From: Diab Jerius Date: Fri, 13 Dec 2013 21:17:06 +0000 (-0500) Subject: support PUREPERL_ONLY X-Git-Tag: v1.005003~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2Fstrictures.git;a=commitdiff_plain;h=ae3262c93038592ea07e02f42c194e59d0ce810d support PUREPERL_ONLY --- diff --git a/Makefile.PL b/Makefile.PL index 9c341ac..cfb4e6d 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -9,8 +9,21 @@ my %extra_prereqs = ( multidimensional => 0, 'bareword::filehandles' => 0, ); + +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 $have_compiler - = eval { require ExtUtils::CBuilder; 1 } + = ! parse_args()->{PUREPERL_ONLY} + && eval { require ExtUtils::CBuilder; 1 } && ExtUtils::CBuilder->new->have_compiler; WriteMakefile(