bisect-runner.pl now builds back to 5.005 on the default OS X filesystem.
authorNicholas Clark <nick@ccl4.org>
Fri, 25 Nov 2011 15:32:26 +0000 (16:32 +0100)
committerNicholas Clark <nick@ccl4.org>
Fri, 25 Nov 2011 16:29:40 +0000 (17:29 +0100)
OS X defaults to case-insensitive HFS+. perl-5.8.0 and later have hints
files to avoid a clash between Makefile and makefile, and hence can build
without problems. Teaching bisect-runner.pl to replicate this hints tweak
allows it to build perl-5.6.0 and perl-5.005 on a default HFS+.
However, only do this for a case insensitive filesystem, else it breaks
the build for 5.003 and earlier (which hardcode 'makefile' in places).

perl-5.004 and earlier won't work on a default HFS+ without a *lot* of
bodgery, as the distribution from that era has two files, Configure and
configure, which trample over each other and confuse git. There are case
clashes in later revisions, which may create unexpected failures for
some actions (versus the same action on a case sensitive file system) but
they don't appear to affect building any 5.*.0 revisions.

bisect-runner.pl can build back to 5.002 on OS X on a case sensitive HFS+
file system.

Porting/bisect-runner.pl

index 1f38589..fa88c6e 100755 (executable)
@@ -812,6 +812,15 @@ if (!defined $target) {
 skip('no Configure - is this the //depot/perlext/Compiler branch?')
     unless -f 'Configure';
 
+my $case_insensitive;
+{
+    my ($dev_C, $ino_C) = stat 'Configure';
+    die "Could not stat Configure: $!" unless defined $dev_C;
+    my ($dev_c, $ino_c) = stat 'configure';
+    ++$case_insensitive
+        if defined $dev_c && $dev_C == $dev_c && $ino_C == $ino_c;
+}
+
 # This changes to PERL_VERSION in 4d8076ea25903dcb in 1999
 my $major
     = extract_from_file('patchlevel.h',
@@ -1580,6 +1589,15 @@ sub patch_hints {
                       # to 5.002, lets just turn it off.
                       $code =~ s/^useshrplib='true'/useshrplib='false'/m
                           if $faking_it;
+
+                      # Part of commit d235852b65d51c44
+                      # Don't do this on a case sensitive HFS+ partition, as it
+                      # breaks the build for 5.003 and earlier.
+                      if ($case_insensitive
+                          && $code !~ /^firstmakefile=GNUmakefile/) {
+                          $code .= "\nfirstmakefile=GNUmakefile;\n";
+                      }
+
                       return $code;
                   });
         }