5 use ExtUtils::MakeMaker;
8 eval { require Config };
9 die 'OS unsupported' if $@;
10 Config->import(qw/%Config/);
18 defined &ActivePerl::BUILD ? ActivePerl::BUILD() : undef
22 print "Checking if this is ActiveState Perl 5.8.8 build 822 or higher... ";
23 if ($^V eq v5.8.8 and defined $as_perl and $as_perl >= 822) {
25 push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=1';
27 print $is_as_822 ? "yes\n" : "no\n";
30 print "Checking if this is gcc 3.4 on Windows trying to link against an import library... ";
31 if ($^O eq 'MSWin32' and not grep /^LD[A-Z]*=/, @ARGV) {
32 my ($libperl, $gccversion) = map $_ || '', @Config{qw/libperl gccversion/};
33 if ($gccversion =~ /^3\.4\.[0-9]+/ and $libperl =~ s/\.lib$//) {
35 my ($lddlflags, $ldflags) = @Config{qw/lddlflags ldflags/};
36 $_ ||= '', s/-L(?:".*?"|\S+)//g for $lddlflags, $ldflags;
37 $libperl = "-l$libperl";
38 my $libdirs = join ' ',
39 map { s/(?<!\\)((?:\\\\)*")/\\$1/g; qq[-L"$_"] }
40 @Config{qw/bin sitebin/};
41 $macro{LDDLFLAGS} = "$lddlflags $libdirs $libperl";
42 $macro{LDFLAGS} = "$ldflags $libdirs $libperl";
43 $macro{PERL_ARCHIVE} = '',
46 print $is_gcc_34 ? "yes\n" : "no\n";
48 # Threads, Windows and 5.8.x don't seem to be best friends
49 if ($^O eq 'MSWin32' && $^V lt v5.9.0) {
50 push @DEFINES, '-DVMG_MULTIPLICITY=0';
51 print "Thread safety disabled for perl 5.8.x on Windows.\n"
54 # Fork emulation got "fixed" in 5.10.1
55 if ($^O eq 'MSWin32' && $^V lt v5.10.1) {
56 push @DEFINES, '-DVMG_FORKSAFE=0';
57 print "Fork safety not ensured for perl 5.8.x and 5.10.0 on Windows.\n";
60 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
61 %macro = (macro => { %macro }) if %macro; # Beware of the circle
63 my $dist = 'Variable-Magic';
65 (my $name = $dist) =~ s{-}{::}g;
67 (my $file = $dist) =~ s{-}{/}g;
68 $file = "lib/$file.pm";
78 configure_requires => {
80 'ExtUtils::MakeMaker' => 0,
85 'ExtUtils::MakeMaker' => 0,
91 bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
92 homepage => "http://search.cpan.org/dist/$dist/",
93 license => 'http://dev.perl.org/licenses/',
94 repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
100 AUTHOR => 'Vincent Pit <perl@profvince.com>',
102 VERSION_FROM => $file,
103 ABSTRACT_FROM => $file,
106 PREREQ_PM => \%PREREQ_PM,
107 MIN_PERL_VERSION => 5.008,
108 META_MERGE => \%META,
110 PREOP => "pod2text $file > \$(DISTVNAME)/README",
111 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
114 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt"