1 | use ExtUtils::MakeMaker; |
1 | use ExtUtils::MakeMaker; |
2 | use Coro::MakeMaker; |
2 | use Coro::MakeMaker; |
3 | |
3 | |
4 | use Canary::Stability Coro::Multicore => 1; |
4 | use Canary::Stability Coro::Multicore => 1, 5.008009; |
5 | |
5 | |
6 | if ($^O eq "MSWin32") { |
6 | if ($^O eq "MSWin32") { |
7 | # configuration on windows is hardcoded - as always |
7 | # configuration on windows is hardcoded - as always |
8 | |
8 | |
9 | print STDERR <<EOF; |
9 | print STDERR <<EOF; |
10 | |
10 | |
11 | *** |
11 | *** |
12 | *** Your platform is not standards compliant. To get this module working, you need to |
12 | *** Your platform is not standards compliant. To get this module working, you need to |
13 | *** download and install win32 pthread (http://sourceware.org/pthreads-win32/) |
13 | *** have the win32 pthread library (http://sourceware.org/pthreads-win32/) and |
14 | *** in /gtk/{lib,include} |
14 | *** the windows sdk or equivalent. |
15 | *** also, the windows SDK is expected to be installed in /sdk |
|
|
16 | *** and visual C is expected to be installed in /vc98 |
|
|
17 | *** |
|
|
18 | *** Alternatively, set the INC and LIBS environment variables |
|
|
19 | *** accordingly before running Makefile.PL, or you can |
|
|
20 | *** pass INC and LIBS arguments to Makefile.PL itself. |
|
|
21 | *** |
15 | *** |
22 | |
16 | |
23 | EOF |
17 | EOF |
24 | |
18 | |
25 | if ($Config{cc} =~ /(?:^|\\|\/)gcc(?:|.*\.exe)$/) { |
19 | $INC = "$ENV{INC}"; |
26 | $INC = "$ENV{INC} -I/gtk/include"; |
|
|
27 | $LIBS = ["$ENV{LIBS} -L/gtk/lib -lpthreadGC2"]; |
20 | $LIBS = ["$ENV{LIBS} -lpthread"]; |
28 | } else { |
|
|
29 | $INC = "$ENV{INC} -I/sdk/include -I/vc98/include -I/gtk/include"; |
|
|
30 | $LIBS = ["$ENV{LIBS} -L/gtk/lib -lpthreadVC2"]; |
|
|
31 | } |
|
|
32 | |
21 | |
33 | } else { |
22 | } else { |
34 | |
23 | |
35 | $INC = ""; |
24 | $INC = ""; |
36 | $LIBS = ['-lpthread', '-lpthreads', '']; |
25 | $LIBS = ['-lpthread', '-lpthreads', '']; |
… | |
… | |
66 | *** |
55 | *** |
67 | |
56 | |
68 | EOF |
57 | EOF |
69 | } |
58 | } |
70 | |
59 | |
|
|
60 | print <<EOF; |
|
|
61 | |
|
|
62 | *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** |
|
|
63 | |
|
|
64 | Coro::Multicore can do some simple checks to make sure perlinterp_release |
|
|
65 | is called only with a valid perl context, and perlinterp_acquire without |
|
|
66 | ensuring that they are always called in proper pairs. This is very useful |
|
|
67 | while developing XS modules using perlmulticore.h. |
|
|
68 | |
|
|
69 | This costs a bit of performance though, so it is disabled by default. |
|
|
70 | |
|
|
71 | The environment variable CORO_MULTICORE_CHECK can be used to set a |
|
|
72 | default for this answer. |
|
|
73 | |
|
|
74 | EOF |
|
|
75 | |
|
|
76 | my $extra = prompt ("Enable extra checks?", $ENV{CORO_MULTICORE_CHECK} ? "y" : "n") =~ /[Yy]/; |
|
|
77 | |
|
|
78 | my $define = sprintf "-DRECURSION_CHECK=%d", $extra; |
|
|
79 | |
71 | WriteMakefile(Coro::MakeMaker::coro_args( |
80 | WriteMakefile(Coro::MakeMaker::coro_args( |
72 | dist => { |
81 | dist => { |
73 | PREOP => 'pod2text Multicore.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
82 | PREOP => 'pod2text Multicore.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
74 | COMPRESS => 'gzip -9v', |
83 | COMPRESS => 'gzip -9v', |
75 | SUFFIX => '.gz', |
84 | SUFFIX => '.gz', |
76 | }, |
85 | }, |
77 | NAME => "Coro::Multicore", |
86 | NAME => "Coro::Multicore", |
78 | VERSION_FROM => "Multicore.pm", |
87 | VERSION_FROM => "Multicore.pm", |
79 | CONFIGURE_REQUIRES => { "ExtUtils::MakeMaker" => 6.52, "Canary::Stability" => 0, "Coro" => 6, "AnyEvent" => 7 }, |
88 | CONFIGURE_REQUIRES => { "ExtUtils::MakeMaker" => 6.52, "Canary::Stability" => 0, "Coro" => 6.44 }, |
|
|
89 | TEST_REQUIRES => { "Coro" => 6.44 }, |
|
|
90 | DEFINE => $define, |
|
|
91 | PREREQ_PM => { "Coro" => 6.44, "AnyEvent" => 7 }, |
80 | INC => $INC, |
92 | INC => $INC, |
81 | LIBS => $LIBS, |
93 | LIBS => $LIBS, |
82 | )); |
94 | )); |
83 | |
95 | |