--- EV/Makefile.PL 2007/11/02 11:11:05 1.14 +++ EV/Makefile.PL 2007/11/04 16:43:53 1.15 @@ -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 <