mirror of
https://github.com/openssl/openssl.git
synced 2025-02-11 14:22:43 +08:00
util/perl/OpenSSL/config.pm, Configure: move check of target with compiler
Previously, ./config would check if "$target-$CC", then "$target" exists and choose the one that does. This is now moved to Configure. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11230)
This commit is contained in:
parent
a3310b182c
commit
081436bf73
19
Configure
19
Configure
@ -1166,7 +1166,24 @@ if ($d) {
|
||||
}
|
||||
}
|
||||
|
||||
&usage if !$table{$target} || $table{$target}->{template};
|
||||
if ($target) {
|
||||
# It's possible that we have different config targets for specific
|
||||
# toolchains, so we try to detect them, and go for the plain config
|
||||
# target if not.
|
||||
my $found;
|
||||
foreach ( ( "$target-$user{CC}", "$target", undef ) ) {
|
||||
$found=$_ if $table{$_} && !$table{$_}->{template};
|
||||
last if $found;
|
||||
}
|
||||
$target = $found;
|
||||
} else {
|
||||
# If we don't have a config target now, we try the C compiler as we
|
||||
# fallback
|
||||
my $cc = $user{CC} // 'cc';
|
||||
$target = $cc if $table{$cc} && !$table{$cc}->{template};
|
||||
}
|
||||
|
||||
&usage unless $target;
|
||||
|
||||
$config{target} = $target;
|
||||
my %target = resolve_config($target);
|
||||
|
@ -867,24 +867,6 @@ EOF
|
||||
return $OUT;
|
||||
}
|
||||
|
||||
# Append $CC to the target if that's in the Config list.
|
||||
sub check_target_exists {
|
||||
my $OUT = shift;
|
||||
my %table;
|
||||
|
||||
open T, "$PERL $WHERE/Configure LIST|" or die "Can't get LIST, $!";
|
||||
while ( <T> ) {
|
||||
chop;
|
||||
$table{$_} = 1;
|
||||
}
|
||||
close T;
|
||||
return "$OUT-$CC" if defined $table{"$OUT-$CC"};
|
||||
return "$OUT" if defined $table{$OUT};
|
||||
print "This system ($OUT) is not supported. See INSTALL for details.\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
|
||||
###
|
||||
### MAIN PROCESSING
|
||||
###
|
||||
|
Loading…
Reference in New Issue
Block a user