summaryrefslogtreecommitdiff
path: root/make_ext.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2014-02-27 12:52:32 +0100
committerNicholas Clark <nick@ccl4.org>2014-03-02 07:08:54 +0100
commit21fb4fa0a1c395401226f0dd3ec0b8f85eff4d2f (patch)
treec1349fd53f9b931c94842cbdb9dffd1b25381838 /make_ext.pl
parent2ce0aa69a204fa44a8c3946e66edc43902f6b657 (diff)
downloadperl-21fb4fa0a1c395401226f0dd3ec0b8f85eff4d2f.tar.gz
make_ext.pl can handle 4 extensions in dist/ which need a Makefile.PL for CPAN.
Diffstat (limited to 'make_ext.pl')
-rw-r--r--make_ext.pl44
1 files changed, 44 insertions, 0 deletions
diff --git a/make_ext.pl b/make_ext.pl
index 0c5d739fc8..00e2a9f953 100644
--- a/make_ext.pl
+++ b/make_ext.pl
@@ -446,7 +446,51 @@ EOM
my $ftime = time - 4;
utime $ftime, $ftime, 'Makefile.PL';
};
+ } elsif ($mname =~ /\A(?:Carp
+ |ExtUtils::CBuilder
+ |Safe
+ |Search::Dict)\z/x) {
+ # An explicit list of dual-life extensions that have a Makefile.PL
+ # for CPAN, but we have verified can also be built using the fakery.
+ my ($problem) = just_pm_to_blib($target, $ext_dir, $mname);
+ # We really need to sanity test that we can fake it.
+ # Otherwise "skips" will go undetected, and the build slow down for
+ # everyone, defeating the purpose.
+ if (defined $problem) {
+ if (-d "$return_dir/.git") {
+ # Get the list of files that git isn't ignoring:
+ my @files = `git ls-files --cached --others --exclude-standard 2>/dev/null`;
+ # on error (eg no git) we get nothing, but that's not a
+ # problem. The goal is to see if git thinks that the problem
+ # file is interesting, by getting a positive match with
+ # something git told us about, and if so bail out:
+ foreach (@files) {
+ chomp;
+ # We really need to sanity test that we can fake it.
+ # The intent is that this should only fail because
+ # you've just added a file to the dual-life dist that
+ # we can't handle. In which case you should either
+ # 1) remove the dist from the regex a few lines above.
+ # or
+ # 2) add the file to regex of "safe" filenames earlier
+ # in this function, that starts with ChangeLog
+ die "FATAL - $0 has $mname in the list of simple extensions, but it now contains file '$problem' which we can't handle"
+ if $problem eq $_;
+ }
+ # There's an unexpected file, but it seems to be something
+ # that git will ignore. So fall through to the regular
+ # Makefile.PL handling code below, on the assumption that
+ # we won't get here for a clean build.
+ }
+ warn "WARNING - $0 is building $mname using EU::MM, as it found file '$problem'";
+ } else {
+ # It faked everything for us.
+ chdir $return_dir || die "Cannot cd to $return_dir: $!";
+ return;
+ }
}
+
+ # We are going to have to use Makefile.PL:
print "\nRunning Makefile.PL in $ext_dir\n";
my @args = ("-I$lib_dir", 'Makefile.PL');