--- cvsroot/EV/Makefile.PL 2007/11/01 09:05:32 1.11 +++ cvsroot/EV/Makefile.PL 2007/11/08 00:44:17 1.17 @@ -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,28 +72,36 @@ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** -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 <; + +*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** + +EOF WriteMakefile( dist => { @@ -119,7 +133,9 @@ SUFFIX => '.gz', }, depend => { - "EV.c" => "EV/EVAPI.h libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c", + "EV.c" => "EV/EVAPI.h " + . "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 libev/evdns.h libev/evdns.c", }, INC => "-Ilibev", DEFINE => "$DEFINE", @@ -129,7 +145,7 @@ PM => { 'EV.pm' => '$(INST_LIBDIR)/EV.pm', 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm', - #'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.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', 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h',