Commit 43b1a3dc authored by Richard Levitte's avatar Richard Levitte
Browse files

Allow parallell make in Configure



If someone tries this:

    MAKE='make -j8' ./config

then Configure ends up doing this:

    make -j8 links depend gentests

Doing those three in parallell leads to a race condition that may very well
cause issue such as tests not being run (because they all get linked to a
dummy that does nothing instead of the real test).

To mitigate this, execute the three targets in one make call each.

Reviewed-by: default avatarEmilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2332)
parent 0d37bd80
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -2041,12 +2041,13 @@ EOF
	close(OUT);
} else {
	my $make_command = "$make PERL=\'$perl\'";
	my $make_targets = "";
	$make_targets .= " links" if $symlink;
	$make_targets .= " depend" if $depflags ne $default_depflags && $make_depend;
	$make_targets .= " gentests" if $symlink;
	(system $make_command.$make_targets) == 0 or exit $?
		if $make_targets ne "";
	my @make_targets = ();
	push @make_targets, "links" if $symlink;
	push @make_targets, "depend" if $depflags ne $default_depflags && $make_depend;
	push @make_targets, "gentests" if $symlink;
	foreach my $make_target (@make_targets) {
	    (system "$make_command $make_target") == 0 or exit $?;
	}
	if ( $perl =~ m@^/@) {
	    &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";', '^my \$prefix;$', 'my $prefix = "' . $prefix . '";');
	    &dofile("apps/CA.pl",$perl,'^#!/', '#!%s');