|
|
1 | use 5.005; |
|
|
2 | |
|
|
3 | use strict; |
1 | use ExtUtils::MakeMaker; |
4 | use ExtUtils::MakeMaker; |
2 | |
|
|
3 | use 5.005; |
|
|
4 | |
|
|
5 | use Config; |
5 | use Config; |
6 | |
6 | |
7 | $|=1; |
7 | $|=1; |
8 | |
8 | |
9 | $DEFINE = ""; |
9 | my $DEFINE; |
|
|
10 | my @LIBS = []; |
10 | |
11 | |
11 | print <<EOF; |
12 | print <<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 | |
|
|
31 | my $iface; |
29 | |
32 | |
30 | if (exists $ENV{CORO_INTERFACE}) { |
33 | if (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 | |
106 | w Microsoft Windows. Try this on Microsoft Windows, although, as there is |
109 | w 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 | |
|
|
113 | p 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 | |
110 | For most systems, the default chosen should be OK. If you experience |
117 | For most systems, the default chosen should be OK. If you experience |
111 | problems then you should experiment with this setting and/or turn |
118 | problems then you should experiment with this setting and/or turn |
112 | optimisations on or off (make OPTIMIZE=-O0). |
119 | optimisations 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 | |
251 | WriteMakefile( |
262 | WriteMakefile( |
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 | |
258 | sub conftest { |
270 | sub conftest { |
259 | my $type = shift; |
271 | my $type = shift; |