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";
43 my $inherited = $self->SUPER::dynamic_lib(@_);
44 $inherited =~ s/"?\$\(PERL_ARCHIVE\)"?//g;
51 print $is_gcc_34 ? "yes\n" : "no\n";
53 # Threads, Windows and 5.8.x don't seem to be best friends
54 if ($^O eq 'MSWin32' && "$]" < 5.009) {
55 push @DEFINES, '-DXSH_MULTIPLICITY=0';
56 print "Thread safety disabled for perl 5.8.x on Windows.\n"
59 # Fork emulation got "fixed" in 5.10.1
60 if ($^O eq 'MSWin32' && "$]" < 5.010_001) {
61 push @DEFINES, '-DXSH_FORKSAFE=0';
62 print "Fork safety not ensured for perl 5.8.x and 5.10.0 on Windows.\n";
65 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
66 %macro = (macro => { %macro }) if %macro; # Beware of the circle
68 my $dist = 'Variable-Magic';
70 (my $name = $dist) =~ s{-}{::}g;
72 (my $file = $dist) =~ s{-}{/}g;
73 $file = "lib/$file.pm";
75 my $bug_web = "http://rt.cpan.org/Dist/Display.html?Name=$dist",
76 my $bug_mailto = 'bug-' . lc($dist) . '@rt.cpan.org';
78 my $repo_host = 'git.vpit.fr';
79 my @repo_path = ('perl', 'modules', "$dist.git");
80 my $repo_url = join '/', 'http:', '', $repo_host, @repo_path, '';
81 my $repo_web = "http://$repo_host/?p=" . join('%2F', @repo_path);
90 my %BUILD_REQUIRES = (
93 'ExtUtils::MakeMaker' => 0,
107 url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
109 configure_requires => {
111 'ExtUtils::MakeMaker' => 0,
120 mailto => $bug_mailto,
122 homepage => "http://search.cpan.org/dist/$dist/",
123 license => 'http://dev.perl.org/licenses/',
134 AUTHOR => 'Vincent Pit <vpit@cpan.org>',
136 VERSION_FROM => $file,
137 ABSTRACT_FROM => $file,
140 BUILD_REQUIRES => \%BUILD_REQUIRES,
141 PREREQ_PM => \%PREREQ_PM,
142 MIN_PERL_VERSION => '5.008',
143 META_MERGE => \%META,
145 PREOP => "pod2text -u $file > \$(DISTVNAME)/README",
146 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
149 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*"