summaryrefslogtreecommitdiffstats
path: root/Configure
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-01-23 19:07:14 +0100
committerRichard Levitte <levitte@openssl.org>2018-01-24 15:56:57 +0100
commit6a8dfb90b54ad1d3d87510b37e409bf568a4338f (patch)
tree24ddb3c9b71b0cd06e05737fad0d6fd66b46142c /Configure
parent38454902208c358ffaa140aef3077c2316f82b19 (diff)
Configure: let INCLUDEs set on binaries "trickle down" to the objects
This ensures that only one set of includes is associated with each object file, reagardless of where it's used. For example, if apps/build.info has this: SOURCE[openssl]=foo.c INCLUDE[openssl]=.. ../include and test/build.info has this: SOURCE[footest]=../apps/foo.c INCLUDE[footest]=../include The inclusion directories used for apps/foo.o would differ depending on which program's dependencies get generated first in the build file. With this change, all those INCLUDEs get combined into one set of inclusion directories tied to the object file. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5153) (cherry picked from commit 1b5ad51fc9b29d8893d5224f00bb3360f8aca465)
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure22
1 files changed, 22 insertions, 0 deletions
diff --git a/Configure b/Configure
index ecbebcce77..4fdecdc284 100755
--- a/Configure
+++ b/Configure
@@ -1880,6 +1880,28 @@ EOF
}
}
+ # Massage the result
+
+ # Trickle down includes placed on libraries, engines and programs to
+ # their sources (i.e. object files)
+ foreach my $dest (keys %{$unified_info{engines}},
+ keys %{$unified_info{libraries}},
+ keys %{$unified_info{programs}}) {
+ foreach my $k (("source", "build")) {
+ next unless defined($unified_info{includes}->{$dest}->{$k});
+ my @incs = reverse @{$unified_info{includes}->{$dest}->{$k}};
+ foreach my $obj (grep /\.o$/,
+ (keys %{$unified_info{sources}->{$dest}},
+ keys %{$unified_info{shared_sources}->{$dest}})) {
+ foreach my $inc (@incs) {
+ unshift @{$unified_info{includes}->{$obj}->{$k}}, $inc
+ unless grep { $_ eq $inc } @{$unified_info{includes}->{$obj}->{$k}};
+ }
+ }
+ }
+ delete $unified_info{includes}->{$dest};
+ }
+
### Make unified_info a bit more efficient
# One level structures
foreach (("programs", "libraries", "engines", "scripts", "extra", "overrides")) {