ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/Makefile.PL
Revision: 1.21
Committed: Fri Nov 16 01:46:26 2007 UTC (16 years, 6 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.20: +15 -0 lines
Log Message:
add solaris port backend

File Contents

# User Rev Content
1 root 1.4 use 5.006;
2    
3 root 1.7 use Config;
4 root 1.1 use ExtUtils::MakeMaker;
5    
6 root 1.10 unless (-e "libev/ev_epoll.c") {
7     print <<EOF;
8    
9     ***
10     *** ERROR: libev is missing or damaged. If you used a CVS check-out of EV,
11     *** you also have to check-out the "libev" module from the same CVS
12     *** repository into the EV dir (i.e. EV/libev from outside).
13     ***
14    
15     EOF
16     exit 1;
17     }
18    
19 root 1.11 print <<EOF;
20    
21    
22     *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
23    
24     Welcome to EV configuration. If you are in a hurry, just press return here
25     and hope for the best. The defaults should usually do.
26    
27     EOF
28    
29     if (prompt ("Skip further questions and use defaults (y/n)?", "y") =~ /[yY]/) {
30     $ENV{PERL_MM_USE_DEFAULT} = 1;
31     }
32    
33     print <<EOF;
34    
35    
36     *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
37    
38 root 1.14 POSIX optionally offers support for a monotonic clock source. EV
39     can take advantage of this clock source to detect time jumps
40     reliably. Unfortunately, some systems are bound to be broken, so you can
41     disable this here: you can completely disable the detection and use of
42     the monotonic clock by answering 'n' here. Support for this clock type
43     will otherwise be autodetected at both compile- and runtime.
44 root 1.11
45     EOF
46    
47     if (prompt ("Enable optional support for CLOCK_MONOTONIC (y/n)?", "y") =~ /[yY]/) {
48     $DEFINE .= " -DEV_USE_MONOTONIC";
49     }
50    
51     print <<EOF;
52    
53    
54     *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
55    
56     POSIX optionally offers support for a (potentially) high-resolution
57     realtime clock interface. In a good implementation, using it is faster
58     than the normal method of using gettimeofday. Unfortunately, this option
59     is also bound to be broken on some systems, so you can disable use and
60     probing of this feature altogether here. Otherwise support for this clock
61     type will be autodetected at compiletime.
62    
63     EOF
64    
65     if (prompt ("Prefer clock_gettime (CLOCK_REALTIME) over gettimeofday (y/n)?", "y") !~ /[yY]/) {
66     $DEFINE .= " -DEV_USE_REALTIME=0";
67     }
68    
69     print <<EOF;
70    
71    
72     *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
73    
74 root 1.19 EV can use various backends with various portability issue. The select
75     backend is the most portable and makes for a good fallback, but it can be
76     limited to a low number of file descriptors and/or might not compile. If
77     you have problems with compiling ev_select., you might try to play around
78     with disabling it here, or forcing it to use the fd_set provided by your
79     OS, via the next question. I highly recommend keeping it in.
80    
81     EOF
82    
83     if (prompt ("Enable select backend (y/n)?", "y") =~ /[yY]/) {
84     $DEFINE .= " -DEV_USE_SELECT";
85    
86     print <<EOF;
87    
88    
89     *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
90    
91     The select backend can operate in two modes. One uses the system-provided
92     fd_set and is usually limited to 1024 file descriptors (64 on windows),
93     the other requires your header files to define NFDBITS and declare a
94     suitable fd_mask type. If you run into problems compiling ev_select.c, you
95     can try forcing the use of the system fd_set here.
96    
97     EOF
98    
99     if (prompt ("Force use of system fd_set for select backend (y/n)?", "n") =~ /[yY]/) {
100     $DEFINE .= " -DEV_SELECT_USE_FD_SET";
101     }
102     }
103    
104     print <<EOF;
105    
106    
107     *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
108    
109     The second very portable backend is poll(2). It does not exist on windows
110     and various versions of Mac OS X (and on the other versions it simply
111     doesn't work), but works basically everywhere else. It is recommended to use
112     the default here unless you run into compile problems in ev_poll.c.
113    
114     EOF
115    
116     if (prompt ("Enable poll backend (y/n)?", (-e "/usr/include/poll.h") ? "y" : "n") =~ /[yY]/) {
117     $DEFINE .= " -DEV_USE_POLL";
118     }
119    
120     print <<EOF;
121    
122    
123     *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
124    
125 root 1.15 EV by default uses select, which makes it hard to write efficient servers,
126     especially if the number of active conencitons is much lower than the open
127     ones. GNU/Linux systems have a more scalable method called "epoll", which
128     EV can use. For this to work, both your kernel and glibc have to support
129     epoll, but if you can compile it, the detection will be done at runtime,
130     and EV will safely fall back to using select when epoll isn't available.
131     If unsure, accept the default.
132 root 1.11
133     EOF
134    
135 root 1.15 if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) {
136     $DEFINE .= " -DEV_USE_EPOLL";
137     }
138    
139     print <<EOF;
140    
141    
142     *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
143    
144 root 1.19 Similarly to the epoll backend above, EV can take advantage of kqueue
145     on many BSD systems (it seems to be broken on Mac OS X though, but what
146     isn't broken on that shoddy platform... ah yes, the cash gushing by apple,
147     selling defective software works perfectly there). Support for kqueue will
148     be detected at runtime, with a safe fallback to other methods when it
149     cannot be used.
150 root 1.11
151 root 1.15 EOF
152    
153 root 1.16 if (prompt ("Enable kqueue backend (y/n)?", (-e "/usr/include/sys/event.h") ? "y" : "n") =~ /[yY]/) {
154 root 1.15 $DEFINE .= " -DEV_USE_KQUEUE";
155     }
156 root 1.11
157     print <<EOF;
158    
159    
160     *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
161    
162 root 1.21 Similarly to the kqueue backend above, EV can take advantage of the
163     solaris 10 port interface. Support for port will be detected at runtime,
164     with a safe fallback to other methods when it cannot be used.
165    
166     EOF
167    
168     if (prompt ("Enable port backend (y/n)?", (-e "/usr/include/sys/port.h") ? "y" : "n") =~ /[yY]/) {
169     $DEFINE .= " -DEV_USE_PORT";
170     }
171    
172     print <<EOF;
173    
174    
175     *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
176    
177 root 1.11 EV needs the functions pthread_atfork and clock_gettime. On most systems
178 root 1.15 you need some special libraries for this (such as -lrt and -lpthread). You
179     can specify additional libraries to provide these calls now, or accept the
180     default.
181 root 1.11
182     EOF
183    
184 root 1.15 $LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt";
185    
186 root 1.11
187     print <<EOF;
188    
189    
190     *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
191    
192     EOF
193    
194 root 1.20 my @anyevent = eval { require AnyEvent; $AnyEvent::VERSION < 2.6 } ? (AnyEvent => 2.6) : ();
195    
196 root 1.1 WriteMakefile(
197     dist => {
198 root 1.2 PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
199 root 1.1 COMPRESS => 'gzip -9v',
200     SUFFIX => '.gz',
201     },
202 root 1.10 depend => {
203 root 1.13 "EV.c" => "EV/EVAPI.h "
204 root 1.17 . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c libev/ev_kqueue.c libev/ev_poll.c "
205 root 1.18 . "libev/event.h libev/event.c evdns.h evdns.c libev/ev_vars.h libev/ev_wrap.h",
206 root 1.10 },
207 root 1.8 INC => "-Ilibev",
208 root 1.11 DEFINE => "$DEFINE",
209 root 1.2 NAME => "EV",
210 root 1.11 LIBS => [$LIBS],
211 root 1.20 PREREQ_PM => {
212     @anyevent,
213     },
214 root 1.2 VERSION_FROM => "EV.pm",
215 root 1.5 PM => {
216     'EV.pm' => '$(INST_LIBDIR)/EV.pm',
217 root 1.12 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm',
218 root 1.5 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h',
219     'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm',
220 root 1.8 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h',
221 root 1.5 },
222 root 1.1 );
223    
224 root 1.6