This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Loading IO is now threadsafe, avoiding the core bug reported as GH #14816.
[perl5.git] / dist / IO / Makefile.PL
1 # This -*- perl -*- script makes the Makefile
2
3 BEGIN { require 5.008_001 }
4 use ExtUtils::MakeMaker;
5 use Config qw(%Config);
6 my $PERL_CORE = grep { $_ eq 'PERL_CORE=1' } @ARGV;
7
8 #--- Attempt to find <poll.h>
9
10 my $define = "";
11
12 unless ($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
24 WriteMakefile(
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 );