1 | use ExtUtils::MakeMaker; |
1 | use ExtUtils::MakeMaker; |
|
|
2 | |
|
|
3 | unless (-e "Coro/libcoro/coro.c") { |
|
|
4 | print <<EOF; |
|
|
5 | |
|
|
6 | *** |
|
|
7 | *** ERROR: Coro/libcoro is missing or damaged. If you used a CVS check-out |
|
|
8 | *** of Coro, you also have to check-out the "libcoro" module from the same CVS |
|
|
9 | *** repository in the Coro subdirectory (i.e. Coro/Coro/libcoro from outside). |
|
|
10 | *** |
|
|
11 | |
|
|
12 | EOF |
|
|
13 | exit 1; |
|
|
14 | } |
|
|
15 | |
|
|
16 | print "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n\n"; |
2 | |
17 | |
3 | if ($] < 5.006) { |
18 | if ($] < 5.006) { |
4 | print <<EOF; |
19 | print <<EOF; |
5 | |
20 | |
6 | *** |
21 | *** |
7 | *** WARNING: This module is quite low-level and uses undocumented perl |
22 | *** 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, |
23 | *** internals to do it's job. While it seems to work fine with perl-5.[6-10] |
9 | *** 5.7 and 5.6, it has not been tested with older versions. If it |
24 | *** it has not been tested with older versions. If it compiles and passes the |
10 | *** compiles and passes the testsuite, it should work. Otherwise you |
25 | *** testsuite, it should work. Otherwise you should either upgrade or fix it ;) |
11 | *** should either upgrade or contact the author, maybe it can be made to |
|
|
12 | *** work... |
|
|
13 | *** |
26 | *** |
14 | *** Marc Lehmann <pcg\@goof.com> |
27 | *** Marc Lehmann <schmorp\@schmorp.de> |
15 | *** |
28 | *** |
16 | |
29 | |
17 | EOF |
30 | EOF |
|
|
31 | } |
|
|
32 | |
|
|
33 | if (eval { require Event }) { |
|
|
34 | if ($Event::VERSION < 0.86 or $Event::VERSION == 0.88) { |
|
|
35 | print <<EOF |
|
|
36 | |
|
|
37 | *** |
|
|
38 | *** WARNING: Event version $Event::VERSION found, NOT building Event support. |
|
|
39 | *** |
|
|
40 | *** This version of Event is broken. The only currently known non-broken |
|
|
41 | *** versions of Event are 0.87 and 0.89+. Please install one of those |
|
|
42 | *** versions. |
|
|
43 | *** |
|
|
44 | |
|
|
45 | EOF |
|
|
46 | } else { |
|
|
47 | $EVENT = 1; |
|
|
48 | $DEFINE .= " -DHAVE_EVENT=1"; |
|
|
49 | print "\nEvent version $Event::VERSION found, building Event support.\n\n"; |
|
|
50 | } |
|
|
51 | } else { |
|
|
52 | print "\n*** Event not found, not build Event support.\n\n"; |
|
|
53 | } |
|
|
54 | |
|
|
55 | if (eval { require EV }) { |
|
|
56 | if ($EV::VERSION < 2.0) { |
|
|
57 | print <<EOF |
|
|
58 | |
|
|
59 | *** |
|
|
60 | *** WARNING: Event version $EV::VERSION found, NOT building EV support. |
|
|
61 | *** |
|
|
62 | *** This version is ABI-incompatible with Coro, please upgrade to 2.0. |
|
|
63 | *** |
|
|
64 | |
|
|
65 | EOF |
|
|
66 | } else { |
|
|
67 | $EV = 1; |
|
|
68 | $DEFINE .= " -DHAVE_EV=1"; |
|
|
69 | print "\nEV version $EV::VERSION found, building EV support.\n\n"; |
|
|
70 | } |
|
|
71 | } else { |
|
|
72 | print "\n*** EV not found, not build EV support.\n\n"; |
18 | } |
73 | } |
19 | |
74 | |
20 | WriteMakefile( |
75 | WriteMakefile( |
21 | dist => { |
76 | dist => { |
22 | PREOP => 'pod2text Coro.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
77 | PREOP => 'pod2text Coro.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
23 | COMPRESS => 'gzip -9v', |
78 | COMPRESS => 'gzip -9v', |
24 | SUFFIX => '.gz', |
79 | SUFFIX => '.gz', |
25 | }, |
80 | }, |
26 | NAME => "Coro", |
81 | NAME => "Coro", |
27 | VERSION_FROM => "Coro.pm", |
82 | VERSION_FROM => "Coro.pm", |
28 | DIR => ['Coro'], |
83 | DIR => ['Coro', ($EVENT ? 'Event' : ()), ($EV ? "EV" : ())], |
29 | PM_PREREQ => { |
84 | PREREQ_PM => { |
30 | Event => 0.84, # yes, 0.83 and below have serious bugs |
85 | Scalar::Util => 0.00, |
|
|
86 | AnyEvent => 3.4, |
|
|
87 | Storable => 2.15, |
|
|
88 | Time::HiRes => 0, |
|
|
89 | |
|
|
90 | # for Coro::Event |
|
|
91 | Event => 1.06, |
|
|
92 | |
|
|
93 | # for Coro::EV |
|
|
94 | EV => 3.0, |
|
|
95 | |
|
|
96 | # for Coro::AIO |
|
|
97 | #IO::AIO => 2.3, |
31 | }, |
98 | }, |
|
|
99 | EXTRA_META => q{ |
|
|
100 | configure_requires: |
|
|
101 | Event: 1.06 |
|
|
102 | EV: 3.0 |
|
|
103 | }, |
|
|
104 | PM => { |
|
|
105 | 'Coro.pm' => '$(INST_LIBDIR)/Coro.pm', |
|
|
106 | |
|
|
107 | 'Coro/State.pm' => '$(INST_LIBDIR)/Coro/State.pm', |
|
|
108 | |
|
|
109 | 'Coro/MakeMaker.pm' => '$(INST_LIBDIR)/Coro/MakeMaker.pm', |
|
|
110 | 'Coro/CoroAPI.h' => '$(INST_LIBDIR)/Coro/CoroAPI.h', |
|
|
111 | |
|
|
112 | # 'Coro/Cont.pm' => '$(INST_LIBDIR)/Coro/Cont.pm', |
|
|
113 | |
|
|
114 | 'Coro/Specific.pm' => '$(INST_LIBDIR)/Coro/Specific.pm', |
|
|
115 | |
|
|
116 | 'Coro/Timer.pm' => '$(INST_LIBDIR)/Coro/Timer.pm', |
|
|
117 | 'Coro/Signal.pm' => '$(INST_LIBDIR)/Coro/Signal.pm', |
|
|
118 | 'Coro/Channel.pm' => '$(INST_LIBDIR)/Coro/Channel.pm', |
|
|
119 | 'Coro/Semaphore.pm' => '$(INST_LIBDIR)/Coro/Semaphore.pm', |
|
|
120 | 'Coro/SemaphoreSet.pm'=> '$(INST_LIBDIR)/Coro/SemaphoreSet.pm', |
|
|
121 | 'Coro/RWLock.pm' => '$(INST_LIBDIR)/Coro/RWLock.pm', |
|
|
122 | |
|
|
123 | 'Coro/Debug.pm' => '$(INST_LIBDIR)/Coro/Debug.pm', |
|
|
124 | 'Coro/Util.pm' => '$(INST_LIBDIR)/Coro/Util.pm', |
|
|
125 | 'Coro/Select.pm' => '$(INST_LIBDIR)/Coro/Select.pm', |
|
|
126 | 'Coro/Handle.pm' => '$(INST_LIBDIR)/Coro/Handle.pm', |
|
|
127 | 'Coro/Socket.pm' => '$(INST_LIBDIR)/Coro/Socket.pm', |
|
|
128 | |
|
|
129 | 'Coro/AIO.pm' => '$(INST_LIBDIR)/Coro/AIO.pm', |
|
|
130 | 'Coro/BDB.pm' => '$(INST_LIBDIR)/Coro/BDB.pm', |
|
|
131 | 'Coro/LWP.pm' => '$(INST_LIBDIR)/Coro/LWP.pm', |
|
|
132 | 'Coro/Storable.pm' => '$(INST_LIBDIR)/Coro/Storable.pm', |
|
|
133 | 'Coro/AnyEvent.pm' => '$(INST_LIBDIR)/Coro/AnyEvent.pm', |
|
|
134 | }, |
32 | ); |
135 | ); |
33 | |
136 | |
34 | sub MY::postamble { |
137 | sub MY::postamble { |
35 | <<EOF; |
138 | <<EOF; |
36 | |
139 | |
37 | # set \$VERSION in all modules |
140 | # set \$VERSION in all modules |
38 | setver: |
141 | setver: |
39 | \$(PERL) -pi -e 's/^(\\s*\\\$\$VERSION\\s*=\\s*).*\$\$/\$\${1}\$(VERSION);/' *.pm Coro/*.pm |
142 | \$(PERL) -pi -e 's/^(\\s*(our\\s*)?\\\$\$VERSION\\s*=\\s*).*\$\$/\$\${1}\$(VERSION);/' *.pm Coro/*.pm Event/*.pm |
40 | |
143 | |
41 | EOF |
144 | EOF |
42 | } |
145 | } |
43 | |
146 | |
44 | |
147 | |