| 1 |
use ExtUtils::MakeMaker; |
| 2 |
|
| 3 |
use Canary::Stability Coro => 1, 5.008009; |
| 4 |
|
| 5 |
unless (-e "Coro/libcoro/coro.c") { |
| 6 |
print <<EOF; |
| 7 |
|
| 8 |
*** |
| 9 |
*** ERROR: Coro/libcoro is missing or damaged. If you used a CVS check-out |
| 10 |
*** of Coro, you also have to check-out the "libcoro" module from the same CVS |
| 11 |
*** repository in the Coro subdirectory (i.e. Coro/Coro/libcoro from outside). |
| 12 |
*** |
| 13 |
|
| 14 |
EOF |
| 15 |
exit 1; |
| 16 |
} |
| 17 |
|
| 18 |
print "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n\n"; |
| 19 |
|
| 20 |
if (eval { require Event }) { |
| 21 |
if ($Event::VERSION < 0.86 or $Event::VERSION == 0.88) { |
| 22 |
print <<EOF |
| 23 |
|
| 24 |
*** |
| 25 |
*** WARNING: Event version $Event::VERSION found, NOT building Event support. |
| 26 |
*** |
| 27 |
*** This version of Event is broken. The only currently known non-broken |
| 28 |
*** versions of Event are 0.87 and 0.89+. Please install one of those |
| 29 |
*** versions. |
| 30 |
*** |
| 31 |
|
| 32 |
EOF |
| 33 |
} else { |
| 34 |
$EVENT = 1; |
| 35 |
$DEFINE .= " -DHAVE_EVENT=1"; |
| 36 |
print "\nEvent version $Event::VERSION found, building Event support.\n\n"; |
| 37 |
} |
| 38 |
} else { |
| 39 |
print "\n*** Event not found, not building Event support.\n\n"; |
| 40 |
} |
| 41 |
|
| 42 |
if (eval { require EV }) { |
| 43 |
if ($EV::VERSION < 4.0) { |
| 44 |
print <<EOF |
| 45 |
|
| 46 |
*** |
| 47 |
*** WARNING: EV version $EV::VERSION found, NOT building EV support. |
| 48 |
*** |
| 49 |
*** This version is ABI-incompatible with Coro, please upgrade to at least 4.0. |
| 50 |
*** |
| 51 |
|
| 52 |
EOF |
| 53 |
} else { |
| 54 |
$EV = 1; |
| 55 |
$DEFINE .= " -DHAVE_EV=1"; |
| 56 |
print "\nEV version $EV::VERSION found, building EV support.\n\n"; |
| 57 |
} |
| 58 |
} else { |
| 59 |
print "\n*** EV not found, not building EV support.\n\n"; |
| 60 |
} |
| 61 |
|
| 62 |
WriteMakefile( |
| 63 |
dist => { |
| 64 |
PREOP => 'pod2text Coro.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
| 65 |
COMPRESS => 'gzip -9v', |
| 66 |
SUFFIX => '.gz', |
| 67 |
}, |
| 68 |
NAME => "Coro", |
| 69 |
VERSION_FROM => "Coro.pm", |
| 70 |
DIR => ['Coro', ($EVENT ? 'Event' : ()), ($EV ? "EV" : ())], |
| 71 |
PREREQ_PM => { |
| 72 |
common::sense => 0, |
| 73 |
Scalar::Util => 0.00, |
| 74 |
AnyEvent => 5.0, |
| 75 |
Storable => 2.15, |
| 76 |
Guard => 0.5, |
| 77 |
|
| 78 |
# for Coro::Event |
| 79 |
#Event => 1.06, |
| 80 |
|
| 81 |
# for Coro::EV |
| 82 |
#EV => 4.0, |
| 83 |
|
| 84 |
# for Coro::AIO |
| 85 |
#IO::AIO => 2.3, |
| 86 |
#AnyEvent::AIO => 1.1, |
| 87 |
|
| 88 |
# for Coro::BDB |
| 89 |
#BDB => 1.5, |
| 90 |
#AnyEvent::BDB => 1.0, |
| 91 |
}, |
| 92 |
CONFIGURE_REQUIRES => { ExtUtils::MakeMaker => 6.52, Canary::Stability => 0 }, |
| 93 |
# neither configure_requires nor recommends can be used |
| 94 |
# for optional dependencies. whoever decided that a module needs |
| 95 |
# to build properly without its dependencies installed |
| 96 |
# needs his brain rearranged dramatically. |
| 97 |
META_MERGE => { |
| 98 |
recommends => { |
| 99 |
Event => 1.08, |
| 100 |
EV => 4.0, |
| 101 |
IO::AIO => 3.1, |
| 102 |
BDB => 0, |
| 103 |
AnyEvent => 7.0, |
| 104 |
AnyEvent::AIO => 1.0, |
| 105 |
AnyEvent::BDB => 1.0, |
| 106 |
} |
| 107 |
}, |
| 108 |
PM => { |
| 109 |
'Coro.pm' => '$(INST_LIB)/Coro.pm', |
| 110 |
|
| 111 |
'Coro/State.pm' => '$(INST_LIB)/Coro/State.pm', |
| 112 |
'Coro/jit-amd64-unix.pl' => '$(INST_LIB)/Coro/jit-amd64-unix.pl', |
| 113 |
'Coro/jit-x86-unix.pl' => '$(INST_LIB)/Coro/jit-x86-unix.pl', |
| 114 |
|
| 115 |
'Coro/MakeMaker.pm' => '$(INST_LIB)/Coro/MakeMaker.pm', |
| 116 |
'Coro/CoroAPI.h' => '$(INST_LIB)/Coro/CoroAPI.h', |
| 117 |
|
| 118 |
# 'Coro/Cont.pm' => '$(INST_LIB)/Coro/Cont.pm', |
| 119 |
|
| 120 |
'Coro/Specific.pm' => '$(INST_LIB)/Coro/Specific.pm', |
| 121 |
|
| 122 |
'Coro/Timer.pm' => '$(INST_LIB)/Coro/Timer.pm', |
| 123 |
'Coro/Signal.pm' => '$(INST_LIB)/Coro/Signal.pm', |
| 124 |
'Coro/Channel.pm' => '$(INST_LIB)/Coro/Channel.pm', |
| 125 |
'Coro/Semaphore.pm' => '$(INST_LIB)/Coro/Semaphore.pm', |
| 126 |
'Coro/SemaphoreSet.pm'=> '$(INST_LIB)/Coro/SemaphoreSet.pm', |
| 127 |
'Coro/RWLock.pm' => '$(INST_LIB)/Coro/RWLock.pm', |
| 128 |
|
| 129 |
'Coro/Debug.pm' => '$(INST_LIB)/Coro/Debug.pm', |
| 130 |
'Coro/Util.pm' => '$(INST_LIB)/Coro/Util.pm', |
| 131 |
'Coro/Select.pm' => '$(INST_LIB)/Coro/Select.pm', |
| 132 |
'Coro/Handle.pm' => '$(INST_LIB)/Coro/Handle.pm', |
| 133 |
'Coro/Socket.pm' => '$(INST_LIB)/Coro/Socket.pm', |
| 134 |
|
| 135 |
'Coro/AIO.pm' => '$(INST_LIB)/Coro/AIO.pm', |
| 136 |
'Coro/BDB.pm' => '$(INST_LIB)/Coro/BDB.pm', |
| 137 |
'Coro/LWP.pm' => '$(INST_LIB)/Coro/LWP.pm', |
| 138 |
'Coro/Storable.pm' => '$(INST_LIB)/Coro/Storable.pm', |
| 139 |
'Coro/AnyEvent.pm' => '$(INST_LIB)/Coro/AnyEvent.pm', |
| 140 |
}, |
| 141 |
); |
| 142 |
|
| 143 |
sub MY::postamble { |
| 144 |
<<EOF; |
| 145 |
|
| 146 |
# set \$VERSION in all modules |
| 147 |
setver: |
| 148 |
\$(PERL) -pi -e 's/^(\\s*(our\\s*)?\\\$\$VERSION\\s*=\\s*).*\$\$/\$\${1}\$(VERSION);/' *.pm Coro/*.pm EV/*.pm Event/*.pm |
| 149 |
|
| 150 |
EOF |
| 151 |
} |
| 152 |
|
| 153 |
|