… | |
… | |
15 | |
15 | |
16 | EOF |
16 | EOF |
17 | exit 1; |
17 | exit 1; |
18 | } |
18 | } |
19 | |
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 |
|
|
107 | |
20 | #$ENV{CC} = $Config{cc}; |
108 | #$ENV{CC} = $Config{cc}; |
21 | #$ENV{CFLAGS} = join " ", map $Config{$_}, qw(inc optimize ccflags cccdlflags); |
109 | #$ENV{CFLAGS} = join " ", map $Config{$_}, qw(inc optimize ccflags cccdlflags); |
22 | #system "cd libevent && ./configure --disable-shared --enable-static --disable-maintainer-mode" |
110 | #system "cd libevent && ./configure --disable-shared --enable-static --disable-maintainer-mode" |
23 | # and die "configure failed."; |
111 | # and die "configure failed."; |
24 | |
112 | |
… | |
… | |
32 | }, |
120 | }, |
33 | depend => { |
121 | depend => { |
34 | "EV.c" => "EV/EVAPI.h libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c", |
122 | "EV.c" => "EV/EVAPI.h libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c", |
35 | }, |
123 | }, |
36 | INC => "-Ilibev", |
124 | INC => "-Ilibev", |
|
|
125 | DEFINE => "$DEFINE", |
37 | NAME => "EV", |
126 | NAME => "EV", |
38 | LIBS => ["-lrt -lpthread"], |
127 | LIBS => [$LIBS], |
39 | VERSION_FROM => "EV.pm", |
128 | VERSION_FROM => "EV.pm", |
40 | PM => { |
129 | PM => { |
41 | 'EV.pm' => '$(INST_LIBDIR)/EV.pm', |
130 | 'EV.pm' => '$(INST_LIBDIR)/EV.pm', |
42 | 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm', |
131 | 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm', |
43 | #'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', |
132 | #'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', |