5 use ExtUtils::MakeMaker;
9 if ($Config{d_cplusplus}) {
10 print STDERR <<'FAILPLUSPLUS';
11 Configuration aborted: C++ compilers are not supported
13 Your perl has been built with a C++ compiler, which is then handed to
14 XS extensions as if it were a proper C compiler. This extension is
15 written in C, and naturally only supports C compilers, so it cannot be
18 Note that building perl with a C++ compiler is only supposed to be done
19 by core developers in order to check that the perl headers can be
20 included from C++ code. Its use in the wild is not supported by the
21 perl5 porters. If your vendor has built its perl binary with a C++
22 compiler, please consider reporting this issue to them.
24 This text will be displayed 10 seconds, and then the configuration
31 my $pl = $Config{perl_patchlevel};
32 my $desc = $Config{git_describe};
34 $_ = undef unless defined and length;
40 print "Checking if this is an official release of perl... ";
41 my $is_release = ("$]" < 5.011) ? (defined($pl) || defined($desc) ? 0 : 1)
42 : (defined($desc) ? 0 : 1);
43 push @DEFINES, "-DSU_RELEASE=$is_release";
44 print $is_release ? "yes\n" : "no\n";
47 print "Checking if this is gcc 3.4 on Windows trying to link against an import library... ";
48 if ($^O eq 'MSWin32' and not grep /^LD[A-Z]*=/, @ARGV) {
49 my ($libperl, $gccversion) = map $_ || '', @Config{qw<libperl gccversion>};
50 if ($gccversion =~ /^3\.4\.[0-9]+/ and $libperl =~ s/\.lib$//) {
52 my ($lddlflags, $ldflags) = @Config{qw<lddlflags ldflags>};
53 $_ ||= '', s/-L(?:".*?"|\S+)//g for $lddlflags, $ldflags;
54 $libperl = "-l$libperl";
55 my $libdirs = join ' ',
56 map { s/(?<!\\)((?:\\\\)*")/\\$1/g; qq[-L"$_"] }
57 @Config{qw<bin sitebin>};
58 $macro{LDDLFLAGS} = "$lddlflags $libdirs $libperl";
59 $macro{LDFLAGS} = "$ldflags $libdirs $libperl";
64 my $inherited = $self->SUPER::dynamic_lib(@_);
65 $inherited =~ s/"?\$\(PERL_ARCHIVE\)"?//g;
72 print $is_gcc_34 ? "yes\n" : "no\n";
74 # Threads, Windows and 5.8.x don't seem to be best friends
75 if ($^O eq 'MSWin32' && "$]" < 5.009) {
76 push @DEFINES, '-DXSH_MULTIPLICITY=0';
79 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
80 %macro = (macro => { %macro }) if %macro; # Beware of the cycle
82 my $dist = 'Scope-Upper';
84 (my $name = $dist) =~ s{-}{::}g;
86 (my $file = $dist) =~ s{-}{/}g;
87 $file = "lib/$file.pm";
89 my $bug_web = "http://rt.cpan.org/Dist/Display.html?Name=$dist",
90 my $bug_mailto = 'bug-' . lc($dist) . '@rt.cpan.org';
92 my $repo_host = 'git.vpit.fr';
93 my @repo_path = ('perl', 'modules', "$dist.git");
94 my $repo_url = join '/', 'http:', '', $repo_host, @repo_path, '';
95 my $repo_web = "http://$repo_host/?p=" . join('%2F', @repo_path);
103 my %BUILD_REQUIRES = (
104 'ExtUtils::MakeMaker' => 0,
114 url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec',
116 configure_requires => {
118 'ExtUtils::MakeMaker' => 0,
127 mailto => $bug_mailto,
129 homepage => "http://search.cpan.org/dist/$dist/",
130 license => 'http://dev.perl.org/licenses/',
141 AUTHOR => 'Vincent Pit <vpit@cpan.org>',
143 VERSION_FROM => $file,
144 ABSTRACT_FROM => $file,
147 BUILD_REQUIRES => \%BUILD_REQUIRES,
148 PREREQ_PM => \%PREREQ_PM,
149 MIN_PERL_VERSION => '5.006001',
150 META_MERGE => \%META,
152 PREOP => "pod2text -u $file > \$(DISTVNAME)/README",
153 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
156 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*"
164 return <<'POSTAMBLE';
166 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)