summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-03-03 00:01:35 +0100
committerRichard Levitte <levitte@openssl.org>2020-06-28 18:34:35 +0200
commite39795af0a871a0bd560838ce54610a34c92fb49 (patch)
tree47b23986b305c2d61e040b75f84871fa385d2e8f /Configure
parent081436bf732c0889b2649426df4e1c23c671d6d7 (diff)
downloadopenssl-new-e39795af0a871a0bd560838ce54610a34c92fb49.tar.gz
util/perl/OpenSSL/config.pm: refactor map_guess()
map_guess() is now table driven, just like get_system(). Additionally, it now takes a config hash table and returns one of its own. This way, 'Configure' can pass whatever it has already found to OpenSSL::config::get_platform(), and easily merge the returned hash table into its %config. This also gets rid of variables that we no longer need. That includes $PERL and all the $__CNF_ environment variables. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11230)
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure20
1 files changed, 18 insertions, 2 deletions
diff --git a/Configure b/Configure
index a56e085adb..43e4a5f6f8 100755
--- a/Configure
+++ b/Configure
@@ -20,6 +20,7 @@ use File::Path qw/mkpath/;
use OpenSSL::fallback "$FindBin::Bin/external/perl/MODULES.txt";
use OpenSSL::Glob;
use OpenSSL::Template;
+use OpenSSL::config;
# see INSTALL.md for instructions.
@@ -608,8 +609,6 @@ while ((my $first, my $second) = (shift @list, shift @list)) {
# To remove something from %disabled, use "enable-foo".
# For symmetry, "disable-foo" is a synonym for "no-foo".
-&usage if ($#ARGV < 0);
-
# For the "make variables" CPPINCLUDES and CPPDEFINES, we support lists with
# platform specific list separators. Users from those platforms should
# recognise those separators from how you set up the PATH to find executables.
@@ -1068,6 +1067,23 @@ if (grep { /-rpath\b/ } ($user{LDFLAGS} ? @{$user{LDFLAGS}} : ())
"***** any of asan, msan or ubsan\n";
}
+# If no target was given, try guessing.
+unless ($target) {
+ my %system_config = OpenSSL::config::get_platform(%config, %user);
+
+ # The $system_config{disable} is used to populate %disabled with
+ # entries that aren't already there.
+ foreach ( @{$system_config{disable} // []} ) {
+ $disabled{$_} = 'system' unless defined $disabled{$_};
+ }
+ delete $system_config{disable};
+
+ # Override config entries with stuff from the guesser.
+ # It's assumed that this really is nothing new.
+ %config = ( %config, %system_config );
+ $target = $system_config{target};
+}
+
sub disable {
my $disable_type = shift;