5 use ExtUtils::MakeMaker;
8 eval { require Config };
9 die 'OS unsupported' if $@;
10 Config->import(qw/%Config/);
15 my $pl = $Config{perl_patchlevel};
16 print "Checking perl patchlevel... ";
17 if (defined $pl && length $pl) {
19 push @DEFINES, '-DVMG_PERL_PATCHLEVEL=' . $pl;
28 defined &ActivePerl::BUILD ? ActivePerl::BUILD() : undef
32 print "Checking if this is ActiveState Perl 5.8.8 build 822 or higher... ";
33 if ($^V eq v5.8.8 and defined $as_perl and $as_perl >= 822) {
35 push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=1';
37 print $is_as_822 ? "yes\n" : "no\n";
40 print "Checking if this is a released perl 5.11.0 or higher... ";
41 if ($^V ge v5.11.0 and not defined $pl) {
42 my $describe = $Config{git_describe};
43 # An empty 'describe' is fine
44 if (defined $describe and $describe !~ /^GitLive-/) {
46 push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=0';
49 print $is_5110rel ? "yes\n" : "no\n";
51 # Threads, Windows and 5.8.x don't seem to be best friends
52 if ($^O eq 'MSWin32' && $^V lt v5.9.0) {
53 push @DEFINES, '-DVMG_MULTIPLICITY=0';
54 print "Thread safety disabled for perl 5.8.x on Windows.\n"
57 # Fork emulation got "fixed" in 5.10.1
58 if ($^O eq 'MSWin32' && $^V lt v5.10.1) {
59 push @DEFINES, '-DVMG_FORKSAFE=0';
60 print "Fork safety not ensured for perl 5.8.x and 5.10.0 on Windows.\n";
63 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
65 my $dist = 'Variable-Magic';
67 (my $name = $dist) =~ s{-}{::}g;
69 (my $file = $dist) =~ s{-}{/}g;
70 $file = "lib/$file.pm";
80 configure_requires => {
82 'ExtUtils::MakeMaker' => 0,
87 'ExtUtils::MakeMaker' => 0,
93 bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
94 homepage => "http://search.cpan.org/dist/$dist/",
95 license => 'http://dev.perl.org/licenses/',
96 repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
102 AUTHOR => 'Vincent Pit <perl@profvince.com>',
104 VERSION_FROM => $file,
105 ABSTRACT_FROM => $file,
108 PREREQ_PM => \%PREREQ_PM,
109 MIN_PERL_VERSION => 5.008,
110 META_MERGE => \%META,
112 PREOP => "pod2text $file > \$(DISTVNAME)/README",
113 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
116 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt"