… | |
… | |
70 | print <<EOF; |
70 | print <<EOF; |
71 | |
71 | |
72 | |
72 | |
73 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
73 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
74 | |
74 | |
75 | EV needs the functions pthread_atfork and clock_gettime. On most systems |
75 | EV by default uses select, which makes it hard to write efficient servers, |
76 | you need some special libraries for this (such as -lrt and -lpthread). You can |
76 | especially if the number of active conencitons is much lower than the open |
77 | specify additional libraries to provide these calls now, or accept the default. |
77 | ones. GNU/Linux systems have a more scalable method called "epoll", which |
|
|
78 | EV can use. For this to work, both your kernel and glibc have to support |
|
|
79 | epoll, but if you can compile it, the detection will be done at runtime, |
|
|
80 | and EV will safely fall back to using select when epoll isn't available. |
|
|
81 | If unsure, accept the default. |
78 | |
82 | |
79 | EOF |
83 | EOF |
80 | |
84 | |
81 | $LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt"; |
85 | if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) { |
|
|
86 | $DEFINE .= " -DEV_USE_EPOLL"; |
|
|
87 | } |
82 | |
88 | |
|
|
89 | print <<EOF; |
|
|
90 | |
|
|
91 | |
|
|
92 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
93 | |
|
|
94 | Similarly to the epoll backend above, EV can take advantage of kqueue on |
|
|
95 | many BSD systems (it seems to be broken on Mac OS X though). The kqueue |
|
|
96 | backend has not been tested, however, so it is disabled by default. Please |
|
|
97 | test (and preferably fix) the kqueue backend when you have a machine |
|
|
98 | supporting it. Support for kqueue will be detected at runtime, with a |
|
|
99 | safe fallback to other methods when it cannot be used. |
|
|
100 | |
|
|
101 | EOF |
|
|
102 | |
|
|
103 | if (prompt ("Enable kqueue backend (y/n)?", (-e "/usr/include/sys/event.h-disabled") ? "y" : "n") =~ /[yY]/) { |
|
|
104 | $DEFINE .= " -DEV_USE_KQUEUE"; |
|
|
105 | } |
83 | |
106 | |
84 | print <<EOF; |
107 | print <<EOF; |
85 | |
108 | |
86 | |
109 | |
87 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
110 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
88 | |
111 | |
89 | EV needs the functions pthread_atfork and clock_gettime. On most systems |
112 | EV needs the functions pthread_atfork and clock_gettime. On most systems |
90 | you need some special libraries for this (such as -lrt and -lpthread). You can |
113 | you need some special libraries for this (such as -lrt and -lpthread). You |
91 | specify additional libraries to provide these calls now, or accept the default. |
114 | can specify additional libraries to provide these calls now, or accept the |
|
|
115 | default. |
92 | |
116 | |
93 | EOF |
117 | EOF |
94 | |
118 | |
95 | if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) { |
119 | $LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt"; |
96 | $DEFINE .= " -DEV_USE_EPOLL"; |
120 | |
97 | } |
|
|
98 | |
121 | |
99 | print <<EOF; |
122 | print <<EOF; |
100 | |
123 | |
101 | |
124 | |
102 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
125 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |