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

Comparing EV/Makefile.PL (file contents):
Revision 1.9 by root, Wed Oct 31 14:44:35 2007 UTC vs.
Revision 1.16 by root, Tue Nov 6 17:20:42 2007 UTC

1use 5.006; 1use 5.006;
2 2
3use Config; 3use Config;
4use ExtUtils::MakeMaker; 4use ExtUtils::MakeMaker;
5 5
6#$ENV{CC} = $Config{cc};
7#$ENV{CFLAGS} = join " ", map $Config{$_}, qw(inc optimize ccflags cccdlflags);
8#system "cd libevent && ./configure --disable-shared --enable-static --disable-maintainer-mode"
9# and die "configure failed.";
10 6
11#$LIBS = qx<cd libevent && make printlibs>; 7unless (-e "libev/ev_epoll.c") {
8 print <<EOF;
9
10***
11*** ERROR: libev is missing or damaged. If you used a CVS check-out of EV,
12*** you also have to check-out the "libev" module from the same CVS
13*** repository into the EV dir (i.e. EV/libev from outside).
14***
15
16EOF
17 exit 1;
18}
19
20print <<EOF;
21
22
23*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
24
25Welcome to EV configuration. If you are in a hurry, just press return here
26and hope for the best. The defaults should usually do.
27
28EOF
29
30if (prompt ("Skip further questions and use defaults (y/n)?", "y") =~ /[yY]/) {
31 $ENV{PERL_MM_USE_DEFAULT} = 1;
32}
33
34print <<EOF;
35
36
37*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
38
39POSIX optionally offers support for a monotonic clock source. EV
40can take advantage of this clock source to detect time jumps
41reliably. Unfortunately, some systems are bound to be broken, so you can
42disable this here: you can completely disable the detection and use of
43the monotonic clock by answering 'n' here. Support for this clock type
44will otherwise be autodetected at both compile- and runtime.
45
46EOF
47
48if (prompt ("Enable optional support for CLOCK_MONOTONIC (y/n)?", "y") =~ /[yY]/) {
49 $DEFINE .= " -DEV_USE_MONOTONIC";
50}
51
52print <<EOF;
53
54
55*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
56
57POSIX optionally offers support for a (potentially) high-resolution
58realtime clock interface. In a good implementation, using it is faster
59than the normal method of using gettimeofday. Unfortunately, this option
60is also bound to be broken on some systems, so you can disable use and
61probing of this feature altogether here. Otherwise support for this clock
62type will be autodetected at compiletime.
63
64EOF
65
66if (prompt ("Prefer clock_gettime (CLOCK_REALTIME) over gettimeofday (y/n)?", "y") !~ /[yY]/) {
67 $DEFINE .= " -DEV_USE_REALTIME=0";
68}
69
70print <<EOF;
71
72
73*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
74
75EV by default uses select, which makes it hard to write efficient servers,
76especially if the number of active conencitons is much lower than the open
77ones. GNU/Linux systems have a more scalable method called "epoll", which
78EV can use. For this to work, both your kernel and glibc have to support
79epoll, but if you can compile it, the detection will be done at runtime,
80and EV will safely fall back to using select when epoll isn't available.
81If unsure, accept the default.
82
83EOF
84
85if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) {
86 $DEFINE .= " -DEV_USE_EPOLL";
87}
88
89print <<EOF;
90
91
92*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
93
94Similarly to the epoll backend above, EV can take advantage of kqueue on
95many BSD systems (it seems to be broken on Mac OS X though). The kqueue
96backend has not been tested, however, so it is disabled by default. Please
97test (and preferably fix) the kqueue backend when you have a machine
98supporting it. Support for kqueue will be detected at runtime, with a
99safe fallback to other methods when it cannot be used.
100
101EOF
102
103if (prompt ("Enable kqueue backend (y/n)?", (-e "/usr/include/sys/event.h") ? "y" : "n") =~ /[yY]/) {
104 $DEFINE .= " -DEV_USE_KQUEUE";
105}
106
107print <<EOF;
108
109
110*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
111
112EV needs the functions pthread_atfork and clock_gettime. On most systems
113you need some special libraries for this (such as -lrt and -lpthread). You
114can specify additional libraries to provide these calls now, or accept the
115default.
116
117EOF
118
119$LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt";
120
121
122print <<EOF;
123
124
125*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
126
127EOF
12 128
13WriteMakefile( 129WriteMakefile(
14 dist => { 130 dist => {
15 PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', 131 PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
16 COMPRESS => 'gzip -9v', 132 COMPRESS => 'gzip -9v',
17 SUFFIX => '.gz', 133 SUFFIX => '.gz',
18 }, 134 },
19 MYEXTLIB => 'libevent/.libs/libevent$(LIB_EXT)', 135 depend => {
136 "EV.c" => "EV/EVAPI.h "
137 . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c "
138 . "libev/event.h libev/event.c libev/evdns.h libev/evdns.c",
139 },
20 INC => "-Ilibev", 140 INC => "-Ilibev",
141 DEFINE => "$DEFINE",
21 NAME => "EV", 142 NAME => "EV",
22 LIBS => ["-lrt -lpthread"], 143 LIBS => [$LIBS],
23 VERSION_FROM => "EV.pm", 144 VERSION_FROM => "EV.pm",
24 PM => { 145 PM => {
25 'EV.pm' => '$(INST_LIBDIR)/EV.pm', 146 'EV.pm' => '$(INST_LIBDIR)/EV.pm',
26 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm', 147 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm',
27 #'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', 148 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm',
28 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', 149 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h',
29 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', 150 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm',
30 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', 151 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h',
31 }, 152 },
32); 153);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines