1 |
use ExtUtils::MakeMaker; |
2 |
|
3 |
use Canary::Stability AnyEvent::XSThreadPool => 1; |
4 |
|
5 |
if ($^O eq "MSWin32") { |
6 |
# configuration on windows is hardcoded - as always |
7 |
|
8 |
print STDERR <<EOF; |
9 |
|
10 |
*** |
11 |
*** Your platform is not standards compliant. To get this module working, you need to |
12 |
*** download and install win32 pthread (http://sourceware.org/pthreads-win32/) |
13 |
*** in /gtk/{lib,include} |
14 |
*** also, the windows SDK is expected to be installed in /sdk |
15 |
*** and visual C is expected to be installed in /vc98 |
16 |
*** |
17 |
*** Alternatively, set the INC and LIBS environment variables |
18 |
*** accordingly before running Makefile.PL, or you can |
19 |
*** pass INC and LIBS arguments to Makefile.PL itself. |
20 |
*** |
21 |
|
22 |
EOF |
23 |
|
24 |
if ($Config{cc} =~ /(?:^|\\|\/)gcc(?:|.*\.exe)$/) { |
25 |
$INC = "$ENV{INC} -I/gtk/include"; |
26 |
$LIBS = ["$ENV{LIBS} -L/gtk/lib -lpthreadGC2"]; |
27 |
} else { |
28 |
$INC = "$ENV{INC} -I/sdk/include -I/vc98/include -I/gtk/include"; |
29 |
$LIBS = ["$ENV{LIBS} -L/gtk/lib -lpthreadVC2"]; |
30 |
} |
31 |
|
32 |
} else { |
33 |
|
34 |
$INC = ""; |
35 |
$LIBS = ['-lpthread', '-lpthreads', '']; |
36 |
|
37 |
if ($^O =~ /bsd/i) { |
38 |
print <<EOF; |
39 |
|
40 |
If you have problems with deadlocks or crashes on your system, |
41 |
make sure your perl has been linked with -lpthread (you might try |
42 |
LD_PRELOAD=/path/to/libpthread.so as a workaround). Also, pthread support |
43 |
under many BSDs is not the best - before reporting a bug in this module, |
44 |
make sure it's not an OS bug. |
45 |
|
46 |
EOF |
47 |
} |
48 |
} |
49 |
|
50 |
if ($^O =~ /linux/ && $Config{usemymalloc} eq "y") { |
51 |
print <<EOF; |
52 |
|
53 |
*** |
54 |
*** WARNING: |
55 |
*** |
56 |
*** Your perl uses its own memory allocator (-Dusemymalloc=y), |
57 |
*** which is known not to be threadsafe on GNU/Linux and probably |
58 |
*** other platforms (even when not used concurrently, it trashes |
59 |
*** the data structures of the system malloc running concurrently), |
60 |
*** for perls up to 5.8.8 and possibly later versions. |
61 |
*** |
62 |
*** If you are unsure wether your perl has been fixed, your system |
63 |
*** is safe for other reasons, or you experience spurious segfaults, |
64 |
*** please compile your perl with -Dusemymalloc=n. |
65 |
*** |
66 |
|
67 |
EOF |
68 |
} |
69 |
|
70 |
WriteMakefile( |
71 |
dist => { |
72 |
PREOP => 'pod2text XSThreadPool.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
73 |
COMPRESS => 'gzip -9v', |
74 |
SUFFIX => '.gz', |
75 |
}, |
76 |
NAME => "AnyEvent::XSThreadPool", |
77 |
VERSION_FROM => "XSThreadPool.pm", |
78 |
CONFIGURE_REQUIRES => { "ExtUtils::MakeMaker" => 6.52, "Canary::Stability" => 0 }, |
79 |
INC => $INC, |
80 |
LIBS => $LIBS, |
81 |
); |
82 |
|