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

Comparing EV/Makefile.PL (file contents):
Revision 1.49 by root, Thu Dec 30 07:37:38 2010 UTC vs.
Revision 1.55 by root, Sat Sep 6 18:42:18 2014 UTC

1use 5.008002; 1use 5.008002;
2 2
3use strict qw(vars subs); 3use strict qw(vars subs);
4use Config; 4use Config;
5use ExtUtils::MakeMaker; 5use ExtUtils::MakeMaker;
6
7sub have_inc($) {
8 scalar grep -r "$_/$_[0]", $Config{usrinc}, split / /, $Config{incpth}
9}
6 10
7unless (-e "libev/ev_epoll.c") { 11unless (-e "libev/ev_epoll.c") {
8 print <<EOF; 12 print <<EOF;
9 13
10*** 14***
93 97
94EOF 98EOF
95 99
96 if (prompt ("Force use of system fd_set for select backend (y/n)?", "n") =~ /[yY]/) { 100 if (prompt ("Force use of system fd_set for select backend (y/n)?", "n") =~ /[yY]/) {
97 $DEFINE .= " -DEV_SELECT_USE_FD_SET"; 101 $DEFINE .= " -DEV_SELECT_USE_FD_SET";
98 } 102 }
99} else { 103} else {
100 $DEFINE .= " -DEV_USE_SELECT=0"; 104 $DEFINE .= " -DEV_USE_SELECT=0";
101} 105}
102 106
103print <<EOF; 107print <<EOF;
104 108
105*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 109*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
106 110
110doesn't work), but works basically everywhere else. It is recommended to use 114doesn't work), but works basically everywhere else. It is recommended to use
111the default here unless you run into compile problems in ev_poll.c. 115the default here unless you run into compile problems in ev_poll.c.
112 116
113EOF 117EOF
114 118
115$DEFINE .= " -DEV_USE_POLL=" . (0 + (prompt ("Enable poll backend (y/n)?", (-e "/usr/include/poll.h") ? "y" : "n") =~ /[yY]/)); 119$DEFINE .= " -DEV_USE_POLL=" . (0 + (prompt ("Enable poll backend (y/n)?", (have_inc "poll.h") ? "y" : "n") =~ /[yY]/));
116 120
117print <<EOF; 121print <<EOF;
118 122
119*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 123*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
120 124
127fall back to using select when epoll isn't available. If unsure, accept 131fall back to using select when epoll isn't available. If unsure, accept
128the default. 132the default.
129 133
130EOF 134EOF
131 135
132my $can_epoll = -e "/usr/include/sys/epoll.h"; 136my $can_epoll = have_inc "sys/epoll.h";
133$can_epoll = $ENV{EV_EPOLL} if exists $ENV{EV_EPOLL}; 137$can_epoll = $ENV{EV_EPOLL} if exists $ENV{EV_EPOLL};
134$DEFINE .= " -DEV_USE_EPOLL=" . (0 + (prompt ("Enable epoll backend (y/n)?", $can_epoll ? "y" : "n") =~ /[yY]/)); 138$DEFINE .= " -DEV_USE_EPOLL=" . (0 + (prompt ("Enable epoll backend (y/n)?", $can_epoll ? "y" : "n") =~ /[yY]/));
135 139
136print <<EOF; 140print <<EOF;
137 141
155 (similar problems as on FreeBSD). 159 (similar problems as on FreeBSD).
156OS X: completely, utterly broken on at least <= 10.6. 160OS X: completely, utterly broken on at least <= 10.6.
157 161
158EOF 162EOF
159 163
160my $can_kqueue = -e "/usr/include/sys/event.h"; 164my $can_kqueue = have_inc "sys/event.h";
161$can_kqueue = $ENV{EV_KQUEUE} if exists $ENV{EV_KQUEUE}; 165$can_kqueue = $ENV{EV_KQUEUE} if exists $ENV{EV_KQUEUE};
162$DEFINE .= " -DEV_USE_KQUEUE=" . (0 + (prompt ("Enable kqueue backend (y/n)?", $can_kqueue ? "y" : "n") =~ /[yY]/)); 166$DEFINE .= " -DEV_USE_KQUEUE=" . (0 + (prompt ("Enable kqueue backend (y/n)?", $can_kqueue ? "y" : "n") =~ /[yY]/));
163 167
164print <<EOF; 168print <<EOF;
165 169
170solaris 10 event port interface. Support for event ports will be detected 174solaris 10 event port interface. Support for event ports will be detected
171at runtime, with a safe fallback to other methods when it cannot be used. 175at runtime, with a safe fallback to other methods when it cannot be used.
172 176
173EOF 177EOF
174 178
175$DEFINE .= " -DEV_USE_PORT=" . (0 + (prompt ("Enable event port backend (y/n)?", (-e "/usr/include/sys/port.h") ? "y" : "n") =~ /[yY]/)); 179$DEFINE .= " -DEV_USE_PORT=" . (0 + (prompt ("Enable event port backend (y/n)?", (have_inc "sys/port.h") ? "y" : "n") =~ /[yY]/));
176 180
177print <<EOF; 181print <<EOF;
178 182
179*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 183*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
180 184
182EV needs the functions pthread_atfork and clock_gettime. On most systems 186EV needs the functions pthread_atfork and clock_gettime. On most systems
183you need some special libraries for this (such as -lrt and -lpthread). You 187you need some special libraries for this (such as -lrt and -lpthread). You
184can specify additional libraries to provide these calls (and any other 188can specify additional libraries to provide these calls (and any other
185required by EV) now, or accept the default. 189required by EV) now, or accept the default.
186 190
191On GNU/Linux systems, EV uses the LSB 3.1 __register_atfork function
192to avoid the dependency on libpthread, and directly uses the clock_gettime
193syscall to avoid a dependency on librt.
194
187EOF 195EOF
188 196
189my $solaris_libs = $^O =~ /solaris/i ? "-lsocket -lnsl" : ""; 197my $solaris_libs = $^O =~ /solaris/i ? "-lsocket -lnsl" : "";
190my $librt = $^O =~ /linux/i ? "-lpthread" : "-lpthread -lrt"; 198my $librt = $^O =~ /linux/i ? "" : "-lpthread -lrt";
199my $LIBS = exists $ENV{EV_LIBS} ? $ENV{EV_LIBS} : "$librt $solaris_libs";
191my $LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "$librt $solaris_libs"; 200$LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", $LIBS;
192 201
193 202
194print <<EOF; 203print <<EOF;
195 204
196*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 205*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
201you have the include file and libc support for it, it is usually a good 210you have the include file and libc support for it, it is usually a good
202idea to enable it, as kernel availability is detected at runtime. 211idea to enable it, as kernel availability is detected at runtime.
203 212
204EOF 213EOF
205 214
206my $can_inotify = -e "/usr/include/sys/inotify.h"; 215my $can_inotify = have_inc "sys/inotify.h";
207$can_inotify = $ENV{EV_INOTIFY} if exists $ENV{EV_INOTIFY}; 216$can_inotify = $ENV{EV_INOTIFY} if exists $ENV{EV_INOTIFY};
208$DEFINE .= " -DEV_USE_INOTIFY=" . (0 + (prompt ("Enable inotify support (y/n)?", $can_inotify ? "y" : "n") =~ /[yY]/)); 217$DEFINE .= " -DEV_USE_INOTIFY=" . (0 + (prompt ("Enable inotify support (y/n)?", $can_inotify ? "y" : "n") =~ /[yY]/));
209 218
210print <<EOF; 219print <<EOF;
211 220
218your libc must contain the necessary wrapper. Glibc 2.7 and later should 227your libc must contain the necessary wrapper. Glibc 2.7 and later should
219have this wrapper. 228have this wrapper.
220 229
221EOF 230EOF
222 231
223my $can_eventfd = -e "/usr/include/sys/eventfd.h"; 232my $can_eventfd = have_inc "sys/eventfd.h";
224$can_eventfd = $ENV{EV_EVENTFD} if exists $ENV{EV_EVENTFD}; 233$can_eventfd = $ENV{EV_EVENTFD} if exists $ENV{EV_EVENTFD};
225$DEFINE .= " -DEV_USE_EVENTFD=" . (0 + (prompt ("Enable linux eventfd support (y/n)?", $can_eventfd ? "y" : "n") =~ /[yY]/)); 234$DEFINE .= " -DEV_USE_EVENTFD=" . (0 + (prompt ("Enable linux eventfd support (y/n)?", $can_eventfd ? "y" : "n") =~ /[yY]/));
226 235
227print <<EOF; 236print <<EOF;
228 237
234this will be probed at runtime, but your libc must contain the necessary 243this will be probed at runtime, but your libc must contain the necessary
235wrapper. Glibc 2.7 and later should have this wrapper. 244wrapper. Glibc 2.7 and later should have this wrapper.
236 245
237EOF 246EOF
238 247
239my $can_signalfd = -e "/usr/include/sys/signalfd.h"; 248my $can_signalfd = have_inc "sys/signalfd.h";
240$can_signalfd = $ENV{EV_SIGNALFD} if exists $ENV{EV_SIGNALFD}; 249$can_signalfd = $ENV{EV_SIGNALFD} if exists $ENV{EV_SIGNALFD};
241$DEFINE .= " -DEV_USE_SIGNALFD=" . (0 + (prompt ("Enable linux signalfd support (y/n)?", $can_signalfd ? "y" : "n") =~ /[yY]/)); 250$DEFINE .= " -DEV_USE_SIGNALFD=" . (0 + (prompt ("Enable linux signalfd support (y/n)?", $can_signalfd ? "y" : "n") =~ /[yY]/));
242 251
243print <<EOF; 252print <<EOF;
244 253
245*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 254*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
246 255
247 256
248Very rarely, people want to tweak EV even more, e.g. to exclude 257Very rarely, people want to tweak EV even more, e.g. to exclude
249or incldue certain watcher types or backends. Thisc na be done by adding 258or include certain watcher types or backends. This can be done by adding
250extra -D options here, or via the EV_EXTRA_DEFS environment variable. 259extra -D options here, or via the EV_EXTRA_DEFS environment variable.
260
261For example, if you run into compile problems because of missing memory
262fences (or you just want extra performance), you can tell EV to not support
263smp and threads via -DEV_NO_THREADS.
264
251Normal persons just press enter. 265Normal persons just press enter.
252 266
253EOF 267EOF
254 268
255$DEFINE .= " " . prompt "Any extra -D options?", "$ENV{EV_EXTRA_DEFS}"; 269$DEFINE .= " " . prompt "Any extra -D options?", "$ENV{EV_EXTRA_DEFS}";
282 @anyevent, 296 @anyevent,
283 "common::sense" => 0, 297 "common::sense" => 0,
284 }, 298 },
285 VERSION_FROM => "EV.pm", 299 VERSION_FROM => "EV.pm",
286 PM => { 300 PM => {
287 'EV.pm' => '$(INST_LIBDIR)/EV.pm', 301 'EV.pm' => '$(INST_LIB)/EV.pm',
288 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', 302 'EV/EVAPI.h' => '$(INST_LIB)/EV/EVAPI.h',
289 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', 303 'EV/MakeMaker.pm' => '$(INST_LIB)/EV/MakeMaker.pm',
290 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', 304 'libev/ev.h' => '$(INST_LIB)/EV/ev.h',
291 'libev/ev.pod' => '$(INST_LIBDIR)/EV/libev.pod', 305 'libev/ev.pod' => '$(INST_LIB)/EV/libev.pod',
292 }, 306 },
293 MAN3PODS => { 307 MAN3PODS => {
294 'EV.pm' => '$(INST_MAN3DIR)/EV.$(MAN3EXT)', 308 'EV.pm' => '$(INST_MAN3DIR)/EV.$(MAN3EXT)',
295 'EV/MakeMaker.pm' => '$(INST_MAN3DIR)/EV::MakeMaker.$(MAN3EXT)', 309 'EV/MakeMaker.pm' => '$(INST_MAN3DIR)/EV::MakeMaker.$(MAN3EXT)',
296 'libev/ev.pod' => '$(INST_MAN3DIR)/EV::libev.$(MAN3EXT)', 310 'libev/ev.pod' => '$(INST_MAN3DIR)/EV::libev.$(MAN3EXT)',

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines