… | |
… | |
66 | print <<EOF; |
66 | print <<EOF; |
67 | |
67 | |
68 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
68 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
69 | |
69 | |
70 | |
70 | |
71 | EV can use various backends with various portability issue. The select |
71 | EV can use various backends with various portability issues. The select |
72 | backend is the most portable and makes for a good fallback, but it can be |
72 | backend is the most portable and makes for a good fallback, but it can be |
73 | limited to a low number of file descriptors and/or might not compile. If |
73 | limited to a low number of file descriptors and/or might not compile. If |
74 | you have problems with compiling ev_select.c, you might try to play around |
74 | you have problems with compiling ev_select.c, you might try to play around |
75 | with disabling it here, or forcing it to use the fd_set provided by your |
75 | with disabling it here, or forcing it to use the fd_set provided by your |
76 | OS, via the next question. I highly recommend keeping it in. |
76 | OS, via the next question. I highly recommend keeping it in. |
… | |
… | |
182 | EV needs the functions pthread_atfork and clock_gettime. On most systems |
182 | EV needs the functions pthread_atfork and clock_gettime. On most systems |
183 | you need some special libraries for this (such as -lrt and -lpthread). You |
183 | you need some special libraries for this (such as -lrt and -lpthread). You |
184 | can specify additional libraries to provide these calls (and any other |
184 | can specify additional libraries to provide these calls (and any other |
185 | required by EV) now, or accept the default. |
185 | required by EV) now, or accept the default. |
186 | |
186 | |
|
|
187 | On GNU/Linux systems, EV uses the LSB 3.1 __register_atfork function |
|
|
188 | to avoid the dependency on libpthread, and directly uses the clock_gettime |
|
|
189 | syscall to avoid a dependency on librt. |
|
|
190 | |
187 | EOF |
191 | EOF |
188 | |
192 | |
189 | my $solaris_libs = $^O =~ /solaris/i ? "-lsocket -lnsl" : ""; |
193 | my $solaris_libs = $^O =~ /solaris/i ? "-lsocket -lnsl" : ""; |
190 | my $librt = $^O =~ /linux/i ? "-lpthread" : "-lpthread -lrt"; |
194 | my $librt = $^O =~ /linux/i ? "" : "-lpthread -lrt"; |
|
|
195 | my $LIBS = exists $ENV{EV_LIBS} ? $ENV{EV_LIBS} : "$librt $solaris_libs"; |
191 | my $LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "$librt $solaris_libs"; |
196 | $LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", $LIBS; |
192 | |
197 | |
193 | |
198 | |
194 | print <<EOF; |
199 | print <<EOF; |
195 | |
200 | |
196 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
201 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
… | |
… | |
243 | print <<EOF; |
248 | print <<EOF; |
244 | |
249 | |
245 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
250 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
246 | |
251 | |
247 | |
252 | |
248 | EOF |
253 | Very rarely, people want to tweak EV even more, e.g. to exclude |
|
|
254 | or include certain watcher types or backends. This can be done by adding |
|
|
255 | extra -D options here, or via the EV_EXTRA_DEFS environment variable. |
249 | |
256 | |
|
|
257 | For example, if you run into compile problems because of missing memory |
|
|
258 | fences (or you just want extra performance), you can tell EV to not support |
|
|
259 | smp and threads via -DEV_NO_THREADS. |
|
|
260 | |
|
|
261 | Normal persons just press enter. |
|
|
262 | |
|
|
263 | EOF |
|
|
264 | |
|
|
265 | $DEFINE .= " " . prompt "Any extra -D options?", "$ENV{EV_EXTRA_DEFS}"; |
|
|
266 | |
|
|
267 | print <<EOF; |
|
|
268 | |
|
|
269 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
270 | |
|
|
271 | |
|
|
272 | EOF |
|
|
273 | |
250 | my @anyevent = eval { require AnyEvent; $AnyEvent::VERSION < 2.6 } ? (AnyEvent => 2.6) : (); |
274 | my @anyevent = eval { require AnyEvent; $AnyEvent::VERSION < 5.29 } ? (AnyEvent => 5.29) : (); |
251 | |
275 | |
252 | WriteMakefile( |
276 | WriteMakefile( |
253 | dist => { |
277 | dist => { |
254 | PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
278 | PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
255 | COMPRESS => 'gzip -9v', |
279 | COMPRESS => 'gzip -9v', |
… | |
… | |
268 | @anyevent, |
292 | @anyevent, |
269 | "common::sense" => 0, |
293 | "common::sense" => 0, |
270 | }, |
294 | }, |
271 | VERSION_FROM => "EV.pm", |
295 | VERSION_FROM => "EV.pm", |
272 | PM => { |
296 | PM => { |
273 | 'EV.pm' => '$(INST_LIBDIR)/EV.pm', |
297 | 'EV.pm' => '$(INST_LIB)/EV.pm', |
274 | 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', |
298 | 'EV/EVAPI.h' => '$(INST_LIB)/EV/EVAPI.h', |
275 | 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', |
299 | 'EV/MakeMaker.pm' => '$(INST_LIB)/EV/MakeMaker.pm', |
276 | 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', |
300 | 'libev/ev.h' => '$(INST_LIB)/EV/ev.h', |
277 | 'libev/ev.pod' => '$(INST_LIBDIR)/EV/libev.pod', |
301 | 'libev/ev.pod' => '$(INST_LIB)/EV/libev.pod', |
278 | }, |
302 | }, |
279 | MAN3PODS => { |
303 | MAN3PODS => { |
280 | 'EV.pm' => '$(INST_MAN3DIR)/EV.$(MAN3EXT)', |
304 | 'EV.pm' => '$(INST_MAN3DIR)/EV.$(MAN3EXT)', |
281 | 'EV/MakeMaker.pm' => '$(INST_MAN3DIR)/EV::MakeMaker.$(MAN3EXT)', |
305 | 'EV/MakeMaker.pm' => '$(INST_MAN3DIR)/EV::MakeMaker.$(MAN3EXT)', |
282 | 'libev/ev.pod' => '$(INST_MAN3DIR)/EV::libev.$(MAN3EXT)', |
306 | 'libev/ev.pod' => '$(INST_MAN3DIR)/EV::libev.$(MAN3EXT)', |