]> git.vpit.fr Git - perl/modules/indirect.git/blob - Makefile.PL
Don't cleanup thread local storage before END blocks are executed
[perl/modules/indirect.git] / Makefile.PL
1 use 5.008_001;
2
3 use strict;
4 use warnings;
5 use ExtUtils::MakeMaker;
6
7 use Config;
8
9 my @DEFINES;
10 my %macro;
11
12 my $is_gcc_34 = 0;
13 print "Checking if this is gcc 3.4 on Windows trying to link against an import library... ";
14 if ($^O eq 'MSWin32' and not grep /^LD[A-Z]*=/, @ARGV) {
15  my ($libperl, $gccversion) = map $_ || '', @Config{qw<libperl gccversion>};
16  if ($gccversion =~ /^3\.4\.[0-9]+/ and $libperl =~ s/\.lib$//) {
17   $is_gcc_34 = 1;
18   my ($lddlflags, $ldflags) = @Config{qw<lddlflags ldflags>};
19   $_ ||= '', s/-L(?:".*?"|\S+)//g for $lddlflags, $ldflags;
20   $libperl = "-l$libperl";
21   my $libdirs = join ' ',
22                  map { s/(?<!\\)((?:\\\\)*")/\\$1/g; qq[-L"$_"] }
23                   @Config{qw<bin sitebin>};
24   $macro{LDDLFLAGS}    = "$lddlflags $libdirs $libperl";
25   $macro{LDFLAGS}      = "$ldflags $libdirs $libperl";
26   $macro{PERL_ARCHIVE} = '',
27  }
28 }
29 print $is_gcc_34 ? "yes\n" : "no\n";
30
31 # Threads, Windows and 5.8.x don't seem to be best friends
32 if ($^O eq 'MSWin32' and "$]" < 5.009) {
33  push @DEFINES, '-DI_MULTIPLICITY=0';
34 }
35
36 # Fork emulation got "fixed" in 5.10.1
37 if ($^O eq 'MSWin32' and "$]" < 5.010_001) {
38  push @DEFINES, '-DI_FORKSAFE=0';
39 }
40
41 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
42 %macro   = (macro  => { %macro })         if %macro; # Beware of the circle
43
44 my $dist = 'indirect';
45
46 (my $name = $dist) =~ s{-}{::}g;
47
48 (my $file = $dist) =~ s{-}{/}g;
49 $file = "lib/$file.pm";
50
51 my %PREREQ_PM = (
52  'Carp'     => 0,
53  'XSLoader' => 0,
54 );
55
56 my %BUILD_REQUIRES =(
57  'Config'              => 0,
58  'ExtUtils::MakeMaker' => 0,
59  'Test::More'          => 0,
60  %PREREQ_PM,
61 );
62
63 my %META = (
64  configure_requires => {
65   'Config'              => 0,
66   'ExtUtils::MakeMaker' => 0,
67  },
68  build_requires => {
69   %BUILD_REQUIRES,
70  },
71  dynamic_config => 1,
72  resources => {
73   bugtracker => "http://rt.cpan.org/Dist/Display.html?Name=$dist",
74   homepage   => "http://search.cpan.org/dist/$dist/",
75   license    => 'http://dev.perl.org/licenses/',
76   repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
77  },
78 );
79
80 WriteMakefile(
81  NAME             => $name,
82  AUTHOR           => 'Vincent Pit <perl@profvince.com>',
83  LICENSE          => 'perl',
84  VERSION_FROM     => $file,
85  ABSTRACT_FROM    => $file,
86  PL_FILES         => {},
87  @DEFINES,
88  BUILD_REQUIRES   => \%BUILD_REQUIRES,
89  PREREQ_PM        => \%PREREQ_PM,
90  MIN_PERL_VERSION => '5.008001',
91  META_MERGE       => \%META,
92  dist             => {
93   PREOP    => "pod2text -u $file > \$(DISTVNAME)/README",
94   COMPRESS => 'gzip -9f', SUFFIX => 'gz'
95  },
96  clean            => {
97   FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*"
98  },
99  %macro,
100 );