From: Graham Knop Date: Fri, 15 Nov 2013 19:53:49 +0000 (-0500) Subject: don't list extra prereqs on perl < 5.8.4 X-Git-Tag: v1.005002~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=27826cd1080d392a6987bb740a6b626008ac090a;p=p5sagit%2Fstrictures.git don't list extra prereqs on perl < 5.8.4 --- diff --git a/Makefile.PL b/Makefile.PL index 6e5f866..9c341ac 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -4,6 +4,15 @@ use ExtUtils::MakeMaker; (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml'; +my %extra_prereqs = ( + indirect => 0, + multidimensional => 0, + 'bareword::filehandles' => 0, +); +my $have_compiler + = eval { require ExtUtils::CBuilder; 1 } + && ExtUtils::CBuilder->new->have_compiler; + WriteMakefile( NAME => 'strictures', VERSION_FROM => 'lib/strictures.pm', @@ -27,27 +36,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 ) : () ), );