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";
38 $macro{PERL_ARCHIVE} = '',
41 print $is_gcc_34 ? "yes\n" : "no\n";
43 # Threads, Windows and 5.8.x don't seem to be best friends
44 if ($^O eq 'MSWin32' && "$]" < 5.009) {
45 push @DEFINES, '-DSU_MULTIPLICITY=0';
48 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
49 %macro = (macro => { %macro }) if %macro; # Beware of the cycle
51 my $dist = 'Scope-Upper';
53 (my $name = $dist) =~ s{-}{::}g;
55 (my $file = $dist) =~ s{-}{/}g;
56 $file = "lib/$file.pm";
64 my %BUILD_REQUIRES = (
65 'ExtUtils::MakeMaker' => 0,
72 configure_requires => {
74 'ExtUtils::MakeMaker' => 0,
81 bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
82 homepage => "http://search.cpan.org/dist/$dist/",
83 license => 'http://dev.perl.org/licenses/',
84 repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
90 AUTHOR => 'Vincent Pit <perl@profvince.com>',
92 VERSION_FROM => $file,
93 ABSTRACT_FROM => $file,
96 BUILD_REQUIRES => \%BUILD_REQUIRES,
97 PREREQ_PM => \%PREREQ_PM,
98 MIN_PERL_VERSION => '5.006',
101 PREOP => "pod2text -u $file > \$(DISTVNAME)/README",
102 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
105 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*"
113 return <<'POSTAMBLE';
115 PERL_DL_NONLAZY=1 PERLDB_OPTS="NonStop=1" $(FULLPERLRUN) -MTAP::Harness -e 'TAP::Harness->new({verbosity => q{$(VERBOSE)}, lib => [ q{$(INST_LIB)}, q{$(INST_ARCHLIB)} ], switches => [ q{-d} ]})->runtests(@ARGV)' $(TEST_FILES)