1 | use ExtUtils::MakeMaker; |
1 | use ExtUtils::MakeMaker; |
|
|
2 | |
|
|
3 | use 5.008002; |
|
|
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"; |
2 | |
19 | |
3 | if ($] < 5.006) { |
20 | if ($] < 5.006) { |
4 | print <<EOF; |
21 | print <<EOF; |
5 | |
22 | |
6 | *** |
23 | *** |
7 | *** WARNING: This module is quite low-level and uses undocumented perl |
24 | *** 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, |
25 | *** 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 |
26 | *** 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 |
27 | *** testsuite, it should work. Otherwise you should either upgrade or fix it ;) |
11 | *** should either upgrade or fix it ;) |
|
|
12 | *** |
28 | *** |
13 | *** Marc Lehmann <schmorp\@schmorp.de> |
29 | *** Marc Lehmann <schmorp\@schmorp.de> |
14 | *** |
30 | *** |
15 | |
31 | |
16 | EOF |
32 | EOF |
… | |
… | |
22 | |
38 | |
23 | *** |
39 | *** |
24 | *** WARNING: Event version $Event::VERSION found, NOT building Event support. |
40 | *** WARNING: Event version $Event::VERSION found, NOT building Event support. |
25 | *** |
41 | *** |
26 | *** This version of Event is broken. The only currently known non-broken |
42 | *** This version of Event is broken. The only currently known non-broken |
27 | *** versions of Event are 0.87 and 0.89+. Please install one of these |
43 | *** versions of Event are 0.87 and 0.89+. Please install one of those |
28 | *** versions. |
44 | *** versions. |
29 | *** |
45 | *** |
30 | |
46 | |
31 | EOF |
47 | EOF |
32 | } else { |
48 | } else { |
33 | $EVENT = 1; |
49 | $EVENT = 1; |
34 | $DEFINE .= " -DHAVE_EVENT=1"; |
50 | $DEFINE .= " -DHAVE_EVENT=1"; |
35 | print "\nEvent version $Event::VERSION found, building Event support.\n\n"; |
51 | print "\nEvent version $Event::VERSION found, building Event support.\n\n"; |
36 | } |
52 | } |
37 | print "\n"; |
|
|
38 | } else { |
53 | } else { |
39 | print "\n*** Event not found, not build Event support.\n\n"; |
54 | print "\n*** Event not found, not build Event support.\n\n"; |
|
|
55 | } |
|
|
56 | |
|
|
57 | if (eval { require EV }) { |
|
|
58 | if ($EV::VERSION < 3.3) { |
|
|
59 | print <<EOF |
|
|
60 | |
|
|
61 | *** |
|
|
62 | *** WARNING: Event version $EV::VERSION found, NOT building EV support. |
|
|
63 | *** |
|
|
64 | *** This version is ABI-incompatible with Coro, please upgrade to at least 3.3. |
|
|
65 | *** |
|
|
66 | |
|
|
67 | EOF |
|
|
68 | } else { |
|
|
69 | $EV = 1; |
|
|
70 | $DEFINE .= " -DHAVE_EV=1"; |
|
|
71 | print "\nEV version $EV::VERSION found, building EV support.\n\n"; |
|
|
72 | } |
|
|
73 | } else { |
|
|
74 | print "\n*** EV not found, not build EV support.\n\n"; |
40 | } |
75 | } |
41 | |
76 | |
42 | WriteMakefile( |
77 | WriteMakefile( |
43 | dist => { |
78 | dist => { |
44 | PREOP => 'pod2text Coro.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
79 | PREOP => 'pod2text Coro.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
45 | COMPRESS => 'gzip -9v', |
80 | COMPRESS => 'gzip -9v', |
46 | SUFFIX => '.gz', |
81 | SUFFIX => '.gz', |
47 | }, |
82 | }, |
48 | NAME => "Coro", |
83 | NAME => "Coro", |
49 | VERSION_FROM => "Coro.pm", |
84 | VERSION_FROM => "Coro.pm", |
50 | DIR => ['Coro', ($EVENT ? 'Event' : ())], |
85 | DIR => ['Coro', ($EVENT ? 'Event' : ()), ($EV ? "EV" : ())], |
51 | PREREQ_PM => { |
86 | PREREQ_PM => { |
52 | Event => 0.86, |
87 | common::sense => 0, |
53 | Scalar::Util => 0.00, |
88 | Scalar::Util => 0.00, |
|
|
89 | AnyEvent => 4.81, |
|
|
90 | Storable => 2.15, |
|
|
91 | Time::HiRes => 0, |
|
|
92 | Guard => 0.5, |
|
|
93 | |
|
|
94 | # for Coro::Event |
|
|
95 | #Event => 1.06, |
|
|
96 | |
|
|
97 | # for Coro::EV |
|
|
98 | #EV => 3.3, |
|
|
99 | |
|
|
100 | # for Coro::AIO |
|
|
101 | #IO::AIO => 2.3, |
|
|
102 | #AnyEvent::AIO => 1.0, |
|
|
103 | |
|
|
104 | # for Coro::BDB |
|
|
105 | #BDB => 1.5, |
|
|
106 | #AnyEvent::BDB => 1.0, |
|
|
107 | }, |
|
|
108 | # neither configure_requires nor recommends can be used |
|
|
109 | # for optional dependencies. whoever decided that a module needs |
|
|
110 | # to build properly without its dependencies installed |
|
|
111 | # needs his brain rearranged dramatically. |
|
|
112 | META_MERGE => { |
|
|
113 | recommends => { |
|
|
114 | Event => 1.08, |
|
|
115 | EV => 3.0, |
|
|
116 | IO::AIO => 3.1, |
|
|
117 | AnyEvent::AIO => 1.0, |
|
|
118 | BDB => 0, |
|
|
119 | AnyEvent::BDB => 1.0, |
|
|
120 | } |
54 | }, |
121 | }, |
55 | PM => { |
122 | PM => { |
56 | 'Coro.pm' => '$(INST_LIBDIR)/Coro.pm', |
123 | 'Coro.pm' => '$(INST_LIBDIR)/Coro.pm', |
57 | |
124 | |
58 | 'Coro/State.pm' => '$(INST_LIBDIR)/Coro/State.pm', |
125 | 'Coro/State.pm' => '$(INST_LIBDIR)/Coro/State.pm', |
59 | |
126 | |
60 | 'Coro/MakeMaker.pm' => '$(INST_LIBDIR)/Coro/MakeMaker.pm', |
127 | 'Coro/MakeMaker.pm' => '$(INST_LIBDIR)/Coro/MakeMaker.pm', |
61 | 'Coro/CoroAPI.h' => '$(INST_LIBDIR)/Coro/CoroAPI.h', |
128 | 'Coro/CoroAPI.h' => '$(INST_LIBDIR)/Coro/CoroAPI.h', |
62 | |
129 | |
63 | 'Coro/Cont.pm' => '$(INST_LIBDIR)/Coro/Cont.pm', |
130 | # 'Coro/Cont.pm' => '$(INST_LIBDIR)/Coro/Cont.pm', |
64 | |
131 | |
65 | 'Coro/Specific.pm' => '$(INST_LIBDIR)/Coro/Specific.pm', |
132 | 'Coro/Specific.pm' => '$(INST_LIBDIR)/Coro/Specific.pm', |
66 | |
133 | |
67 | 'Coro/Timer.pm' => '$(INST_LIBDIR)/Coro/Timer.pm', |
134 | 'Coro/Timer.pm' => '$(INST_LIBDIR)/Coro/Timer.pm', |
68 | 'Coro/Signal.pm' => '$(INST_LIBDIR)/Coro/Signal.pm', |
135 | 'Coro/Signal.pm' => '$(INST_LIBDIR)/Coro/Signal.pm', |
69 | 'Coro/Channel.pm' => '$(INST_LIBDIR)/Coro/Channel.pm', |
136 | 'Coro/Channel.pm' => '$(INST_LIBDIR)/Coro/Channel.pm', |
70 | 'Coro/Semaphore.pm' => '$(INST_LIBDIR)/Coro/Semaphore.pm', |
137 | 'Coro/Semaphore.pm' => '$(INST_LIBDIR)/Coro/Semaphore.pm', |
71 | 'Coro/SemaphoreSet.pm'=> '$(INST_LIBDIR)/Coro/SemaphoreSet.pm', |
138 | 'Coro/SemaphoreSet.pm'=> '$(INST_LIBDIR)/Coro/SemaphoreSet.pm', |
72 | 'Coro/RWLock.pm' => '$(INST_LIBDIR)/Coro/RWLock.pm', |
139 | 'Coro/RWLock.pm' => '$(INST_LIBDIR)/Coro/RWLock.pm', |
|
|
140 | |
|
|
141 | 'Coro/Debug.pm' => '$(INST_LIBDIR)/Coro/Debug.pm', |
|
|
142 | 'Coro/Util.pm' => '$(INST_LIBDIR)/Coro/Util.pm', |
|
|
143 | 'Coro/Select.pm' => '$(INST_LIBDIR)/Coro/Select.pm', |
|
|
144 | 'Coro/Handle.pm' => '$(INST_LIBDIR)/Coro/Handle.pm', |
|
|
145 | 'Coro/Socket.pm' => '$(INST_LIBDIR)/Coro/Socket.pm', |
|
|
146 | |
|
|
147 | 'Coro/AIO.pm' => '$(INST_LIBDIR)/Coro/AIO.pm', |
|
|
148 | 'Coro/BDB.pm' => '$(INST_LIBDIR)/Coro/BDB.pm', |
|
|
149 | 'Coro/LWP.pm' => '$(INST_LIBDIR)/Coro/LWP.pm', |
|
|
150 | 'Coro/Storable.pm' => '$(INST_LIBDIR)/Coro/Storable.pm', |
|
|
151 | 'Coro/AnyEvent.pm' => '$(INST_LIBDIR)/Coro/AnyEvent.pm', |
73 | }, |
152 | }, |
74 | ); |
153 | ); |
75 | |
154 | |
76 | sub MY::postamble { |
155 | sub MY::postamble { |
77 | <<EOF; |
156 | <<EOF; |
78 | |
157 | |
79 | # set \$VERSION in all modules |
158 | # set \$VERSION in all modules |
80 | setver: |
159 | setver: |
81 | \$(PERL) -pi -e 's/^(\\s*\\\$\$VERSION\\s*=\\s*).*\$\$/\$\${1}\$(VERSION);/' *.pm Coro/*.pm Event/*.pm |
160 | \$(PERL) -pi -e 's/^(\\s*(our\\s*)?\\\$\$VERSION\\s*=\\s*).*\$\$/\$\${1}\$(VERSION);/' *.pm Coro/*.pm EV/*.pm Event/*.pm |
82 | |
161 | |
83 | EOF |
162 | EOF |
84 | } |
163 | } |
85 | |
164 | |
86 | |
165 | |