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

Comparing EV/Makefile.PL (file contents):
Revision 1.22 by root, Sat Nov 17 01:41:33 2007 UTC vs.
Revision 1.28 by root, Fri Dec 21 04:41:12 2007 UTC

116print <<EOF; 116print <<EOF;
117 117
118*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 118*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
119 119
120 120
121EV by default uses select, which makes it hard to write efficient servers, 121Select and poll make it hard to write efficient servers, especially if the
122especially if the number of active connections is much lower than the open 122number of active connections is much lower than the watched ones. GNU/Linux
123ones. GNU/Linux systems have a more scalable method called "epoll", which 123systems have a more scalable method called "epoll", which EV can use. For
124EV can use. For this to work, both your kernel and glibc have to support 124this to work, both your kernel and glibc have to support epoll, but if you
125epoll, but if you can compile it, the detection will be done at runtime, 125can compile it, the detection will be done at runtime, and EV will safely
126and EV will safely fall back to using select when epoll isn't available. 126fall back to using select when epoll isn't available. If unsure, accept
127If unsure, accept the default. 127the default.
128 128
129EOF 129EOF
130 130
131$DEFINE .= " -DEV_USE_EPOLL=" . (0 + (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/)); 131$DEFINE .= " -DEV_USE_EPOLL=" . (0 + (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/));
132 132
133print <<EOF; 133print <<EOF;
134 134
135*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 135*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
136 136
137 137
138Similarly to the epoll backend above, EV can take advantage of kqueue 138Similarly to the epoll backend above, EV can take advantage of kqueue on
139on many BSD systems (it seems to be broken on Mac OS X though, but what 139many BSD systems. Support for kqueue will be detected at runtime, with a
140isn't broken on that shoddy platform... ah yes, the cash gushing by apple, 140safe fallback to other methods when it cannot be used.
141selling defective software works perfectly there). Support for kqueue will
142be detected at runtime, with a safe fallback to other methods when it
143cannot be used.
144 141
145EOF 142Note that kqueue is broken on most operating systems, so it defaults to
143'n' on everything but netbsd. Here is what we know:
146 144
145NetBSD: partially working in at least 3.1. Yeah! :)
146FreeBSD: broken on at least 6.2-STABLE,
147 sockets *likely* work, ptys definitely don't.
148OpenBSD: reports indicate that it likely doesn't work
149 (similar problems as on FreeBSD).
150OS X: completely, utterly broken on at least < 10.5.
151
152EOF
153
154my $can_kqueue = -e "/usr/include/sys/event.h";
155
147$DEFINE .= " -DEV_USE_KQUEUE=" . (0 + (prompt ("Enable kqueue backend (y/n)?", (-e "/usr/include/sys/event.h") ? "y" : "n") =~ /[yY]/)); 156$DEFINE .= " -DEV_USE_KQUEUE=" . (0 + (prompt ("Enable kqueue backend (y/n)?", $can_kqueue ? "y" : "n") =~ /[yY]/));
148 157
149print <<EOF; 158print <<EOF;
150 159
151*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 160*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
152 161
153 162
154Similarly to the kqueue backend above, EV can take advantage of the 163Similarly to the kqueue backend above, EV can take advantage of the
155solaris 10 port interface. Support for port will be detected at runtime, 164solaris 10 event port interface. Support for event ports will be detected
156with a safe fallback to other methods when it cannot be used. 165at runtime, with a safe fallback to other methods when it cannot be used.
157 166
158EOF 167EOF
159 168
160$DEFINE .= " -DEV_USE_PORT=" . (0 + (prompt ("Enable port backend (y/n)?", (-e "/usr/include/sys/port.h") ? "y" : "n") =~ /[yY]/)); 169$DEFINE .= " -DEV_USE_PORT=" . (0 + (prompt ("Enable event port backend (y/n)?", (-e "/usr/include/sys/port.h") ? "y" : "n") =~ /[yY]/));
161 170
162print <<EOF; 171print <<EOF;
163 172
164*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 173*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
165 174
166 175
167EV needs the functions pthread_atfork and clock_gettime. On most systems 176EV needs the functions pthread_atfork and clock_gettime. On most systems
168you need some special libraries for this (such as -lrt and -lpthread). You 177you need some special libraries for this (such as -lrt and -lpthread). You
169can specify additional libraries to provide these calls now, or accept the 178can specify additional libraries to provide these calls (and any other
170default. 179required by EV) now, or accept the default.
171 180
172EOF 181EOF
173 182
183$SOLARIS_LIBS = $^O =~ /solaris/ ? " -lsocket -lnsl" : "";
184
174$LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt"; 185$LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt$SOLARIS_LIBS";
175 186
187
188print <<EOF;
189
190*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
191
192
193A backend of a different kind is the Linux inotify(7) interface, which can
194be used to speed up (and reduce resource consumption) of stat watchers. If
195you have it, it is usually a good idea to enable it.
196
197EOF
198
199my $can_inotify = -e "/usr/include/sys/inotify.h";
200
201$DEFINE .= " -DEV_USE_INOTIFY=" . (0 + (prompt ("Enable inotify support (y/n)?", $can_inotify ? "y" : "n") =~ /[yY]/));
176 202
177print <<EOF; 203print <<EOF;
178 204
179*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 205*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
180 206
190 SUFFIX => '.gz', 216 SUFFIX => '.gz',
191 }, 217 },
192 depend => { 218 depend => {
193 "EV.c" => "EV/EVAPI.h " 219 "EV.c" => "EV/EVAPI.h "
194 . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c libev/ev_kqueue.c libev/ev_poll.c " 220 . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c libev/ev_kqueue.c libev/ev_poll.c "
195 . "libev/event.h libev/event.c evdns.h evdns.c libev/ev_vars.h libev/ev_wrap.h", 221 . "libev/event.h libev/event.c libev/ev_vars.h libev/ev_wrap.h",
196 }, 222 },
197 INC => "-Ilibev", 223 INC => "-Ilibev",
198 DEFINE => "$DEFINE", 224 DEFINE => "$DEFINE",
199 NAME => "EV", 225 NAME => "EV",
200 LIBS => [$LIBS], 226 LIBS => [$LIBS],
202 @anyevent, 228 @anyevent,
203 }, 229 },
204 VERSION_FROM => "EV.pm", 230 VERSION_FROM => "EV.pm",
205 PM => { 231 PM => {
206 'EV.pm' => '$(INST_LIBDIR)/EV.pm', 232 'EV.pm' => '$(INST_LIBDIR)/EV.pm',
207 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm',
208 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', 233 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h',
209 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', 234 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm',
210 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', 235 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h',
211 }, 236 },
212); 237);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines