ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Makefile.PL
Revision: 1.59
Committed: Tue Jul 14 00:55:10 2009 UTC (14 years, 10 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.58: +1 -0 lines
Log Message:
*** empty log message ***

File Contents

# Content
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";
17
18 if ($] < 5.006) {
19 print <<EOF;
20
21 ***
22 *** WARNING: This module is quite low-level and uses undocumented perl
23 *** internals to do it's job. While it seems to work fine with perl-5.[6-10]
24 *** it has not been tested with older versions. If it compiles and passes the
25 *** testsuite, it should work. Otherwise you should either upgrade or fix it ;)
26 ***
27 *** Marc Lehmann <schmorp\@schmorp.de>
28 ***
29
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 < 3.3) {
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 at least 3.3.
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";
73 }
74
75 WriteMakefile(
76 dist => {
77 PREOP => 'pod2text Coro.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
78 COMPRESS => 'gzip -9v',
79 SUFFIX => '.gz',
80 },
81 NAME => "Coro",
82 VERSION_FROM => "Coro.pm",
83 DIR => ['Coro', ($EVENT ? 'Event' : ()), ($EV ? "EV" : ())],
84 PREREQ_PM => {
85 common::sense => 0,
86 Scalar::Util => 0.00,
87 AnyEvent => 4.800001,
88 Storable => 2.15,
89 Time::HiRes => 0,
90 Guard => 0.5,
91
92 # for Coro::Event
93 #Event => 1.06,
94
95 # for Coro::EV
96 #EV => 3.3,
97
98 # for Coro::AIO
99 #IO::AIO => 2.3,
100 #AnyEvent::AIO => 1.0,
101
102 # for Coro::BDB
103 #BDB => 1.5,
104 #AnyEvent::BDB => 1.0,
105 },
106 # neither configure_requires nor recommends can be used
107 # for optional dependencies. whoever decided that a module needs
108 # to build properly without its dependencies installed
109 # needs his brain rearranged dramatically.
110 META_MERGE => {
111 recommends => {
112 Event => 1.08,
113 EV => 3.0,
114 IO::AIO => 3.1,
115 AnyEvent::AIO => 1.0,
116 BDB => 0,
117 AnyEvent::BDB => 1.0,
118 }
119 },
120 PM => {
121 'Coro.pm' => '$(INST_LIBDIR)/Coro.pm',
122
123 'Coro/State.pm' => '$(INST_LIBDIR)/Coro/State.pm',
124
125 'Coro/MakeMaker.pm' => '$(INST_LIBDIR)/Coro/MakeMaker.pm',
126 'Coro/CoroAPI.h' => '$(INST_LIBDIR)/Coro/CoroAPI.h',
127
128 # 'Coro/Cont.pm' => '$(INST_LIBDIR)/Coro/Cont.pm',
129
130 'Coro/Specific.pm' => '$(INST_LIBDIR)/Coro/Specific.pm',
131
132 'Coro/Timer.pm' => '$(INST_LIBDIR)/Coro/Timer.pm',
133 'Coro/Signal.pm' => '$(INST_LIBDIR)/Coro/Signal.pm',
134 'Coro/Channel.pm' => '$(INST_LIBDIR)/Coro/Channel.pm',
135 'Coro/Semaphore.pm' => '$(INST_LIBDIR)/Coro/Semaphore.pm',
136 'Coro/SemaphoreSet.pm'=> '$(INST_LIBDIR)/Coro/SemaphoreSet.pm',
137 'Coro/RWLock.pm' => '$(INST_LIBDIR)/Coro/RWLock.pm',
138
139 'Coro/Debug.pm' => '$(INST_LIBDIR)/Coro/Debug.pm',
140 'Coro/Util.pm' => '$(INST_LIBDIR)/Coro/Util.pm',
141 'Coro/Select.pm' => '$(INST_LIBDIR)/Coro/Select.pm',
142 'Coro/Handle.pm' => '$(INST_LIBDIR)/Coro/Handle.pm',
143 'Coro/Socket.pm' => '$(INST_LIBDIR)/Coro/Socket.pm',
144
145 'Coro/AIO.pm' => '$(INST_LIBDIR)/Coro/AIO.pm',
146 'Coro/BDB.pm' => '$(INST_LIBDIR)/Coro/BDB.pm',
147 'Coro/LWP.pm' => '$(INST_LIBDIR)/Coro/LWP.pm',
148 'Coro/Storable.pm' => '$(INST_LIBDIR)/Coro/Storable.pm',
149 'Coro/AnyEvent.pm' => '$(INST_LIBDIR)/Coro/AnyEvent.pm',
150 },
151 );
152
153 sub MY::postamble {
154 <<EOF;
155
156 # set \$VERSION in all modules
157 setver:
158 \$(PERL) -pi -e 's/^(\\s*(our\\s*)?\\\$\$VERSION\\s*=\\s*).*\$\$/\$\${1}\$(VERSION);/' *.pm Coro/*.pm EV/*.pm Event/*.pm
159
160 EOF
161 }
162
163