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

Comparing EV/Makefile.PL (file contents):
Revision 1.12 by root, Thu Nov 1 15:46:43 2007 UTC vs.
Revision 1.19 by root, Mon Nov 12 01:01:13 2007 UTC

34print <<EOF; 34print <<EOF;
35 35
36 36
37*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 37*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
38 38
39POSIX optionally offers support for a monotonic clock source. EV can 39POSIX optionally offers support for a monotonic clock source. EV
40take advantage of this clock source to detect time jumps reliably. This 40can take advantage of this clock source to detect time jumps
41will usually slow down EV a tiny amount, but this is usually
42well-invested. Unfortunately, some systems are bound to be broken, so 41reliably. Unfortunately, some systems are bound to be broken, so you can
43you can disable this here. Whatever your reasons, you can completely 42disable this here: you can completely disable the detection and use of
44disable the detection and use of this monotonic clock by answering 'n' 43the monotonic clock by answering 'n' here. Support for this clock type
45here. Support for this clock type will otherwise be autodetected at both 44will otherwise be autodetected at both compile- and runtime.
46compile- and runtime.
47 45
48EOF 46EOF
49 47
50if (prompt ("Enable optional support for CLOCK_MONOTONIC (y/n)?", "y") =~ /[yY]/) { 48if (prompt ("Enable optional support for CLOCK_MONOTONIC (y/n)?", "y") =~ /[yY]/) {
51 $DEFINE .= " -DEV_USE_MONOTONIC"; 49 $DEFINE .= " -DEV_USE_MONOTONIC";
72print <<EOF; 70print <<EOF;
73 71
74 72
75*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 73*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
76 74
77EV needs the functions pthread_atfork and clock_gettime. On most systems 75EV can use various backends with various portability issue. The select
78you need some special libraries for this (such as -lrt and -lpthread). You can 76backend is the most portable and makes for a good fallback, but it can be
79specify additional libraries to provide these calls now, or accept the default. 77limited to a low number of file descriptors and/or might not compile. If
78you have problems with compiling ev_select., you might try to play around
79with disabling it here, or forcing it to use the fd_set provided by your
80OS, via the next question. I highly recommend keeping it in.
80 81
81EOF 82EOF
82 83
83$LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt"; 84if (prompt ("Enable select backend (y/n)?", "y") =~ /[yY]/) {
85 $DEFINE .= " -DEV_USE_SELECT";
84 86
85
86print <<EOF; 87 print <<EOF;
87 88
88 89
89*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 90*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
90 91
91EV needs the functions pthread_atfork and clock_gettime. On most systems 92The select backend can operate in two modes. One uses the system-provided
92you need some special libraries for this (such as -lrt and -lpthread). You can 93fd_set and is usually limited to 1024 file descriptors (64 on windows),
93specify additional libraries to provide these calls now, or accept the default. 94the other requires your header files to define NFDBITS and declare a
95suitable fd_mask type. If you run into problems compiling ev_select.c, you
96can try forcing the use of the system fd_set here.
97
98EOF
99
100 if (prompt ("Force use of system fd_set for select backend (y/n)?", "n") =~ /[yY]/) {
101 $DEFINE .= " -DEV_SELECT_USE_FD_SET";
102 }
103}
104
105print <<EOF;
106
107
108*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
109
110The second very portable backend is poll(2). It does not exist on windows
111and various versions of Mac OS X (and on the other versions it simply
112doesn't work), but works basically everywhere else. It is recommended to use
113the default here unless you run into compile problems in ev_poll.c.
114
115EOF
116
117if (prompt ("Enable poll backend (y/n)?", (-e "/usr/include/poll.h") ? "y" : "n") =~ /[yY]/) {
118 $DEFINE .= " -DEV_USE_POLL";
119}
120
121print <<EOF;
122
123
124*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
125
126EV by default uses select, which makes it hard to write efficient servers,
127especially if the number of active conencitons is much lower than the open
128ones. GNU/Linux systems have a more scalable method called "epoll", which
129EV can use. For this to work, both your kernel and glibc have to support
130epoll, but if you can compile it, the detection will be done at runtime,
131and EV will safely fall back to using select when epoll isn't available.
132If unsure, accept the default.
94 133
95EOF 134EOF
96 135
97if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) { 136if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) {
98 $DEFINE .= " -DEV_USE_EPOLL"; 137 $DEFINE .= " -DEV_USE_EPOLL";
101print <<EOF; 140print <<EOF;
102 141
103 142
104*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 143*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
105 144
106EOF 145Similarly to the epoll backend above, EV can take advantage of kqueue
146on many BSD systems (it seems to be broken on Mac OS X though, but what
147isn't broken on that shoddy platform... ah yes, the cash gushing by apple,
148selling defective software works perfectly there). Support for kqueue will
149be detected at runtime, with a safe fallback to other methods when it
150cannot be used.
107 151
108#$ENV{CC} = $Config{cc}; 152EOF
109#$ENV{CFLAGS} = join " ", map $Config{$_}, qw(inc optimize ccflags cccdlflags);
110#system "cd libevent && ./configure --disable-shared --enable-static --disable-maintainer-mode"
111# and die "configure failed.";
112 153
113#$LIBS = qx<cd libevent && make printlibs>; 154if (prompt ("Enable kqueue backend (y/n)?", (-e "/usr/include/sys/event.h") ? "y" : "n") =~ /[yY]/) {
155 $DEFINE .= " -DEV_USE_KQUEUE";
156}
157
158print <<EOF;
159
160
161*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
162
163EV needs the functions pthread_atfork and clock_gettime. On most systems
164you need some special libraries for this (such as -lrt and -lpthread). You
165can specify additional libraries to provide these calls now, or accept the
166default.
167
168EOF
169
170$LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt";
171
172
173print <<EOF;
174
175
176*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
177
178EOF
114 179
115WriteMakefile( 180WriteMakefile(
116 dist => { 181 dist => {
117 PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', 182 PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
118 COMPRESS => 'gzip -9v', 183 COMPRESS => 'gzip -9v',
119 SUFFIX => '.gz', 184 SUFFIX => '.gz',
120 }, 185 },
121 depend => { 186 depend => {
122 "EV.c" => "EV/EVAPI.h libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c", 187 "EV.c" => "EV/EVAPI.h "
188 . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c libev/ev_kqueue.c libev/ev_poll.c "
189 . "libev/event.h libev/event.c evdns.h evdns.c libev/ev_vars.h libev/ev_wrap.h",
123 }, 190 },
124 INC => "-Ilibev", 191 INC => "-Ilibev",
125 DEFINE => "$DEFINE", 192 DEFINE => "$DEFINE",
126 NAME => "EV", 193 NAME => "EV",
127 LIBS => [$LIBS], 194 LIBS => [$LIBS],
128 VERSION_FROM => "EV.pm", 195 VERSION_FROM => "EV.pm",
129 PM => { 196 PM => {
130 'EV.pm' => '$(INST_LIBDIR)/EV.pm', 197 'EV.pm' => '$(INST_LIBDIR)/EV.pm',
131 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm',
132 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', 198 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm',
133 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', 199 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h',
134 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', 200 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm',
135 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', 201 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h',
136 }, 202 },

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines