X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=cfb4e6d12e9c37a3849defd964a4abbcacc4ede9;hb=2b1798e04c7e7da24eb968124d86c1009bfe19d9;hp=2bb28b9d551efb0ec1b2d030133be97f135ca6e3;hpb=5468e090435bd3cdba396ad5f3267a7478227339;p=p5sagit%2Fstrictures.git diff --git a/Makefile.PL b/Makefile.PL index 2bb28b9..cfb4e6d 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -4,6 +4,28 @@ use ExtUtils::MakeMaker; (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; +my %extra_prereqs = ( + indirect => 0, + 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 + = ! parse_args()->{PUREPERL_ONLY} + && eval { require ExtUtils::CBuilder; 1 } + && ExtUtils::CBuilder->new->have_compiler; + WriteMakefile( NAME => 'strictures', VERSION_FROM => 'lib/strictures.pm', @@ -11,7 +33,7 @@ WriteMakefile( META_MERGE => { 'meta-spec' => { version => 2 }, - dynamic_config => 0, + dynamic_config => 1, resources => { # r/w: p5sagit@git.shadowcat.co.uk:strictures.git @@ -27,22 +49,18 @@ WriteMakefile( }, prereqs => { - runtime => { - recommends => { - indirect => 0, - multidimensional => 0, - 'bareword::filehandles' => 0, + configure => { + requires => { + 'ExtUtils::CBuilder' => 0, }, }, + runtime => { + ( $] >= 5.008004 && !$have_compiler + ? ( recommends => \%extra_prereqs ) : () ), + }, }, }, - (eval { require ExtUtils::CBuilder; 1 } - and ExtUtils::CBuilder->new->have_compiler) - ? (PREREQ_PM => { - indirect => 0, - multidimensional => 0, - 'bareword::filehandles' => 0, - }) - : (), + ($] >= 5.008004 && $have_compiler + ? ( PREREQ_PM => \%extra_prereqs ) : () ), );