… | |
… | |
64 | EOF |
64 | EOF |
65 | |
65 | |
66 | if (prompt ("Prefer clock_gettime (CLOCK_REALTIME) over gettimeofday (y/n)?", "y") !~ /[yY]/) { |
66 | if (prompt ("Prefer clock_gettime (CLOCK_REALTIME) over gettimeofday (y/n)?", "y") !~ /[yY]/) { |
67 | $DEFINE .= " -DEV_USE_REALTIME=0"; |
67 | $DEFINE .= " -DEV_USE_REALTIME=0"; |
68 | } |
68 | } |
|
|
69 | |
|
|
70 | print <<EOF; |
|
|
71 | |
|
|
72 | |
|
|
73 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
74 | |
|
|
75 | EV can use various backends with various portability issue. The select |
|
|
76 | backend is the most portable and makes for a good fallback, but it can be |
|
|
77 | limited to a low number of file descriptors and/or might not compile. If |
|
|
78 | you have problems with compiling ev_select., you might try to play around |
|
|
79 | with disabling it here, or forcing it to use the fd_set provided by your |
|
|
80 | OS, via the next question. I highly recommend keeping it in. |
|
|
81 | |
|
|
82 | EOF |
|
|
83 | |
|
|
84 | if (prompt ("Enable select backend (y/n)?", "y") =~ /[yY]/) { |
|
|
85 | $DEFINE .= " -DEV_USE_SELECT"; |
|
|
86 | |
|
|
87 | print <<EOF; |
|
|
88 | |
|
|
89 | |
|
|
90 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
91 | |
|
|
92 | The select backend can operate in two modes. One uses the system-provided |
|
|
93 | fd_set and is usually limited to 1024 file descriptors (64 on windows), |
|
|
94 | the other requires your header files to define NFDBITS and declare a |
|
|
95 | suitable fd_mask type. If you run into problems compiling ev_select.c, you |
|
|
96 | can try forcing the use of the system fd_set here. |
|
|
97 | |
|
|
98 | EOF |
|
|
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 | |
|
|
105 | print <<EOF; |
|
|
106 | |
|
|
107 | |
|
|
108 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
109 | |
|
|
110 | The second very portable backend is poll(2). It does not exist on windows |
|
|
111 | and various versions of Mac OS X (and on the other versions it simply |
|
|
112 | doesn't work), but works basically everywhere else. It is recommended to use |
|
|
113 | the default here unless you run into compile problems in ev_poll.c. |
|
|
114 | |
|
|
115 | EOF |
|
|
116 | |
|
|
117 | if (prompt ("Enable poll backend (y/n)?", (-e "/usr/include/poll.h") ? "y" : "n") =~ /[yY]/) { |
|
|
118 | $DEFINE .= " -DEV_USE_POLL"; |
|
|
119 | } |
69 | |
120 | |
70 | print <<EOF; |
121 | print <<EOF; |
71 | |
122 | |
72 | |
123 | |
73 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
124 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
… | |
… | |
89 | print <<EOF; |
140 | print <<EOF; |
90 | |
141 | |
91 | |
142 | |
92 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
143 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
93 | |
144 | |
94 | Similarly to the epoll backend above, EV can take advantage of kqueue on |
145 | Similarly to the epoll backend above, EV can take advantage of kqueue |
95 | many BSD systems (it seems to be broken on Mac OS X though). The kqueue |
146 | on many BSD systems (it seems to be broken on Mac OS X though, but what |
96 | backend has not been tested, however, so it is disabled by default. Please |
147 | isn't broken on that shoddy platform... ah yes, the cash gushing by apple, |
97 | test (and preferably fix) the kqueue backend when you have a machine |
148 | selling defective software works perfectly there). Support for kqueue will |
98 | supporting it. Support for kqueue will be detected at runtime, with a |
149 | be detected at runtime, with a safe fallback to other methods when it |
99 | safe fallback to other methods when it cannot be used. |
150 | cannot be used. |
100 | |
151 | |
101 | EOF |
152 | EOF |
102 | |
153 | |
103 | if (prompt ("Enable kqueue backend (y/n)?", (-e "/usr/include/sys/event.h") ? "y" : "n") =~ /[yY]/) { |
154 | if (prompt ("Enable kqueue backend (y/n)?", (-e "/usr/include/sys/event.h") ? "y" : "n") =~ /[yY]/) { |
104 | $DEFINE .= " -DEV_USE_KQUEUE"; |
155 | $DEFINE .= " -DEV_USE_KQUEUE"; |
… | |
… | |
133 | SUFFIX => '.gz', |
184 | SUFFIX => '.gz', |
134 | }, |
185 | }, |
135 | depend => { |
186 | depend => { |
136 | "EV.c" => "EV/EVAPI.h " |
187 | "EV.c" => "EV/EVAPI.h " |
137 | . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c libev/ev_kqueue.c libev/ev_poll.c " |
188 | . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c libev/ev_kqueue.c libev/ev_poll.c " |
138 | . "libev/event.h libev/event.c libev/evdns.h libev/evdns.c", |
189 | . "libev/event.h libev/event.c evdns.h evdns.c libev/ev_vars.h libev/ev_wrap.h", |
139 | }, |
190 | }, |
140 | INC => "-Ilibev", |
191 | INC => "-Ilibev", |
141 | DEFINE => "$DEFINE", |
192 | DEFINE => "$DEFINE", |
142 | NAME => "EV", |
193 | NAME => "EV", |
143 | LIBS => [$LIBS], |
194 | LIBS => [$LIBS], |
144 | VERSION_FROM => "EV.pm", |
195 | VERSION_FROM => "EV.pm", |
145 | PM => { |
196 | PM => { |
146 | 'EV.pm' => '$(INST_LIBDIR)/EV.pm', |
197 | 'EV.pm' => '$(INST_LIBDIR)/EV.pm', |
147 | 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm', |
|
|
148 | 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', |
198 | 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', |
149 | 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', |
199 | 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', |
150 | 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', |
200 | 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', |
151 | 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', |
201 | 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', |
152 | }, |
202 | }, |