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 fix it ;) |
|
|
12 | *** |
26 | *** |
13 | *** Marc Lehmann <pcg\@goof.com> |
27 | *** Marc Lehmann <schmorp\@schmorp.de> |
14 | *** |
28 | *** |
15 | |
29 | |
16 | EOF |
30 | EOF |
17 | } |
31 | } |
18 | |
32 | |
19 | if (eval { require Event }) { |
33 | if (eval { require Event }) { |
20 | if ($Event::VERSION < 0.86) { |
34 | if ($Event::VERSION < 0.86 or $Event::VERSION == 0.88) { |
21 | print "*** Please read the INSTALL file, you need a patched Event.\n"; |
|
|
22 | } elsif ($Event::VERSION == 0.88) { |
|
|
23 | print <<EOF |
35 | print <<EOF |
24 | |
36 | |
25 | *** |
37 | *** |
26 | *** WARNING: Event version $Event::VERSION found, NOT building Event support. |
38 | *** WARNING: Event version $Event::VERSION found, NOT building Event support. |
27 | *** |
39 | *** |
28 | *** This version of Event is broken. The only currently known non-broken |
40 | *** This version of Event is broken. The only currently known non-broken |
29 | *** version of Event is 0.87. Please install this version, or try with a |
41 | *** versions of Event are 0.87 and 0.89+. Please install one of those |
30 | *** newer version that hopefully has the bug fixed. |
42 | *** versions. |
31 | *** |
43 | *** |
32 | |
44 | |
33 | EOF |
45 | EOF |
34 | } else { |
46 | } else { |
35 | $EVENT = 1; |
47 | $EVENT = 1; |
36 | $DEFINE .= " -DHAVE_EVENT=1"; |
48 | $DEFINE .= " -DHAVE_EVENT=1"; |
37 | print "\nEvent version $Event::VERSION found, building Event support.\n\n"; |
49 | print "\nEvent version $Event::VERSION found, building Event support.\n\n"; |
38 | } |
50 | } |
39 | print "\n"; |
|
|
40 | } else { |
51 | } else { |
41 | print "\n*** Event not found, not build Event support.\n\n"; |
52 | print "\n*** Event not found, not build Event support.\n\n"; |
|
|
53 | } |
|
|
54 | |
|
|
55 | if (eval { require EV }) { |
|
|
56 | $EV = 1; |
|
|
57 | $DEFINE .= " -DHAVE_EV=1"; |
|
|
58 | print "\nEV version $EV::VERSION found, building EV support.\n\n"; |
|
|
59 | } else { |
|
|
60 | print "\n*** EV not found, not build EV support.\n\n"; |
42 | } |
61 | } |
43 | |
62 | |
44 | WriteMakefile( |
63 | WriteMakefile( |
45 | dist => { |
64 | dist => { |
46 | PREOP => 'pod2text Coro.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
65 | PREOP => 'pod2text Coro.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
47 | COMPRESS => 'gzip -9v', |
66 | COMPRESS => 'gzip -9v', |
48 | SUFFIX => '.gz', |
67 | SUFFIX => '.gz', |
49 | }, |
68 | }, |
50 | NAME => "Coro", |
69 | NAME => "Coro", |
51 | VERSION_FROM => "Coro.pm", |
70 | VERSION_FROM => "Coro.pm", |
52 | DIR => ['Coro', ($EVENT ? 'Event' : ())], |
71 | DIR => ['Coro', ($EVENT ? 'Event' : ()), ($EV ? "EV" : ())], |
53 | PREREQ_PM => { |
72 | PREREQ_PM => { |
54 | Event => 0.86, |
|
|
55 | Scalar::Util => 0.00, |
73 | Scalar::Util => 0.00, |
|
|
74 | AnyEvent => 2.51, |
|
|
75 | Storable => 2.15, |
|
|
76 | Time::HiRes => 0, |
|
|
77 | |
|
|
78 | # for Coro::Event |
|
|
79 | Event => 1.06, |
|
|
80 | |
|
|
81 | # for Coro::EV |
|
|
82 | EV => 0.03, |
|
|
83 | |
|
|
84 | # for Coro::AIO |
|
|
85 | IO::AIO => 2.3, |
56 | }, |
86 | }, |
57 | PM => { |
87 | PM => { |
58 | 'Coro.pm' => '$(INST_LIBDIR)/Coro.pm', |
88 | 'Coro.pm' => '$(INST_LIBDIR)/Coro.pm', |
59 | |
89 | |
60 | 'Coro/State.pm' => '$(INST_LIBDIR)/Coro/State.pm', |
90 | 'Coro/State.pm' => '$(INST_LIBDIR)/Coro/State.pm', |
61 | |
91 | |
62 | 'Coro/MakeMaker.pm' => '$(INST_LIBDIR)/Coro/MakeMaker.pm', |
92 | 'Coro/MakeMaker.pm' => '$(INST_LIBDIR)/Coro/MakeMaker.pm', |
63 | 'Coro/CoroAPI.h' => '$(INST_LIBDIR)/Coro/CoroAPI.h', |
93 | 'Coro/CoroAPI.h' => '$(INST_LIBDIR)/Coro/CoroAPI.h', |
64 | |
94 | |
65 | 'Coro/Cont.pm' => '$(INST_LIBDIR)/Coro/Cont.pm', |
95 | # 'Coro/Cont.pm' => '$(INST_LIBDIR)/Coro/Cont.pm', |
66 | |
96 | |
67 | 'Coro/Specific.pm' => '$(INST_LIBDIR)/Coro/Specific.pm', |
97 | 'Coro/Specific.pm' => '$(INST_LIBDIR)/Coro/Specific.pm', |
68 | |
98 | |
69 | 'Coro/Timer.pm' => '$(INST_LIBDIR)/Coro/Timer.pm', |
99 | 'Coro/Timer.pm' => '$(INST_LIBDIR)/Coro/Timer.pm', |
70 | 'Coro/Signal.pm' => '$(INST_LIBDIR)/Coro/Signal.pm', |
100 | 'Coro/Signal.pm' => '$(INST_LIBDIR)/Coro/Signal.pm', |
71 | 'Coro/Channel.pm' => '$(INST_LIBDIR)/Coro/Channel.pm', |
101 | 'Coro/Channel.pm' => '$(INST_LIBDIR)/Coro/Channel.pm', |
72 | 'Coro/Semaphore.pm' => '$(INST_LIBDIR)/Coro/Semaphore.pm', |
102 | 'Coro/Semaphore.pm' => '$(INST_LIBDIR)/Coro/Semaphore.pm', |
73 | 'Coro/SemaphoreSet.pm'=> '$(INST_LIBDIR)/Coro/SemaphoreSet.pm', |
103 | 'Coro/SemaphoreSet.pm'=> '$(INST_LIBDIR)/Coro/SemaphoreSet.pm', |
74 | 'Coro/RWLock.pm' => '$(INST_LIBDIR)/Coro/RWLock.pm', |
104 | 'Coro/RWLock.pm' => '$(INST_LIBDIR)/Coro/RWLock.pm', |
|
|
105 | |
|
|
106 | 'Coro/Debug.pm' => '$(INST_LIBDIR)/Coro/Debug.pm', |
|
|
107 | 'Coro/Util.pm' => '$(INST_LIBDIR)/Coro/Util.pm', |
|
|
108 | 'Coro/Select.pm' => '$(INST_LIBDIR)/Coro/Select.pm', |
|
|
109 | 'Coro/Handle.pm' => '$(INST_LIBDIR)/Coro/Handle.pm', |
|
|
110 | 'Coro/Socket.pm' => '$(INST_LIBDIR)/Coro/Socket.pm', |
|
|
111 | |
|
|
112 | 'Coro/AIO.pm' => '$(INST_LIBDIR)/Coro/AIO.pm', |
|
|
113 | 'Coro/LWP.pm' => '$(INST_LIBDIR)/Coro/LWP.pm', |
|
|
114 | 'Coro/Storable.pm' => '$(INST_LIBDIR)/Coro/Storable.pm', |
75 | }, |
115 | }, |
76 | ); |
116 | ); |
77 | |
117 | |
78 | sub MY::postamble { |
118 | sub MY::postamble { |
79 | <<EOF; |
119 | <<EOF; |
80 | |
120 | |
81 | # set \$VERSION in all modules |
121 | # set \$VERSION in all modules |
82 | setver: |
122 | setver: |
83 | \$(PERL) -pi -e 's/^(\\s*\\\$\$VERSION\\s*=\\s*).*\$\$/\$\${1}\$(VERSION);/' *.pm Coro/*.pm Event/*.pm |
123 | \$(PERL) -pi -e 's/^(\\s*(our\\s*)?\\\$\$VERSION\\s*=\\s*).*\$\$/\$\${1}\$(VERSION);/' *.pm Coro/*.pm Event/*.pm |
84 | |
124 | |
85 | EOF |
125 | EOF |
86 | } |
126 | } |
87 | |
127 | |
88 | |
128 | |