From: Richard Levitte Date: Thu, 8 Sep 2016 16:09:47 +0000 (+0200) Subject: Build file templates: additional information to build file template functions X-Git-Tag: OpenSSL_1_1_1-pre1~3577 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=84f3867536625253b48e270cc261f0559b8861a9;p=openssl Build file templates: additional information to build file template functions Send a bit information to the build file template functions. For src2obj(), the additional option 'product' holds the name of the final file that the object file will go into. Additionally, the diverse functions will get the option 'installed', with a value that evaluates true if the final product is to be installed, otherwise false. Reviewed-by: Rich Salz --- diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl index 9d7fbf2e77..d811a2a144 100644 --- a/Configurations/common.tmpl +++ b/Configurations/common.tmpl @@ -34,6 +34,18 @@ @newlist; } + # is_installed checks if a given file will be installed (i.e. they are + # not defined _NO_INST in build.info) + sub is_installed { + my $product = shift; + if (grep { $product eq $_ } + map { (@{$unified_info{install}->{$_}}) } + keys %{$unified_info{install}}) { + return 1; + } + return 0; + } + # dogenerate is responsible for producing all the recipes that build # generated source files. It recurses in case a dependency is also a # generated source file. @@ -72,6 +84,7 @@ my %opts = @_; if (@{$unified_info{sources}->{$obj}}) { $OUT .= src2obj(obj => $obj_no_o, + product => $bin, srcs => $unified_info{sources}->{$obj}, deps => $unified_info{depends}->{$obj}, incs => [ @{$unified_info{includes}->{$bin}}, @@ -102,9 +115,10 @@ (@{$unified_info{sources}->{$lib}}, @{$unified_info{shared_sources}->{$lib}}) ], deps => [ reducedepends(resolvedepends($lib)) ], + installed => is_installed($lib), %ordinals); foreach (@{$unified_info{shared_sources}->{$lib}}) { - doobj($_, $lib, intent => "lib"); + doobj($_, $lib, intent => "lib", installed => is_installed($lib)); } } $OUT .= obj2lib(lib => $lib, @@ -126,10 +140,11 @@ objs => [ map { (my $x = $_) =~ s|\.o$||; $x } (@{$unified_info{sources}->{$lib}}, @{$unified_info{shared_sources}->{$lib}}) ], - deps => [ resolvedepends($lib) ]); + deps => [ resolvedepends($lib) ], + installed => is_installed($lib)); foreach ((@{$unified_info{sources}->{$lib}}, @{$unified_info{shared_sources}->{$lib}})) { - doobj($_, $lib, intent => "dso"); + doobj($_, $lib, intent => "dso", installed => is_installed($lib)); } $cache{$lib} = 1; } @@ -143,9 +158,10 @@ $OUT .= obj2bin(bin => $bin, objs => [ map { (my $x = $_) =~ s|\.o$||; $x } @{$unified_info{sources}->{$bin}} ], - deps => $deps); + deps => $deps, + installed => is_installed($bin)); foreach (@{$unified_info{sources}->{$bin}}) { - doobj($_, $bin, intent => "bin"); + doobj($_, $bin, intent => "bin", installed => is_installed($bin)); } $cache{$bin} = 1; } @@ -156,7 +172,8 @@ my $script = shift; return "" if $cache{$script}; $OUT .= in2script(script => $script, - sources => $unified_info{sources}->{$script}); + sources => $unified_info{sources}->{$script}, + installed => is_installed($script)); $cache{$script} = 1; }