|
|
1 | use 5.006; |
|
|
2 | |
|
|
3 | use Config; |
1 | use ExtUtils::MakeMaker; |
4 | use ExtUtils::MakeMaker; |
|
|
5 | |
|
|
6 | |
|
|
7 | unless (-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 | |
|
|
16 | EOF |
|
|
17 | exit 1; |
|
|
18 | } |
|
|
19 | |
|
|
20 | print <<EOF; |
|
|
21 | |
|
|
22 | |
|
|
23 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
24 | |
|
|
25 | Welcome to EV configuration. If you are in a hurry, just press return here |
|
|
26 | and hope for the best. The defaults should usually do. |
|
|
27 | |
|
|
28 | EOF |
|
|
29 | |
|
|
30 | if (prompt ("Skip further questions and use defaults (y/n)?", "y") =~ /[yY]/) { |
|
|
31 | $ENV{PERL_MM_USE_DEFAULT} = 1; |
|
|
32 | } |
|
|
33 | |
|
|
34 | print <<EOF; |
|
|
35 | |
|
|
36 | |
|
|
37 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
38 | |
|
|
39 | POSIX optionally offers support for a monotonic clock source. EV can |
|
|
40 | take advantage of this clock source to detect time jumps reliably. This |
|
|
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 |
|
|
43 | you can disable this here. Whatever your reasons, you can completely |
|
|
44 | disable the detection and use of this monotonic clock by answering 'n' |
|
|
45 | here. Support for this clock type will otherwise be autodetected at both |
|
|
46 | compile- and runtime. |
|
|
47 | |
|
|
48 | EOF |
|
|
49 | |
|
|
50 | if (prompt ("Enable optional support for CLOCK_MONOTONIC (y/n)?", "y") =~ /[yY]/) { |
|
|
51 | $DEFINE .= " -DEV_USE_MONOTONIC"; |
|
|
52 | } |
|
|
53 | |
|
|
54 | print <<EOF; |
|
|
55 | |
|
|
56 | |
|
|
57 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
58 | |
|
|
59 | POSIX optionally offers support for a (potentially) high-resolution |
|
|
60 | realtime clock interface. In a good implementation, using it is faster |
|
|
61 | than the normal method of using gettimeofday. Unfortunately, this option |
|
|
62 | is also bound to be broken on some systems, so you can disable use and |
|
|
63 | probing of this feature altogether here. Otherwise support for this clock |
|
|
64 | type will be autodetected at compiletime. |
|
|
65 | |
|
|
66 | EOF |
|
|
67 | |
|
|
68 | if (prompt ("Prefer clock_gettime (CLOCK_REALTIME) over gettimeofday (y/n)?", "y") !~ /[yY]/) { |
|
|
69 | $DEFINE .= " -DEV_USE_REALTIME=0"; |
|
|
70 | } |
|
|
71 | |
|
|
72 | print <<EOF; |
|
|
73 | |
|
|
74 | |
|
|
75 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
76 | |
|
|
77 | EV needs the functions pthread_atfork and clock_gettime. On most systems |
|
|
78 | you need some special libraries for this (such as -lrt and -lpthread). You can |
|
|
79 | specify additional libraries to provide these calls now, or accept the default. |
|
|
80 | |
|
|
81 | EOF |
|
|
82 | |
|
|
83 | $LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt"; |
|
|
84 | |
|
|
85 | |
|
|
86 | print <<EOF; |
|
|
87 | |
|
|
88 | |
|
|
89 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
90 | |
|
|
91 | 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 |
|
|
93 | specify additional libraries to provide these calls now, or accept the default. |
|
|
94 | |
|
|
95 | EOF |
|
|
96 | |
|
|
97 | if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) { |
|
|
98 | $DEFINE .= " -DEV_USE_EPOLL"; |
|
|
99 | } |
|
|
100 | |
|
|
101 | print <<EOF; |
|
|
102 | |
|
|
103 | |
|
|
104 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
105 | |
|
|
106 | EOF |
2 | |
107 | |
3 | WriteMakefile( |
108 | WriteMakefile( |
4 | dist => { |
109 | dist => { |
5 | PREOP => 'pod2text Libevent.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
110 | PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
6 | COMPRESS => 'gzip -9v', |
111 | COMPRESS => 'gzip -9v', |
7 | SUFFIX => '.gz', |
112 | SUFFIX => '.gz', |
8 | }, |
113 | }, |
|
|
114 | depend => { |
|
|
115 | "EV.c" => "EV/EVAPI.h " |
|
|
116 | . "libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c " |
|
|
117 | . "libev/event.h libev/event.c libev/evdns.h libev/evdns.c", |
|
|
118 | }, |
|
|
119 | INC => "-Ilibev", |
|
|
120 | DEFINE => "$DEFINE", |
9 | NAME => "Libevent", |
121 | NAME => "EV", |
|
|
122 | LIBS => [$LIBS], |
10 | VERSION_FROM => "Libevent.pm", |
123 | VERSION_FROM => "EV.pm", |
|
|
124 | PM => { |
|
|
125 | 'EV.pm' => '$(INST_LIBDIR)/EV.pm', |
|
|
126 | 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm', |
|
|
127 | 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', |
|
|
128 | 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', |
|
|
129 | 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', |
|
|
130 | 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h', |
|
|
131 | }, |
11 | ); |
132 | ); |
12 | |
133 | |
|
|
134 | |