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}
45 VERSION_FROM => 'lib/strictures.pm',
46 MIN_PERL_VERSION => '5.006',
49 'meta-spec' => { version => 2 },
53 # r/w: p5sagit@git.shadowcat.co.uk:strictures.git
55 url => 'git://git.shadowcat.co.uk/p5sagit/strictures.git',
56 web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/strictures.git',
60 mailto => 'bug-strictures@rt.cpan.org',
61 web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=strictures',
68 'ExtUtils::CBuilder' => 0,
72 ( $] >= 5.008004 && !$have_compiler
73 ? ( recommends => \%extra_prereqs ) : () ),
78 ($] >= 5.008004 && $have_compiler
79 ? ( PREREQ_PM => \%extra_prereqs ) : () ),
82 # can we locate a (the) C compiler
84 my @chunks = split(/ /, $Config::Config{cc}) or return;
86 # $Config{cc} may contain args; try to find out the program part
88 return can_run("@chunks") || (pop(@chunks), next);
94 # check if we can run some command
98 return $cmd if -x $cmd;
99 if (my $found_cmd = MM->maybe_command($cmd)) {
104 for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
106 my $abs = File::Spec->catfile($dir, $cmd);
107 return $abs if (-x $abs or $abs = MM->maybe_command($abs));
113 # Can our C compiler environment build XS files
115 # Do we have the configure_requires checker?
117 eval "require ExtUtils::CBuilder; ExtUtils::CBuilder->VERSION(0.27)";
119 # They don't obey configure_requires, so it is
120 # someone old and delicate. Try to avoid hurting
121 # them by falling back to an older simpler test.
125 # Do we have a working C compiler
126 my $builder = ExtUtils::CBuilder->new(
129 unless ( $builder->have_compiler ) {
130 # No working C compiler
134 # Write a C file representative of what XS becomes
136 my ( $FH, $tmpfile ) = File::Temp::tempfile(
146 int main(int argc, char **argv) {
157 # Can the C compiler access the same headers XS does
162 $object = $builder->compile(
165 @libs = $builder->link(
167 module_name => 'sanexs',
170 my $result = $@ ? 0 : 1;
172 # Clean up all the build files
173 foreach ( $tmpfile, $object, @libs ) {
174 next unless defined $_;