--- cvsroot/EV/Makefile.PL 2007/11/01 17:45:30 1.13 +++ cvsroot/EV/Makefile.PL 2007/11/09 19:33:51 1.18 @@ -36,14 +36,12 @@ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** -POSIX optionally offers support for a monotonic clock source. EV can -take advantage of this clock source to detect time jumps reliably. This -will usually slow down EV a tiny amount, but this is usually -well-invested. Unfortunately, some systems are bound to be broken, so -you can disable this here. Whatever your reasons, you can completely -disable the detection and use of this monotonic clock by answering 'n' -here. Support for this clock type will otherwise be autodetected at both -compile- and runtime. +POSIX optionally offers support for a monotonic clock source. EV +can take advantage of this clock source to detect time jumps +reliably. Unfortunately, some systems are bound to be broken, so you can +disable this here: you can completely disable the detection and use of +the monotonic clock by answering 'n' here. Support for this clock type +will otherwise be autodetected at both compile- and runtime. EOF @@ -74,14 +72,37 @@ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** -EV needs the functions pthread_atfork and clock_gettime. On most systems -you need some special libraries for this (such as -lrt and -lpthread). You can -specify additional libraries to provide these calls now, or accept the default. +EV by default uses select, which makes it hard to write efficient servers, +especially if the number of active conencitons is much lower than the open +ones. GNU/Linux systems have a more scalable method called "epoll", which +EV can use. For this to work, both your kernel and glibc have to support +epoll, but if you can compile it, the detection will be done at runtime, +and EV will safely fall back to using select when epoll isn't available. +If unsure, accept the default. EOF -$LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt"; +if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) { + $DEFINE .= " -DEV_USE_EPOLL"; +} + +print < { "EV.c" => "EV/EVAPI.h " - . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c " - . "libev/event.h libev/event.c libev/evdns.h libev/evdns.c", + . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c libev/ev_kqueue.c libev/ev_poll.c " + . "libev/event.h libev/event.c evdns.h evdns.c libev/ev_vars.h libev/ev_wrap.h", }, INC => "-Ilibev", DEFINE => "$DEFINE", @@ -123,7 +144,6 @@ VERSION_FROM => "EV.pm", PM => { 'EV.pm' => '$(INST_LIBDIR)/EV.pm', - 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm', 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm',