ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/Makefile.PL
(Generate patch)

Comparing EV/Makefile.PL (file contents):
Revision 1.5 by root, Mon Oct 29 08:48:07 2007 UTC vs.
Revision 1.19 by root, Mon Nov 12 01:01:13 2007 UTC

1use 5.006; 1use 5.006;
2 2
3use Config;
3use ExtUtils::MakeMaker; 4use ExtUtils::MakeMaker;
4 5
6
7unless (-e "libev/ev_epoll.c") {
5print <<EOF; 8 print <<EOF;
6 9
7*** 10***
8*** You need to install libevent (http://monkey.org/~provos/libevent/) separately 11*** ERROR: libev is missing or damaged. If you used a CVS check-out of EV,
9*** first in a way so that the Makefile.PL can find both -levent and the event.h 12*** you also have to check-out the "libev" module from the same CVS
10*** and evdns.h include files. 13*** repository into the EV dir (i.e. EV/libev from outside).
11*** 14***
12*** Version 1.3e or higher is recommended, but older 1.3 versions likely work too. 15
13*** 16EOF
17 exit 1;
18}
19
20print <<EOF;
21
22
23*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
24
25Welcome to EV configuration. If you are in a hurry, just press return here
26and hope for the best. The defaults should usually do.
27
28EOF
29
30if (prompt ("Skip further questions and use defaults (y/n)?", "y") =~ /[yY]/) {
31 $ENV{PERL_MM_USE_DEFAULT} = 1;
32}
33
34print <<EOF;
35
36
37*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
38
39POSIX optionally offers support for a monotonic clock source. EV
40can take advantage of this clock source to detect time jumps
41reliably. Unfortunately, some systems are bound to be broken, so you can
42disable this here: you can completely disable the detection and use of
43the monotonic clock by answering 'n' here. Support for this clock type
44will otherwise be autodetected at both compile- and runtime.
45
46EOF
47
48if (prompt ("Enable optional support for CLOCK_MONOTONIC (y/n)?", "y") =~ /[yY]/) {
49 $DEFINE .= " -DEV_USE_MONOTONIC";
50}
51
52print <<EOF;
53
54
55*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
56
57POSIX optionally offers support for a (potentially) high-resolution
58realtime clock interface. In a good implementation, using it is faster
59than the normal method of using gettimeofday. Unfortunately, this option
60is also bound to be broken on some systems, so you can disable use and
61probing of this feature altogether here. Otherwise support for this clock
62type will be autodetected at compiletime.
63
64EOF
65
66if (prompt ("Prefer clock_gettime (CLOCK_REALTIME) over gettimeofday (y/n)?", "y") !~ /[yY]/) {
67 $DEFINE .= " -DEV_USE_REALTIME=0";
68}
69
70print <<EOF;
71
72
73*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
74
75EV can use various backends with various portability issue. The select
76backend is the most portable and makes for a good fallback, but it can be
77limited to a low number of file descriptors and/or might not compile. If
78you have problems with compiling ev_select., you might try to play around
79with disabling it here, or forcing it to use the fd_set provided by your
80OS, via the next question. I highly recommend keeping it in.
81
82EOF
83
84if (prompt ("Enable select backend (y/n)?", "y") =~ /[yY]/) {
85 $DEFINE .= " -DEV_USE_SELECT";
86
87 print <<EOF;
88
89
90*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
91
92The select backend can operate in two modes. One uses the system-provided
93fd_set and is usually limited to 1024 file descriptors (64 on windows),
94the other requires your header files to define NFDBITS and declare a
95suitable fd_mask type. If you run into problems compiling ev_select.c, you
96can try forcing the use of the system fd_set here.
97
98EOF
99
100 if (prompt ("Force use of system fd_set for select backend (y/n)?", "n") =~ /[yY]/) {
101 $DEFINE .= " -DEV_SELECT_USE_FD_SET";
102 }
103}
104
105print <<EOF;
106
107
108*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
109
110The second very portable backend is poll(2). It does not exist on windows
111and various versions of Mac OS X (and on the other versions it simply
112doesn't work), but works basically everywhere else. It is recommended to use
113the default here unless you run into compile problems in ev_poll.c.
114
115EOF
116
117if (prompt ("Enable poll backend (y/n)?", (-e "/usr/include/poll.h") ? "y" : "n") =~ /[yY]/) {
118 $DEFINE .= " -DEV_USE_POLL";
119}
120
121print <<EOF;
122
123
124*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
125
126EV by default uses select, which makes it hard to write efficient servers,
127especially if the number of active conencitons is much lower than the open
128ones. GNU/Linux systems have a more scalable method called "epoll", which
129EV can use. For this to work, both your kernel and glibc have to support
130epoll, but if you can compile it, the detection will be done at runtime,
131and EV will safely fall back to using select when epoll isn't available.
132If unsure, accept the default.
133
134EOF
135
136if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) {
137 $DEFINE .= " -DEV_USE_EPOLL";
138}
139
140print <<EOF;
141
142
143*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
144
145Similarly to the epoll backend above, EV can take advantage of kqueue
146on many BSD systems (it seems to be broken on Mac OS X though, but what
147isn't broken on that shoddy platform... ah yes, the cash gushing by apple,
148selling defective software works perfectly there). Support for kqueue will
149be detected at runtime, with a safe fallback to other methods when it
150cannot be used.
151
152EOF
153
154if (prompt ("Enable kqueue backend (y/n)?", (-e "/usr/include/sys/event.h") ? "y" : "n") =~ /[yY]/) {
155 $DEFINE .= " -DEV_USE_KQUEUE";
156}
157
158print <<EOF;
159
160
161*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
162
163EV needs the functions pthread_atfork and clock_gettime. On most systems
164you need some special libraries for this (such as -lrt and -lpthread). You
165can specify additional libraries to provide these calls now, or accept the
166default.
167
168EOF
169
170$LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt";
171
172
173print <<EOF;
174
175
176*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
14 177
15EOF 178EOF
16 179
17WriteMakefile( 180WriteMakefile(
18 dist => { 181 dist => {
19 PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', 182 PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
20 COMPRESS => 'gzip -9v', 183 COMPRESS => 'gzip -9v',
21 SUFFIX => '.gz', 184 SUFFIX => '.gz',
22 }, 185 },
23 LIBS => ["-levent"], 186 depend => {
187 "EV.c" => "EV/EVAPI.h "
188 . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c libev/ev_kqueue.c libev/ev_poll.c "
189 . "libev/event.h libev/event.c evdns.h evdns.c libev/ev_vars.h libev/ev_wrap.h",
190 },
191 INC => "-Ilibev",
192 DEFINE => "$DEFINE",
24 NAME => "EV", 193 NAME => "EV",
194 LIBS => [$LIBS],
25 VERSION_FROM => "EV.pm", 195 VERSION_FROM => "EV.pm",
26 PM => { 196 PM => {
27 'EV.pm' => '$(INST_LIBDIR)/EV.pm', 197 'EV.pm' => '$(INST_LIBDIR)/EV.pm',
28 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm',
29 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', 198 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm',
30 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', 199 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h',
31 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', 200 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm',
201 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h',
32 }, 202 },
33); 203);
34 204
205

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines