X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=9c341ac75c8d01642bec9de93d712f4847e45be6;hb=bddcde2284b61783c010ede67cd122c17508d598;hp=cf639581a1d6ca2f4f97b908b68a166528afe5de;hpb=088e735faa0027bbb538e71ff738423bdd0bcf43;p=p5sagit%2Fstrictures.git diff --git a/Makefile.PL b/Makefile.PL index cf63958..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', @@ -11,7 +20,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,13 +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 ) : () ), + }, }, }, + + ($] >= 5.008004 && $have_compiler + ? ( PREREQ_PM => \%extra_prereqs ) : () ), );