From: Richard Levitte Date: Tue, 9 Jan 2018 18:51:19 +0000 (+0100) Subject: Configure: try to make sure every config target name is unique X-Git-Tag: OpenSSL_1_1_1-pre1~203 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=225f980d22dfe66aa3945c21609042c32284e61c;p=oweals%2Fopenssl.git Configure: try to make sure every config target name is unique Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/5047) --- diff --git a/Configurations/README b/Configurations/README index 9f31dfcd9e..9d5dc5c55c 100644 --- a/Configurations/README +++ b/Configurations/README @@ -18,10 +18,14 @@ configuration in diverse ways: Configurations of OpenSSL target platforms ========================================== -Target configurations are a collection of facts that we know about +Configuration targets are a collection of facts that we know about different platforms and their capabilities. We organise them in a hash table, where each entry represent a specific target. +Note that configuration target names must be unique across all config +files. The Configure script does check that a config file doesn't +have config targets that shadow config targets from other files. + In each table entry, the following keys are significant: inherit_from => Other targets to inherit values from. diff --git a/Configure b/Configure index b172595ece..67e59a252d 100755 --- a/Configure +++ b/Configure @@ -2381,6 +2381,17 @@ sub read_config { %targets = read_eval_file($fname); } + my %preexisting = (); + foreach (sort keys %targets) { + $preexisting{$_} = 1 if $table{$_}; + } + die <<"EOF", +The following config targets from $fname +shadow pre-existing config targets with the same name: +EOF + map { " $_\n" } sort keys %preexisting + if %preexisting; + # For each target, check that it's configured with a hash table. foreach (keys %targets) {