ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/Makefile.PL
(Generate patch)

Comparing EV/Makefile.PL (file contents):
Revision 1.54 by root, Tue Oct 22 10:43:05 2013 UTC vs.
Revision 1.55 by root, Sat Sep 6 18:42:18 2014 UTC

1use 5.008002; 1use 5.008002;
2 2
3use strict qw(vars subs); 3use strict qw(vars subs);
4use Config; 4use Config;
5use ExtUtils::MakeMaker; 5use ExtUtils::MakeMaker;
6
7sub have_inc($) {
8 scalar grep -r "$_/$_[0]", $Config{usrinc}, split / /, $Config{incpth}
9}
6 10
7unless (-e "libev/ev_epoll.c") { 11unless (-e "libev/ev_epoll.c") {
8 print <<EOF; 12 print <<EOF;
9 13
10*** 14***
93 97
94EOF 98EOF
95 99
96 if (prompt ("Force use of system fd_set for select backend (y/n)?", "n") =~ /[yY]/) { 100 if (prompt ("Force use of system fd_set for select backend (y/n)?", "n") =~ /[yY]/) {
97 $DEFINE .= " -DEV_SELECT_USE_FD_SET"; 101 $DEFINE .= " -DEV_SELECT_USE_FD_SET";
98 } 102 }
99} else { 103} else {
100 $DEFINE .= " -DEV_USE_SELECT=0"; 104 $DEFINE .= " -DEV_USE_SELECT=0";
101} 105}
102 106
103print <<EOF; 107print <<EOF;
104 108
105*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 109*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
106 110
110doesn't work), but works basically everywhere else. It is recommended to use 114doesn't work), but works basically everywhere else. It is recommended to use
111the default here unless you run into compile problems in ev_poll.c. 115the default here unless you run into compile problems in ev_poll.c.
112 116
113EOF 117EOF
114 118
115$DEFINE .= " -DEV_USE_POLL=" . (0 + (prompt ("Enable poll backend (y/n)?", (-e "/usr/include/poll.h") ? "y" : "n") =~ /[yY]/)); 119$DEFINE .= " -DEV_USE_POLL=" . (0 + (prompt ("Enable poll backend (y/n)?", (have_inc "poll.h") ? "y" : "n") =~ /[yY]/));
116 120
117print <<EOF; 121print <<EOF;
118 122
119*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 123*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
120 124
127fall back to using select when epoll isn't available. If unsure, accept 131fall back to using select when epoll isn't available. If unsure, accept
128the default. 132the default.
129 133
130EOF 134EOF
131 135
132my $can_epoll = -e "/usr/include/sys/epoll.h"; 136my $can_epoll = have_inc "sys/epoll.h";
133$can_epoll = $ENV{EV_EPOLL} if exists $ENV{EV_EPOLL}; 137$can_epoll = $ENV{EV_EPOLL} if exists $ENV{EV_EPOLL};
134$DEFINE .= " -DEV_USE_EPOLL=" . (0 + (prompt ("Enable epoll backend (y/n)?", $can_epoll ? "y" : "n") =~ /[yY]/)); 138$DEFINE .= " -DEV_USE_EPOLL=" . (0 + (prompt ("Enable epoll backend (y/n)?", $can_epoll ? "y" : "n") =~ /[yY]/));
135 139
136print <<EOF; 140print <<EOF;
137 141
155 (similar problems as on FreeBSD). 159 (similar problems as on FreeBSD).
156OS X: completely, utterly broken on at least <= 10.6. 160OS X: completely, utterly broken on at least <= 10.6.
157 161
158EOF 162EOF
159 163
160my $can_kqueue = -e "/usr/include/sys/event.h"; 164my $can_kqueue = have_inc "sys/event.h";
161$can_kqueue = $ENV{EV_KQUEUE} if exists $ENV{EV_KQUEUE}; 165$can_kqueue = $ENV{EV_KQUEUE} if exists $ENV{EV_KQUEUE};
162$DEFINE .= " -DEV_USE_KQUEUE=" . (0 + (prompt ("Enable kqueue backend (y/n)?", $can_kqueue ? "y" : "n") =~ /[yY]/)); 166$DEFINE .= " -DEV_USE_KQUEUE=" . (0 + (prompt ("Enable kqueue backend (y/n)?", $can_kqueue ? "y" : "n") =~ /[yY]/));
163 167
164print <<EOF; 168print <<EOF;
165 169
170solaris 10 event port interface. Support for event ports will be detected 174solaris 10 event port interface. Support for event ports will be detected
171at runtime, with a safe fallback to other methods when it cannot be used. 175at runtime, with a safe fallback to other methods when it cannot be used.
172 176
173EOF 177EOF
174 178
175$DEFINE .= " -DEV_USE_PORT=" . (0 + (prompt ("Enable event port backend (y/n)?", (-e "/usr/include/sys/port.h") ? "y" : "n") =~ /[yY]/)); 179$DEFINE .= " -DEV_USE_PORT=" . (0 + (prompt ("Enable event port backend (y/n)?", (have_inc "sys/port.h") ? "y" : "n") =~ /[yY]/));
176 180
177print <<EOF; 181print <<EOF;
178 182
179*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 183*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
180 184
206you have the include file and libc support for it, it is usually a good 210you have the include file and libc support for it, it is usually a good
207idea to enable it, as kernel availability is detected at runtime. 211idea to enable it, as kernel availability is detected at runtime.
208 212
209EOF 213EOF
210 214
211my $can_inotify = -e "/usr/include/sys/inotify.h"; 215my $can_inotify = have_inc "sys/inotify.h";
212$can_inotify = $ENV{EV_INOTIFY} if exists $ENV{EV_INOTIFY}; 216$can_inotify = $ENV{EV_INOTIFY} if exists $ENV{EV_INOTIFY};
213$DEFINE .= " -DEV_USE_INOTIFY=" . (0 + (prompt ("Enable inotify support (y/n)?", $can_inotify ? "y" : "n") =~ /[yY]/)); 217$DEFINE .= " -DEV_USE_INOTIFY=" . (0 + (prompt ("Enable inotify support (y/n)?", $can_inotify ? "y" : "n") =~ /[yY]/));
214 218
215print <<EOF; 219print <<EOF;
216 220
223your libc must contain the necessary wrapper. Glibc 2.7 and later should 227your libc must contain the necessary wrapper. Glibc 2.7 and later should
224have this wrapper. 228have this wrapper.
225 229
226EOF 230EOF
227 231
228my $can_eventfd = -e "/usr/include/sys/eventfd.h"; 232my $can_eventfd = have_inc "sys/eventfd.h";
229$can_eventfd = $ENV{EV_EVENTFD} if exists $ENV{EV_EVENTFD}; 233$can_eventfd = $ENV{EV_EVENTFD} if exists $ENV{EV_EVENTFD};
230$DEFINE .= " -DEV_USE_EVENTFD=" . (0 + (prompt ("Enable linux eventfd support (y/n)?", $can_eventfd ? "y" : "n") =~ /[yY]/)); 234$DEFINE .= " -DEV_USE_EVENTFD=" . (0 + (prompt ("Enable linux eventfd support (y/n)?", $can_eventfd ? "y" : "n") =~ /[yY]/));
231 235
232print <<EOF; 236print <<EOF;
233 237
239this will be probed at runtime, but your libc must contain the necessary 243this will be probed at runtime, but your libc must contain the necessary
240wrapper. Glibc 2.7 and later should have this wrapper. 244wrapper. Glibc 2.7 and later should have this wrapper.
241 245
242EOF 246EOF
243 247
244my $can_signalfd = -e "/usr/include/sys/signalfd.h"; 248my $can_signalfd = have_inc "sys/signalfd.h";
245$can_signalfd = $ENV{EV_SIGNALFD} if exists $ENV{EV_SIGNALFD}; 249$can_signalfd = $ENV{EV_SIGNALFD} if exists $ENV{EV_SIGNALFD};
246$DEFINE .= " -DEV_USE_SIGNALFD=" . (0 + (prompt ("Enable linux signalfd support (y/n)?", $can_signalfd ? "y" : "n") =~ /[yY]/)); 250$DEFINE .= " -DEV_USE_SIGNALFD=" . (0 + (prompt ("Enable linux signalfd support (y/n)?", $can_signalfd ? "y" : "n") =~ /[yY]/));
247 251
248print <<EOF; 252print <<EOF;
249 253

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines