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

Comparing Coro/Coro/Makefile.PL (file contents):
Revision 1.54 by root, Sun Mar 2 16:10:21 2008 UTC vs.
Revision 1.55 by root, Fri Apr 4 20:07:34 2008 UTC

1use 5.005;
2
3use strict;
1use ExtUtils::MakeMaker; 4use ExtUtils::MakeMaker;
2
3use 5.005;
4
5use Config; 5use Config;
6 6
7$|=1; 7$|=1;
8 8
9$DEFINE = ""; 9my $DEFINE;
10my @LIBS = [];
10 11
11print <<EOF; 12print <<EOF;
12 13
13*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 14*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
14 15
24 $ENV{PERL_MM_USE_DEFAULT} = 1; 25 $ENV{PERL_MM_USE_DEFAULT} = 1;
25} 26}
26 27
27 28
28$DEFINE .= " -DHAVE_MMAP" if $Config{d_mmap} eq "define" && $Config{d_munmap} eq "define"; 29$DEFINE .= " -DHAVE_MMAP" if $Config{d_mmap} eq "define" && $Config{d_munmap} eq "define";
30
31my $iface;
29 32
30if (exists $ENV{CORO_INTERFACE}) { 33if (exists $ENV{CORO_INTERFACE}) {
31 $iface = $ENV{CORO_INTERFACE}; 34 $iface = $ENV{CORO_INTERFACE};
32 35
33} elsif ($^O =~ /win32/i or $^O =~ /cygwin/ or $^O =~ /mswin/) { 36} elsif ($^O =~ /win32/i or $^O =~ /cygwin/ or $^O =~ /mswin/) {
104 be needed (it's fast), although [s] and [u] should also work now. 107 be needed (it's fast), although [s] and [u] should also work now.
105 108
106w Microsoft Windows. Try this on Microsoft Windows, although, as there is 109w Microsoft Windows. Try this on Microsoft Windows, although, as there is
107 no standard on how to do this under windows, this might work only on 110 no standard on how to do this under windows, this might work only on
108 cygwin or specific versions of msvc. Your problem, your fix, our patch. 111 cygwin or specific versions of msvc. Your problem, your fix, our patch.
112
113p Use pthread API. Try to avoid this option, it was only created to make
114 a point about the programming language shootout and might leak threads.
115 It might work fine as a last resort, however.
109 116
110For most systems, the default chosen should be OK. If you experience 117For most systems, the default chosen should be OK. If you experience
111problems then you should experiment with this setting and/or turn 118problems then you should experiment with this setting and/or turn
112optimisations on or off (make OPTIMIZE=-O0). 119optimisations on or off (make OPTIMIZE=-O0).
113 120
138 $DEFINE .= " -DCORO_LOSER"; 145 $DEFINE .= " -DCORO_LOSER";
139 print "\nUsing windows-specific implementation\n\n"; 146 print "\nUsing windows-specific implementation\n\n";
140} elsif ($iface eq "a") { 147} elsif ($iface eq "a") {
141 $DEFINE .= " -DCORO_ASM"; 148 $DEFINE .= " -DCORO_ASM";
142 print "\nUsing handcoded assembly implementation\n\n"; 149 print "\nUsing handcoded assembly implementation\n\n";
150} elsif ($iface eq "p") {
151 $DEFINE .= " -DCORO_PTHREAD";
152 @LIBS = ["-lpthread"];
153 print "\nUsing pthread implementation\n\n";
143} else { 154} else {
144 print "\nUnknown implementation \"$iface\"\n"; 155 print "\nUnknown implementation \"$iface\"\n";
145 goto retry; 156 goto retry;
146} 157}
147 158
250 261
251WriteMakefile( 262WriteMakefile(
252 NAME => "Coro::State", 263 NAME => "Coro::State",
253 VERSION_FROM => "State.pm", 264 VERSION_FROM => "State.pm",
254 DEFINE => $DEFINE, 265 DEFINE => $DEFINE,
266 LIBS => @LIBS,
255 DIR => [], 267 DIR => [],
256); 268);
257 269
258sub conftest { 270sub conftest {
259 my $type = shift; 271 my $type = shift;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines