Add a --make option to bisect.pl, to specify an alternate make command.
authorNicholas Clark <nick@ccl4.org>
Wed, 23 Nov 2011 14:15:15 +0000 (15:15 +0100)
committerNicholas Clark <nick@ccl4.org>
Wed, 23 Nov 2011 14:15:15 +0000 (15:15 +0100)
For example, one can utilise this to use gmake instead of the system make.

Porting/bisect-runner.pl

index 81dff82..41e15cc 100755 (executable)
@@ -59,7 +59,7 @@ my %defines =
     );
 
 unless(GetOptions(\%options,
-                  'target=s', 'jobs|j=i', 'expect-pass=i',
+                  'target=s', 'make=s', 'jobs|j=i', 'expect-pass=i',
                   'expect-fail' => sub { $options{'expect-pass'} = 0; },
                   'clean!', 'one-liner|e=s', 'match=s', 'force-manifest',
                   'force-regen', 'test-build', 'A=s@', 'l', 'w',
@@ -320,6 +320,15 @@ often very useful to be able to disable some XS extensions.
 
 =item *
 
+--make I<make-prog>
+
+The C<make> command to use. If this not set, F<make> is used. If this is
+set, it also adds a C<-Dmake=...> else some recursive make invocations
+in extensions may fail. Typically one would use this as C<--make gmake>
+to use F<gmake> in place of the system F<make>.
+
+=item *
+
 --jobs I<jobs>
 
 =item *
@@ -465,6 +474,14 @@ die "$0: Can't build $target" if defined $target && !grep {@targets} $target;
 
 $j = "-j$j" if $j =~ /\A\d+\z/;
 
+if (exists $options{make}) {
+    if (!exists $defines{make}) {
+        $defines{make} = $options{make};
+    }
+} else {
+    $options{make} = 'make';
+}
+
 # Sadly, however hard we try, I don't think that it will be possible to build
 # modules in ext/ on x86_64 Linux before commit e1666bf5602ae794 on 1999/12/29,
 # which updated to MakeMaker 3.7, which changed from using a hard coded ld
@@ -764,7 +781,7 @@ patch_C();
 patch_ext();
 
 # Parallel build for miniperl is safe
-system "make $j miniperl </dev/null";
+system "$options{make} $j miniperl </dev/null";
 
 my $expected = $target =~ /^test/ ? 't/perl'
     : $target eq 'Fcntl' ? "lib/auto/Fcntl/Fcntl.$Config{so}"
@@ -786,7 +803,7 @@ if ($target ne 'miniperl') {
         }
     }
 
-    system "make $j $real_target </dev/null";
+    system "$options{make} $j $real_target </dev/null";
 }
 
 my $missing_target = $expected =~ /perl$/ ? !-x $expected : !-r $expected;