Commit | Line | Data |
---|---|---|
eb1c4873 GB |
1 | # This -*- perl -*- script makes the Makefile |
2 | ||
3 | BEGIN { require 5.006_001 } | |
8add82fc | 4 | use ExtUtils::MakeMaker; |
eb1c4873 GB |
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 | if ($] < 5.008 and !$PERL_CORE) { | |
23 | open(FH,">typemap"); | |
24 | print FH "const char * T_PV\n"; | |
25 | close(FH); | |
26 | } | |
27 | ||
28 | #--- Write the Makefile | |
cf7fe8a2 | 29 | |
8add82fc | 30 | WriteMakefile( |
eb1c4873 GB |
31 | VERSION_FROM => "IO.pm", |
32 | NAME => "IO", | |
33 | OBJECT => '$(O_FILES)', | |
34 | ABSTRACT => 'Perl core IO modules', | |
35 | AUTHOR => 'Graham Barr <gbarr@cpan.org>', | |
36 | ( $PERL_CORE | |
37 | ? () | |
38 | : ( | |
39 | INSTALLDIRS => 'perl', | |
40 | clean => {FILES => 'typemap'}, | |
41 | ) | |
42 | ), | |
43 | ($define ? (DEFINE => $define) : ()), | |
44 | ((ExtUtils::MakeMaker->VERSION() gt '6.30') ? ('LICENSE' => 'perl') : ()), | |
8add82fc | 45 | ); |