ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro-Multicore/Makefile.PL
Revision: 1.9
Committed: Tue Dec 17 20:04:34 2019 UTC (4 years, 5 months ago) by root
Content type: text/plain
Branch: MAIN
CVS Tags: rel-1_06, rel-1_07, HEAD
Changes since 1.8: +2 -2 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 use ExtUtils::MakeMaker;
2     use Coro::MakeMaker;
3    
4 root 1.4 use Canary::Stability Coro::Multicore => 1, 5.008009;
5 root 1.1
6     if ($^O eq "MSWin32") {
7     # configuration on windows is hardcoded - as always
8    
9     print STDERR <<EOF;
10    
11     ***
12     *** Your platform is not standards compliant. To get this module working, you need to
13 root 1.5 *** have the win32 pthread library (http://sourceware.org/pthreads-win32/) and
14     *** the windows sdk or equivalent.
15 root 1.1 ***
16    
17     EOF
18    
19 root 1.5 $INC = "$ENV{INC}";
20     $LIBS = ["$ENV{LIBS} -lpthread"];
21 root 1.1
22     } else {
23    
24     $INC = "";
25     $LIBS = ['-lpthread', '-lpthreads', ''];
26    
27     if ($^O =~ /bsd/i) {
28     print <<EOF;
29    
30     If you have problems with deadlocks or crashes on your system,
31     make sure your perl has been linked with -lpthread (you might try
32     LD_PRELOAD=/path/to/libpthread.so as a workaround). Also, pthread support
33     under many BSDs is not the best - before reporting a bug in this module,
34     make sure it's not an OS bug.
35    
36     EOF
37     }
38     }
39    
40     if ($^O =~ /linux/ && $Config{usemymalloc} eq "y") {
41     print <<EOF;
42    
43     ***
44     *** WARNING:
45     ***
46     *** Your perl uses its own memory allocator (-Dusemymalloc=y),
47     *** which is known not to be threadsafe on GNU/Linux and probably
48     *** other platforms (even when not used concurrently, it trashes
49     *** the data structures of the system malloc running concurrently),
50     *** for perls up to 5.8.8 and possibly later versions.
51     ***
52     *** If you are unsure wether your perl has been fixed, your system
53     *** is safe for other reasons, or you experience spurious segfaults,
54     *** please compile your perl with -Dusemymalloc=n.
55     ***
56    
57     EOF
58     }
59    
60 root 1.6 print <<EOF;
61    
62     *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
63    
64 root 1.8 Coro::Multicore can do some simple checks to make sure perlinterp_release
65 root 1.9 is called only with a valid perl context, and perlinterp_acquire without
66 root 1.6 ensuring that they are always called in proper pairs. This is very useful
67 root 1.9 while developing XS modules using perlmulticore.h.
68 root 1.6
69     This costs a bit of performance though, so it is disabled by default.
70    
71 root 1.7 The environment variable CORO_MULTICORE_CHECK can be used to set a
72 root 1.6 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    
80 root 1.1 WriteMakefile(Coro::MakeMaker::coro_args(
81     dist => {
82     PREOP => 'pod2text Multicore.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
83     COMPRESS => 'gzip -9v',
84     SUFFIX => '.gz',
85     },
86     NAME => "Coro::Multicore",
87     VERSION_FROM => "Multicore.pm",
88 root 1.2 CONFIGURE_REQUIRES => { "ExtUtils::MakeMaker" => 6.52, "Canary::Stability" => 0, "Coro" => 6.44 },
89 root 1.3 TEST_REQUIRES => { "Coro" => 6.44 },
90 root 1.6 DEFINE => $define,
91 root 1.2 PREREQ_PM => { "Coro" => 6.44, "AnyEvent" => 7 },
92 root 1.1 INC => $INC,
93     LIBS => $LIBS,
94     ));
95