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";
95 my %BUILD_REQUIRES = (
96 'ExtUtils::MakeMaker' => 0,
104 configure_requires => {
106 'ExtUtils::MakeMaker' => 0,
113 bugtracker => "http://rt.cpan.org/Dist/Display.html?Name=$dist",
114 homepage => "http://search.cpan.org/dist/$dist/",
115 license => 'http://dev.perl.org/licenses/',
116 repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
122 AUTHOR => 'Vincent Pit <perl@profvince.com>',
124 VERSION_FROM => $file,
125 ABSTRACT_FROM => $file,
128 BUILD_REQUIRES => \%BUILD_REQUIRES,
129 PREREQ_PM => \%PREREQ_PM,
130 MIN_PERL_VERSION => '5.006001',
131 META_MERGE => \%META,
133 PREOP => "pod2text -u $file > \$(DISTVNAME)/README",
134 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
137 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*"
145 return <<'POSTAMBLE';
147 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)