1 | use ExtUtils::MakeMaker; |
1 | use ExtUtils::MakeMaker; |
2 | |
2 | |
3 | use Config; |
3 | use Config; |
4 | |
4 | |
5 | require "autoconf.pm"; |
5 | if ($^O =~ /win32/i or $^O =~ /mswin/) { |
6 | |
6 | |
|
|
7 | # configuration on windows is hardcoded - as always |
|
|
8 | |
|
|
9 | warn "your platform is not standards-compliant, you have to port this module first\n"; |
|
|
10 | warn "using some hardcoded config that will not work on your system\n"; |
|
|
11 | |
|
|
12 | $INC = "-I/Perl/lib/CORE -I/sdk/include -I/vc98/include -I/gtk/include -I/gtk/include/pango-1.0 -I/gtk/include/glib-2.0 -I/gtk/lib/glib-2.0/include/ -I/gtk/include/freetype2"; |
|
|
13 | $LIBS = ["-L/gtk/lib -lpthreadVC2"]; |
|
|
14 | |
|
|
15 | } else { |
|
|
16 | |
|
|
17 | $INC = ""; |
|
|
18 | $LIBS = ['-lpthread -lrt', '-lpthread', '-lpthreads', '-lpthreadVC2', '']; |
|
|
19 | |
7 | if ($^O =~ /freebsd/i) { |
20 | if ($^O =~ /freebsd/i) { |
|
|
21 | print <<EOF; |
|
|
22 | |
|
|
23 | This package seems to deadlock or otherwise misbehave under FreeBSD. As |
|
|
24 | documentation on FreeBSD threading is sorely lacking and confusing, I'll |
|
|
25 | just call FreeBSD broken with regards to threading. |
|
|
26 | |
|
|
27 | If you find out whats wrong, please tell me. |
|
|
28 | |
|
|
29 | Some people had luck with using OPTIMIZE=-O instead of -O2, so you might |
|
|
30 | want to try that. |
|
|
31 | |
|
|
32 | EOF |
|
|
33 | } |
|
|
34 | |
|
|
35 | { |
|
|
36 | local %ENV = %ENV; |
|
|
37 | |
|
|
38 | while (my ($k, $v) = each %Config) { |
|
|
39 | $ENV{$k} = $v; |
|
|
40 | } |
|
|
41 | |
|
|
42 | $ENV{MAKE} = $Config{make}; |
|
|
43 | $ENV{SHELL} = $Config{sh}; |
|
|
44 | $ENV{CC} = $Config{cc}; |
|
|
45 | $ENV{CPPFLAGS} = $Config{cppflags}; |
|
|
46 | $ENV{CFLAGS} = $Config{ccflags}; |
|
|
47 | $ENV{LDFLAGS} = $Config{ldflags}; |
|
|
48 | $ENV{LIBS} = $Config{libs}; |
|
|
49 | $ENV{LINKER} = $Config{ld}; # nonstandard |
|
|
50 | |
|
|
51 | system $ENV{SHELL}, -c => "cd libeio && ./configure --prefix \Q$Config{prefixexp}\E" |
|
|
52 | and exit $? >> 8; |
|
|
53 | } |
|
|
54 | } |
|
|
55 | |
|
|
56 | if ($^O =~ /linux/ && $Config{usemymalloc} eq "y") { |
8 | print <<EOF; |
57 | print <<EOF; |
9 | |
58 | |
10 | This package seems to deadlock under FreeBSD. As documentation on FreeBSD |
59 | *** |
11 | threading is sorely lacking and confusing, I'll just call FreeBSD broken |
60 | *** WARNING: |
12 | with regards to threading. |
61 | *** |
13 | |
62 | *** Your perl uses it's own memory allocator (-Dusemymalloc=y), |
14 | If you get it to work, tell me how (maybe you need to specify magical link |
63 | *** which is known not to be threadsafe on GNU/Linux and probably |
15 | flags despite man pthread telling me otherwise, maybe yo need special |
64 | *** other platforms (even when not used concurrently, it trashes |
16 | library, maybe you need magical preprocessor symbols, maybe you need to |
65 | *** the data structures of the system malloc running concurrently), |
17 | recompile or re-link perl with threads enabled (a bad idea) - I have no |
66 | *** for perls up to 5.8.8 and possibly later versions. |
18 | idea, and I no longer care). Or maybe I do, but am frustrated about the |
67 | *** |
19 | continous "we are different=broken" attitude. |
68 | *** If you are unsure wether your perl has been fixed, your system |
|
|
69 | *** is safe for other reasons, or you experience spurious segfaults, |
|
|
70 | *** please compile your perl with -Dusemymalloc=n. |
|
|
71 | *** |
20 | |
72 | |
21 | EOF |
73 | EOF |
22 | } |
74 | } |
23 | |
|
|
24 | autoconf::run_script() |
|
|
25 | and die "\nconfigure failed, check it's output above and autoconf/config.log\n\n"; |
|
|
26 | |
75 | |
27 | my $mm = MM->new({ |
76 | my $mm = MM->new({ |
28 | dist => { |
77 | dist => { |
29 | PREOP => 'pod2text AIO.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
78 | PREOP => 'pod2text AIO.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;', |
30 | COMPRESS => 'gzip -9v', |
79 | COMPRESS => 'gzip -9v', |
31 | SUFFIX => '.gz', |
80 | SUFFIX => '.gz', |
32 | }, |
81 | }, |
|
|
82 | depend => { |
|
|
83 | "AIO.c" => "libeio/eio.h libeio/eio.c libeio/config.h", |
|
|
84 | }, |
33 | NAME => "IO::AIO", |
85 | NAME => "IO::AIO", |
34 | VERSION_FROM => "AIO.pm", |
86 | VERSION_FROM => "AIO.pm", |
35 | LIBS => ['-lpthread -lrt', '-lpthread', '-lpthreads', ''], |
87 | INC => $INC, |
|
|
88 | LIBS => $LIBS, |
|
|
89 | PM => { |
|
|
90 | 'AIO.pm' => '$(INST_LIBDIR)/AIO.pm', |
|
|
91 | }, |
36 | clean => { FILES => "autoconf/config.h autoconf/config.log autoconf/config.status" }, |
92 | clean => { FILES => "libeio/config.h libeio/config.log libeio/config.status" }, |
37 | }); |
93 | }); |
38 | |
94 | |
39 | $mm->flush; |
95 | $mm->flush; |
40 | |
96 | |