1# This -*- perl -*- script makes the Makefile 2 3BEGIN { require 5.008_001 } 4use ExtUtils::MakeMaker; 5use Config qw(%Config); 6my $PERL_CORE = grep { $_ eq 'PERL_CORE=1' } @ARGV; 7 8#--- Attempt to find <poll.h> 9 10my $define = ""; 11 12unless ($PERL_CORE or exists $Config{'i_poll'}) { 13 my @inc = split(/\s+/, join(" ", $Config{'usrinc'}, $Config{'incpth'}, $Config{'locincpth'})); 14 foreach $path (@inc) { 15 if (-f $path . "/poll.h") { 16 $define .= "-DI_POLL "; 17 last; 18 } 19 } 20} 21 22#--- Write the Makefile 23 24WriteMakefile( 25 VERSION_FROM => "IO.pm", 26 NAME => "IO", 27 OBJECT => '$(O_FILES)', 28 ABSTRACT => 'Perl core IO modules', 29 AUTHOR => 'Graham Barr <gbarr@cpan.org>', 30 PREREQ_PM => { 31 'Test::More' => 0, 32 'File::Temp' => '0.15', 33 }, 34 ( $PERL_CORE 35 ? () 36 : ( 37 INSTALLDIRS => ($] < 5.011 ? 'perl' : 'site'), 38 clean => {FILES => 'typemap'}, 39 ) 40 ), 41 ($define ? (DEFINE => $define) : ()), 42 ((ExtUtils::MakeMaker->VERSION() gt '6.30') ? ('LICENSE' => 'perl') : ()), 43); 44