… | |
… | |
34 | print <<EOF; |
34 | print <<EOF; |
35 | |
35 | |
36 | |
36 | |
37 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
37 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
38 | |
38 | |
39 | POSIX optionally offers support for a monotonic clock source. EV can |
39 | POSIX optionally offers support for a monotonic clock source. EV |
40 | take advantage of this clock source to detect time jumps reliably. This |
40 | can take advantage of this clock source to detect time jumps |
41 | will usually slow down EV a tiny amount, but this is usually |
|
|
42 | well-invested. Unfortunately, some systems are bound to be broken, so |
41 | reliably. Unfortunately, some systems are bound to be broken, so you can |
43 | you can disable this here. Whatever your reasons, you can completely |
42 | disable this here: you can completely disable the detection and use of |
44 | disable the detection and use of this monotonic clock by answering 'n' |
43 | the monotonic clock by answering 'n' here. Support for this clock type |
45 | here. Support for this clock type will otherwise be autodetected at both |
44 | will otherwise be autodetected at both compile- and runtime. |
46 | compile- and runtime. |
|
|
47 | |
45 | |
48 | EOF |
46 | EOF |
49 | |
47 | |
50 | if (prompt ("Enable optional support for CLOCK_MONOTONIC (y/n)?", "y") =~ /[yY]/) { |
48 | if (prompt ("Enable optional support for CLOCK_MONOTONIC (y/n)?", "y") =~ /[yY]/) { |
51 | $DEFINE .= " -DEV_USE_MONOTONIC"; |
49 | $DEFINE .= " -DEV_USE_MONOTONIC"; |
… | |
… | |
72 | print <<EOF; |
70 | print <<EOF; |
73 | |
71 | |
74 | |
72 | |
75 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
73 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
76 | |
74 | |
77 | EV needs the functions pthread_atfork and clock_gettime. On most systems |
75 | EV by default uses select, which makes it hard to write efficient servers, |
78 | you need some special libraries for this (such as -lrt and -lpthread). You can |
76 | especially if the number of active conencitons is much lower than the open |
79 | specify additional libraries to provide these calls now, or accept the default. |
77 | ones. GNU/Linux systems have a more scalable method called "epoll", which |
|
|
78 | EV can use. For this to work, both your kernel and glibc have to support |
|
|
79 | epoll, but if you can compile it, the detection will be done at runtime, |
|
|
80 | and EV will safely fall back to using select when epoll isn't available. |
|
|
81 | If unsure, accept the default. |
80 | |
82 | |
81 | EOF |
83 | EOF |
82 | |
84 | |
83 | $LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt"; |
85 | if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) { |
|
|
86 | $DEFINE .= " -DEV_USE_EPOLL"; |
|
|
87 | } |
84 | |
88 | |
|
|
89 | print <<EOF; |
|
|
90 | |
|
|
91 | |
|
|
92 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
93 | |
|
|
94 | Similarly to the epoll backend above, EV can take advantage of kqueue on |
|
|
95 | many BSD systems (it seems to be broken on Mac OS X though). The kqueue |
|
|
96 | backend has not been tested, however, so it is disabled by default. Please |
|
|
97 | test (and preferably fix) the kqueue backend when you have a machine |
|
|
98 | supporting it. Support for kqueue will be detected at runtime, with a |
|
|
99 | safe fallback to other methods when it cannot be used. |
|
|
100 | |
|
|
101 | EOF |
|
|
102 | |
|
|
103 | if (prompt ("Enable kqueue backend (y/n)?", (-e "/usr/include/sys/event.h") ? "y" : "n") =~ /[yY]/) { |
|
|
104 | $DEFINE .= " -DEV_USE_KQUEUE"; |
|
|
105 | } |
85 | |
106 | |
86 | print <<EOF; |
107 | print <<EOF; |
87 | |
108 | |
88 | |
109 | |
89 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
110 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
90 | |
111 | |
91 | EV needs the functions pthread_atfork and clock_gettime. On most systems |
112 | EV needs the functions pthread_atfork and clock_gettime. On most systems |
92 | you need some special libraries for this (such as -lrt and -lpthread). You can |
113 | you need some special libraries for this (such as -lrt and -lpthread). You |
93 | specify additional libraries to provide these calls now, or accept the default. |
114 | can specify additional libraries to provide these calls now, or accept the |
|
|
115 | default. |
94 | |
116 | |
95 | EOF |
117 | EOF |
96 | |
118 | |
97 | if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) { |
119 | $LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt"; |
98 | $DEFINE .= " -DEV_USE_EPOLL"; |
120 | |
99 | } |
|
|
100 | |
121 | |
101 | print <<EOF; |
122 | print <<EOF; |
102 | |
123 | |
103 | |
124 | |
104 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
125 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
… | |
… | |
111 | COMPRESS => 'gzip -9v', |
132 | COMPRESS => 'gzip -9v', |
112 | SUFFIX => '.gz', |
133 | SUFFIX => '.gz', |
113 | }, |
134 | }, |
114 | depend => { |
135 | depend => { |
115 | "EV.c" => "EV/EVAPI.h " |
136 | "EV.c" => "EV/EVAPI.h " |
116 | . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c " |
137 | . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c libev/ev_kqueue.c libev/ev_poll.c " |
117 | . "libev/event.h libev/event.c libev/evdns.h libev/evdns.c", |
138 | . "libev/event.h libev/event.c evdns.h evdns.c libev/ev_vars.h libev/ev_wrap.h", |
118 | }, |
139 | }, |
119 | INC => "-Ilibev", |
140 | INC => "-Ilibev", |
120 | DEFINE => "$DEFINE", |
141 | DEFINE => "$DEFINE", |
121 | NAME => "EV", |
142 | NAME => "EV", |
122 | LIBS => [$LIBS], |
143 | LIBS => [$LIBS], |
123 | VERSION_FROM => "EV.pm", |
144 | VERSION_FROM => "EV.pm", |
124 | PM => { |
145 | PM => { |
125 | 'EV.pm' => '$(INST_LIBDIR)/EV.pm', |
146 | 'EV.pm' => '$(INST_LIBDIR)/EV.pm', |
126 | 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm', |
|
|
127 | 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', |
147 | 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', |
128 | 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', |
148 | 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', |
129 | 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', |
149 | 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', |
130 | 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', |
150 | 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', |
131 | }, |
151 | }, |