Skip to content

Commit 870187d

Browse files
committed
fix distmeta etc with BSD make -j
1 parent 9cac04f commit 870187d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

.github/workflows/smoke-freebsd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
sysctl hw.physmem
3636
sysctl hw.usermem
3737
CPU=$(sysctl -n hw.ncpu)
38-
export HARNESS_OPTIONS=j$CPU
38+
export HARNESS_OPTIONS=j$CPU MAKEFLAGS=-j$CPU
3939
perl -V
4040
perl Makefile.PL
4141
make test

lib/ExtUtils/MM_Any.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ sub is_make_type {
225225
if $type eq 'gmake' and $minus_v =~ /GNU make/i;
226226
return $maketype2true{$type} = 1
227227
if $type eq 'bsdmake'
228-
and $minus_v =~ /^usage: make \[-BeikNnqrstWwX\]/im;
228+
and $minus_v =~ /^usage:.*make\s*\[-B/im;
229229
$maketype2true{$type} = 0; # it wasn't whatever you asked
230230
}
231231

lib/ExtUtils/MM_Unix.pm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3471,14 +3471,16 @@ sub replace_manpage_separator {
34713471

34723472
=item cd
34733473
3474+
On BSD make, will add a countervailing C<cd ..> on each command since
3475+
parallel builds run all the commands in a recipe in the same shell.
3476+
34743477
=cut
34753478

34763479
sub cd {
34773480
my($self, $dir, @cmds) = @_;
3478-
3481+
@cmds = map "$_ && cd $Updir", @cmds if $self->is_make_type('bsdmake');
34793482
# No leading tab and no trailing newline makes for easier embedding
3480-
my $make_frag = join "\n\t", map { "cd $dir && $_" } @cmds;
3481-
3483+
my $make_frag = join "\n\t", map "cd $dir && $_", @cmds;
34823484
return $make_frag;
34833485
}
34843486

0 commit comments

Comments
 (0)