2 use warnings FATAL => 'all';
3 use ExtUtils::MakeMaker;
4 BEGIN { if ( $^O eq 'cygwin' ) {
5 require ExtUtils::MM_Cygwin;
6 require ExtUtils::MM_Win32;
7 if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) {
8 *ExtUtils::MM_Cygwin::maybe_command = sub {
9 my ($self, $file) = @_;
10 if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
11 ExtUtils::MM_Win32->maybe_command($file);
13 ExtUtils::MM_Unix->maybe_command($file);
20 (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
24 multidimensional => 0,
25 'bareword::filehandles' => 0,
31 ExtUtils::MakeMaker::parse_args(
33 Text::ParseWords::shellwords($ENV{PERL_MM_OPT} || ''),
36 return $tmp->{ARGS} || {};
40 = ! parse_args()->{PUREPERL_ONLY}
43 my $support_configure_requires
44 = $ENV{PERL5_CPANM_IS_RUNNING}
45 || !$ENV{PERL5_CPAN_IS_RUNNING}
47 my ($cpanpm) = grep { -e } map { "$_/CPAN.pm" } @INC;
48 my $v = $cpanpm && MM->parse_version($cpanpm);
49 ($v and $v = eval $v) ? $v > 1.94_55 : 1;
55 VERSION_FROM => 'lib/strictures.pm',
56 MIN_PERL_VERSION => '5.006',
59 'meta-spec' => { version => 2 },
63 # r/w: p5sagit@git.shadowcat.co.uk:strictures.git
65 url => 'git://git.shadowcat.co.uk/p5sagit/strictures.git',
66 web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/strictures.git',
70 mailto => 'bug-strictures@rt.cpan.org',
71 web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=strictures',
78 'ExtUtils::CBuilder' => 0,
82 ( $] >= 5.008004 && !($have_compiler && $support_configure_requires)
83 ? ( recommends => \%extra_prereqs ) : () ),
88 ($] >= 5.008004 && $have_compiler && $support_configure_requires
89 ? ( PREREQ_PM => \%extra_prereqs ) : () ),
92 # can we locate a (the) C compiler
94 my @chunks = split(/ /, $Config::Config{cc}) or return;
96 # $Config{cc} may contain args; try to find out the program part
98 return can_run("@chunks") || (pop(@chunks), next);
104 # check if we can run some command
108 return $cmd if -x $cmd;
109 if (my $found_cmd = MM->maybe_command($cmd)) {
114 for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
116 my $abs = File::Spec->catfile($dir, $cmd);
117 return $abs if (-x $abs or $abs = MM->maybe_command($abs));
123 # Can our C compiler environment build XS files
125 # Do we have the configure_requires checker?
127 eval "require ExtUtils::CBuilder; ExtUtils::CBuilder->VERSION(0.27)";
129 # They don't obey configure_requires, so it is
130 # someone old and delicate. Try to avoid hurting
131 # them by falling back to an older simpler test.
135 # Do we have a working C compiler
136 my $builder = ExtUtils::CBuilder->new(
139 unless ( $builder->have_compiler ) {
140 # No working C compiler
144 # Write a C file representative of what XS becomes
146 my ( $FH, $tmpfile ) = File::Temp::tempfile(
156 int main(int argc, char **argv) {
167 # Can the C compiler access the same headers XS does
172 $object = $builder->compile(
175 @libs = $builder->link(
177 module_name => 'sanexs',
180 my $result = $@ ? 0 : 1;
182 # Clean up all the build files
183 foreach ( $tmpfile, $object, @libs ) {
184 next unless defined $_;