… | |
… | |
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") ? "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 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
… | |
… | |
109 | COMPRESS => 'gzip -9v', |
132 | COMPRESS => 'gzip -9v', |
110 | SUFFIX => '.gz', |
133 | SUFFIX => '.gz', |
111 | }, |
134 | }, |
112 | depend => { |
135 | depend => { |
113 | "EV.c" => "EV/EVAPI.h " |
136 | "EV.c" => "EV/EVAPI.h " |
114 | . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c " |
137 | . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c libev/ev_kqueue.c libev/ev_poll.c " |
115 | . "libev/event.h libev/event.c libev/evdns.h libev/evdns.c", |
138 | . "libev/event.h libev/event.c evdns.h evdns.c libev/ev_vars.h libev/ev_wrap.h", |
116 | }, |
139 | }, |
117 | INC => "-Ilibev", |
140 | INC => "-Ilibev", |
118 | DEFINE => "$DEFINE", |
141 | DEFINE => "$DEFINE", |
119 | NAME => "EV", |
142 | NAME => "EV", |
120 | LIBS => [$LIBS], |
143 | LIBS => [$LIBS], |
121 | VERSION_FROM => "EV.pm", |
144 | VERSION_FROM => "EV.pm", |
122 | PM => { |
145 | PM => { |
123 | 'EV.pm' => '$(INST_LIBDIR)/EV.pm', |
146 | 'EV.pm' => '$(INST_LIBDIR)/EV.pm', |
124 | 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm', |
|
|
125 | 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', |
147 | 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', |
126 | 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', |
148 | 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', |
127 | 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', |
149 | 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', |
128 | 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', |
150 | 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', |
129 | }, |
151 | }, |