support PUREPERL_ONLY
[p5sagit/strictures.git] / Makefile.PL
CommitLineData
eae006ee 1use strict;
2use warnings FATAL => 'all';
394c3a46 3use ExtUtils::MakeMaker;
4
eae006ee 5(do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
6
27826cd1 7my %extra_prereqs = (
8 indirect => 0,
9 multidimensional => 0,
10 'bareword::filehandles' => 0,
11);
ae3262c9 12
13use Text::ParseWords;
14sub parse_args {
15 # copied from EUMM
16 ExtUtils::MakeMaker::parse_args(
17 my $tmp = {},
18 Text::ParseWords::shellwords($ENV{PERL_MM_OPT} || ''),
19 @ARGV,
20 );
21 return $tmp->{ARGS} || {};
22}
23
27826cd1 24my $have_compiler
ae3262c9 25 = ! parse_args()->{PUREPERL_ONLY}
26 && eval { require ExtUtils::CBuilder; 1 }
27826cd1 27 && ExtUtils::CBuilder->new->have_compiler;
28
394c3a46 29WriteMakefile(
30 NAME => 'strictures',
31 VERSION_FROM => 'lib/strictures.pm',
21e2b1b2 32 MIN_PERL_VERSION => '5.006',
de111885 33
dfdfcbae 34 META_MERGE => {
5c109c51 35 'meta-spec' => { version => 2 },
e9258733 36 dynamic_config => 1,
77f9ff76 37
de111885 38 resources => {
39 # r/w: p5sagit@git.shadowcat.co.uk:strictures.git
bfbeb6fd 40 repository => {
41 url => 'git://git.shadowcat.co.uk/p5sagit/strictures.git',
42 web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/strictures.git',
43 type => 'git',
44 },
45 bugtracker => {
46 mailto => 'bug-strictures@rt.cpan.org',
47 web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=strictures',
48 },
de111885 49 },
dfdfcbae 50
088e735f 51 prereqs => {
e9258733 52 configure => {
53 requires => {
54 'ExtUtils::CBuilder' => 0,
55 },
56 },
27826cd1 57 runtime => {
58 ( $] >= 5.008004 && !$have_compiler
59 ? ( recommends => \%extra_prereqs ) : () ),
60 },
dfdfcbae 61 },
de111885 62 },
5468e090 63
27826cd1 64 ($] >= 5.008004 && $have_compiler
65 ? ( PREREQ_PM => \%extra_prereqs ) : () ),
394c3a46 66);