diff options
author | Richard Levitte <levitte@openssl.org> | 2016-09-08 18:09:47 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-09-09 00:12:54 +0200 |
commit | 84f3867536625253b48e270cc261f0559b8861a9 (patch) | |
tree | aafdd9c421e40a7b63fe6ed028364be0022290ef | |
parent | e82e2186e93e9a678dd8c0c5ba084d21d27d4d62 (diff) | |
download | openssl-84f3867536625253b48e270cc261f0559b8861a9.tar.gz |
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 <rsalz@openssl.org>
-rw-r--r-- | Configurations/common.tmpl | 29 |
1 files changed, 23 insertions, 6 deletions
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; } |