]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blob - Makefile.PL
Introduce VMG_COMPAT_ARRAY_PUSH_NOLEN_VOID and fix 5.11.0 compatibility
[perl/modules/Variable-Magic.git] / Makefile.PL
1 use 5.008;
2
3 use strict;
4 use warnings;
5 use ExtUtils::MakeMaker;
6
7 BEGIN {
8  eval { require Config };
9  die 'OS unsupported' if $@;
10  Config->import(qw/%Config/);
11 }
12
13 my @DEFINES;
14
15 my $pl = $Config{perl_patchlevel};
16 print "Checking perl patchlevel... ";
17 if (defined $pl && length $pl) {
18  $pl = int $pl;
19  push @DEFINES, '-DVMG_PERL_PATCHLEVEL=' . $pl;
20  print $pl, "\n";
21 } else {
22  $pl = undef;
23  print "none\n";
24 }
25
26 my $is_as = 0;
27 print "Checking if this is ActiveState Perl 5.8.8 build 822 or higher... ";
28 if ($^V eq v5.8.8) {
29  eval {
30   require ActivePerl;
31   1;
32  } and do {
33   if (defined &ActivePerl::BUILD) {
34    my $build = int ActivePerl::BUILD();
35    if ($build >= 822) {
36     $is_as = 1;
37     push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=1';
38    }
39   }
40  }
41 }
42 print $is_as ? "yes\n" : "no\n";
43
44 my $is_5110rel = 0;
45 print "Checking if this is a released perl 5.11.0... ";
46 if ($^V eq v5.11.0 and not defined $pl) {
47  my $describe = $Config{git_describe};
48  if (defined $describe and $describe !~ /^GitLive-/) {
49   $is_5110rel = 1;
50   push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=0';
51  }
52 }
53 print $is_5110rel ? "yes\n" : "no\n";
54
55 # Threads, Windows and 5.8.x don't seem to be best friends
56 if ($^O eq 'MSWin32' && $^V lt v5.9.0) {
57  push @DEFINES, '-DVMG_MULTIPLICITY=0';
58 }
59
60 # Fork emulation got "fixed" in 5.10.1
61 if ($^O eq 'MSWin32' && $^V lt v5.10.1) {
62  push @DEFINES, '-DVMG_FORKSAFE=0';
63 }
64
65 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
66
67 my $dist = 'Variable-Magic';
68
69 (my $name = $dist) =~ s{-}{::}g;
70
71 (my $file = $dist) =~ s{-}{/}g;
72 $file = "lib/$file.pm";
73
74 my %PREREQ_PM = (
75  'Carp'     => 0,
76  'Exporter' => 0,
77  'XSLoader' => 0,
78  'base'     => 0,
79 );
80
81 my %META = (
82  configure_requires => {
83   'Config'              => 0,
84   'ExtUtils::MakeMaker' => 0,
85  },
86  build_requires => {
87   'Carp'                => 0,
88   'Config'              => 0,
89   'ExtUtils::MakeMaker' => 0,
90   'Test::More'          => 0,
91   %PREREQ_PM,
92  },
93  dynamic_config => 1,
94  resources => {
95   bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
96   homepage   => "http://search.cpan.org/dist/$dist/",
97   license    => 'http://dev.perl.org/licenses/',
98   repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
99  },
100 );
101
102 WriteMakefile(
103  NAME             => $name,
104  AUTHOR           => 'Vincent Pit <perl@profvince.com>',
105  LICENSE          => 'perl',
106  VERSION_FROM     => $file,
107  ABSTRACT_FROM    => $file,
108  PL_FILES         => {},
109  @DEFINES,
110  PREREQ_PM        => \%PREREQ_PM,
111  MIN_PERL_VERSION => 5.008,
112  META_MERGE       => \%META,
113  dist             => {
114   PREOP    => "pod2text $file > \$(DISTVNAME)/README",
115   COMPRESS => 'gzip -9f', SUFFIX => 'gz'
116  },
117  clean            => {
118   FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt"
119  },
120 );