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

Comparing EV/Makefile.PL (file contents):
Revision 1.6 by root, Tue Oct 30 14:02:35 2007 UTC vs.
Revision 1.12 by root, Thu Nov 1 15:46:43 2007 UTC

1use 5.006; 1use 5.006;
2 2
3use Config;
3use ExtUtils::MakeMaker; 4use ExtUtils::MakeMaker;
5
6
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 can
40take advantage of this clock source to detect time jumps reliably. This
41will usually slow down EV a tiny amount, but this is usually
42well-invested. Unfortunately, some systems are bound to be broken, so
43you can disable this here. Whatever your reasons, you can completely
44disable the detection and use of this monotonic clock by answering 'n'
45here. Support for this clock type will otherwise be autodetected at both
46compile- and runtime.
47
48EOF
49
50if (prompt ("Enable optional support for CLOCK_MONOTONIC (y/n)?", "y") =~ /[yY]/) {
51 $DEFINE .= " -DEV_USE_MONOTONIC";
52}
53
54print <<EOF;
55
56
57*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
58
59POSIX optionally offers support for a (potentially) high-resolution
60realtime clock interface. In a good implementation, using it is faster
61than the normal method of using gettimeofday. Unfortunately, this option
62is also bound to be broken on some systems, so you can disable use and
63probing of this feature altogether here. Otherwise support for this clock
64type will be autodetected at compiletime.
65
66EOF
67
68if (prompt ("Prefer clock_gettime (CLOCK_REALTIME) over gettimeofday (y/n)?", "y") !~ /[yY]/) {
69 $DEFINE .= " -DEV_USE_REALTIME=0";
70}
71
72print <<EOF;
73
74
75*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
76
77EV needs the functions pthread_atfork and clock_gettime. On most systems
78you need some special libraries for this (such as -lrt and -lpthread). You can
79specify additional libraries to provide these calls now, or accept the default.
80
81EOF
82
83$LIBS = prompt "Extra libraries for pthread_atfork and clock_gettime?", "-lpthread -lrt";
84
85
86print <<EOF;
87
88
89*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
90
91EV needs the functions pthread_atfork and clock_gettime. On most systems
92you need some special libraries for this (such as -lrt and -lpthread). You can
93specify additional libraries to provide these calls now, or accept the default.
94
95EOF
96
97if (prompt ("Enable epoll backend (y/n)?", (-e "/usr/include/sys/epoll.h") ? "y" : "n") =~ /[yY]/) {
98 $DEFINE .= " -DEV_USE_EPOLL";
99}
100
101print <<EOF;
102
103
104*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
105
106EOF
107
108#$ENV{CC} = $Config{cc};
109#$ENV{CFLAGS} = join " ", map $Config{$_}, qw(inc optimize ccflags cccdlflags);
110#system "cd libevent && ./configure --disable-shared --enable-static --disable-maintainer-mode"
111# and die "configure failed.";
112
113#$LIBS = qx<cd libevent && make printlibs>;
4 114
5WriteMakefile( 115WriteMakefile(
6 dist => { 116 dist => {
7 PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', 117 PREOP => 'pod2text EV.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
8 COMPRESS => 'gzip -9v', 118 COMPRESS => 'gzip -9v',
9 SUFFIX => '.gz', 119 SUFFIX => '.gz',
10 }, 120 },
11 MYEXTLIB => 'libevent/.libs/libevent$(LIB_EXT)', 121 depend => {
122 "EV.c" => "EV/EVAPI.h libev/ev.c libev/ev.h libev/ev_epoll.c libev/ev_select.c",
123 },
124 INC => "-Ilibev",
125 DEFINE => "$DEFINE",
12 NAME => "EV", 126 NAME => "EV",
127 LIBS => [$LIBS],
13 VERSION_FROM => "EV.pm", 128 VERSION_FROM => "EV.pm",
14 PM => { 129 PM => {
15 'EV.pm' => '$(INST_LIBDIR)/EV.pm', 130 'EV.pm' => '$(INST_LIBDIR)/EV.pm',
16 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm', 131 'EV/AnyEvent.pm' => '$(INST_LIBDIR)/EV/AnyEvent.pm',
17 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm', 132 'EV/DNS.pm' => '$(INST_LIBDIR)/EV/DNS.pm',
18 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h', 133 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h',
19 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm', 134 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm',
20 'libevent/event.h' => '$(INST_LIBDIR)/EV/event.h', 135 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h',
21 'libevent/evdns.h' => '$(INST_LIBDIR)/EV/evdns.h',
22 'libevent/evhttp.h' => '$(INST_LIBDIR)/EV/evhttp.h',
23 }, 136 },
24); 137);
25 138
26sub MY::postamble {
27 my $postamble =<<'END';
28 139
29libevent/Makefile: libevent/configure
30 cd libevent && CC="$(CC)" CFLAGS="$(OPTIMIZE) $(CFLAGS) $(CCCDLFLAGS)" ./configure --disable-shared --enable-static --disable-maintainer-mode
31
32clean::
33 -cd libevent && make distclean
34
35force:
36
37$(MYEXTLIB): libevent/Makefile force
38 cd libevent && $(MAKE) all
39
40END
41}
42

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines