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

Comparing EV/Makefile.PL (file contents):
Revision 1.16 by root, Tue Nov 6 17:20:42 2007 UTC vs.
Revision 1.20 by root, Wed Nov 14 22:30:50 2007 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines