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