--- cvsroot/EV/Makefile.PL 2007/11/02 11:11:05 1.14 +++ cvsroot/EV/Makefile.PL 2007/11/09 19:33:51 1.18 @@ -72,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", @@ -121,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',