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

Comparing EV/Makefile.PL (file contents):
Revision 1.52 by root, Sat Feb 4 20:12:17 2012 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
182EV needs the functions pthread_atfork and clock_gettime. On most systems 186EV needs the functions pthread_atfork and clock_gettime. On most systems
183you need some special libraries for this (such as -lrt and -lpthread). You 187you need some special libraries for this (such as -lrt and -lpthread). You
184can specify additional libraries to provide these calls (and any other 188can specify additional libraries to provide these calls (and any other
185required by EV) now, or accept the default. 189required by EV) now, or accept the default.
186 190
191On GNU/Linux systems, EV uses the LSB 3.1 __register_atfork function
192to avoid the dependency on libpthread, and directly uses the clock_gettime
193syscall to avoid a dependency on librt.
194
187EOF 195EOF
188 196
189my $solaris_libs = $^O =~ /solaris/i ? "-lsocket -lnsl" : ""; 197my $solaris_libs = $^O =~ /solaris/i ? "-lsocket -lnsl" : "";
190#my $librt = $^O =~ /linux/i ? "-lpthread" : "-lpthread -lrt"; 198my $librt = $^O =~ /linux/i ? "" : "-lpthread -lrt";
191my $librt = "-lpthread -lrt"; 199my $LIBS = exists $ENV{EV_LIBS} ? $ENV{EV_LIBS} : "$librt $solaris_libs";
192my $LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "$librt $solaris_libs"; 200$LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", $LIBS;
193 201
194 202
195print <<EOF; 203print <<EOF;
196 204
197*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 205*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
202you 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
203idea to enable it, as kernel availability is detected at runtime. 211idea to enable it, as kernel availability is detected at runtime.
204 212
205EOF 213EOF
206 214
207my $can_inotify = -e "/usr/include/sys/inotify.h"; 215my $can_inotify = have_inc "sys/inotify.h";
208$can_inotify = $ENV{EV_INOTIFY} if exists $ENV{EV_INOTIFY}; 216$can_inotify = $ENV{EV_INOTIFY} if exists $ENV{EV_INOTIFY};
209$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]/));
210 218
211print <<EOF; 219print <<EOF;
212 220
219your 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
220have this wrapper. 228have this wrapper.
221 229
222EOF 230EOF
223 231
224my $can_eventfd = -e "/usr/include/sys/eventfd.h"; 232my $can_eventfd = have_inc "sys/eventfd.h";
225$can_eventfd = $ENV{EV_EVENTFD} if exists $ENV{EV_EVENTFD}; 233$can_eventfd = $ENV{EV_EVENTFD} if exists $ENV{EV_EVENTFD};
226$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]/));
227 235
228print <<EOF; 236print <<EOF;
229 237
235this 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
236wrapper. Glibc 2.7 and later should have this wrapper. 244wrapper. Glibc 2.7 and later should have this wrapper.
237 245
238EOF 246EOF
239 247
240my $can_signalfd = -e "/usr/include/sys/signalfd.h"; 248my $can_signalfd = have_inc "sys/signalfd.h";
241$can_signalfd = $ENV{EV_SIGNALFD} if exists $ENV{EV_SIGNALFD}; 249$can_signalfd = $ENV{EV_SIGNALFD} if exists $ENV{EV_SIGNALFD};
242$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]/));
243 251
244print <<EOF; 252print <<EOF;
245 253
288 @anyevent, 296 @anyevent,
289 "common::sense" => 0, 297 "common::sense" => 0,
290 }, 298 },
291 VERSION_FROM => "EV.pm", 299 VERSION_FROM => "EV.pm",
292 PM => { 300 PM => {
293 'EV.pm' => '$(INST_LIBDIR)/EV.pm', 301 'EV.pm' => '$(INST_LIB)/EV.pm',
294 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', 302 'EV/EVAPI.h' => '$(INST_LIB)/EV/EVAPI.h',
295 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', 303 'EV/MakeMaker.pm' => '$(INST_LIB)/EV/MakeMaker.pm',
296 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', 304 'libev/ev.h' => '$(INST_LIB)/EV/ev.h',
297 'libev/ev.pod' => '$(INST_LIBDIR)/EV/libev.pod', 305 'libev/ev.pod' => '$(INST_LIB)/EV/libev.pod',
298 }, 306 },
299 MAN3PODS => { 307 MAN3PODS => {
300 'EV.pm' => '$(INST_MAN3DIR)/EV.$(MAN3EXT)', 308 'EV.pm' => '$(INST_MAN3DIR)/EV.$(MAN3EXT)',
301 'EV/MakeMaker.pm' => '$(INST_MAN3DIR)/EV::MakeMaker.$(MAN3EXT)', 309 'EV/MakeMaker.pm' => '$(INST_MAN3DIR)/EV::MakeMaker.$(MAN3EXT)',
302 'libev/ev.pod' => '$(INST_MAN3DIR)/EV::libev.$(MAN3EXT)', 310 'libev/ev.pod' => '$(INST_MAN3DIR)/EV::libev.$(MAN3EXT)',

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines