5 use ExtUtils::MakeMaker;
14 defined &ActivePerl::BUILD ? ActivePerl::BUILD() : undef
18 print "Checking if this is ActiveState Perl 5.8.8 build 822 or higher... ";
19 if ("$]" == 5.008_008 and defined $as_perl and $as_perl >= 822) {
21 push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=1';
23 print $is_as_822 ? "yes\n" : "no\n";
26 print "Checking if this is gcc 3.4 on Windows trying to link against an import library... ";
27 if ($^O eq 'MSWin32' and not grep /^LD[A-Z]*=/, @ARGV) {
28 my ($libperl, $gccversion) = map $_ || '', @Config{qw<libperl gccversion>};
29 if ($gccversion =~ /^3\.4\.[0-9]+/ and $libperl =~ s/\.lib$//) {
31 my ($lddlflags, $ldflags) = @Config{qw<lddlflags ldflags>};
32 $_ ||= '', s/-L(?:".*?"|\S+)//g for $lddlflags, $ldflags;
33 $libperl = "-l$libperl";
34 my $libdirs = join ' ',
35 map { s/(?<!\\)((?:\\\\)*")/\\$1/g; qq[-L"$_"] }
36 @Config{qw<bin sitebin>};
37 $macro{LDDLFLAGS} = "$lddlflags $libdirs $libperl";
38 $macro{LDFLAGS} = "$ldflags $libdirs $libperl";
39 $macro{PERL_ARCHIVE} = '',
42 print $is_gcc_34 ? "yes\n" : "no\n";
44 # Threads, Windows and 5.8.x don't seem to be best friends
45 if ($^O eq 'MSWin32' && "$]" < 5.009) {
46 push @DEFINES, '-DVMG_MULTIPLICITY=0';
47 print "Thread safety disabled for perl 5.8.x on Windows.\n"
50 # Fork emulation got "fixed" in 5.10.1
51 if ($^O eq 'MSWin32' && "$]" < 5.010_001) {
52 push @DEFINES, '-DVMG_FORKSAFE=0';
53 print "Fork safety not ensured for perl 5.8.x and 5.10.0 on Windows.\n";
56 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
57 %macro = (macro => { %macro }) if %macro; # Beware of the circle
59 my $dist = 'Variable-Magic';
61 (my $name = $dist) =~ s{-}{::}g;
63 (my $file = $dist) =~ s{-}{/}g;
64 $file = "lib/$file.pm";
73 my %BUILD_REQUIRES = (
76 'ExtUtils::MakeMaker' => 0,
83 configure_requires => {
85 'ExtUtils::MakeMaker' => 0,
92 bugtracker => "http://rt.cpan.org/Dist/Display.html?Name=$dist",
93 homepage => "http://search.cpan.org/dist/$dist/",
94 license => 'http://dev.perl.org/licenses/',
95 repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
101 AUTHOR => 'Vincent Pit <perl@profvince.com>',
103 VERSION_FROM => $file,
104 ABSTRACT_FROM => $file,
107 BUILD_REQUIRES => \%BUILD_REQUIRES,
108 PREREQ_PM => \%PREREQ_PM,
109 MIN_PERL_VERSION => '5.008',
110 META_MERGE => \%META,
112 PREOP => "pod2text -u $file > \$(DISTVNAME)/README",
113 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
116 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*"