1 | use 5.008002; |
|
|
2 | |
|
|
3 | use strict qw(vars subs); |
1 | use strict qw(vars subs); |
|
|
2 | use Canary::Stability EV => 1, 5.008002; |
4 | use Config; |
3 | use Config; |
5 | use ExtUtils::MakeMaker; |
4 | use ExtUtils::MakeMaker; |
6 | |
5 | |
7 | sub have_inc($) { |
6 | sub have_inc($) { |
8 | scalar grep -r "$_/$_[0]", $Config{usrinc}, split / /, $Config{incpth} |
7 | scalar grep -r "$_/$_[0]", $Config{usrinc}, split / /, $Config{incpth} |
9 | } |
8 | } |
|
|
9 | |
|
|
10 | my $DEFINE; |
10 | |
11 | |
11 | unless (-e "libev/ev_epoll.c") { |
12 | unless (-e "libev/ev_epoll.c") { |
12 | print <<EOF; |
13 | print <<EOF; |
13 | |
14 | |
14 | *** |
15 | *** |
… | |
… | |
48 | will otherwise be autodetected at both compile- and runtime. (this setting |
49 | will otherwise be autodetected at both compile- and runtime. (this setting |
49 | currently affects the use of nanosleep over select as well). |
50 | currently affects the use of nanosleep over select as well). |
50 | |
51 | |
51 | EOF |
52 | EOF |
52 | |
53 | |
53 | my $DEFINE .= " -DEV_USE_MONOTONIC=" . (0 + (prompt ("Enable optional support for CLOCK_MONOTONIC (y/n)?", "y") =~ /[yY]/)); |
54 | unless (prompt ("Enable optional support for CLOCK_MONOTONIC (y/n)?", "y") =~ /[yY]/) { |
|
|
55 | $DEFINE .= " -DEV_USE_MONOTONIC=0"; |
|
|
56 | } |
54 | |
57 | |
55 | print <<EOF; |
58 | print <<EOF; |
56 | |
59 | |
57 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
60 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
58 | |
61 | |
… | |
… | |
134 | EOF |
137 | EOF |
135 | |
138 | |
136 | my $can_epoll = have_inc "sys/epoll.h"; |
139 | my $can_epoll = have_inc "sys/epoll.h"; |
137 | $can_epoll = $ENV{EV_EPOLL} if exists $ENV{EV_EPOLL}; |
140 | $can_epoll = $ENV{EV_EPOLL} if exists $ENV{EV_EPOLL}; |
138 | $DEFINE .= " -DEV_USE_EPOLL=" . (0 + (prompt ("Enable epoll backend (y/n)?", $can_epoll ? "y" : "n") =~ /[yY]/)); |
141 | $DEFINE .= " -DEV_USE_EPOLL=" . (0 + (prompt ("Enable epoll backend (y/n)?", $can_epoll ? "y" : "n") =~ /[yY]/)); |
|
|
142 | |
|
|
143 | print <<EOF; |
|
|
144 | |
|
|
145 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
146 | |
|
|
147 | |
|
|
148 | Linux 4.18 introduced another event polling interface, this time using |
|
|
149 | the Linux AIO API. While this API is far superior to epoll and almost |
|
|
150 | rivals kqueue, it also suffers from the same issues as kqueue typically |
|
|
151 | does: only a subset of file types are supported (as of 4.19, I have seen |
|
|
152 | eventfd, pipes, sockets files and some devices, but no ttys). It also |
|
|
153 | is subject arbitrary system-wide limits imposed on it. Therefore, this |
|
|
154 | backend is not used by default, even when it is compiled in, and you have |
|
|
155 | to request it explicitly, e.g. with LIBEV_FLAGS=64. If unsure, accept the |
|
|
156 | default. |
|
|
157 | |
|
|
158 | EOF |
|
|
159 | |
|
|
160 | my $can_linuxaio = have_inc "linux/aio_abi.h"; |
|
|
161 | $can_linuxaio or die; |
|
|
162 | $can_linuxaio = $ENV{EV_LINUXAIO} if exists $ENV{EV_LINUXAIO}; |
|
|
163 | $DEFINE .= " -DEV_USE_LINUXAIO=" . (0 + (prompt ("Enable linux aio backend (y/n)?", $can_linuxaio ? "y" : "n") =~ /[yY]/)); |
139 | |
164 | |
140 | print <<EOF; |
165 | print <<EOF; |
141 | |
166 | |
142 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
167 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
143 | |
168 | |
… | |
… | |
294 | LIBS => [$LIBS], |
319 | LIBS => [$LIBS], |
295 | PREREQ_PM => { |
320 | PREREQ_PM => { |
296 | @anyevent, |
321 | @anyevent, |
297 | "common::sense" => 0, |
322 | "common::sense" => 0, |
298 | }, |
323 | }, |
|
|
324 | CONFIGURE_REQUIRES => { "ExtUtils::MakeMaker" => 6.52, "Canary::Stability" => 0 }, |
299 | VERSION_FROM => "EV.pm", |
325 | VERSION_FROM => "EV.pm", |
300 | PM => { |
326 | PM => { |
301 | 'EV.pm' => '$(INST_LIB)/EV.pm', |
327 | 'EV.pm' => '$(INST_LIB)/EV.pm', |
302 | 'EV/EVAPI.h' => '$(INST_LIB)/EV/EVAPI.h', |
328 | 'EV/EVAPI.h' => '$(INST_LIB)/EV/EVAPI.h', |
303 | 'EV/MakeMaker.pm' => '$(INST_LIB)/EV/MakeMaker.pm', |
329 | 'EV/MakeMaker.pm' => '$(INST_LIB)/EV/MakeMaker.pm', |