1 |
use ExtUtils::MakeMaker; |
2 |
|
3 |
if ($] < 5.006) { |
4 |
print <<EOF; |
5 |
|
6 |
*** |
7 |
*** WARNING: This module is quite low-level and uses undocumented perl |
8 |
*** internals to do it's job. While it seems to work fine with perl-5.8, |
9 |
*** 5.7 and 5.6, it has not been tested with older versions. If it |
10 |
*** compiles and passes the testsuite, it should work. Otherwise you |
11 |
*** should either upgrade or fix it ;) |
12 |
*** |
13 |
*** Marc Lehmann <pcg\@goof.com> |
14 |
*** |
15 |
|
16 |
EOF |
17 |
} |
18 |
|
19 |
if (eval { require Event }) { |
20 |
if ($Event::VERSION < 0.86) { |
21 |
print "*** Please read the INSTALL file, you need a patched Event.\n"; |
22 |
} else { |
23 |
$EVENT = 1; |
24 |
$DEFINE .= " -DHAVE_EVENT=1"; |
25 |
print "\nEvent version $Event::VERSION found, building Event support.\n\n"; |
26 |
} |
27 |
print "\n"; |
28 |
} else { |
29 |
print "\n*** Event not found, not build Event support.\n\n"; |
30 |
} |
31 |
|
32 |
WriteMakefile( |
33 |
dist => { |
34 |
PREOP => 'pod2text Coro.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
35 |
COMPRESS => 'gzip -9v', |
36 |
SUFFIX => '.gz', |
37 |
}, |
38 |
NAME => "Coro", |
39 |
VERSION_FROM => "Coro.pm", |
40 |
DIR => ['Coro', ($EVENT ? 'Event' : ())], |
41 |
PREREQ_PM => { |
42 |
Event => 0.86, |
43 |
Scalar::Util => 0.00, |
44 |
}, |
45 |
PM => { |
46 |
'Coro.pm' => '$(INST_LIBDIR)/Coro.pm', |
47 |
|
48 |
'Coro/State.pm' => '$(INST_LIBDIR)/Coro/State.pm', |
49 |
|
50 |
'Coro/MakeMaker.pm' => '$(INST_LIBDIR)/Coro/MakeMaker.pm', |
51 |
'Coro/CoroAPI.h' => '$(INST_LIBDIR)/Coro/CoroAPI.h', |
52 |
|
53 |
'Coro/Cont.pm' => '$(INST_LIBDIR)/Coro/Cont.pm', |
54 |
|
55 |
'Coro/Specific.pm' => '$(INST_LIBDIR)/Coro/Specific.pm', |
56 |
|
57 |
'Coro/Timer.pm' => '$(INST_LIBDIR)/Coro/Timer.pm', |
58 |
'Coro/Signal.pm' => '$(INST_LIBDIR)/Coro/Signal.pm', |
59 |
'Coro/Channel.pm' => '$(INST_LIBDIR)/Coro/Channel.pm', |
60 |
'Coro/Semaphore.pm' => '$(INST_LIBDIR)/Coro/Semaphore.pm', |
61 |
'Coro/SemaphoreSet.pm'=> '$(INST_LIBDIR)/Coro/SemaphoreSet.pm', |
62 |
'Coro/RWLock.pm' => '$(INST_LIBDIR)/Coro/RWLock.pm', |
63 |
}, |
64 |
); |
65 |
|
66 |
sub MY::postamble { |
67 |
<<EOF; |
68 |
|
69 |
# set \$VERSION in all modules |
70 |
setver: |
71 |
\$(PERL) -pi -e 's/^(\\s*\\\$\$VERSION\\s*=\\s*).*\$\$/\$\${1}\$(VERSION);/' *.pm Coro/*.pm Event/*.pm |
72 |
|
73 |
EOF |
74 |
} |
75 |
|
76 |
|