5 use ExtUtils::MakeMaker;
9 my $pl = $Config{perl_patchlevel};
10 my $desc = $Config{git_describe};
12 $_ = undef unless defined and length;
18 print "Checking if this is an official release of perl... ";
19 my $is_release = ("$]" < 5.011) ? (defined($pl) || defined($desc) ? 0 : 1)
20 : (defined($desc) ? 0 : 1);
21 push @DEFINES, "-DSU_RELEASE=$is_release";
22 print $is_release ? "yes\n" : "no\n";
25 print "Checking if this is gcc 3.4 on Windows trying to link against an import library... ";
26 if ($^O eq 'MSWin32' and not grep /^LD[A-Z]*=/, @ARGV) {
27 my ($libperl, $gccversion) = map $_ || '', @Config{qw<libperl gccversion>};
28 if ($gccversion =~ /^3\.4\.[0-9]+/ and $libperl =~ s/\.lib$//) {
30 my ($lddlflags, $ldflags) = @Config{qw<lddlflags ldflags>};
31 $_ ||= '', s/-L(?:".*?"|\S+)//g for $lddlflags, $ldflags;
32 $libperl = "-l$libperl";
33 my $libdirs = join ' ',
34 map { s/(?<!\\)((?:\\\\)*")/\\$1/g; qq[-L"$_"] }
35 @Config{qw<bin sitebin>};
36 $macro{LDDLFLAGS} = "$lddlflags $libdirs $libperl";
37 $macro{LDFLAGS} = "$ldflags $libdirs $libperl";
42 my $inherited = $self->SUPER::dynamic_lib(@_);
43 $inherited =~ s/"?\$\(PERL_ARCHIVE\)"?//g;
50 print $is_gcc_34 ? "yes\n" : "no\n";
52 # Threads, Windows and 5.8.x don't seem to be best friends
53 if ($^O eq 'MSWin32' && "$]" < 5.009) {
54 push @DEFINES, '-DSU_MULTIPLICITY=0';
57 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
58 %macro = (macro => { %macro }) if %macro; # Beware of the cycle
60 my $dist = 'Scope-Upper';
62 (my $name = $dist) =~ s{-}{::}g;
64 (my $file = $dist) =~ s{-}{/}g;
65 $file = "lib/$file.pm";
73 my %BUILD_REQUIRES = (
74 'ExtUtils::MakeMaker' => 0,
82 configure_requires => {
84 'ExtUtils::MakeMaker' => 0,
91 bugtracker => "http://rt.cpan.org/Dist/Display.html?Name=$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 BUILD_REQUIRES => \%BUILD_REQUIRES,
107 PREREQ_PM => \%PREREQ_PM,
108 MIN_PERL_VERSION => '5.006001',
109 META_MERGE => \%META,
111 PREOP => "pod2text -u $file > \$(DISTVNAME)/README",
112 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
115 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*"
123 return <<'POSTAMBLE';
125 PERL_DL_NONLAZY=1 PERLDB_OPTS="NonStop=1" $(FULLPERLRUN) -MTAP::Harness -e 'TAP::Harness->new({verbosity => q{$(TEST_VERBOSE)}, lib => [ q{$(INST_LIB)}, q{$(INST_ARCHLIB)} ], switches => [ q{-d} ]})->runtests(@ARGV)' $(TEST_FILES)